code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public void marshall(DeleteResourcePolicyRequest deleteResourcePolicyRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteResourcePolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteResourcePolicyRequest.getPolicyName(), POLICYNAME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[deleteResourcePolicyRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deleteResourcePolicyRequest], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPolicyName, postfix_operators=[], prefix_operators=[], qualifier=deleteResourcePolicyRequest, selectors=[], type_arguments=None), MemberReference(member=POLICYNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DeleteResourcePolicyRequest] identifier[deleteResourcePolicyRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteResourcePolicyRequest] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteResourcePolicyRequest] operator[SEP] identifier[getPolicyName] operator[SEP] operator[SEP] , identifier[POLICYNAME_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void marshall(DeleteVoiceChannelRequest deleteVoiceChannelRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteVoiceChannelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteVoiceChannelRequest.getApplicationId(), APPLICATIONID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[deleteVoiceChannelRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deleteVoiceChannelRequest], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getApplicationId, postfix_operators=[], prefix_operators=[], qualifier=deleteVoiceChannelRequest, selectors=[], type_arguments=None), MemberReference(member=APPLICATIONID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DeleteVoiceChannelRequest] identifier[deleteVoiceChannelRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteVoiceChannelRequest] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteVoiceChannelRequest] operator[SEP] identifier[getApplicationId] operator[SEP] operator[SEP] , identifier[APPLICATIONID_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
protected void initModel() {
final WaveChecker waveChecker = wave -> ObjectUtility.equalsOrBothNull(wave.get(TAB_KEY), object().id());
listen(waveChecker, ADD);
listen(waveChecker, REMOVE);
if (ObjectUtility.nullOrEmpty(object().id())) {
object().id(TabbedPaneModel.class.getSimpleName() + TAB_COUNTER++);
}
// Manage Style
node().getStyleClass().add(this.getClass().getSimpleName());
} | class class_name[name] begin[{]
method[initModel, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[WaveChecker], waveChecker]
call[.listen, parameter[member[.waveChecker], member[.ADD]]]
call[.listen, parameter[member[.waveChecker], member[.REMOVE]]]
if[call[ObjectUtility.nullOrEmpty, parameter[call[.object, parameter[]]]]] begin[{]
call[.object, parameter[]]
else begin[{]
None
end[}]
call[.node, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[initModel] operator[SEP] operator[SEP] {
Keyword[final] identifier[WaveChecker] identifier[waveChecker] operator[=] identifier[wave] operator[->] identifier[ObjectUtility] operator[SEP] identifier[equalsOrBothNull] operator[SEP] identifier[wave] operator[SEP] identifier[get] operator[SEP] identifier[TAB_KEY] operator[SEP] , identifier[object] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[listen] operator[SEP] identifier[waveChecker] , identifier[ADD] operator[SEP] operator[SEP] identifier[listen] operator[SEP] identifier[waveChecker] , identifier[REMOVE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ObjectUtility] operator[SEP] identifier[nullOrEmpty] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[object] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] identifier[TabbedPaneModel] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] identifier[TAB_COUNTER] operator[++] operator[SEP] operator[SEP]
}
identifier[node] operator[SEP] operator[SEP] operator[SEP] identifier[getStyleClass] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public OvhEligibilityStatus eligibility_GET(String domain) throws IOException {
String qPath = "/sslGateway/eligibility";
StringBuilder sb = path(qPath);
query(sb, "domain", domain);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhEligibilityStatus.class);
} | class class_name[name] begin[{]
method[eligibility_GET, return_type[type[OvhEligibilityStatus]], modifier[public], parameter[domain]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["domain"], member[.domain]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhEligibilityStatus, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhEligibilityStatus] identifier[eligibility_GET] operator[SEP] identifier[String] identifier[domain] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[domain] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[execN] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhEligibilityStatus] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public StringGrabber removeTailConsecutiveChars(char charToRemove) {
boolean loop = true;
if (sb.length() > 0) {
while (loop) {
if (sb.charAt(sb.length() - 1) == charToRemove) {
removeTail(1);
} else {
loop = false;
}
}
}
return StringGrabber.this;
} | class class_name[name] begin[{]
method[removeTailConsecutiveChars, return_type[type[StringGrabber]], modifier[public], parameter[charToRemove]] begin[{]
local_variable[type[boolean], loop]
if[binary_operation[call[sb.length, parameter[]], >, literal[0]]] begin[{]
while[member[.loop]] begin[{]
if[binary_operation[call[sb.charAt, parameter[binary_operation[call[sb.length, parameter[]], -, literal[1]]]], ==, member[.charToRemove]]] begin[{]
call[.removeTail, parameter[literal[1]]]
else begin[{]
assign[member[.loop], literal[false]]
end[}]
end[}]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[StringGrabber] identifier[removeTailConsecutiveChars] operator[SEP] Keyword[char] identifier[charToRemove] operator[SEP] {
Keyword[boolean] identifier[loop] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[while] operator[SEP] identifier[loop] operator[SEP] {
Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[charAt] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] identifier[charToRemove] operator[SEP] {
identifier[removeTail] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[loop] operator[=] literal[boolean] operator[SEP]
}
}
}
Keyword[return] identifier[StringGrabber] operator[SEP] Keyword[this] operator[SEP]
}
|
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (com.google.api.ads.adwords.axis.v201809.cm.BiddingStrategyServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
com.google.api.ads.adwords.axis.v201809.cm.BiddingStrategyServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.BiddingStrategyServiceSoapBindingStub(new java.net.URL(BiddingStrategyServiceInterfacePort_address), this);
_stub.setPortName(getBiddingStrategyServiceInterfacePortWSDDServiceName());
return _stub;
}
}
catch (java.lang.Throwable t) {
throw new javax.xml.rpc.ServiceException(t);
}
throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
} | class class_name[name] begin[{]
method[getPort, return_type[type[java]], modifier[public], parameter[serviceEndpointInterface]] begin[{]
TryStatement(block=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=com.google.api.ads.adwords.axis.v201809.cm, selectors=[MethodInvocation(arguments=[MemberReference(member=serviceEndpointInterface, 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=BiddingStrategyServiceInterface, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=BiddingStrategyServiceInterfacePort_address, 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=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None)))), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=ads, sub_type=ReferenceType(arguments=None, dimensions=None, name=adwords, sub_type=ReferenceType(arguments=None, dimensions=None, name=axis, sub_type=ReferenceType(arguments=None, dimensions=None, name=v201809, sub_type=ReferenceType(arguments=None, dimensions=None, name=cm, sub_type=ReferenceType(arguments=None, dimensions=None, name=BiddingStrategyServiceSoapBindingStub, sub_type=None)))))))))), name=_stub)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=ads, sub_type=ReferenceType(arguments=None, dimensions=None, name=adwords, sub_type=ReferenceType(arguments=None, dimensions=None, name=axis, sub_type=ReferenceType(arguments=None, dimensions=None, name=v201809, sub_type=ReferenceType(arguments=None, dimensions=None, name=cm, sub_type=ReferenceType(arguments=None, dimensions=None, name=BiddingStrategyServiceSoapBindingStub, sub_type=None)))))))))), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBiddingStrategyServiceInterfacePortWSDDServiceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setPortName, postfix_operators=[], prefix_operators=[], qualifier=_stub, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=_stub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=t, 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=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=rpc, sub_type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['java.lang.Throwable']))], finally_block=None, label=None, resources=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="There is no stub implementation for the interface: "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=serviceEndpointInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=serviceEndpointInterface, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=rpc, sub_type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))))), label=None)
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[rmi] operator[SEP] identifier[Remote] identifier[getPort] operator[SEP] identifier[Class] identifier[serviceEndpointInterface] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[cm] operator[SEP] identifier[BiddingStrategyServiceInterface] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[serviceEndpointInterface] operator[SEP] operator[SEP] {
identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[cm] operator[SEP] identifier[BiddingStrategyServiceSoapBindingStub] identifier[_stub] operator[=] Keyword[new] 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[BiddingStrategyServiceSoapBindingStub] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URL] operator[SEP] identifier[BiddingStrategyServiceInterfacePort_address] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] identifier[_stub] operator[SEP] identifier[setPortName] operator[SEP] identifier[getBiddingStrategyServiceInterfacePortWSDDServiceName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[_stub] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[serviceEndpointInterface] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[serviceEndpointInterface] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Nonnull
@Deprecated
public static CSSDeclarationList readDeclarationListFromNode (@Nonnull final ECSSVersion eVersion,
@Nonnull final CSSNode aNode)
{
return readDeclarationListFromNode (eVersion, aNode, CSSReader.getDefaultInterpretErrorHandler ());
} | class class_name[name] begin[{]
method[readDeclarationListFromNode, return_type[type[CSSDeclarationList]], modifier[public static], parameter[eVersion, aNode]] begin[{]
return[call[.readDeclarationListFromNode, parameter[member[.eVersion], member[.aNode], call[CSSReader.getDefaultInterpretErrorHandler, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[CSSDeclarationList] identifier[readDeclarationListFromNode] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[ECSSVersion] identifier[eVersion] , annotation[@] identifier[Nonnull] Keyword[final] identifier[CSSNode] identifier[aNode] operator[SEP] {
Keyword[return] identifier[readDeclarationListFromNode] operator[SEP] identifier[eVersion] , identifier[aNode] , identifier[CSSReader] operator[SEP] identifier[getDefaultInterpretErrorHandler] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static HttpHeaders toArmeria(Http2Headers headers, boolean endOfStream) {
final HttpHeaders converted = new DefaultHttpHeaders(false, headers.size(), endOfStream);
StringJoiner cookieJoiner = null;
for (Entry<CharSequence, CharSequence> e : headers) {
final AsciiString name = HttpHeaderNames.of(e.getKey());
final CharSequence value = e.getValue();
// Cookies must be concatenated into a single octet string.
// https://tools.ietf.org/html/rfc7540#section-8.1.2.5
if (name.equals(HttpHeaderNames.COOKIE)) {
if (cookieJoiner == null) {
cookieJoiner = new StringJoiner(COOKIE_SEPARATOR);
}
COOKIE_SPLITTER.split(value).forEach(cookieJoiner::add);
} else {
converted.add(name, convertHeaderValue(name, value));
}
}
if (cookieJoiner != null && cookieJoiner.length() != 0) {
converted.add(HttpHeaderNames.COOKIE, cookieJoiner.toString());
}
return converted;
} | class class_name[name] begin[{]
method[toArmeria, return_type[type[HttpHeaders]], modifier[public static], parameter[headers, endOfStream]] begin[{]
local_variable[type[HttpHeaders], converted]
local_variable[type[StringJoiner], cookieJoiner]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=HttpHeaderNames, selectors=[], type_arguments=None), name=name)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=AsciiString, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=value)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=COOKIE, postfix_operators=[], prefix_operators=[], qualifier=HttpHeaderNames, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertHeaderValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=converted, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cookieJoiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cookieJoiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=COOKIE_SEPARATOR, 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=StringJoiner, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=COOKIE_SPLITTER, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=cookieJoiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=forEach, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
if[binary_operation[binary_operation[member[.cookieJoiner], !=, literal[null]], &&, binary_operation[call[cookieJoiner.length, parameter[]], !=, literal[0]]]] begin[{]
call[converted.add, parameter[member[HttpHeaderNames.COOKIE], call[cookieJoiner.toString, parameter[]]]]
else begin[{]
None
end[}]
return[member[.converted]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[HttpHeaders] identifier[toArmeria] operator[SEP] identifier[Http2Headers] identifier[headers] , Keyword[boolean] identifier[endOfStream] operator[SEP] {
Keyword[final] identifier[HttpHeaders] identifier[converted] operator[=] Keyword[new] identifier[DefaultHttpHeaders] operator[SEP] literal[boolean] , identifier[headers] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[endOfStream] operator[SEP] operator[SEP] identifier[StringJoiner] identifier[cookieJoiner] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[CharSequence] , identifier[CharSequence] operator[>] identifier[e] operator[:] identifier[headers] operator[SEP] {
Keyword[final] identifier[AsciiString] identifier[name] operator[=] identifier[HttpHeaderNames] operator[SEP] identifier[of] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[CharSequence] identifier[value] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[COOKIE] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[cookieJoiner] operator[==] Other[null] operator[SEP] {
identifier[cookieJoiner] operator[=] Keyword[new] identifier[StringJoiner] operator[SEP] identifier[COOKIE_SEPARATOR] operator[SEP] operator[SEP]
}
identifier[COOKIE_SPLITTER] operator[SEP] identifier[split] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[cookieJoiner] operator[::] identifier[add] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[converted] operator[SEP] identifier[add] operator[SEP] identifier[name] , identifier[convertHeaderValue] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[cookieJoiner] operator[!=] Other[null] operator[&&] identifier[cookieJoiner] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[converted] operator[SEP] identifier[add] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[COOKIE] , identifier[cookieJoiner] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[converted] operator[SEP]
}
|
public static Collection<CommunicationSummaryStatistics> buildCommunicationSummaryTree(
Collection<CommunicationSummaryStatistics> nodes, Set<String> endpoints) {
Map<String, CommunicationSummaryStatistics> nodeMap = new HashMap<String, CommunicationSummaryStatistics>();
// Create a map of nodes
for (CommunicationSummaryStatistics css : nodes) {
nodeMap.put(css.getId(), css);
}
List<CommunicationSummaryStatistics> ret = new ArrayList<>();
for (String endpoint : endpoints) {
// Check if a 'client' node also exists for the endpoint, and if so, use this as the
// initial endpoint
CommunicationSummaryStatistics n = nodeMap.get(EndpointUtil.encodeClientURI(endpoint));
if (n == null) {
n = nodeMap.get(endpoint);
}
if (n != null) {
CommunicationSummaryStatistics rootNode = new CommunicationSummaryStatistics(n);
initCommunicationSummaryTreeNode(rootNode, nodeMap,
new HashSet<>(Collections.singleton(rootNode.getId())));
ret.add(rootNode);
}
}
return ret;
} | class class_name[name] begin[{]
method[buildCommunicationSummaryTree, return_type[type[Collection]], modifier[public static], parameter[nodes, endpoints]] begin[{]
local_variable[type[Map], nodeMap]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=css, selectors=[], type_arguments=None), MemberReference(member=css, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=nodeMap, 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=css)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommunicationSummaryStatistics, sub_type=None))), label=None)
local_variable[type[List], ret]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=endpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encodeClientURI, postfix_operators=[], prefix_operators=[], qualifier=EndpointUtil, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeMap, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommunicationSummaryStatistics, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=endpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeMap, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=n, 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=ClassCreator(arguments=[MemberReference(member=n, 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=CommunicationSummaryStatistics, sub_type=None)), name=rootNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommunicationSummaryStatistics, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nodeMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=rootNode, selectors=[], type_arguments=None)], member=singleton, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))], member=initCommunicationSummaryTreeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=endpoints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=endpoint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.ret]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[CommunicationSummaryStatistics] operator[>] identifier[buildCommunicationSummaryTree] operator[SEP] identifier[Collection] operator[<] identifier[CommunicationSummaryStatistics] operator[>] identifier[nodes] , identifier[Set] operator[<] identifier[String] operator[>] identifier[endpoints] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[CommunicationSummaryStatistics] operator[>] identifier[nodeMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[CommunicationSummaryStatistics] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CommunicationSummaryStatistics] identifier[css] operator[:] identifier[nodes] operator[SEP] {
identifier[nodeMap] operator[SEP] identifier[put] operator[SEP] identifier[css] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[css] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[CommunicationSummaryStatistics] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[endpoint] operator[:] identifier[endpoints] operator[SEP] {
identifier[CommunicationSummaryStatistics] identifier[n] operator[=] identifier[nodeMap] operator[SEP] identifier[get] operator[SEP] identifier[EndpointUtil] operator[SEP] identifier[encodeClientURI] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[null] operator[SEP] {
identifier[n] operator[=] identifier[nodeMap] operator[SEP] identifier[get] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[n] operator[!=] Other[null] operator[SEP] {
identifier[CommunicationSummaryStatistics] identifier[rootNode] operator[=] Keyword[new] identifier[CommunicationSummaryStatistics] operator[SEP] identifier[n] operator[SEP] operator[SEP] identifier[initCommunicationSummaryTreeNode] operator[SEP] identifier[rootNode] , identifier[nodeMap] , Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[Collections] operator[SEP] identifier[singleton] operator[SEP] identifier[rootNode] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[rootNode] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[ret] operator[SEP]
}
|
private Object invokeImpl(Object thiz, String name, Object... args)
throws ScriptException, NoSuchMethodException {
if (name == null) {
throw new NullPointerException("method name is null");
}
try {
if (thiz != null) {
return InvokerHelper.invokeMethod(thiz, name, args);
} else {
return callGlobal(name, args);
}
} catch (MissingMethodException mme) {
throw new NoSuchMethodException(mme.getMessage());
} catch (Exception e) {
throw new ScriptException(e);
}
} | class class_name[name] begin[{]
method[invokeImpl, return_type[type[Object]], modifier[private], parameter[thiz, name, args]] begin[{]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="method name is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=thiz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=callGlobal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=thiz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeMethod, postfix_operators=[], prefix_operators=[], qualifier=InvokerHelper, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=mme, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchMethodException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=mme, types=['MissingMethodException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ScriptException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] identifier[Object] identifier[invokeImpl] operator[SEP] identifier[Object] identifier[thiz] , identifier[String] identifier[name] , identifier[Object] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[ScriptException] , identifier[NoSuchMethodException] {
Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[thiz] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[InvokerHelper] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[thiz] , identifier[name] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[callGlobal] operator[SEP] identifier[name] , identifier[args] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[MissingMethodException] identifier[mme] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NoSuchMethodException] operator[SEP] identifier[mme] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ScriptException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public void configure(DefaultHttpClient httpClient, SolrParams config) {
super.configure(httpClient, config);
// Begin change for SDC-2962
// Instead of checking existence of JAAS file, do the following if solr kerberos is enabled
//if (System.getProperty(LOGIN_CONFIG_PROP) != null) {
//String configValue = System.getProperty(LOGIN_CONFIG_PROP);
//if (configValue != null) {
// logger.info("Setting up SPNego auth with config: " + configValue);
final String useSubjectCredsProp = "javax.security.auth.useSubjectCredsOnly";
String useSubjectCredsVal = System.getProperty(useSubjectCredsProp);
// "javax.security.auth.useSubjectCredsOnly" should be false so that the underlying
// authentication mechanism can load the credentials from the JAAS configuration.
if (useSubjectCredsVal == null) {
System.setProperty(useSubjectCredsProp, "false");
}
else if (!useSubjectCredsVal.toLowerCase(Locale.ROOT).equals("false")) {
// Don't overwrite the prop value if it's already been written to something else,
// but log because it is likely the Credentials won't be loaded correctly.
logger.warn("System Property: " + useSubjectCredsProp + " set to: " + useSubjectCredsVal
+ " not false. SPNego authentication may not be successful.");
}
// Change for SDC-2962
//javax.security.auth.login.Configuration.setConfiguration(jaasConfig);
//Enable only SPNEGO authentication scheme.
AuthSchemeRegistry registry = new AuthSchemeRegistry();
registry.register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory(true, false));
httpClient.setAuthSchemes(registry);
// Get the credentials from the JAAS configuration rather than here
Credentials useJaasCreds = new Credentials() {
public String getPassword() {
return null;
}
public Principal getUserPrincipal() {
return null;
}
};
SolrPortAwareCookieSpecFactory cookieFactory = new SolrPortAwareCookieSpecFactory();
httpClient.getCookieSpecs().register(cookieFactory.POLICY_NAME, cookieFactory);
httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, cookieFactory.POLICY_NAME);
httpClient.getCredentialsProvider().setCredentials(AuthScope.ANY, useJaasCreds);
httpClient.addRequestInterceptor(bufferedEntityInterceptor);
//} else {
//httpClient.getCredentialsProvider().clear();
//}
// }
} | class class_name[name] begin[{]
method[configure, return_type[void], modifier[public], parameter[httpClient, config]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=httpClient, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=configure, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
local_variable[type[String], useSubjectCredsProp]
local_variable[type[String], useSubjectCredsVal]
if[binary_operation[member[.useSubjectCredsVal], ==, literal[null]]] begin[{]
call[System.setProperty, parameter[member[.useSubjectCredsProp], literal["false"]]]
else begin[{]
if[call[useSubjectCredsVal.toLowerCase, parameter[member[Locale.ROOT]]]] begin[{]
call[logger.warn, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["System Property: "], +, member[.useSubjectCredsProp]], +, literal[" set to: "]], +, member[.useSubjectCredsVal]], +, literal[" not false. SPNego authentication may not be successful."]]]]
else begin[{]
None
end[}]
end[}]
local_variable[type[AuthSchemeRegistry], registry]
call[registry.register, parameter[member[AuthSchemes.SPNEGO], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SPNegoSchemeFactory, sub_type=None))]]
call[httpClient.setAuthSchemes, parameter[member[.registry]]]
local_variable[type[Credentials], useJaasCreds]
local_variable[type[SolrPortAwareCookieSpecFactory], cookieFactory]
call[httpClient.getCookieSpecs, parameter[]]
call[httpClient.getParams, parameter[]]
call[httpClient.getCredentialsProvider, parameter[]]
call[httpClient.addRequestInterceptor, parameter[member[.bufferedEntityInterceptor]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[configure] operator[SEP] identifier[DefaultHttpClient] identifier[httpClient] , identifier[SolrParams] identifier[config] operator[SEP] {
Keyword[super] operator[SEP] identifier[configure] operator[SEP] identifier[httpClient] , identifier[config] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[useSubjectCredsProp] operator[=] literal[String] operator[SEP] identifier[String] identifier[useSubjectCredsVal] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[useSubjectCredsProp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useSubjectCredsVal] operator[==] Other[null] operator[SEP] {
identifier[System] operator[SEP] identifier[setProperty] operator[SEP] identifier[useSubjectCredsProp] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[useSubjectCredsVal] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ROOT] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[useSubjectCredsProp] operator[+] literal[String] operator[+] identifier[useSubjectCredsVal] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[AuthSchemeRegistry] identifier[registry] operator[=] Keyword[new] identifier[AuthSchemeRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[registry] operator[SEP] identifier[register] operator[SEP] identifier[AuthSchemes] operator[SEP] identifier[SPNEGO] , Keyword[new] identifier[SPNegoSchemeFactory] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[httpClient] operator[SEP] identifier[setAuthSchemes] operator[SEP] identifier[registry] operator[SEP] operator[SEP] identifier[Credentials] identifier[useJaasCreds] operator[=] Keyword[new] identifier[Credentials] operator[SEP] operator[SEP] {
Keyword[public] identifier[String] identifier[getPassword] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[public] identifier[Principal] identifier[getUserPrincipal] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
} operator[SEP] identifier[SolrPortAwareCookieSpecFactory] identifier[cookieFactory] operator[=] Keyword[new] identifier[SolrPortAwareCookieSpecFactory] operator[SEP] operator[SEP] operator[SEP] identifier[httpClient] operator[SEP] identifier[getCookieSpecs] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[cookieFactory] operator[SEP] identifier[POLICY_NAME] , identifier[cookieFactory] operator[SEP] operator[SEP] identifier[httpClient] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] identifier[setParameter] operator[SEP] identifier[ClientPNames] operator[SEP] identifier[COOKIE_POLICY] , identifier[cookieFactory] operator[SEP] identifier[POLICY_NAME] operator[SEP] operator[SEP] identifier[httpClient] operator[SEP] identifier[getCredentialsProvider] operator[SEP] operator[SEP] operator[SEP] identifier[setCredentials] operator[SEP] identifier[AuthScope] operator[SEP] identifier[ANY] , identifier[useJaasCreds] operator[SEP] operator[SEP] identifier[httpClient] operator[SEP] identifier[addRequestInterceptor] operator[SEP] identifier[bufferedEntityInterceptor] operator[SEP] operator[SEP]
}
|
public List<String> assets(final String name) {
return fileset.getOrDefault(name, Collections.emptyList());
} | class class_name[name] begin[{]
method[assets, return_type[type[List]], modifier[public], parameter[name]] begin[{]
return[call[fileset.getOrDefault, parameter[member[.name], call[Collections.emptyList, parameter[]]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[assets] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] {
Keyword[return] identifier[fileset] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[name] , identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@BuilderMethod
public void setReportField(@NonNull ReportField field, boolean enable) {
this.reportContentChanges.put(field, enable);
} | class class_name[name] begin[{]
method[setReportField, return_type[void], modifier[public], parameter[field, enable]] begin[{]
THIS[member[None.reportContentChanges]call[None.put, parameter[member[.field], member[.enable]]]]
end[}]
END[}] | annotation[@] identifier[BuilderMethod] Keyword[public] Keyword[void] identifier[setReportField] operator[SEP] annotation[@] identifier[NonNull] identifier[ReportField] identifier[field] , Keyword[boolean] identifier[enable] operator[SEP] {
Keyword[this] operator[SEP] identifier[reportContentChanges] operator[SEP] identifier[put] operator[SEP] identifier[field] , identifier[enable] operator[SEP] operator[SEP]
}
|
@Override
public <T> ServiceBuilder service(Class<T> type)
{
Key<?> key = Key.of(type, ServiceImpl.class);
return service(key, type);
} | class class_name[name] begin[{]
method[service, return_type[type[ServiceBuilder]], modifier[public], parameter[type]] begin[{]
local_variable[type[Key], key]
return[call[.service, parameter[member[.key], member[.type]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[ServiceBuilder] identifier[service] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] {
identifier[Key] operator[<] operator[?] operator[>] identifier[key] operator[=] identifier[Key] operator[SEP] identifier[of] operator[SEP] identifier[type] , identifier[ServiceImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[key] , identifier[type] operator[SEP] operator[SEP]
}
|
public static boolean if_infeasible(double[] x) {
boolean infeasible = false;
for (int i = 0; i < pindex9.length - 1; i++) {
double[][] p = new double[pindex9[i + 1] - pindex9[i]][2];
for (int j = pindex9[i]; j < pindex9[i + 1]; j++) {
p[j - pindex9[i]] = oth_poly_points9[j];
}
infeasible = if_inside_polygon(x, p);
if (infeasible) {
break;
}
}
if (infeasible) {//check if the point is on the edges of regular polygon
for (int i = 0; i < r_polyline9.length - 1; i++) {
if (r_polyline9[i][0] == 1) {
if (x[0] == r_polyline9[i][1] && x[1] >= rangey9[i][0] && x[1] <= rangey9[i][1]) {
infeasible = false;
break;
}
} else {
if ((x[0] * r_polyline9[i][1] + r_polyline9[i][2] == x[1]) && x[1] >= rangey9[i][0]
&& x[1] <= rangey9[i][1] && x[0] >= rangex9[i][0] && x[0] <= rangex9[i][1]) {
infeasible = false;
break;
}
}
}
if (r_polyline9[M9 - 1][0] == 1) {
if (x[0] == r_polyline9[M9 - 1][1] && x[1] >= rangey9[M9 - 1][0] && x[1] <= rangey9[M9
- 1][1]) {
infeasible = false;
}
} else {
if (x[0] * r_polyline9[M9 - 1][1] + r_polyline9[M9 - 1][2] == x[1] && x[1] >= rangey9[M9
- 1][0] && x[1] <= rangey9[M9 - 1][1]
&& x[0] >= rangex9[M9 - 1][0] && x[0] <= rangex9[M9 - 1][1]) {
infeasible = false;
}
}
}
return infeasible;
} | class class_name[name] begin[{]
method[if_infeasible, return_type[type[boolean]], modifier[public static], parameter[x]] begin[{]
local_variable[type[boolean], infeasible]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=pindex9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=MemberReference(member=pindex9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double)), name=p)], modifiers=set(), type=BasicType(dimensions=[None, None], name=double)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=pindex9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-))]), type==, value=MemberReference(member=oth_poly_points9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=pindex9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, 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=MemberReference(member=pindex9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=infeasible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=if_inside_polygon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=infeasible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=pindex9, 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=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[.infeasible]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=r_polyline9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=r_polyline9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=*), operandr=MemberReference(member=r_polyline9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), operator=+), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=rangey9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=>=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=rangey9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=<=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=rangex9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=>=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=rangex9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=infeasible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=r_polyline9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=rangey9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=>=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=rangey9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=infeasible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=r_polyline9, 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=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[.r_polyline9], ==, literal[1]]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.x], ==, member[.r_polyline9]], &&, binary_operation[member[.x], >=, member[.rangey9]]], &&, binary_operation[member[.x], <=, member[.rangey9]]]] begin[{]
assign[member[.infeasible], literal[false]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.x], *, member[.r_polyline9]], +, member[.r_polyline9]], ==, member[.x]], &&, binary_operation[member[.x], >=, member[.rangey9]]], &&, binary_operation[member[.x], <=, member[.rangey9]]], &&, binary_operation[member[.x], >=, member[.rangex9]]], &&, binary_operation[member[.x], <=, member[.rangex9]]]] begin[{]
assign[member[.infeasible], literal[false]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
return[member[.infeasible]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[if_infeasible] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[x] operator[SEP] {
Keyword[boolean] identifier[infeasible] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[pindex9] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[p] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[pindex9] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[-] identifier[pindex9] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[pindex9] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[<] identifier[pindex9] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[p] operator[SEP] identifier[j] operator[-] identifier[pindex9] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[=] identifier[oth_poly_points9] operator[SEP] identifier[j] operator[SEP] operator[SEP]
}
identifier[infeasible] operator[=] identifier[if_inside_polygon] operator[SEP] identifier[x] , identifier[p] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[infeasible] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[infeasible] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[r_polyline9] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[r_polyline9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[if] operator[SEP] identifier[x] operator[SEP] Other[0] operator[SEP] operator[==] identifier[r_polyline9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[>=] identifier[rangey9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[<=] identifier[rangey9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] {
identifier[infeasible] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] operator[SEP] identifier[x] operator[SEP] Other[0] operator[SEP] operator[*] identifier[r_polyline9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[+] identifier[r_polyline9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[2] operator[SEP] operator[==] identifier[x] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[>=] identifier[rangey9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[<=] identifier[rangey9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[0] operator[SEP] operator[>=] identifier[rangex9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[0] operator[SEP] operator[<=] identifier[rangex9] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] {
identifier[infeasible] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[r_polyline9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[if] operator[SEP] identifier[x] operator[SEP] Other[0] operator[SEP] operator[==] identifier[r_polyline9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[>=] identifier[rangey9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[<=] identifier[rangey9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] {
identifier[infeasible] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[x] operator[SEP] Other[0] operator[SEP] operator[*] identifier[r_polyline9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[+] identifier[r_polyline9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[2] operator[SEP] operator[==] identifier[x] operator[SEP] Other[1] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[>=] identifier[rangey9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[1] operator[SEP] operator[<=] identifier[rangey9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[0] operator[SEP] operator[>=] identifier[rangex9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[&&] identifier[x] operator[SEP] Other[0] operator[SEP] operator[<=] identifier[rangex9] operator[SEP] identifier[M9] operator[-] Other[1] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] {
identifier[infeasible] operator[=] literal[boolean] operator[SEP]
}
}
}
Keyword[return] identifier[infeasible] operator[SEP]
}
|
@Nonnull
@ReturnsMutableCopy
public ICommonsList <String> getAllUserGroupIDsWithAssignedUser (@Nullable final String sUserID)
{
if (StringHelper.hasNoText (sUserID))
return new CommonsArrayList <> ();
return getAllMapped (aUserGroup -> aUserGroup.containsUserID (sUserID), aUserGroup -> aUserGroup.getID ());
} | class class_name[name] begin[{]
method[getAllUserGroupIDsWithAssignedUser, return_type[type[ICommonsList]], modifier[public], parameter[sUserID]] begin[{]
if[call[StringHelper.hasNoText, parameter[member[.sUserID]]]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=CommonsArrayList, sub_type=None))]
else begin[{]
None
end[}]
return[call[.getAllMapped, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=sUserID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsUserID, postfix_operators=[], prefix_operators=[], qualifier=aUserGroup, selectors=[], type_arguments=None), parameters=[MemberReference(member=aUserGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), LambdaExpression(body=MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=aUserGroup, selectors=[], type_arguments=None), parameters=[MemberReference(member=aUserGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] annotation[@] identifier[ReturnsMutableCopy] Keyword[public] identifier[ICommonsList] operator[<] identifier[String] operator[>] identifier[getAllUserGroupIDsWithAssignedUser] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[sUserID] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringHelper] operator[SEP] identifier[hasNoText] operator[SEP] identifier[sUserID] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CommonsArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getAllMapped] operator[SEP] identifier[aUserGroup] operator[->] identifier[aUserGroup] operator[SEP] identifier[containsUserID] operator[SEP] identifier[sUserID] operator[SEP] , identifier[aUserGroup] operator[->] identifier[aUserGroup] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@CheckReturnValue
private FlowScope traverseReturn(Node n, FlowScope scope) {
scope = traverseChildren(n, scope);
Node retValue = n.getFirstChild();
if (retValue != null) {
JSType type = functionScope.getRootNode().getJSType();
if (type != null) {
FunctionType fnType = type.toMaybeFunctionType();
if (fnType != null) {
inferPropertyTypesToMatchConstraint(
retValue.getJSType(), fnType.getReturnType());
}
}
}
return scope;
} | class class_name[name] begin[{]
method[traverseReturn, return_type[type[FlowScope]], modifier[private], parameter[n, scope]] begin[{]
assign[member[.scope], call[.traverseChildren, parameter[member[.n], member[.scope]]]]
local_variable[type[Node], retValue]
if[binary_operation[member[.retValue], !=, literal[null]]] begin[{]
local_variable[type[JSType], type]
if[binary_operation[member[.type], !=, literal[null]]] begin[{]
local_variable[type[FunctionType], fnType]
if[binary_operation[member[.fnType], !=, literal[null]]] begin[{]
call[.inferPropertyTypesToMatchConstraint, parameter[call[retValue.getJSType, parameter[]], call[fnType.getReturnType, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.scope]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] Keyword[private] identifier[FlowScope] identifier[traverseReturn] operator[SEP] identifier[Node] identifier[n] , identifier[FlowScope] identifier[scope] operator[SEP] {
identifier[scope] operator[=] identifier[traverseChildren] operator[SEP] identifier[n] , identifier[scope] operator[SEP] operator[SEP] identifier[Node] identifier[retValue] operator[=] identifier[n] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[retValue] operator[!=] Other[null] operator[SEP] {
identifier[JSType] identifier[type] operator[=] identifier[functionScope] operator[SEP] identifier[getRootNode] operator[SEP] operator[SEP] operator[SEP] identifier[getJSType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] {
identifier[FunctionType] identifier[fnType] operator[=] identifier[type] operator[SEP] identifier[toMaybeFunctionType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fnType] operator[!=] Other[null] operator[SEP] {
identifier[inferPropertyTypesToMatchConstraint] operator[SEP] identifier[retValue] operator[SEP] identifier[getJSType] operator[SEP] operator[SEP] , identifier[fnType] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[scope] operator[SEP]
}
|
public String getTableNames(boolean bAddQuotes)
{
return (m_tableName == null) ? Record.formatTableNames(MESSAGE_INFO_FILE, bAddQuotes) : super.getTableNames(bAddQuotes);
} | class class_name[name] begin[{]
method[getTableNames, return_type[type[String]], modifier[public], parameter[bAddQuotes]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=m_tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=SuperMethodInvocation(arguments=[MemberReference(member=bAddQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTableNames, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=MESSAGE_INFO_FILE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bAddQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formatTableNames, postfix_operators=[], prefix_operators=[], qualifier=Record, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getTableNames] operator[SEP] Keyword[boolean] identifier[bAddQuotes] operator[SEP] {
Keyword[return] operator[SEP] identifier[m_tableName] operator[==] Other[null] operator[SEP] operator[?] identifier[Record] operator[SEP] identifier[formatTableNames] operator[SEP] identifier[MESSAGE_INFO_FILE] , identifier[bAddQuotes] operator[SEP] operator[:] Keyword[super] operator[SEP] identifier[getTableNames] operator[SEP] identifier[bAddQuotes] operator[SEP] operator[SEP]
}
|
public static Store<InputStream> anonymousStore()
throws IOException
{
File temp = File.createTempFile( "ops4j-store-anonymous-", "" );
temp.delete();
temp.mkdir();
return new TemporaryStore( temp, true );
} | class class_name[name] begin[{]
method[anonymousStore, return_type[type[Store]], modifier[public static], parameter[]] begin[{]
local_variable[type[File], temp]
call[temp.delete, parameter[]]
call[temp.mkdir, parameter[]]
return[ClassCreator(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TemporaryStore, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Store] operator[<] identifier[InputStream] operator[>] identifier[anonymousStore] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[File] identifier[temp] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[mkdir] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TemporaryStore] operator[SEP] identifier[temp] , literal[boolean] operator[SEP] operator[SEP]
}
|
public Token peek() {
if (!splitTokens.isEmpty()) {
return splitTokens.peek();
}
final var value = stringIterator.peek();
if (argumentEscapeEncountered) {
return new ArgumentToken(value);
}
if (Objects.equals(value, argumentTerminator)) {
return new ArgumentToken(value);
}
if (argumentTerminator != null) {
return new ArgumentToken(value);
}
if (isArgumentEscape(value)) {
argumentEscapeEncountered = true;
return peek();
}
if (isSwitch(value)) {
if (isShortSwitchList(value)) {
var tokens = splitSwitchTokens(value);
return tokens.get(0);
} else {
return new SwitchToken(value.substring(2), value);
}
} else {
return new ArgumentToken(value);
}
} | class class_name[name] begin[{]
method[peek, return_type[type[Token]], modifier[public], parameter[]] begin[{]
if[call[splitTokens.isEmpty, parameter[]]] begin[{]
return[call[splitTokens.peek, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[var], value]
if[member[.argumentEscapeEncountered]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArgumentToken, sub_type=None))]
else begin[{]
None
end[}]
if[call[Objects.equals, parameter[member[.value], member[.argumentTerminator]]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArgumentToken, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.argumentTerminator], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArgumentToken, sub_type=None))]
else begin[{]
None
end[}]
if[call[.isArgumentEscape, parameter[member[.value]]]] begin[{]
assign[member[.argumentEscapeEncountered], literal[true]]
return[call[.peek, parameter[]]]
else begin[{]
None
end[}]
if[call[.isSwitch, parameter[member[.value]]]] begin[{]
if[call[.isShortSwitchList, parameter[member[.value]]]] begin[{]
local_variable[type[var], tokens]
return[call[tokens.get, parameter[literal[0]]]]
else begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SwitchToken, sub_type=None))]
end[}]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArgumentToken, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[public] identifier[Token] identifier[peek] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[splitTokens] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[splitTokens] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[var] identifier[value] operator[=] identifier[stringIterator] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argumentEscapeEncountered] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArgumentToken] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[value] , identifier[argumentTerminator] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArgumentToken] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[argumentTerminator] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArgumentToken] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isArgumentEscape] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[argumentEscapeEncountered] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[peek] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isSwitch] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isShortSwitchList] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[var] identifier[tokens] operator[=] identifier[splitSwitchTokens] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[tokens] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[SwitchToken] operator[SEP] identifier[value] operator[SEP] identifier[substring] operator[SEP] Other[2] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[ArgumentToken] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
public void setVisitorId(String visitorId){
if (visitorId != null){
if (visitorId.length() != ID_LENGTH){
throw new IllegalArgumentException(visitorId+" is not "+ID_LENGTH+" characters long.");
}
// Verify visitorID is a 16 character hexadecimal string
else if (!visitorId.matches("[0-9A-Fa-f]+")){
throw new IllegalArgumentException(visitorId+" is not a hexadecimal string.");
}
}
setParameter(VISITOR_ID, visitorId);
} | class class_name[name] begin[{]
method[setVisitorId, return_type[void], modifier[public], parameter[visitorId]] begin[{]
if[binary_operation[member[.visitorId], !=, literal[null]]] begin[{]
if[binary_operation[call[visitorId.length, parameter[]], !=, member[.ID_LENGTH]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=visitorId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not "), operator=+), operandr=MemberReference(member=ID_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" characters long."), 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[{]
if[call[visitorId.matches, parameter[literal["[0-9A-Fa-f]+"]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=visitorId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a hexadecimal string."), 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[}]
end[}]
else begin[{]
None
end[}]
call[.setParameter, parameter[member[.VISITOR_ID], member[.visitorId]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setVisitorId] operator[SEP] identifier[String] identifier[visitorId] operator[SEP] {
Keyword[if] operator[SEP] identifier[visitorId] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[visitorId] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] identifier[ID_LENGTH] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[visitorId] operator[+] literal[String] operator[+] identifier[ID_LENGTH] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[visitorId] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[visitorId] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
identifier[setParameter] operator[SEP] identifier[VISITOR_ID] , identifier[visitorId] operator[SEP] operator[SEP]
}
|
private void skip() {
try {
int blockSize;
do {
blockSize = read();
rawData.position(rawData.position() + blockSize);
} while (blockSize > 0);
} catch (IllegalArgumentException ex) {
}
} | class class_name[name] begin[{]
method[skip, return_type[void], modifier[private], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=blockSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), DoStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=position, postfix_operators=[], prefix_operators=[], qualifier=rawData, selectors=[], type_arguments=None), operandr=MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=position, postfix_operators=[], prefix_operators=[], qualifier=rawData, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[skip] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[int] identifier[blockSize] operator[SEP] Keyword[do] {
identifier[blockSize] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] identifier[rawData] operator[SEP] identifier[position] operator[SEP] identifier[rawData] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[+] identifier[blockSize] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[blockSize] operator[>] Other[0] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ex] operator[SEP] {
}
}
|
public void setMaximumNumberOfInstances(final InstanceType instanceType, final int number) {
this.maximumMap.put(instanceType, Integer.valueOf(number));
} | class class_name[name] begin[{]
method[setMaximumNumberOfInstances, return_type[void], modifier[public], parameter[instanceType, number]] begin[{]
THIS[member[None.maximumMap]call[None.put, parameter[member[.instanceType], call[Integer.valueOf, parameter[member[.number]]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setMaximumNumberOfInstances] operator[SEP] Keyword[final] identifier[InstanceType] identifier[instanceType] , Keyword[final] Keyword[int] identifier[number] operator[SEP] {
Keyword[this] operator[SEP] identifier[maximumMap] operator[SEP] identifier[put] operator[SEP] identifier[instanceType] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[number] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized void removeGeoQueryEventListener(final GeoQueryDataEventListener listener) {
if (!eventListeners.contains(listener)) {
throw new IllegalArgumentException("Trying to remove listener that was removed or not added!");
}
eventListeners.remove(listener);
if (!this.hasListeners()) {
reset();
}
} | class class_name[name] begin[{]
method[removeGeoQueryEventListener, return_type[void], modifier[synchronized public], parameter[listener]] begin[{]
if[call[eventListeners.contains, parameter[member[.listener]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trying to remove listener that was removed or not added!")], 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[eventListeners.remove, parameter[member[.listener]]]
if[THIS[call[None.hasListeners, parameter[]]]] begin[{]
call[.reset, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[removeGeoQueryEventListener] operator[SEP] Keyword[final] identifier[GeoQueryDataEventListener] identifier[listener] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[eventListeners] operator[SEP] identifier[contains] operator[SEP] identifier[listener] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[eventListeners] operator[SEP] identifier[remove] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[hasListeners] operator[SEP] operator[SEP] operator[SEP] {
identifier[reset] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static void evaluateSubexpression(final Deque<String> operators, final Deque<String> values) {
String operator = operators.pop();
while (!(operator).equals(SeparatorToken.OPEN_PARENTHESIS.toString())) {
values.push(getBooleanResultAsString(operator,
values.pop(),
values.pop()));
operator = operators.pop();
}
} | class class_name[name] begin[{]
method[evaluateSubexpression, return_type[void], modifier[private static], parameter[operators, values]] begin[{]
local_variable[type[String], operator]
while[member[.operator]] begin[{]
call[values.push, parameter[call[.getBooleanResultAsString, parameter[member[.operator], call[values.pop, parameter[]], call[values.pop, parameter[]]]]]]
assign[member[.operator], call[operators.pop, parameter[]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[evaluateSubexpression] operator[SEP] Keyword[final] identifier[Deque] operator[<] identifier[String] operator[>] identifier[operators] , Keyword[final] identifier[Deque] operator[<] identifier[String] operator[>] identifier[values] operator[SEP] {
identifier[String] identifier[operator] operator[=] identifier[operators] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] operator[SEP] identifier[operator] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[SeparatorToken] operator[SEP] identifier[OPEN_PARENTHESIS] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[values] operator[SEP] identifier[push] operator[SEP] identifier[getBooleanResultAsString] operator[SEP] identifier[operator] , identifier[values] operator[SEP] identifier[pop] operator[SEP] operator[SEP] , identifier[values] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[operator] operator[=] identifier[operators] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public int countDifferencesBetweenAnd(String first, String second) {
if (first == null) {
if (second == null) {
return 0;
} else {
first = "";
}
} else if (second == null) {
second = "";
}
LinkedList<DiffMatchPatch.Diff> diffs = getDiffs(first, second);
int diffCount = 0;
for (DiffMatchPatch.Diff diff : diffs) {
if (diff.operation != DiffMatchPatch.Operation.EQUAL) {
diffCount++;
}
}
return diffCount;
} | class class_name[name] begin[{]
method[countDifferencesBetweenAnd, return_type[type[int]], modifier[public], parameter[first, second]] begin[{]
if[binary_operation[member[.first], ==, literal[null]]] begin[{]
if[binary_operation[member[.second], ==, literal[null]]] begin[{]
return[literal[0]]
else begin[{]
assign[member[.first], literal[""]]
end[}]
else begin[{]
if[binary_operation[member[.second], ==, literal[null]]] begin[{]
assign[member[.second], literal[""]]
else begin[{]
None
end[}]
end[}]
local_variable[type[LinkedList], diffs]
local_variable[type[int], diffCount]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=diff, selectors=[]), operandr=MemberReference(member=EQUAL, postfix_operators=[], prefix_operators=[], qualifier=DiffMatchPatch.Operation, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=diffCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=diffs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=diff)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DiffMatchPatch, sub_type=ReferenceType(arguments=None, dimensions=None, name=Diff, sub_type=None)))), label=None)
return[member[.diffCount]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[countDifferencesBetweenAnd] operator[SEP] identifier[String] identifier[first] , identifier[String] identifier[second] operator[SEP] {
Keyword[if] operator[SEP] identifier[first] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[second] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[else] {
identifier[first] operator[=] literal[String] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[second] operator[==] Other[null] operator[SEP] {
identifier[second] operator[=] literal[String] operator[SEP]
}
identifier[LinkedList] operator[<] identifier[DiffMatchPatch] operator[SEP] identifier[Diff] operator[>] identifier[diffs] operator[=] identifier[getDiffs] operator[SEP] identifier[first] , identifier[second] operator[SEP] operator[SEP] Keyword[int] identifier[diffCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[DiffMatchPatch] operator[SEP] identifier[Diff] identifier[diff] operator[:] identifier[diffs] operator[SEP] {
Keyword[if] operator[SEP] identifier[diff] operator[SEP] identifier[operation] operator[!=] identifier[DiffMatchPatch] operator[SEP] identifier[Operation] operator[SEP] identifier[EQUAL] operator[SEP] {
identifier[diffCount] operator[++] operator[SEP]
}
}
Keyword[return] identifier[diffCount] operator[SEP]
}
|
@Override
public int getObjectSizeInByteBuffer(ByteBuffer buffer, OWALChanges walChanges, int offset) {
return OBinarySerializerFactory.TYPE_IDENTIFIER_SIZE + binarySerializer
.getObjectSizeInByteBuffer(buffer, walChanges, OBinarySerializerFactory.TYPE_IDENTIFIER_SIZE + offset);
} | class class_name[name] begin[{]
method[getObjectSizeInByteBuffer, return_type[type[int]], modifier[public], parameter[buffer, walChanges, offset]] begin[{]
return[binary_operation[member[OBinarySerializerFactory.TYPE_IDENTIFIER_SIZE], +, call[binarySerializer.getObjectSizeInByteBuffer, parameter[member[.buffer], member[.walChanges], binary_operation[member[OBinarySerializerFactory.TYPE_IDENTIFIER_SIZE], +, member[.offset]]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getObjectSizeInByteBuffer] operator[SEP] identifier[ByteBuffer] identifier[buffer] , identifier[OWALChanges] identifier[walChanges] , Keyword[int] identifier[offset] operator[SEP] {
Keyword[return] identifier[OBinarySerializerFactory] operator[SEP] identifier[TYPE_IDENTIFIER_SIZE] operator[+] identifier[binarySerializer] operator[SEP] identifier[getObjectSizeInByteBuffer] operator[SEP] identifier[buffer] , identifier[walChanges] , identifier[OBinarySerializerFactory] operator[SEP] identifier[TYPE_IDENTIFIER_SIZE] operator[+] identifier[offset] operator[SEP] operator[SEP]
}
|
public static long factorial(int arg) {
if (arg <= 0) {
throw new IllegalArgumentException("参数必须大于0");
}
long result = 1;
for (int i = arg; i > 0; i--) {
result *= i;
}
return result;
} | class class_name[name] begin[{]
method[factorial, return_type[type[long]], modifier[public static], parameter[arg]] begin[{]
if[binary_operation[member[.arg], <=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[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=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[long], result]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[long] identifier[factorial] operator[SEP] Keyword[int] identifier[arg] operator[SEP] {
Keyword[if] operator[SEP] identifier[arg] operator[<=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[long] identifier[result] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[arg] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] {
identifier[result] operator[*=] identifier[i] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void decode(AsnInputStream ais) throws ParseException {
try {
if (this.type == ErrorCodeType.Global) {
this.globalErrorCode = ais.readObjectIdentifier();
} else if (this.type == ErrorCodeType.Local) {
this.localErrorCode = ais.readInteger();
} else {
throw new ParseException(null, GeneralProblemType.MistypedComponent);
}
} catch (IOException e) {
e.printStackTrace();
throw new ParseException(null, GeneralProblemType.BadlyStructuredComponent, "IOException while parsing ErrorCode: "
+ e.getMessage(), e);
} catch (AsnException e) {
e.printStackTrace();
throw new ParseException(null, GeneralProblemType.BadlyStructuredComponent,
"AsnException while parsing ErrorCode: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[decode, return_type[void], modifier[public], parameter[ais]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=Global, postfix_operators=[], prefix_operators=[], qualifier=ErrorCodeType, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=Local, postfix_operators=[], prefix_operators=[], qualifier=ErrorCodeType, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=MistypedComponent, postfix_operators=[], prefix_operators=[], qualifier=GeneralProblemType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParseException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=localErrorCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[], member=readInteger, postfix_operators=[], prefix_operators=[], qualifier=ais, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=globalErrorCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[], member=readObjectIdentifier, postfix_operators=[], prefix_operators=[], qualifier=ais, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=BadlyStructuredComponent, postfix_operators=[], prefix_operators=[], qualifier=GeneralProblemType, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException while parsing ErrorCode: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParseException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=BadlyStructuredComponent, postfix_operators=[], prefix_operators=[], qualifier=GeneralProblemType, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AsnException while parsing ErrorCode: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParseException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AsnException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[decode] operator[SEP] identifier[AsnInputStream] identifier[ais] operator[SEP] Keyword[throws] identifier[ParseException] {
Keyword[try] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[==] identifier[ErrorCodeType] operator[SEP] identifier[Global] operator[SEP] {
Keyword[this] operator[SEP] identifier[globalErrorCode] operator[=] identifier[ais] operator[SEP] identifier[readObjectIdentifier] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[==] identifier[ErrorCodeType] operator[SEP] identifier[Local] operator[SEP] {
Keyword[this] operator[SEP] identifier[localErrorCode] operator[=] identifier[ais] operator[SEP] identifier[readInteger] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[ParseException] operator[SEP] Other[null] , identifier[GeneralProblemType] operator[SEP] identifier[MistypedComponent] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ParseException] operator[SEP] Other[null] , identifier[GeneralProblemType] operator[SEP] identifier[BadlyStructuredComponent] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[AsnException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ParseException] operator[SEP] Other[null] , identifier[GeneralProblemType] operator[SEP] identifier[BadlyStructuredComponent] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private SecureRandom createSecureRandom()
{
SecureRandom result = null;
long t1 = System.currentTimeMillis();
if (secureRandomClass != null)
{
try
{
// Construct and seed a new random number generator
Class<?> clazz = Class.forName(secureRandomClass);
result = (SecureRandom) clazz.newInstance();
}
catch (Exception e)
{
log.log(Level.SEVERE, "Exception initializing random number generator of class "+
secureRandomClass + ". Falling back to java.secure.SecureRandom", e);
}
}
if (result == null)
{
// No secureRandomClass or creation failed. Use SecureRandom.
try
{
if (secureRandomProvider != null
&& secureRandomProvider.length() > 0)
{
result = SecureRandom.getInstance(secureRandomAlgorithm,
secureRandomProvider);
}
else
{
if (secureRandomAlgorithm != null
&& secureRandomAlgorithm.length() > 0)
{
result = SecureRandom.getInstance(secureRandomAlgorithm);
}
}
}
catch (NoSuchAlgorithmException e)
{
log.log(Level.SEVERE, "Exception initializing random number generator using algorithm: "+
secureRandomAlgorithm, e);
}
catch (NoSuchProviderException e)
{
log.log(Level.SEVERE, "Exception initializing random number generator using provider: " +
secureRandomProvider, e);
}
}
if (result == null)
{
// Invalid provider / algorithm
try
{
result = SecureRandom.getInstance("SHA1PRNG");
}
catch (NoSuchAlgorithmException e)
{
log.log(Level.SEVERE, "Invalid provider / algoritm SHA1PRNG for generate secure random token", e);
}
}
if (result == null)
{
// Nothing works - use platform default
result = new SecureRandom();
}
// Force seeding to take place
result.nextInt();
long t2 = System.currentTimeMillis();
if ((t2 - t1) > 100)
{
if (log.isLoggable(Level.FINEST))
{
log.info("Creation of SecureRandom instance for session ID generation using ["
+result.getAlgorithm()+"] took ["+Long.valueOf(t2 - t1)+"] milliseconds.");
}
}
return result;
} | class class_name[name] begin[{]
method[createSecureRandom, return_type[type[SecureRandom]], modifier[private], parameter[]] begin[{]
local_variable[type[SecureRandom], result]
local_variable[type[long], t1]
if[binary_operation[member[.secureRandomClass], !=, literal[null]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=secureRandomClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SecureRandom, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception initializing random number generator of class "), operandr=MemberReference(member=secureRandomClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Falling back to java.secure.SecureRandom"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, 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)
else begin[{]
None
end[}]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=secureRandomProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=secureRandomProvider, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=secureRandomAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=secureRandomAlgorithm, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=secureRandomAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SecureRandom, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=secureRandomAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=secureRandomProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SecureRandom, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception initializing random number generator using algorithm: "), operandr=MemberReference(member=secureRandomAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception initializing random number generator using provider: "), operandr=MemberReference(member=secureRandomProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchProviderException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SHA1PRNG")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SecureRandom, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid provider / algoritm SHA1PRNG for generate secure random token"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
assign[member[.result], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecureRandom, sub_type=None))]
else begin[{]
None
end[}]
call[result.nextInt, parameter[]]
local_variable[type[long], t2]
if[binary_operation[binary_operation[member[.t2], -, member[.t1]], >, literal[100]]] begin[{]
if[call[log.isLoggable, parameter[member[Level.FINEST]]]] begin[{]
call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Creation of SecureRandom instance for session ID generation using ["], +, call[result.getAlgorithm, parameter[]]], +, literal["] took ["]], +, call[Long.valueOf, parameter[binary_operation[member[.t2], -, member[.t1]]]]], +, literal["] milliseconds."]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[SecureRandom] identifier[createSecureRandom] operator[SEP] operator[SEP] {
identifier[SecureRandom] identifier[result] operator[=] Other[null] operator[SEP] Keyword[long] identifier[t1] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[secureRandomClass] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[secureRandomClass] operator[SEP] operator[SEP] identifier[result] operator[=] operator[SEP] identifier[SecureRandom] operator[SEP] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[secureRandomClass] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[secureRandomProvider] operator[!=] Other[null] operator[&&] identifier[secureRandomProvider] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[result] operator[=] identifier[SecureRandom] operator[SEP] identifier[getInstance] operator[SEP] identifier[secureRandomAlgorithm] , identifier[secureRandomProvider] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[secureRandomAlgorithm] operator[!=] Other[null] operator[&&] identifier[secureRandomAlgorithm] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[result] operator[=] identifier[SecureRandom] operator[SEP] identifier[getInstance] operator[SEP] identifier[secureRandomAlgorithm] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[secureRandomAlgorithm] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchProviderException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[secureRandomProvider] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
Keyword[try] {
identifier[result] operator[=] identifier[SecureRandom] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
identifier[result] operator[=] Keyword[new] identifier[SecureRandom] operator[SEP] operator[SEP] operator[SEP]
}
identifier[result] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[t2] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[t2] operator[-] identifier[t1] operator[SEP] operator[>] Other[100] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[result] operator[SEP] identifier[getAlgorithm] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[t2] operator[-] identifier[t1] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
private static List<Field> getAllFields(Class type) {
final List<Field> fields = new ArrayList<>();
for (Class<?> c = type; c != null; c = c.getSuperclass()) {
fields.addAll(Arrays.asList(c.getDeclaredFields()));
}
return fields;
} | class class_name[name] begin[{]
method[getAllFields, return_type[type[List]], modifier[private static], parameter[type]] begin[{]
local_variable[type[List], fields]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeclaredFields, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getSuperclass, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None))]), label=None)
return[member[.fields]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Field] operator[>] identifier[getAllFields] operator[SEP] identifier[Class] identifier[type] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[Field] operator[>] identifier[fields] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[=] identifier[type] operator[SEP] identifier[c] operator[!=] Other[null] operator[SEP] identifier[c] operator[=] identifier[c] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] {
identifier[fields] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[c] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fields] operator[SEP]
}
|
public void setHostReservationIdSet(java.util.Collection<String> hostReservationIdSet) {
if (hostReservationIdSet == null) {
this.hostReservationIdSet = null;
return;
}
this.hostReservationIdSet = new com.amazonaws.internal.SdkInternalList<String>(hostReservationIdSet);
} | class class_name[name] begin[{]
method[setHostReservationIdSet, return_type[void], modifier[public], parameter[hostReservationIdSet]] begin[{]
if[binary_operation[member[.hostReservationIdSet], ==, literal[null]]] begin[{]
assign[THIS[member[None.hostReservationIdSet]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.hostReservationIdSet]], ClassCreator(arguments=[MemberReference(member=hostReservationIdSet, 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=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setHostReservationIdSet] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[hostReservationIdSet] operator[SEP] {
Keyword[if] operator[SEP] identifier[hostReservationIdSet] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[hostReservationIdSet] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[hostReservationIdSet] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[hostReservationIdSet] operator[SEP] operator[SEP]
}
|
public static final String serializeToString(final Object object) {
if (object == null)
throw new IllegalArgumentException("Object was null");
try {
return jsonMapper.writeValueAsString(object);
} catch (JsonProcessingException e) {
throw new JSONException(e);
}
} | class class_name[name] begin[{]
method[serializeToString, return_type[type[String]], modifier[final public static], parameter[object]] begin[{]
if[binary_operation[member[.object], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Object was 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[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeValueAsString, postfix_operators=[], prefix_operators=[], qualifier=jsonMapper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JsonProcessingException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[String] identifier[serializeToString] operator[SEP] Keyword[final] identifier[Object] identifier[object] operator[SEP] {
Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[jsonMapper] operator[SEP] identifier[writeValueAsString] operator[SEP] identifier[object] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[JsonProcessingException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JSONException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@Pure
public static Integer getAttributeIntWithDefault(Node document, Integer defaultValue, String... path) {
return getAttributeIntWithDefault(document, true, defaultValue, path);
} | class class_name[name] begin[{]
method[getAttributeIntWithDefault, return_type[type[Integer]], modifier[public static], parameter[document, defaultValue, path]] begin[{]
return[call[.getAttributeIntWithDefault, parameter[member[.document], literal[true], member[.defaultValue], member[.path]]]]
end[}]
END[}] | annotation[@] identifier[Pure] Keyword[public] Keyword[static] identifier[Integer] identifier[getAttributeIntWithDefault] operator[SEP] identifier[Node] identifier[document] , identifier[Integer] identifier[defaultValue] , identifier[String] operator[...] identifier[path] operator[SEP] {
Keyword[return] identifier[getAttributeIntWithDefault] operator[SEP] identifier[document] , literal[boolean] , identifier[defaultValue] , identifier[path] operator[SEP] operator[SEP]
}
|
@Override
public RequestCtx handleRequest(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
if (logger.isDebugEnabled()) {
logger.debug("{}/handleRequest!", this.getClass().getName());
}
String asOfDateTime = request.getParameter("asOfDateTime");
if (!isDate(asOfDateTime)) {
asOfDateTime = null;
}
RequestCtx req = null;
Map<URI, AttributeValue> actions = new HashMap<URI, AttributeValue>();
Map<URI, AttributeValue> resAttr;
try {
String[] parts = getPathParts(request);
resAttr = ResourceAttributes.getResources(parts);
if (asOfDateTime != null && !asOfDateTime.isEmpty()) {
resAttr.put(Constants.DATASTREAM.AS_OF_DATETIME.getURI(),
DateTimeAttribute.getInstance(asOfDateTime));
}
actions.put(Constants.ACTION.ID.getURI(),
Constants.ACTION.LIST_DATASTREAMS
.getStringAttribute());
actions.put(Constants.ACTION.API.getURI(),
Constants.ACTION.APIA.getStringAttribute());
req =
getContextHandler().buildRequest(getSubjects(request),
actions,
resAttr,
getEnvironment(request));
String pid = resAttr.get(Constants.OBJECT.PID.getURI()).toString();
LogUtil.statLog(request.getRemoteUser(),
Constants.ACTION.LIST_DATASTREAMS.uri,
pid,
null);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new ServletException(e.getMessage(), e);
}
return req;
} | class class_name[name] begin[{]
method[handleRequest, return_type[type[RequestCtx]], modifier[public], parameter[request, response]] begin[{]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[literal["{}/handleRequest!"], THIS[call[None.getClass, parameter[]]call[None.getName, parameter[]]]]]
else begin[{]
None
end[}]
local_variable[type[String], asOfDateTime]
if[call[.isDate, parameter[member[.asOfDateTime]]]] begin[{]
assign[member[.asOfDateTime], literal[null]]
else begin[{]
None
end[}]
local_variable[type[RequestCtx], req]
local_variable[type[Map], actions]
local_variable[type[Map], resAttr]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPathParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=parts)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resAttr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=ResourceAttributes, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=asOfDateTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=asOfDateTime, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getURI, postfix_operators=[], prefix_operators=[], qualifier=Constants.DATASTREAM.AS_OF_DATETIME, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=asOfDateTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=DateTimeAttribute, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=resAttr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getURI, postfix_operators=[], prefix_operators=[], qualifier=Constants.ACTION.ID, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getStringAttribute, postfix_operators=[], prefix_operators=[], qualifier=Constants.ACTION.LIST_DATASTREAMS, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=actions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getURI, postfix_operators=[], prefix_operators=[], qualifier=Constants.ACTION.API, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getStringAttribute, postfix_operators=[], prefix_operators=[], qualifier=Constants.ACTION.APIA, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=actions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getContextHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSubjects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=actions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resAttr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEnvironment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=buildRequest, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getURI, postfix_operators=[], prefix_operators=[], qualifier=Constants.OBJECT.PID, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=resAttr, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=pid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRemoteUser, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=Constants.ACTION.LIST_DATASTREAMS, selectors=[]), MemberReference(member=pid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=statLog, postfix_operators=[], prefix_operators=[], qualifier=LogUtil, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServletException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.req]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[RequestCtx] identifier[handleRequest] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] {
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] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[asOfDateTime] operator[=] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isDate] operator[SEP] identifier[asOfDateTime] operator[SEP] operator[SEP] {
identifier[asOfDateTime] operator[=] Other[null] operator[SEP]
}
identifier[RequestCtx] identifier[req] operator[=] Other[null] operator[SEP] identifier[Map] operator[<] identifier[URI] , identifier[AttributeValue] operator[>] identifier[actions] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[URI] , identifier[AttributeValue] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[URI] , identifier[AttributeValue] operator[>] identifier[resAttr] operator[SEP] Keyword[try] {
identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[getPathParts] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[resAttr] operator[=] identifier[ResourceAttributes] operator[SEP] identifier[getResources] operator[SEP] identifier[parts] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[asOfDateTime] operator[!=] Other[null] operator[&&] operator[!] identifier[asOfDateTime] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[resAttr] operator[SEP] identifier[put] operator[SEP] identifier[Constants] operator[SEP] identifier[DATASTREAM] operator[SEP] identifier[AS_OF_DATETIME] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] , identifier[DateTimeAttribute] operator[SEP] identifier[getInstance] operator[SEP] identifier[asOfDateTime] operator[SEP] operator[SEP] operator[SEP]
}
identifier[actions] operator[SEP] identifier[put] operator[SEP] identifier[Constants] operator[SEP] identifier[ACTION] operator[SEP] identifier[ID] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] , identifier[Constants] operator[SEP] identifier[ACTION] operator[SEP] identifier[LIST_DATASTREAMS] operator[SEP] identifier[getStringAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[actions] operator[SEP] identifier[put] operator[SEP] identifier[Constants] operator[SEP] identifier[ACTION] operator[SEP] identifier[API] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] , identifier[Constants] operator[SEP] identifier[ACTION] operator[SEP] identifier[APIA] operator[SEP] identifier[getStringAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[req] operator[=] identifier[getContextHandler] operator[SEP] operator[SEP] operator[SEP] identifier[buildRequest] operator[SEP] identifier[getSubjects] operator[SEP] identifier[request] operator[SEP] , identifier[actions] , identifier[resAttr] , identifier[getEnvironment] operator[SEP] identifier[request] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pid] operator[=] identifier[resAttr] operator[SEP] identifier[get] operator[SEP] identifier[Constants] operator[SEP] identifier[OBJECT] operator[SEP] identifier[PID] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[LogUtil] operator[SEP] identifier[statLog] operator[SEP] identifier[request] operator[SEP] identifier[getRemoteUser] operator[SEP] operator[SEP] , identifier[Constants] operator[SEP] identifier[ACTION] operator[SEP] identifier[LIST_DATASTREAMS] operator[SEP] identifier[uri] , identifier[pid] , Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ServletException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[req] operator[SEP]
}
|
public static HeliosClient create(final String domain, final String user) {
return HeliosClient.newBuilder()
.setDomain(domain)
.setUser(user)
.build();
} | class class_name[name] begin[{]
method[create, return_type[type[HeliosClient]], modifier[public static], parameter[domain, user]] begin[{]
return[call[HeliosClient.newBuilder, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[HeliosClient] identifier[create] operator[SEP] Keyword[final] identifier[String] identifier[domain] , Keyword[final] identifier[String] identifier[user] operator[SEP] {
Keyword[return] identifier[HeliosClient] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setDomain] operator[SEP] identifier[domain] operator[SEP] operator[SEP] identifier[setUser] operator[SEP] identifier[user] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public void searchAtomic (@Nonnull final Query aQuery, @Nonnull final Collector aCollector) throws IOException
{
ValueEnforcer.notNull (aQuery, "Query");
ValueEnforcer.notNull (aCollector, "Collector");
m_aLucene.readLockedAtomic ( () -> {
final IndexSearcher aSearcher = m_aLucene.getSearcher ();
if (aSearcher != null)
{
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Searching Lucene: " + aQuery);
// Search all documents, collect them
_timedSearch ( () -> aSearcher.search (aQuery, aCollector), aQuery);
}
else
LOGGER.error ("Failed to obtain IndexSearcher for " + aQuery);
// Return values does not matter
return null;
});
} | class class_name[name] begin[{]
method[searchAtomic, return_type[void], modifier[public], parameter[aQuery, aCollector]] begin[{]
call[ValueEnforcer.notNull, parameter[member[.aQuery], literal["Query"]]]
call[ValueEnforcer.notNull, parameter[member[.aCollector], literal["Collector"]]]
call[m_aLucene.readLockedAtomic, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSearcher, postfix_operators=[], prefix_operators=[], qualifier=m_aLucene, selectors=[], type_arguments=None), name=aSearcher)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=IndexSearcher, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aSearcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to obtain IndexSearcher for "), operandr=MemberReference(member=aQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Searching Lucene: "), operandr=MemberReference(member=aQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=aQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aCollector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=search, postfix_operators=[], prefix_operators=[], qualifier=aSearcher, selectors=[], type_arguments=None), parameters=[]), MemberReference(member=aQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=_timedSearch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], parameters=[])]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[searchAtomic] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Query] identifier[aQuery] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Collector] identifier[aCollector] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aQuery] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aCollector] , literal[String] operator[SEP] operator[SEP] identifier[m_aLucene] operator[SEP] identifier[readLockedAtomic] operator[SEP] operator[SEP] operator[SEP] operator[->] {
Keyword[final] identifier[IndexSearcher] identifier[aSearcher] operator[=] identifier[m_aLucene] operator[SEP] identifier[getSearcher] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aSearcher] operator[!=] Other[null] 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[aQuery] operator[SEP] operator[SEP] identifier[_timedSearch] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[aSearcher] operator[SEP] identifier[search] operator[SEP] identifier[aQuery] , identifier[aCollector] operator[SEP] , identifier[aQuery] operator[SEP] operator[SEP]
}
Keyword[else] identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[aQuery] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
} operator[SEP] operator[SEP]
}
|
private boolean isNeedRestore(final String fullName,
final String[] parts) {
if (fullName == null) {
return false;
}
if ((parent.getCurrent().getCurrentDataContextName() != null)
&& (parent.getCurrent().getCurrentDataContextName()
.toLowerCase()
.startsWith(fullName.toLowerCase()))) {
return false;
}
return ((parts != null) && (parts.length > 1));
} | class class_name[name] begin[{]
method[isNeedRestore, return_type[type[boolean]], modifier[private], parameter[fullName, parts]] begin[{]
if[binary_operation[member[.fullName], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[parent.getCurrent, parameter[]], !=, literal[null]], &&, call[parent.getCurrent, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[binary_operation[binary_operation[member[.parts], !=, literal[null]], &&, binary_operation[member[parts.length], >, literal[1]]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isNeedRestore] operator[SEP] Keyword[final] identifier[String] identifier[fullName] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[SEP] {
Keyword[if] operator[SEP] identifier[fullName] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentDataContextName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[parent] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentDataContextName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[fullName] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] operator[SEP] operator[SEP] identifier[parts] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
|
public static int getHour(Date timeFrom) {
Calendar instance = Calendar.getInstance();
instance.setTime(timeFrom);
int hour = instance.get(Calendar.HOUR);
return hour;
} | class class_name[name] begin[{]
method[getHour, return_type[type[int]], modifier[public static], parameter[timeFrom]] begin[{]
local_variable[type[Calendar], instance]
call[instance.setTime, parameter[member[.timeFrom]]]
local_variable[type[int], hour]
return[member[.hour]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[getHour] operator[SEP] identifier[Date] identifier[timeFrom] operator[SEP] {
identifier[Calendar] identifier[instance] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[instance] operator[SEP] identifier[setTime] operator[SEP] identifier[timeFrom] operator[SEP] operator[SEP] Keyword[int] identifier[hour] operator[=] identifier[instance] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR] operator[SEP] operator[SEP] Keyword[return] identifier[hour] operator[SEP]
}
|
private static long[] rtable(int n) {
return new long[]{
0x00000000l << n, 0x00000001l << n, 0x00000100l << n, 0x00000101l << n,
0x00010000l << n, 0x00010001l << n, 0x00010100l << n, 0x00010101l << n,
0x01000000l << n, 0x01000001l << n, 0x01000100l << n, 0x01000101l << n,
0x01010000l << n, 0x01010001l << n, 0x01010100l << n, 0x01010101l << n
};
} | class class_name[name] begin[{]
method[rtable, return_type[type[long]], modifier[private static], parameter[n]] begin[{]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00000000l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00000001l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00000100l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00000101l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00010000l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00010001l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00010100l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00010101l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01000000l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01000001l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01000100l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01000101l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01010000l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01010001l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01010100l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x01010101l), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long))]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[long] operator[SEP] operator[SEP] identifier[rtable] operator[SEP] Keyword[int] identifier[n] operator[SEP] {
Keyword[return] Keyword[new] Keyword[long] operator[SEP] operator[SEP] {
literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n] , literal[Integer] operator[<<] identifier[n]
} operator[SEP]
}
|
public static boolean containsKey(String key, int length)
{
if (!trie.containsKey(key)) return false;
return key.length() >= length;
} | class class_name[name] begin[{]
method[containsKey, return_type[type[boolean]], modifier[public static], parameter[key, length]] begin[{]
if[call[trie.containsKey, parameter[member[.key]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[binary_operation[call[key.length, parameter[]], >=, member[.length]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[containsKey] operator[SEP] identifier[String] identifier[key] , Keyword[int] identifier[length] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[trie] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] identifier[key] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>=] identifier[length] operator[SEP]
}
|
public void savePreferences() {
FOKLogger.info(Prefs.class.getName(), "Saving preference file as: " + file.getAbsolutePath());
if (!file.getParentFile().exists() && !file.getParentFile().mkdirs())
throw new IllegalStateException("Unable to create the folder to save the Prefs in");
try (FileOutputStream out = new FileOutputStream(file)){
props.store(out, "This is a preference file of the app " + Common.getInstance().getAppName() + ". If you delete this file, the specified app will be (partly or entirely) reset to its factory settings.");
} catch (IOException e) {
e.printStackTrace();
}
} | class class_name[name] begin[{]
method[savePreferences, return_type[void], modifier[public], parameter[]] begin[{]
call[FOKLogger.info, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Prefs, sub_type=None)), binary_operation[literal["Saving preference file as: "], +, call[file.getAbsolutePath, parameter[]]]]]
if[binary_operation[call[file.getParentFile, parameter[]], &&, call[file.getParentFile, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to create the folder to save the Prefs in")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This is a preference file of the app "), operandr=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Common, selectors=[MethodInvocation(arguments=[], member=getAppName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". If you delete this file, the specified app will be (partly or entirely) reset to its factory settings."), operator=+)], member=store, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=out, type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, 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=FileOutputStream, sub_type=None)))])
end[}]
END[}] | Keyword[public] Keyword[void] identifier[savePreferences] operator[SEP] operator[SEP] {
identifier[FOKLogger] operator[SEP] identifier[info] operator[SEP] identifier[Prefs] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[FileOutputStream] identifier[out] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] {
identifier[props] operator[SEP] identifier[store] operator[SEP] identifier[out] , literal[String] operator[+] identifier[Common] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ListPoliciesGrantingServiceAccessResult withPoliciesGrantingServiceAccess(ListPoliciesGrantingServiceAccessEntry... policiesGrantingServiceAccess) {
if (this.policiesGrantingServiceAccess == null) {
setPoliciesGrantingServiceAccess(new com.amazonaws.internal.SdkInternalList<ListPoliciesGrantingServiceAccessEntry>(
policiesGrantingServiceAccess.length));
}
for (ListPoliciesGrantingServiceAccessEntry ele : policiesGrantingServiceAccess) {
this.policiesGrantingServiceAccess.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withPoliciesGrantingServiceAccess, return_type[type[ListPoliciesGrantingServiceAccessResult]], modifier[public], parameter[policiesGrantingServiceAccess]] begin[{]
if[binary_operation[THIS[member[None.policiesGrantingServiceAccess]], ==, literal[null]]] begin[{]
call[.setPoliciesGrantingServiceAccess, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=policiesGrantingServiceAccess, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ListPoliciesGrantingServiceAccessEntry, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=policiesGrantingServiceAccess, 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=policiesGrantingServiceAccess, 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=ListPoliciesGrantingServiceAccessEntry, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ListPoliciesGrantingServiceAccessResult] identifier[withPoliciesGrantingServiceAccess] operator[SEP] identifier[ListPoliciesGrantingServiceAccessEntry] operator[...] identifier[policiesGrantingServiceAccess] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[policiesGrantingServiceAccess] operator[==] Other[null] operator[SEP] {
identifier[setPoliciesGrantingServiceAccess] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ListPoliciesGrantingServiceAccessEntry] operator[>] operator[SEP] identifier[policiesGrantingServiceAccess] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[ListPoliciesGrantingServiceAccessEntry] identifier[ele] operator[:] identifier[policiesGrantingServiceAccess] operator[SEP] {
Keyword[this] operator[SEP] identifier[policiesGrantingServiceAccess] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public JSONObject get(String path, Map<String,String> headers)
throws ServiceException, JSONException {
Asset rules = getRulesAsset(path);
Operand input = new Operand();
input.setContext(getContext(path));
Query query = getQuery(path, headers);
input.setParams(query.getFilters());
input.setMeta(headers);
JSONObject response = invokeRules(rules, input, getExecutor(headers));
Status status = input.getStatus();
if (status != null) {
headers.put(Listener.METAINFO_HTTP_STATUS_CODE, String.valueOf(status.getCode()));
if (response == null)
return status.getJson();
}
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[JSONObject]], modifier[public], parameter[path, headers]] begin[{]
local_variable[type[Asset], rules]
local_variable[type[Operand], input]
call[input.setContext, parameter[call[.getContext, parameter[member[.path]]]]]
local_variable[type[Query], query]
call[input.setParams, parameter[call[query.getFilters, parameter[]]]]
call[input.setMeta, parameter[member[.headers]]]
local_variable[type[JSONObject], response]
local_variable[type[Status], status]
if[binary_operation[member[.status], !=, literal[null]]] begin[{]
call[headers.put, parameter[member[Listener.METAINFO_HTTP_STATUS_CODE], call[String.valueOf, parameter[call[status.getCode, parameter[]]]]]]
if[binary_operation[member[.response], ==, literal[null]]] begin[{]
return[call[status.getJson, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.response]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[JSONObject] identifier[get] operator[SEP] identifier[String] identifier[path] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] operator[SEP] Keyword[throws] identifier[ServiceException] , identifier[JSONException] {
identifier[Asset] identifier[rules] operator[=] identifier[getRulesAsset] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[Operand] identifier[input] operator[=] Keyword[new] identifier[Operand] operator[SEP] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[setContext] operator[SEP] identifier[getContext] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[Query] identifier[query] operator[=] identifier[getQuery] operator[SEP] identifier[path] , identifier[headers] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[setParams] operator[SEP] identifier[query] operator[SEP] identifier[getFilters] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[setMeta] operator[SEP] identifier[headers] operator[SEP] operator[SEP] identifier[JSONObject] identifier[response] operator[=] identifier[invokeRules] operator[SEP] identifier[rules] , identifier[input] , identifier[getExecutor] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[Status] identifier[status] operator[=] identifier[input] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[status] operator[!=] Other[null] operator[SEP] {
identifier[headers] operator[SEP] identifier[put] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_HTTP_STATUS_CODE] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[status] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[==] Other[null] operator[SEP] Keyword[return] identifier[status] operator[SEP] identifier[getJson] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[response] operator[SEP]
}
|
public SIMPIterator getAttachedRemoteSubscriberIterator()
throws SIMPException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAttachedRemoteSubscriberIterator");
assertMessageHandlerNotCorrupt();
Collection anycastInputHandlers = baseDest.getPseudoDurableAIHMap().values();
AttachedRemoteSubscriberIterator remoteSubscriberItr =
new AttachedRemoteSubscriberIterator(anycastInputHandlers);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAttachedRemoteSubscriberIterator", remoteSubscriberItr);
return remoteSubscriberItr;
} | class class_name[name] begin[{]
method[getAttachedRemoteSubscriberIterator, return_type[type[SIMPIterator]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["getAttachedRemoteSubscriberIterator"]]]
else begin[{]
None
end[}]
call[.assertMessageHandlerNotCorrupt, parameter[]]
local_variable[type[Collection], anycastInputHandlers]
local_variable[type[AttachedRemoteSubscriberIterator], remoteSubscriberItr]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["getAttachedRemoteSubscriberIterator"], member[.remoteSubscriberItr]]]
else begin[{]
None
end[}]
return[member[.remoteSubscriberItr]]
end[}]
END[}] | Keyword[public] identifier[SIMPIterator] identifier[getAttachedRemoteSubscriberIterator] operator[SEP] operator[SEP] Keyword[throws] identifier[SIMPException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[assertMessageHandlerNotCorrupt] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] identifier[anycastInputHandlers] operator[=] identifier[baseDest] operator[SEP] identifier[getPseudoDurableAIHMap] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[AttachedRemoteSubscriberIterator] identifier[remoteSubscriberItr] operator[=] Keyword[new] identifier[AttachedRemoteSubscriberIterator] operator[SEP] identifier[anycastInputHandlers] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[remoteSubscriberItr] operator[SEP] operator[SEP] Keyword[return] identifier[remoteSubscriberItr] operator[SEP]
}
|
public static <K /*>>> extends @NonNull Object*/, V /*>>> extends @NonNull Object*/>
void checkMapElementNotNull(Map<K, V> map, @javax.annotation.Nullable Object errorMessage) {
for (Map.Entry<K, V> entry : map.entrySet()) {
if (entry.getKey() == null || entry.getValue() == null) {
throw new NullPointerException(String.valueOf(errorMessage));
}
}
} | class class_name[name] begin[{]
method[checkMapElementNotNull, return_type[void], modifier[public static], parameter[map, errorMessage]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=errorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] Keyword[void] identifier[checkMapElementNotNull] operator[SEP] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] , annotation[@] identifier[javax] operator[SEP] identifier[annotation] operator[SEP] identifier[Nullable] identifier[Object] identifier[errorMessage] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[errorMessage] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public long readLong() throws IOException {
long byte1 = file.read();
long byte2 = file.read();
long byte3 = file.read();
long byte4 = file.read();
long byte5 = file.read();
long byte6 = file.read();
long byte7 = file.read();
long byte8 = file.read();
if (byte8 < 0) {
throw new EOFException();
}
return (byte8 << 56) + ((byte7 << 56) >>> 8)
+ ((byte6 << 56) >>> 16) + ((byte5 << 56) >>> 24)
+ ((byte4 << 56) >>> 32) + ((byte3 << 56) >>> 40)
+ ((byte2 << 56) >>> 48) + ((byte1 << 56) >>> 56);
} | class class_name[name] begin[{]
method[readLong, return_type[type[long]], modifier[public], parameter[]] begin[{]
local_variable[type[long], byte1]
local_variable[type[long], byte2]
local_variable[type[long], byte3]
local_variable[type[long], byte4]
local_variable[type[long], byte5]
local_variable[type[long], byte6]
local_variable[type[long], byte7]
local_variable[type[long], byte8]
if[binary_operation[member[.byte8], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.byte8], <<, literal[56]], +, binary_operation[binary_operation[member[.byte7], <<, literal[56]], >>>, literal[8]]], +, binary_operation[binary_operation[member[.byte6], <<, literal[56]], >>>, literal[16]]], +, binary_operation[binary_operation[member[.byte5], <<, literal[56]], >>>, literal[24]]], +, binary_operation[binary_operation[member[.byte4], <<, literal[56]], >>>, literal[32]]], +, binary_operation[binary_operation[member[.byte3], <<, literal[56]], >>>, literal[40]]], +, binary_operation[binary_operation[member[.byte2], <<, literal[56]], >>>, literal[48]]], +, binary_operation[binary_operation[member[.byte1], <<, literal[56]], >>>, literal[56]]]]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[readLong] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[long] identifier[byte1] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[byte2] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[byte3] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[byte4] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[byte5] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[byte6] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[byte7] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[byte8] operator[=] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[byte8] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[byte8] operator[<<] Other[56] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[byte7] operator[<<] Other[56] operator[SEP] operator[>] operator[>] operator[>] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[byte6] operator[<<] Other[56] operator[SEP] operator[>] operator[>] operator[>] Other[16] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[byte5] operator[<<] Other[56] operator[SEP] operator[>] operator[>] operator[>] Other[24] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[byte4] operator[<<] Other[56] operator[SEP] operator[>] operator[>] operator[>] Other[32] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[byte3] operator[<<] Other[56] operator[SEP] operator[>] operator[>] operator[>] Other[40] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[byte2] operator[<<] Other[56] operator[SEP] operator[>] operator[>] operator[>] Other[48] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[byte1] operator[<<] Other[56] operator[SEP] operator[>] operator[>] operator[>] Other[56] operator[SEP] operator[SEP]
}
|
public static boolean isConstructor(Method m) {
if (m.getName().equals("")) {
throw new Error("method name cannot be empty");
}
return m.getName().equals("<init>");
} | class class_name[name] begin[{]
method[isConstructor, return_type[type[boolean]], modifier[public static], parameter[m]] begin[{]
if[call[m.getName, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="method name cannot be empty")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Error, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[m.getName, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isConstructor] operator[SEP] identifier[Method] identifier[m] operator[SEP] {
Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Error] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
private Transformer createIndentingTransformer() throws TransformerConfigurationException {
Transformer transformer = createTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
return transformer;
} | class class_name[name] begin[{]
method[createIndentingTransformer, return_type[type[Transformer]], modifier[private], parameter[]] begin[{]
local_variable[type[Transformer], transformer]
call[transformer.setOutputProperty, parameter[member[OutputKeys.OMIT_XML_DECLARATION], literal["yes"]]]
call[transformer.setOutputProperty, parameter[member[OutputKeys.INDENT], literal["yes"]]]
return[member[.transformer]]
end[}]
END[}] | Keyword[private] identifier[Transformer] identifier[createIndentingTransformer] operator[SEP] operator[SEP] Keyword[throws] identifier[TransformerConfigurationException] {
identifier[Transformer] identifier[transformer] operator[=] identifier[createTransformer] operator[SEP] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[OMIT_XML_DECLARATION] , literal[String] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[INDENT] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[transformer] operator[SEP]
}
|
protected void handshakeReceived(IoSession session,
HandshakeMessage handshakeMessage) {
log.debug("Received {}", handshakeMessage);
this.receivedHandshake = handshakeMessage;
Boolean handshakeCheck = this.checkHandshake();
if (handshakeCheck == null) {
return;
}
if (Boolean.FALSE.equals(handshakeCheck)) {
log.warn("Handshakes did not match.");
this._disconnect();
}
if (Boolean.TRUE.equals(handshakeCheck)) {
SubscriptionMessage msg = this.generateGenericSubscriptionMessage();
this.session.write(msg);
this.connected = true;
}
} | class class_name[name] begin[{]
method[handshakeReceived, return_type[void], modifier[protected], parameter[session, handshakeMessage]] begin[{]
call[log.debug, parameter[literal["Received {}"], member[.handshakeMessage]]]
assign[THIS[member[None.receivedHandshake]], member[.handshakeMessage]]
local_variable[type[Boolean], handshakeCheck]
if[binary_operation[member[.handshakeCheck], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[Boolean.FALSE.equals, parameter[member[.handshakeCheck]]]] begin[{]
call[log.warn, parameter[literal["Handshakes did not match."]]]
THIS[call[None._disconnect, parameter[]]]
else begin[{]
None
end[}]
if[call[Boolean.TRUE.equals, parameter[member[.handshakeCheck]]]] begin[{]
local_variable[type[SubscriptionMessage], msg]
THIS[member[None.session]call[None.write, parameter[member[.msg]]]]
assign[THIS[member[None.connected]], literal[true]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[handshakeReceived] operator[SEP] identifier[IoSession] identifier[session] , identifier[HandshakeMessage] identifier[handshakeMessage] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[handshakeMessage] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[receivedHandshake] operator[=] identifier[handshakeMessage] operator[SEP] identifier[Boolean] identifier[handshakeCheck] operator[=] Keyword[this] operator[SEP] identifier[checkHandshake] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handshakeCheck] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] identifier[equals] operator[SEP] identifier[handshakeCheck] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[_disconnect] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] identifier[equals] operator[SEP] identifier[handshakeCheck] operator[SEP] operator[SEP] {
identifier[SubscriptionMessage] identifier[msg] operator[=] Keyword[this] operator[SEP] identifier[generateGenericSubscriptionMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[session] operator[SEP] identifier[write] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[connected] operator[=] literal[boolean] operator[SEP]
}
}
|
public Observable<OperationStatus> deleteCustomPrebuiltDomainAsync(UUID appId, String versionId, String domainName) {
return deleteCustomPrebuiltDomainWithServiceResponseAsync(appId, versionId, domainName).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public OperationStatus call(ServiceResponse<OperationStatus> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[deleteCustomPrebuiltDomainAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, domainName]] begin[{]
return[call[.deleteCustomPrebuiltDomainWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.domainName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[OperationStatus] operator[>] identifier[deleteCustomPrebuiltDomainAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[String] identifier[domainName] operator[SEP] {
Keyword[return] identifier[deleteCustomPrebuiltDomainWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[domainName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[OperationStatus] operator[>] , identifier[OperationStatus] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[OperationStatus] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[OperationStatus] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public boolean isSubtype(SemanticType lhs, SemanticType rhs, LifetimeRelation lifetimes) {
boolean max = emptinessTest.isVoid(lhs, EmptinessTest.NegativeMax, rhs, EmptinessTest.PositiveMax, lifetimes);
//
// FIXME: I don't think this logic is correct yet for some reason.
if (!max) {
return false;
} else {
boolean min = emptinessTest.isVoid(lhs, EmptinessTest.NegativeMin, rhs, EmptinessTest.PositiveMin,
lifetimes);
if (min) {
return true;
} else {
return false;
}
}
} | class class_name[name] begin[{]
method[isSubtype, return_type[type[boolean]], modifier[public], parameter[lhs, rhs, lifetimes]] begin[{]
local_variable[type[boolean], max]
if[member[.max]] begin[{]
return[literal[false]]
else begin[{]
local_variable[type[boolean], min]
if[member[.min]] begin[{]
return[literal[true]]
else begin[{]
return[literal[false]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isSubtype] operator[SEP] identifier[SemanticType] identifier[lhs] , identifier[SemanticType] identifier[rhs] , identifier[LifetimeRelation] identifier[lifetimes] operator[SEP] {
Keyword[boolean] identifier[max] operator[=] identifier[emptinessTest] operator[SEP] identifier[isVoid] operator[SEP] identifier[lhs] , identifier[EmptinessTest] operator[SEP] identifier[NegativeMax] , identifier[rhs] , identifier[EmptinessTest] operator[SEP] identifier[PositiveMax] , identifier[lifetimes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[max] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[boolean] identifier[min] operator[=] identifier[emptinessTest] operator[SEP] identifier[isVoid] operator[SEP] identifier[lhs] , identifier[EmptinessTest] operator[SEP] identifier[NegativeMin] , identifier[rhs] , identifier[EmptinessTest] operator[SEP] identifier[PositiveMin] , identifier[lifetimes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[min] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
|
private void navigateTheRoutes(NavigableMap<String, Collection<ControllerRouteModel<Raml>>> routes,
Resource parent, Raml raml) {
//nothing to see here
if (routes == null || routes.isEmpty()) {
return;
}
String headUri = routes.firstKey();
LOGGER.debug("Routes "+routes.toString());
LOGGER.debug("Parent " + parent);
Collection<ControllerRouteModel<Raml>> siblings = routes.get(headUri);
String relativeUri;
Resource res = new Resource();
if (parent != null) {
res.setParentResource(parent);
res.setParentUri(parent.getUri());
//Get the relative part of the url
relativeUri = normalizeActionPath(parent, headUri);
res.setRelativeUri(relativeUri);
parent.getResources().put(res.getRelativeUri(), res);
} else {
// We don't have a parent, check whether we should create one.
if (headUri.endsWith("/")) {
// We have to create a 'fake' parent when we have such kind of url: /foo/
// We create a parent /foo and a sub-resource /, this is because /foo and /foo/ are different
// Create a parent - this parent doest not have any action attached.
String parentUri = normalizeParentPath(headUri);
// However we do have a tricky case here, if parentURi == "/", we are the parent.
if (! parentUri.equals("/")) {
parent = new Resource();
parent.setParentUri("");
parent.setRelativeUri(parentUri);
raml.getResources().put(parentUri, parent);
// Now manage the current resource, it's uri is necessarily /
relativeUri = "/";
res.setParentUri(parent.getUri());
res.setRelativeUri(relativeUri);
parent.getResources().put(relativeUri, res);
} else {
// We are the root.
res.setParentUri("");
relativeUri = normalizeParentPath(headUri);
res.setRelativeUri(relativeUri);
raml.getResources().put(res.getRelativeUri(), res);
}
} else {
// No parent
res.setParentUri("");
relativeUri = normalizeParentPath(headUri);
res.setRelativeUri(relativeUri);
raml.getResources().put(res.getRelativeUri(), res);
}
}
//Add the action from the brother routes
for (ControllerRouteModel<Raml> bro : siblings) {
addActionFromRouteElem(bro, res);
}
//visit the children route
NavigableMap<String, Collection<ControllerRouteModel<Raml>>> child = routes.tailMap(headUri, false);
//no more route element
if (child.isEmpty()) {
return;
}
final String next = child.firstKey();
final Resource maybeParent = findParent(next, raml);
navigateTheRoutes(child, maybeParent, raml);
} | class class_name[name] begin[{]
method[navigateTheRoutes, return_type[void], modifier[private], parameter[routes, parent, raml]] begin[{]
if[binary_operation[binary_operation[member[.routes], ==, literal[null]], ||, call[routes.isEmpty, parameter[]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[String], headUri]
call[LOGGER.debug, parameter[binary_operation[literal["Routes "], +, call[routes.toString, parameter[]]]]]
call[LOGGER.debug, parameter[binary_operation[literal["Parent "], +, member[.parent]]]]
local_variable[type[Collection], siblings]
local_variable[type[String], relativeUri]
local_variable[type[Resource], res]
if[binary_operation[member[.parent], !=, literal[null]]] begin[{]
call[res.setParentResource, parameter[member[.parent]]]
call[res.setParentUri, parameter[call[parent.getUri, parameter[]]]]
assign[member[.relativeUri], call[.normalizeActionPath, parameter[member[.parent], member[.headUri]]]]
call[res.setRelativeUri, parameter[member[.relativeUri]]]
call[parent.getResources, parameter[]]
else begin[{]
if[call[headUri.endsWith, parameter[literal["/"]]]] begin[{]
local_variable[type[String], parentUri]
if[call[parentUri.equals, parameter[literal["/"]]]] begin[{]
assign[member[.parent], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Resource, sub_type=None))]
call[parent.setParentUri, parameter[literal[""]]]
call[parent.setRelativeUri, parameter[member[.parentUri]]]
call[raml.getResources, parameter[]]
assign[member[.relativeUri], literal["/"]]
call[res.setParentUri, parameter[call[parent.getUri, parameter[]]]]
call[res.setRelativeUri, parameter[member[.relativeUri]]]
call[parent.getResources, parameter[]]
else begin[{]
call[res.setParentUri, parameter[literal[""]]]
assign[member[.relativeUri], call[.normalizeParentPath, parameter[member[.headUri]]]]
call[res.setRelativeUri, parameter[member[.relativeUri]]]
call[raml.getResources, parameter[]]
end[}]
else begin[{]
call[res.setParentUri, parameter[literal[""]]]
assign[member[.relativeUri], call[.normalizeParentPath, parameter[member[.headUri]]]]
call[res.setRelativeUri, parameter[member[.relativeUri]]]
call[raml.getResources, parameter[]]
end[}]
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bro, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addActionFromRouteElem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=siblings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bro)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Raml, sub_type=None))], dimensions=[], name=ControllerRouteModel, sub_type=None))), label=None)
local_variable[type[NavigableMap], child]
if[call[child.isEmpty, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[String], next]
local_variable[type[Resource], maybeParent]
call[.navigateTheRoutes, parameter[member[.child], member[.maybeParent], member[.raml]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[navigateTheRoutes] operator[SEP] identifier[NavigableMap] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[ControllerRouteModel] operator[<] identifier[Raml] operator[>] operator[>] operator[>] identifier[routes] , identifier[Resource] identifier[parent] , identifier[Raml] identifier[raml] operator[SEP] {
Keyword[if] operator[SEP] identifier[routes] operator[==] Other[null] operator[||] identifier[routes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[String] identifier[headUri] operator[=] identifier[routes] operator[SEP] identifier[firstKey] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[routes] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[parent] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[ControllerRouteModel] operator[<] identifier[Raml] operator[>] operator[>] identifier[siblings] operator[=] identifier[routes] operator[SEP] identifier[get] operator[SEP] identifier[headUri] operator[SEP] operator[SEP] identifier[String] identifier[relativeUri] operator[SEP] identifier[Resource] identifier[res] operator[=] Keyword[new] identifier[Resource] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] {
identifier[res] operator[SEP] identifier[setParentResource] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setParentUri] operator[SEP] identifier[parent] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[relativeUri] operator[=] identifier[normalizeActionPath] operator[SEP] identifier[parent] , identifier[headUri] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setRelativeUri] operator[SEP] identifier[relativeUri] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[res] operator[SEP] identifier[getRelativeUri] operator[SEP] operator[SEP] , identifier[res] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[headUri] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[String] identifier[parentUri] operator[=] identifier[normalizeParentPath] operator[SEP] identifier[headUri] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[parentUri] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[parent] operator[=] Keyword[new] identifier[Resource] operator[SEP] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[setParentUri] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[setRelativeUri] operator[SEP] identifier[parentUri] operator[SEP] operator[SEP] identifier[raml] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[parentUri] , identifier[parent] operator[SEP] operator[SEP] identifier[relativeUri] operator[=] literal[String] operator[SEP] identifier[res] operator[SEP] identifier[setParentUri] operator[SEP] identifier[parent] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setRelativeUri] operator[SEP] identifier[relativeUri] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[relativeUri] , identifier[res] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[res] operator[SEP] identifier[setParentUri] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[relativeUri] operator[=] identifier[normalizeParentPath] operator[SEP] identifier[headUri] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setRelativeUri] operator[SEP] identifier[relativeUri] operator[SEP] operator[SEP] identifier[raml] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[res] operator[SEP] identifier[getRelativeUri] operator[SEP] operator[SEP] , identifier[res] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[res] operator[SEP] identifier[setParentUri] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[relativeUri] operator[=] identifier[normalizeParentPath] operator[SEP] identifier[headUri] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setRelativeUri] operator[SEP] identifier[relativeUri] operator[SEP] operator[SEP] identifier[raml] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[res] operator[SEP] identifier[getRelativeUri] operator[SEP] operator[SEP] , identifier[res] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[ControllerRouteModel] operator[<] identifier[Raml] operator[>] identifier[bro] operator[:] identifier[siblings] operator[SEP] {
identifier[addActionFromRouteElem] operator[SEP] identifier[bro] , identifier[res] operator[SEP] operator[SEP]
}
identifier[NavigableMap] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[ControllerRouteModel] operator[<] identifier[Raml] operator[>] operator[>] operator[>] identifier[child] operator[=] identifier[routes] operator[SEP] identifier[tailMap] operator[SEP] identifier[headUri] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[final] identifier[String] identifier[next] operator[=] identifier[child] operator[SEP] identifier[firstKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Resource] identifier[maybeParent] operator[=] identifier[findParent] operator[SEP] identifier[next] , identifier[raml] operator[SEP] operator[SEP] identifier[navigateTheRoutes] operator[SEP] identifier[child] , identifier[maybeParent] , identifier[raml] operator[SEP] operator[SEP]
}
|
private static List<TypeMirror> getAnnotationClassValues(Element member, Annotation annotation, String annotationMemberName) {
for (AnnotationMirror annotationMirror : member.getAnnotationMirrors()) {
if (((TypeElement) annotationMirror.getAnnotationType().asElement()).getQualifiedName().contentEquals(annotation.annotationType().getName())) {
for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : annotationMirror.getElementValues().entrySet()) {
if (entry.getKey().getSimpleName().contentEquals(annotationMemberName)) {
@SuppressWarnings({ "unchecked", "rawtypes" })
List<AnnotationValue> types = (List) entry.getValue().getValue();
TypeMirror[] result = new TypeMirror[types.size()];
for (int i = 0; i < types.size(); i++) {
result[i] = (TypeMirror) types.get(i).getValue();
}
return Arrays.asList(result);
}
}
return Collections.emptyList();
}
}
throw new IllegalStateException(annotation.annotationType().getName() + " not found in " + member);
} | class class_name[name] begin[{]
method[getAnnotationClassValues, return_type[type[List]], modifier[private static], parameter[member, annotation, annotationMemberName]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=Cast(expression=MethodInvocation(arguments=[], member=getAnnotationType, postfix_operators=[], prefix_operators=[], qualifier=annotationMirror, selectors=[MethodInvocation(arguments=[], member=asElement, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TypeElement, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=annotationMemberName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contentEquals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[Annotation(element=ElementArrayValue(values=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rawtypes")]), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), name=types)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AnnotationValue, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TypeMirror, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=TypeMirror, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TypeMirror, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getElementValues, postfix_operators=[], prefix_operators=[], qualifier=annotationMirror, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=ExecutableElement, sub_type=None)), TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=AnnotationValue, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAnnotationMirrors, postfix_operators=[], prefix_operators=[], qualifier=member, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotationMirror)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationMirror, sub_type=None))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=annotationType, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[MethodInvocation(arguments=[], member=getName, 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=" not found in "), operator=+), operandr=MemberReference(member=member, 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=IllegalStateException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] identifier[List] operator[<] identifier[TypeMirror] operator[>] identifier[getAnnotationClassValues] operator[SEP] identifier[Element] identifier[member] , identifier[Annotation] identifier[annotation] , identifier[String] identifier[annotationMemberName] operator[SEP] {
Keyword[for] operator[SEP] identifier[AnnotationMirror] identifier[annotationMirror] operator[:] identifier[member] operator[SEP] identifier[getAnnotationMirrors] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[TypeElement] operator[SEP] identifier[annotationMirror] operator[SEP] identifier[getAnnotationType] operator[SEP] operator[SEP] operator[SEP] identifier[asElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[contentEquals] operator[SEP] identifier[annotation] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] operator[?] Keyword[extends] identifier[ExecutableElement] , operator[?] Keyword[extends] identifier[AnnotationValue] operator[>] identifier[entry] operator[:] identifier[annotationMirror] operator[SEP] identifier[getElementValues] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[contentEquals] operator[SEP] identifier[annotationMemberName] operator[SEP] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] identifier[List] operator[<] identifier[AnnotationValue] operator[>] identifier[types] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[TypeMirror] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[TypeMirror] operator[SEP] identifier[types] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[types] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[TypeMirror] operator[SEP] identifier[types] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[result] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[annotation] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[member] operator[SEP] operator[SEP]
}
|
protected <T extends InvocationMarshaller<?>> T addDispatcher (InvocationDispatcher<T> disp)
{
T marsh = _invmgr.registerDispatcher(disp);
_marshallers.add(marsh);
return marsh;
} | class class_name[name] begin[{]
method[addDispatcher, return_type[type[T]], modifier[protected], parameter[disp]] begin[{]
local_variable[type[T], marsh]
call[_marshallers.add, parameter[member[.marsh]]]
return[member[.marsh]]
end[}]
END[}] | Keyword[protected] operator[<] identifier[T] Keyword[extends] identifier[InvocationMarshaller] operator[<] operator[?] operator[>] operator[>] identifier[T] identifier[addDispatcher] operator[SEP] identifier[InvocationDispatcher] operator[<] identifier[T] operator[>] identifier[disp] operator[SEP] {
identifier[T] identifier[marsh] operator[=] identifier[_invmgr] operator[SEP] identifier[registerDispatcher] operator[SEP] identifier[disp] operator[SEP] operator[SEP] identifier[_marshallers] operator[SEP] identifier[add] operator[SEP] identifier[marsh] operator[SEP] operator[SEP] Keyword[return] identifier[marsh] operator[SEP]
}
|
@GwtIncompatible // SmallCharMatcher
private static CharMatcher precomputedPositive(
int totalCharacters, BitSet table, String description) {
switch (totalCharacters) {
case 0:
return none();
case 1:
return is((char) table.nextSetBit(0));
case 2:
char c1 = (char) table.nextSetBit(0);
char c2 = (char) table.nextSetBit(c1 + 1);
return isEither(c1, c2);
default:
return isSmall(totalCharacters, table.length())
? SmallCharMatcher.from(table, description)
: new BitSetMatcher(table, description);
}
} | class class_name[name] begin[{]
method[precomputedPositive, return_type[type[CharMatcher]], modifier[private static], parameter[totalCharacters, table, description]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=none, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=nextSetBit, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=char))], member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=nextSetBit, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=char)), name=c1)], modifiers=set(), type=BasicType(dimensions=[], name=char)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=nextSetBit, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=char)), name=c2)], modifiers=set(), type=BasicType(dimensions=[], name=char)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEither, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=totalCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=isSmall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=ClassCreator(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=description, 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=BitSetMatcher, sub_type=None)), if_true=MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=from, postfix_operators=[], prefix_operators=[], qualifier=SmallCharMatcher, selectors=[], type_arguments=None)), label=None)])], expression=MemberReference(member=totalCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | annotation[@] identifier[GwtIncompatible] Keyword[private] Keyword[static] identifier[CharMatcher] identifier[precomputedPositive] operator[SEP] Keyword[int] identifier[totalCharacters] , identifier[BitSet] identifier[table] , identifier[String] identifier[description] operator[SEP] {
Keyword[switch] operator[SEP] identifier[totalCharacters] operator[SEP] {
Keyword[case] Other[0] operator[:] Keyword[return] identifier[none] operator[SEP] operator[SEP] operator[SEP] Keyword[case] Other[1] operator[:] Keyword[return] identifier[is] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[table] operator[SEP] identifier[nextSetBit] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[case] Other[2] operator[:] Keyword[char] identifier[c1] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[table] operator[SEP] identifier[nextSetBit] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[char] identifier[c2] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[table] operator[SEP] identifier[nextSetBit] operator[SEP] identifier[c1] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[isEither] operator[SEP] identifier[c1] , identifier[c2] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[return] identifier[isSmall] operator[SEP] identifier[totalCharacters] , identifier[table] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[SmallCharMatcher] operator[SEP] identifier[from] operator[SEP] identifier[table] , identifier[description] operator[SEP] operator[:] Keyword[new] identifier[BitSetMatcher] operator[SEP] identifier[table] , identifier[description] operator[SEP] operator[SEP]
}
}
|
@Override
protected List<E> load() {
List<E> loadedList = super.load();
parseList(loadedList);
return loadedList;
} | class class_name[name] begin[{]
method[load, return_type[type[List]], modifier[protected], parameter[]] begin[{]
local_variable[type[List], loadedList]
call[.parseList, parameter[member[.loadedList]]]
return[member[.loadedList]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[List] operator[<] identifier[E] operator[>] identifier[load] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[E] operator[>] identifier[loadedList] operator[=] Keyword[super] operator[SEP] identifier[load] operator[SEP] operator[SEP] operator[SEP] identifier[parseList] operator[SEP] identifier[loadedList] operator[SEP] operator[SEP] Keyword[return] identifier[loadedList] operator[SEP]
}
|
static AccountingChronology create(DayOfWeek endsOn, Month end, boolean inLastWeek, AccountingYearDivision division, int leapWeekInMonth) {
if (endsOn == null || end == null || division == null || leapWeekInMonth == 0) {
throw new IllegalStateException("AccountingCronology cannot be built: "
+ (endsOn == null ? "| ending day-of-week |" : "")
+ (end == null ? "| month ending in/nearest to |" : "")
+ (division == null ? "| how year divided |" : "")
+ (leapWeekInMonth == 0 ? "| leap-week month |" : "")
+ " not set.");
}
if (!division.getMonthsInYearRange().isValidValue(leapWeekInMonth)) {
throw new IllegalStateException("Leap week cannot not be placed in non-existent month " + leapWeekInMonth
+ ", range is [" + division.getMonthsInYearRange() + "].");
}
// Derive cached information.
LocalDate endingLimit = inLastWeek ? LocalDate.of(0, end, 1).with(TemporalAdjusters.lastDayOfMonth()) :
LocalDate.of(0, end, 1).with(TemporalAdjusters.lastDayOfMonth()).plusDays(3);
LocalDate yearZeroEnd = endingLimit.with(TemporalAdjusters.previousOrSame(endsOn));
int yearZeroDifference = (int) yearZeroEnd.until(endingLimit, ChronoUnit.DAYS);
// Longest/shortest month lengths and related
int longestMonthLength = 0;
int shortestMonthLength = Integer.MAX_VALUE;
for (int month = 1; month <= division.getMonthsInYearRange().getMaximum(); month++) {
int monthLength = division.getWeeksInMonth(month);
shortestMonthLength = Math.min(shortestMonthLength, monthLength);
longestMonthLength = Math.max(longestMonthLength, monthLength + (month == leapWeekInMonth ? 1 : 0));
}
ValueRange alignedWeekOfMonthRange = ValueRange.of(1, shortestMonthLength, longestMonthLength);
ValueRange dayOfMonthRange = ValueRange.of(1, shortestMonthLength * 7, longestMonthLength * 7);
int daysToEpoch = Math.toIntExact(0 - yearZeroEnd.plusDays(1).toEpochDay());
return new AccountingChronology(endsOn, end, inLastWeek, division, leapWeekInMonth, yearZeroDifference, alignedWeekOfMonthRange, dayOfMonthRange, daysToEpoch);
} | class class_name[name] begin[{]
method[create, return_type[type[AccountingChronology]], modifier[static], parameter[endsOn, end, inLastWeek, division, leapWeekInMonth]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.endsOn], ==, literal[null]], ||, binary_operation[member[.end], ==, literal[null]]], ||, binary_operation[member[.division], ==, literal[null]]], ||, binary_operation[member[.leapWeekInMonth], ==, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AccountingCronology cannot be built: "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=endsOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="| ending day-of-week |")), operator=+), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="| month ending in/nearest to |")), operator=+), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=division, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="| how year divided |")), operator=+), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=leapWeekInMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="| leap-week month |")), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not set."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[division.getMonthsInYearRange, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Leap week cannot not be placed in non-existent month "), operandr=MemberReference(member=leapWeekInMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", range is ["), operator=+), operandr=MethodInvocation(arguments=[], member=getMonthsInYearRange, postfix_operators=[], prefix_operators=[], qualifier=division, 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=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[LocalDate], endingLimit]
local_variable[type[LocalDate], yearZeroEnd]
local_variable[type[int], yearZeroDifference]
local_variable[type[int], longestMonthLength]
local_variable[type[int], shortestMonthLength]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=month, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWeeksInMonth, postfix_operators=[], prefix_operators=[], qualifier=division, selectors=[], type_arguments=None), name=monthLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=shortestMonthLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=shortestMonthLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=monthLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=longestMonthLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=longestMonthLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=monthLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=month, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=leapWeekInMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), operator=+)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=month, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMonthsInYearRange, postfix_operators=[], prefix_operators=[], qualifier=division, selectors=[MethodInvocation(arguments=[], member=getMaximum, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=month)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=month, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[ValueRange], alignedWeekOfMonthRange]
local_variable[type[ValueRange], dayOfMonthRange]
local_variable[type[int], daysToEpoch]
return[ClassCreator(arguments=[MemberReference(member=endsOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inLastWeek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=division, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=leapWeekInMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=yearZeroDifference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alignedWeekOfMonthRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dayOfMonthRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=daysToEpoch, 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=AccountingChronology, sub_type=None))]
end[}]
END[}] | Keyword[static] identifier[AccountingChronology] identifier[create] operator[SEP] identifier[DayOfWeek] identifier[endsOn] , identifier[Month] identifier[end] , Keyword[boolean] identifier[inLastWeek] , identifier[AccountingYearDivision] identifier[division] , Keyword[int] identifier[leapWeekInMonth] operator[SEP] {
Keyword[if] operator[SEP] identifier[endsOn] operator[==] Other[null] operator[||] identifier[end] operator[==] Other[null] operator[||] identifier[division] operator[==] Other[null] operator[||] identifier[leapWeekInMonth] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[endsOn] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] operator[SEP] identifier[end] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] operator[SEP] identifier[division] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] operator[SEP] identifier[leapWeekInMonth] operator[==] Other[0] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[division] operator[SEP] identifier[getMonthsInYearRange] operator[SEP] operator[SEP] operator[SEP] identifier[isValidValue] operator[SEP] identifier[leapWeekInMonth] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[leapWeekInMonth] operator[+] literal[String] operator[+] identifier[division] operator[SEP] identifier[getMonthsInYearRange] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[LocalDate] identifier[endingLimit] operator[=] identifier[inLastWeek] operator[?] identifier[LocalDate] operator[SEP] identifier[of] operator[SEP] Other[0] , identifier[end] , Other[1] operator[SEP] operator[SEP] identifier[with] operator[SEP] identifier[TemporalAdjusters] operator[SEP] identifier[lastDayOfMonth] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[LocalDate] operator[SEP] identifier[of] operator[SEP] Other[0] , identifier[end] , Other[1] operator[SEP] operator[SEP] identifier[with] operator[SEP] identifier[TemporalAdjusters] operator[SEP] identifier[lastDayOfMonth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[plusDays] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[LocalDate] identifier[yearZeroEnd] operator[=] identifier[endingLimit] operator[SEP] identifier[with] operator[SEP] identifier[TemporalAdjusters] operator[SEP] identifier[previousOrSame] operator[SEP] identifier[endsOn] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[yearZeroDifference] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[yearZeroEnd] operator[SEP] identifier[until] operator[SEP] identifier[endingLimit] , identifier[ChronoUnit] operator[SEP] identifier[DAYS] operator[SEP] operator[SEP] Keyword[int] identifier[longestMonthLength] operator[=] Other[0] operator[SEP] Keyword[int] identifier[shortestMonthLength] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[month] operator[=] Other[1] operator[SEP] identifier[month] operator[<=] identifier[division] operator[SEP] identifier[getMonthsInYearRange] operator[SEP] operator[SEP] operator[SEP] identifier[getMaximum] operator[SEP] operator[SEP] operator[SEP] identifier[month] operator[++] operator[SEP] {
Keyword[int] identifier[monthLength] operator[=] identifier[division] operator[SEP] identifier[getWeeksInMonth] operator[SEP] identifier[month] operator[SEP] operator[SEP] identifier[shortestMonthLength] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[shortestMonthLength] , identifier[monthLength] operator[SEP] operator[SEP] identifier[longestMonthLength] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[longestMonthLength] , identifier[monthLength] operator[+] operator[SEP] identifier[month] operator[==] identifier[leapWeekInMonth] operator[?] Other[1] operator[:] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ValueRange] identifier[alignedWeekOfMonthRange] operator[=] identifier[ValueRange] operator[SEP] identifier[of] operator[SEP] Other[1] , identifier[shortestMonthLength] , identifier[longestMonthLength] operator[SEP] operator[SEP] identifier[ValueRange] identifier[dayOfMonthRange] operator[=] identifier[ValueRange] operator[SEP] identifier[of] operator[SEP] Other[1] , identifier[shortestMonthLength] operator[*] Other[7] , identifier[longestMonthLength] operator[*] Other[7] operator[SEP] operator[SEP] Keyword[int] identifier[daysToEpoch] operator[=] identifier[Math] operator[SEP] identifier[toIntExact] operator[SEP] Other[0] operator[-] identifier[yearZeroEnd] operator[SEP] identifier[plusDays] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[toEpochDay] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AccountingChronology] operator[SEP] identifier[endsOn] , identifier[end] , identifier[inLastWeek] , identifier[division] , identifier[leapWeekInMonth] , identifier[yearZeroDifference] , identifier[alignedWeekOfMonthRange] , identifier[dayOfMonthRange] , identifier[daysToEpoch] operator[SEP] operator[SEP]
}
|
public static FaxClientSpi createFaxClientSpi(String type,Properties configuration)
{
//create fax client SPI
FaxClientSpi faxClientSpi=FaxClientSpiFactory.createFaxClientSpiImpl(type,configuration,false);
return faxClientSpi;
} | class class_name[name] begin[{]
method[createFaxClientSpi, return_type[type[FaxClientSpi]], modifier[public static], parameter[type, configuration]] begin[{]
local_variable[type[FaxClientSpi], faxClientSpi]
return[member[.faxClientSpi]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[FaxClientSpi] identifier[createFaxClientSpi] operator[SEP] identifier[String] identifier[type] , identifier[Properties] identifier[configuration] operator[SEP] {
identifier[FaxClientSpi] identifier[faxClientSpi] operator[=] identifier[FaxClientSpiFactory] operator[SEP] identifier[createFaxClientSpiImpl] operator[SEP] identifier[type] , identifier[configuration] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[faxClientSpi] operator[SEP]
}
|
public JsStatement append(CharSequence javascriptCode)
{
JsStatement statement = new JsStatement();
statements.add(statement);
return statement.append(javascriptCode);
} | class class_name[name] begin[{]
method[append, return_type[type[JsStatement]], modifier[public], parameter[javascriptCode]] begin[{]
local_variable[type[JsStatement], statement]
call[statements.add, parameter[member[.statement]]]
return[call[statement.append, parameter[member[.javascriptCode]]]]
end[}]
END[}] | Keyword[public] identifier[JsStatement] identifier[append] operator[SEP] identifier[CharSequence] identifier[javascriptCode] operator[SEP] {
identifier[JsStatement] identifier[statement] operator[=] Keyword[new] identifier[JsStatement] operator[SEP] operator[SEP] operator[SEP] identifier[statements] operator[SEP] identifier[add] operator[SEP] identifier[statement] operator[SEP] operator[SEP] Keyword[return] identifier[statement] operator[SEP] identifier[append] operator[SEP] identifier[javascriptCode] operator[SEP] operator[SEP]
}
|
@Override
public void afterDelivery() throws ResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
Tr.entry(tc, "MessageEndpoint.afterDelivery");
}
if (!ivSkipCheckState) {
//method param for checkState can be null since it's only used when the method is a MDB_BUSINESS_METHOD
checkState(-1, null, AFTER_DELIVERY_METHOD);
}
try
{
if (ivRollbackOnly) // f743-7046
{
ContainerTx currentTx = ivEJSDeployedSupport.getCurrentTx();
if (currentTx != null) // d629697
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
Tr.debug(tc, "calling setRollbackOnly");
}
currentTx.setRollbackOnly(); // f743-7046
}
}
// The container postInvoke will complete the TX if the TX is
// not an imported global TX. Rollback occurs if setRollbackOnly
// was invoked on the current TX.
container.postInvoke(this, ivMethodId, ivEJSDeployedSupport);
} catch (Throwable e)
{
//FFDCFilter.processException(e, CLASS_NAME + ".afterDelivery", "1280", this);
// f743-7046 start
if (!ivRollbackOnly) // f743-7046
{
FFDCFilter.processException(e, CLASS_NAME + ".afterDelivery", "1280", this);
throw new ResourceException("afterDelivery failure", e);
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
Tr.debug(tc, "MessageEndpoint.afterDelivery is eating Throwable: " + e.getMessage()
+ " since " + majorJCAVersion + "." + minorJCAVersion + " requires abort of TX and no exceptions to be thrown.", e);
}
} // f743-7046 end
} finally
{
// Release objects no longer needed and ensure the
// rollback only and imported TX flags are reset to false.
ivRollbackOnly = false; // f743-7046
ivImportedTx = false; // f743-7046
ivEJSDeployedSupport = null;
ivMDB = null;
ivMethod = null;
// Enter the ready state.
synchronized (this)
{
ivState = READY_STATE;
ivThread = null;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
Tr.exit(tc, "MessageEndpoint.afterDelivery");
}
}
} | class class_name[name] begin[{]
method[afterDelivery, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["MessageEndpoint.afterDelivery"]]]
else begin[{]
None
end[}]
if[member[.ivSkipCheckState]] begin[{]
call[.checkState, parameter[literal[1], literal[null], member[.AFTER_DELIVERY_METHOD]]]
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=MemberReference(member=ivRollbackOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCurrentTx, postfix_operators=[], prefix_operators=[], qualifier=ivEJSDeployedSupport, selectors=[], type_arguments=None), name=currentTx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ContainerTx, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="calling setRollbackOnly")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=setRollbackOnly, postfix_operators=[], prefix_operators=[], qualifier=currentTx, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=ivMethodId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ivEJSDeployedSupport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=postInvoke, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=ivRollbackOnly, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MessageEndpoint.afterDelivery is eating Throwable: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" since "), operator=+), operandr=MemberReference(member=majorJCAVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=minorJCAVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" requires abort of TX and no exceptions to be thrown."), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".afterDelivery"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1280"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="afterDelivery failure"), 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=ResourceException, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivRollbackOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivImportedTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivEJSDeployedSupport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivMDB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=READY_STATE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivThread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MessageEndpoint.afterDelivery")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[afterDelivery] operator[SEP] operator[SEP] Keyword[throws] identifier[ResourceException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[ivSkipCheckState] operator[SEP] {
identifier[checkState] operator[SEP] operator[-] Other[1] , Other[null] , identifier[AFTER_DELIVERY_METHOD] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[ivRollbackOnly] operator[SEP] {
identifier[ContainerTx] identifier[currentTx] operator[=] identifier[ivEJSDeployedSupport] operator[SEP] identifier[getCurrentTx] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentTx] operator[!=] Other[null] 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] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
identifier[currentTx] operator[SEP] identifier[setRollbackOnly] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[container] operator[SEP] identifier[postInvoke] operator[SEP] Keyword[this] , identifier[ivMethodId] , identifier[ivEJSDeployedSupport] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[ivRollbackOnly] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ResourceException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[else] {
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] identifier[tc] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[majorJCAVersion] operator[+] literal[String] operator[+] identifier[minorJCAVersion] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
}
Keyword[finally] {
identifier[ivRollbackOnly] operator[=] literal[boolean] operator[SEP] identifier[ivImportedTx] operator[=] literal[boolean] operator[SEP] identifier[ivEJSDeployedSupport] operator[=] Other[null] operator[SEP] identifier[ivMDB] operator[=] Other[null] operator[SEP] identifier[ivMethod] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
identifier[ivState] operator[=] identifier[READY_STATE] operator[SEP] identifier[ivThread] operator[=] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
}
}
|
public static SolrServer inject(SolrServer server, DocumentObjectBinder binder) {
checkNotNull(server, "Server cannot be null.");
checkNotNull(binder, "Binder cannot be null.");
Field binderField;
try {
binderField = SolrServer.class.getDeclaredField(BINDER_FIELD_NAME);
binderField.setAccessible(true);
binderField.set(server, binder);
} catch (NoSuchFieldException e) {
throw new UnsupportedOperationException(
"Impossible to set binder. Field not present in server. New Solr version?",
e);
} catch (SecurityException e) {
throw new UnsupportedOperationException(
"Not allowed to set server's binder field.", e);
} catch (IllegalAccessException e) {
throw new UnsupportedOperationException(
"Cannot access server's binder field.", e);
}
return server;
} | class class_name[name] begin[{]
method[inject, return_type[type[SolrServer]], modifier[public static], parameter[server, binder]] begin[{]
call[.checkNotNull, parameter[member[.server], literal["Server cannot be null."]]]
call[.checkNotNull, parameter[member[.binder], literal["Binder cannot be null."]]]
local_variable[type[Field], binderField]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=binderField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=BINDER_FIELD_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SolrServer, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=binderField, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=binder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=binderField, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Impossible to set binder. Field not present in server. New Solr version?"), 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=UnsupportedOperationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchFieldException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not allowed to set server's binder field."), 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=UnsupportedOperationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SecurityException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot access server's binder field."), 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=UnsupportedOperationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None)
return[member[.server]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SolrServer] identifier[inject] operator[SEP] identifier[SolrServer] identifier[server] , identifier[DocumentObjectBinder] identifier[binder] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[server] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[binder] , literal[String] operator[SEP] operator[SEP] identifier[Field] identifier[binderField] operator[SEP] Keyword[try] {
identifier[binderField] operator[=] identifier[SolrServer] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredField] operator[SEP] identifier[BINDER_FIELD_NAME] operator[SEP] operator[SEP] identifier[binderField] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[binderField] operator[SEP] identifier[set] operator[SEP] identifier[server] , identifier[binder] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchFieldException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SecurityException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[server] operator[SEP]
}
|
private String getVariable(GDLParser.HeaderContext header) {
if (header != null && header.Identifier() != null) {
return header.Identifier().getText();
}
return null;
} | class class_name[name] begin[{]
method[getVariable, return_type[type[String]], modifier[private], parameter[header]] begin[{]
if[binary_operation[binary_operation[member[.header], !=, literal[null]], &&, binary_operation[call[header.Identifier, parameter[]], !=, literal[null]]]] begin[{]
return[call[header.Identifier, parameter[]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[getVariable] operator[SEP] identifier[GDLParser] operator[SEP] identifier[HeaderContext] identifier[header] operator[SEP] {
Keyword[if] operator[SEP] identifier[header] operator[!=] Other[null] operator[&&] identifier[header] operator[SEP] identifier[Identifier] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[header] operator[SEP] identifier[Identifier] operator[SEP] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
protected Image newImage(final String id, final IResource imageResource)
{
return ComponentFactory.newImage(id, imageResource);
} | class class_name[name] begin[{]
method[newImage, return_type[type[Image]], modifier[protected], parameter[id, imageResource]] begin[{]
return[call[ComponentFactory.newImage, parameter[member[.id], member[.imageResource]]]]
end[}]
END[}] | Keyword[protected] identifier[Image] identifier[newImage] operator[SEP] Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[IResource] identifier[imageResource] operator[SEP] {
Keyword[return] identifier[ComponentFactory] operator[SEP] identifier[newImage] operator[SEP] identifier[id] , identifier[imageResource] operator[SEP] operator[SEP]
}
|
public Map<Column, List<Condition>> getConditionsMap() {
Map<Column, List<Condition>> result = new LinkedHashMap<>(conditions.size(), 1);
for (Condition each : conditions) {
if (!result.containsKey(each.getColumn())) {
result.put(each.getColumn(), new LinkedList<Condition>());
}
result.get(each.getColumn()).add(each);
}
return result;
} | class class_name[name] begin[{]
method[getConditionsMap, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], result]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=each, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=result, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=each, selectors=[], type_arguments=None), 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=Condition, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=each, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[MemberReference(member=each, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=conditions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=each)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Condition, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[Column] , identifier[List] operator[<] identifier[Condition] operator[>] operator[>] identifier[getConditionsMap] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[Column] , identifier[List] operator[<] identifier[Condition] operator[>] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] identifier[conditions] operator[SEP] identifier[size] operator[SEP] operator[SEP] , Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Condition] identifier[each] operator[:] identifier[conditions] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[result] operator[SEP] identifier[containsKey] operator[SEP] identifier[each] operator[SEP] identifier[getColumn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[each] operator[SEP] identifier[getColumn] operator[SEP] operator[SEP] , Keyword[new] identifier[LinkedList] operator[<] identifier[Condition] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[result] operator[SEP] identifier[get] operator[SEP] identifier[each] operator[SEP] identifier[getColumn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[each] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static final <X> Function<X,Boolean> greaterOrEqToBy(final IFunction<X,?> by, final Object object) {
return FnFunc.chain(by, greaterOrEqTo(object));
} | class class_name[name] begin[{]
method[greaterOrEqToBy, return_type[type[Function]], modifier[final public static], parameter[by, object]] begin[{]
return[call[FnFunc.chain, parameter[member[.by], call[.greaterOrEqTo, parameter[member[.object]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] operator[<] identifier[X] operator[>] identifier[Function] operator[<] identifier[X] , identifier[Boolean] operator[>] identifier[greaterOrEqToBy] operator[SEP] Keyword[final] identifier[IFunction] operator[<] identifier[X] , operator[?] operator[>] identifier[by] , Keyword[final] identifier[Object] identifier[object] operator[SEP] {
Keyword[return] identifier[FnFunc] operator[SEP] identifier[chain] operator[SEP] identifier[by] , identifier[greaterOrEqTo] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP]
}
|
public Collection<Project> projects(ProjectFilter filter) {
return get(Project.class, (filter != null) ? filter : new ProjectFilter());
} | class class_name[name] begin[{]
method[projects, return_type[type[Collection]], modifier[public], parameter[filter]] begin[{]
return[call[.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Project, sub_type=None)), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProjectFilter, sub_type=None)), if_true=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]]]
end[}]
END[}] | Keyword[public] identifier[Collection] operator[<] identifier[Project] operator[>] identifier[projects] operator[SEP] identifier[ProjectFilter] identifier[filter] operator[SEP] {
Keyword[return] identifier[get] operator[SEP] identifier[Project] operator[SEP] Keyword[class] , operator[SEP] identifier[filter] operator[!=] Other[null] operator[SEP] operator[?] identifier[filter] operator[:] Keyword[new] identifier[ProjectFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
Rule HeaderEol() {
return Sequence(ZeroOrMore(WSP()).suppressNode(),
FirstOfS(Comment(), suppr(Eol()), suppr(EOI))
).label(HeaderEol);
} | class class_name[name] begin[{]
method[HeaderEol, return_type[type[Rule]], modifier[default], parameter[]] begin[{]
return[call[.Sequence, parameter[call[.ZeroOrMore, parameter[call[.WSP, parameter[]]]], call[.FirstOfS, parameter[call[.Comment, parameter[]], call[.suppr, parameter[call[.Eol, parameter[]]]], call[.suppr, parameter[member[.EOI]]]]]]]]
end[}]
END[}] | identifier[Rule] identifier[HeaderEol] operator[SEP] operator[SEP] {
Keyword[return] identifier[Sequence] operator[SEP] identifier[ZeroOrMore] operator[SEP] identifier[WSP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[suppressNode] operator[SEP] operator[SEP] , identifier[FirstOfS] operator[SEP] identifier[Comment] operator[SEP] operator[SEP] , identifier[suppr] operator[SEP] identifier[Eol] operator[SEP] operator[SEP] operator[SEP] , identifier[suppr] operator[SEP] identifier[EOI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[HeaderEol] operator[SEP] operator[SEP]
}
|
public String convertToString(Class<?> cls, Object object) {
if (object == null) {
return null;
}
StringConverter<Object> conv = findConverterNoGenerics(cls);
return conv.convertToString(object);
} | class class_name[name] begin[{]
method[convertToString, return_type[type[String]], modifier[public], parameter[cls, object]] begin[{]
if[binary_operation[member[.object], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringConverter], conv]
return[call[conv.convertToString, parameter[member[.object]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[convertToString] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] , identifier[Object] identifier[object] operator[SEP] {
Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[StringConverter] operator[<] identifier[Object] operator[>] identifier[conv] operator[=] identifier[findConverterNoGenerics] operator[SEP] identifier[cls] operator[SEP] operator[SEP] Keyword[return] identifier[conv] operator[SEP] identifier[convertToString] operator[SEP] identifier[object] operator[SEP] operator[SEP]
}
|
public void runRawSqlToCsv( String sql, File csvFile, boolean doHeader, String separator ) throws Exception {
try (BufferedWriter bw = new BufferedWriter(new FileWriter(csvFile))) {
SpatialiteWKBReader wkbReader = new SpatialiteWKBReader();
try (IHMStatement stmt = mConn.createStatement(); IHMResultSet rs = stmt.executeQuery(sql)) {
IHMResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
int geometryIndex = -1;
for( int i = 1; i <= columnCount; i++ ) {
if (i > 1) {
bw.write(separator);
}
String columnTypeName = rsmd.getColumnTypeName(i);
String columnName = rsmd.getColumnName(i);
bw.write(columnName);
if (ESpatialiteGeometryType.isGeometryName(columnTypeName)) {
geometryIndex = i;
}
}
bw.write("\n");
while( rs.next() ) {
for( int j = 1; j <= columnCount; j++ ) {
if (j > 1) {
bw.write(separator);
}
byte[] geomBytes = null;
if (j == geometryIndex) {
geomBytes = rs.getBytes(j);
}
if (geomBytes != null) {
try {
Geometry geometry = wkbReader.read(geomBytes);
bw.write(geometry.toText());
} catch (Exception e) {
// write it as it comes
Object object = rs.getObject(j);
if (object instanceof Clob) {
object = rs.getString(j);
}
if (object != null) {
bw.write(object.toString());
} else {
bw.write("");
}
}
} else {
Object object = rs.getObject(j);
if (object instanceof Clob) {
object = rs.getString(j);
}
if (object != null) {
bw.write(object.toString());
} else {
bw.write("");
}
}
}
bw.write("\n");
}
}
}
} | class class_name[name] begin[{]
method[runRawSqlToCsv, return_type[void], modifier[public], parameter[sql, csvFile, doHeader, separator]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpatialiteWKBReader, sub_type=None)), name=wkbReader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SpatialiteWKBReader, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMetaData, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=rsmd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IHMResultSetMetaData, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getColumnCount, postfix_operators=[], prefix_operators=[], qualifier=rsmd, selectors=[], type_arguments=None), name=columnCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=geometryIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), 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=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumnTypeName, postfix_operators=[], prefix_operators=[], qualifier=rsmd, selectors=[], type_arguments=None), name=columnTypeName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumnName, postfix_operators=[], prefix_operators=[], qualifier=rsmd, selectors=[], type_arguments=None), name=columnName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=columnTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isGeometryName, postfix_operators=[], prefix_operators=[], qualifier=ESpatialiteGeometryType, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=geometryIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, 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=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, 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=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=geomBytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=geometryIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=geomBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=geomBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Clob, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=geomBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=wkbReader, selectors=[], type_arguments=None), name=geometry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Geometry, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toText, postfix_operators=[], prefix_operators=[], qualifier=geometry, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Clob, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, 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)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=write, postfix_operators=[], prefix_operators=[], qualifier=bw, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stmt, type=ReferenceType(arguments=None, dimensions=[], name=IHMStatement, sub_type=None), value=MethodInvocation(arguments=[], member=createStatement, postfix_operators=[], prefix_operators=[], qualifier=mConn, selectors=[], type_arguments=None)), TryResource(annotations=[], modifiers=set(), name=rs, type=ReferenceType(arguments=None, dimensions=[], name=IHMResultSet, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None))])], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=bw, type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=csvFile, 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=FileWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedWriter, sub_type=None)))])
end[}]
END[}] | Keyword[public] Keyword[void] identifier[runRawSqlToCsv] operator[SEP] identifier[String] identifier[sql] , identifier[File] identifier[csvFile] , Keyword[boolean] identifier[doHeader] , identifier[String] identifier[separator] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[try] operator[SEP] identifier[BufferedWriter] identifier[bw] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[FileWriter] operator[SEP] identifier[csvFile] operator[SEP] operator[SEP] operator[SEP] {
identifier[SpatialiteWKBReader] identifier[wkbReader] operator[=] Keyword[new] identifier[SpatialiteWKBReader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[IHMStatement] identifier[stmt] operator[=] identifier[mConn] operator[SEP] identifier[createStatement] operator[SEP] operator[SEP] operator[SEP] identifier[IHMResultSet] identifier[rs] operator[=] identifier[stmt] operator[SEP] identifier[executeQuery] operator[SEP] identifier[sql] operator[SEP] operator[SEP] {
identifier[IHMResultSetMetaData] identifier[rsmd] operator[=] identifier[rs] operator[SEP] identifier[getMetaData] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[columnCount] operator[=] identifier[rsmd] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[geometryIndex] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] identifier[columnCount] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[>] Other[1] operator[SEP] {
identifier[bw] operator[SEP] identifier[write] operator[SEP] identifier[separator] operator[SEP] operator[SEP]
}
identifier[String] identifier[columnTypeName] operator[=] identifier[rsmd] operator[SEP] identifier[getColumnTypeName] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[columnName] operator[=] identifier[rsmd] operator[SEP] identifier[getColumnName] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[bw] operator[SEP] identifier[write] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ESpatialiteGeometryType] operator[SEP] identifier[isGeometryName] operator[SEP] identifier[columnTypeName] operator[SEP] operator[SEP] {
identifier[geometryIndex] operator[=] identifier[i] operator[SEP]
}
}
identifier[bw] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[1] operator[SEP] identifier[j] operator[<=] identifier[columnCount] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[j] operator[>] Other[1] operator[SEP] {
identifier[bw] operator[SEP] identifier[write] operator[SEP] identifier[separator] operator[SEP] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[geomBytes] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[j] operator[==] identifier[geometryIndex] operator[SEP] {
identifier[geomBytes] operator[=] identifier[rs] operator[SEP] identifier[getBytes] operator[SEP] identifier[j] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[geomBytes] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[Geometry] identifier[geometry] operator[=] identifier[wkbReader] operator[SEP] identifier[read] operator[SEP] identifier[geomBytes] operator[SEP] operator[SEP] identifier[bw] operator[SEP] identifier[write] operator[SEP] identifier[geometry] operator[SEP] identifier[toText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[Object] identifier[object] operator[=] identifier[rs] operator[SEP] identifier[getObject] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Clob] operator[SEP] {
identifier[object] operator[=] identifier[rs] operator[SEP] identifier[getString] operator[SEP] identifier[j] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[object] operator[!=] Other[null] operator[SEP] {
identifier[bw] operator[SEP] identifier[write] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[bw] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[Object] identifier[object] operator[=] identifier[rs] operator[SEP] identifier[getObject] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Clob] operator[SEP] {
identifier[object] operator[=] identifier[rs] operator[SEP] identifier[getString] operator[SEP] identifier[j] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[object] operator[!=] Other[null] operator[SEP] {
identifier[bw] operator[SEP] identifier[write] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[bw] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
identifier[bw] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
}
|
public Slider setAnimate(AnimateEnum animate)
{
if (animate.equals(AnimateEnum.FAST))
this.options.put("animate", SliderAnimate.FAST);
else if (animate.equals(AnimateEnum.NORMAL))
this.options.put("animate", SliderAnimate.NORMAL);
else if (animate.equals(AnimateEnum.SLOW))
this.options.put("animate", SliderAnimate.SLOW);
else
unsetAnimate();
return this;
} | class class_name[name] begin[{]
method[setAnimate, return_type[type[Slider]], modifier[public], parameter[animate]] begin[{]
if[call[animate.equals, parameter[member[AnimateEnum.FAST]]]] begin[{]
THIS[member[None.options]call[None.put, parameter[literal["animate"], member[SliderAnimate.FAST]]]]
else begin[{]
if[call[animate.equals, parameter[member[AnimateEnum.NORMAL]]]] begin[{]
THIS[member[None.options]call[None.put, parameter[literal["animate"], member[SliderAnimate.NORMAL]]]]
else begin[{]
if[call[animate.equals, parameter[member[AnimateEnum.SLOW]]]] begin[{]
THIS[member[None.options]call[None.put, parameter[literal["animate"], member[SliderAnimate.SLOW]]]]
else begin[{]
call[.unsetAnimate, parameter[]]
end[}]
end[}]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Slider] identifier[setAnimate] operator[SEP] identifier[AnimateEnum] identifier[animate] operator[SEP] {
Keyword[if] operator[SEP] identifier[animate] operator[SEP] identifier[equals] operator[SEP] identifier[AnimateEnum] operator[SEP] identifier[FAST] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[options] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[SliderAnimate] operator[SEP] identifier[FAST] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[animate] operator[SEP] identifier[equals] operator[SEP] identifier[AnimateEnum] operator[SEP] identifier[NORMAL] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[options] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[SliderAnimate] operator[SEP] identifier[NORMAL] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[animate] operator[SEP] identifier[equals] operator[SEP] identifier[AnimateEnum] operator[SEP] identifier[SLOW] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[options] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[SliderAnimate] operator[SEP] identifier[SLOW] operator[SEP] operator[SEP] Keyword[else] identifier[unsetAnimate] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public void onComponentTag(final Component _component,
final ComponentTag _tag)
{
super.onComponentTag(_component, _tag);
if (isLayoutContainer()) {
_tag.put("data-dojo-type", "dijit/layout/LayoutContainer");
} else {
_tag.put("data-dojo-type", isJsExecuteable() ? "dojox/layout/ContentPane" : "dijit/layout/ContentPane");
if (isJsExecuteable()) {
_tag.put("scriptHasHooks", "true");
}
}
if (this.region != null) {
_tag.append("data-dojo-props", "region: '" + this.region.getKey() + "'", ",");
}
if (this.splitter) {
_tag.append("data-dojo-props", "splitter: true", ",");
}
if (this.splitterState != null) {
_tag.append("data-dojo-props", "toggleSplitterState: \"" + this.splitterState + "\"", ",");
}
if (this.width != null) {
_tag.append("style", "width: " + this.width, ";");
}
if (this.height != null) {
_tag.append("style", "height: " + this.height, ";");
}
} | class class_name[name] begin[{]
method[onComponentTag, return_type[void], modifier[public], parameter[_component, _tag]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=_component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onComponentTag, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[call[.isLayoutContainer, parameter[]]] begin[{]
call[_tag.put, parameter[literal["data-dojo-type"], literal["dijit/layout/LayoutContainer"]]]
else begin[{]
call[_tag.put, parameter[literal["data-dojo-type"], TernaryExpression(condition=MethodInvocation(arguments=[], member=isJsExecuteable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dijit/layout/ContentPane"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dojox/layout/ContentPane"))]]
if[call[.isJsExecuteable, parameter[]]] begin[{]
call[_tag.put, parameter[literal["scriptHasHooks"], literal["true"]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[THIS[member[None.region]], !=, literal[null]]] begin[{]
call[_tag.append, parameter[literal["data-dojo-props"], binary_operation[binary_operation[literal["region: '"], +, THIS[member[None.region]call[None.getKey, parameter[]]]], +, literal["'"]], literal[","]]]
else begin[{]
None
end[}]
if[THIS[member[None.splitter]]] begin[{]
call[_tag.append, parameter[literal["data-dojo-props"], literal["splitter: true"], literal[","]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.splitterState]], !=, literal[null]]] begin[{]
call[_tag.append, parameter[literal["data-dojo-props"], binary_operation[binary_operation[literal["toggleSplitterState: \""], +, THIS[member[None.splitterState]]], +, literal["\""]], literal[","]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.width]], !=, literal[null]]] begin[{]
call[_tag.append, parameter[literal["style"], binary_operation[literal["width: "], +, THIS[member[None.width]]], literal[";"]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.height]], !=, literal[null]]] begin[{]
call[_tag.append, parameter[literal["style"], binary_operation[literal["height: "], +, THIS[member[None.height]]], literal[";"]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onComponentTag] operator[SEP] Keyword[final] identifier[Component] identifier[_component] , Keyword[final] identifier[ComponentTag] identifier[_tag] operator[SEP] {
Keyword[super] operator[SEP] identifier[onComponentTag] operator[SEP] identifier[_component] , identifier[_tag] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isLayoutContainer] operator[SEP] operator[SEP] operator[SEP] {
identifier[_tag] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_tag] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[isJsExecuteable] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isJsExecuteable] operator[SEP] operator[SEP] operator[SEP] {
identifier[_tag] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[region] operator[!=] Other[null] operator[SEP] {
identifier[_tag] operator[SEP] identifier[append] operator[SEP] literal[String] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[region] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[splitter] operator[SEP] {
identifier[_tag] operator[SEP] identifier[append] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[splitterState] operator[!=] Other[null] operator[SEP] {
identifier[_tag] operator[SEP] identifier[append] operator[SEP] literal[String] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[splitterState] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[width] operator[!=] Other[null] operator[SEP] {
identifier[_tag] operator[SEP] identifier[append] operator[SEP] literal[String] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[width] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[height] operator[!=] Other[null] operator[SEP] {
identifier[_tag] operator[SEP] identifier[append] operator[SEP] literal[String] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[height] , literal[String] operator[SEP] operator[SEP]
}
}
|
protected ILaunchConfiguration createConfiguration(INode type,
String projectName)
{
ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
try
{
ILaunchConfigurationType configType = getConfigurationType();
wc = configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(projectName+" "+AstNameUtil.getName(type)));
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_PROJECT, projectName);
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_CREATE_COVERAGE, true);
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_DEFAULT, getModuleName( type));
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_OPERATION, getOperationName( type)
+ "()");
if (isStaticAccessRequired(type))
{
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MODULE, getModuleName(type));
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_EXPRESSION, getModuleName(type)
+ "`" + getOperationName(type) + "()");
} else
{
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MODULE, getModuleNameLaunch(type));
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_EXPRESSION, "new "
+ getModuleNameLaunch(type)
+ "."
+ getOperationName(type) + "()");
}
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_STATIC_OPERATION, isStaticAccessRequired(type));
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_ENABLE_LOGGING, false);
config = wc.doSave();
} catch (CoreException exception)
{
MessageDialog.openError(VdmDebugPlugin.getActiveWorkbenchShell(), LauncherMessages.VdmLaunchShortcut_3, exception.getStatus().getMessage());
}
return config;
} | class class_name[name] begin[{]
method[createConfiguration, return_type[type[ILaunchConfiguration]], modifier[protected], parameter[type, projectName]] begin[{]
local_variable[type[ILaunchConfiguration], config]
local_variable[type[ILaunchConfigurationWorkingCopy], wc]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConfigurationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=configType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ILaunchConfigurationType, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=wc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getLaunchManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getName, postfix_operators=[], prefix_operators=[], qualifier=AstNameUtil, selectors=[], type_arguments=None), operator=+)], member=generateLaunchConfigurationName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=configType, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_PROJECT, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_CREATE_COVERAGE, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_DEFAULT, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModuleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_OPERATION, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOperationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="()"), operator=+)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isStaticAccessRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_MODULE, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModuleNameLaunch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_EXPRESSION, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="new "), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModuleNameLaunch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOperationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="()"), operator=+)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_MODULE, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModuleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_EXPRESSION, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModuleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="`"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOperationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="()"), operator=+)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_STATIC_OPERATION, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isStaticAccessRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VDM_LAUNCH_CONFIG_ENABLE_LOGGING, postfix_operators=[], prefix_operators=[], qualifier=IDebugConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=doSave, postfix_operators=[], prefix_operators=[], qualifier=wc, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getActiveWorkbenchShell, postfix_operators=[], prefix_operators=[], qualifier=VdmDebugPlugin, selectors=[], type_arguments=None), MemberReference(member=VdmLaunchShortcut_3, postfix_operators=[], prefix_operators=[], qualifier=LauncherMessages, selectors=[]), MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=exception, selectors=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=openError, postfix_operators=[], prefix_operators=[], qualifier=MessageDialog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['CoreException']))], finally_block=None, label=None, resources=None)
return[member[.config]]
end[}]
END[}] | Keyword[protected] identifier[ILaunchConfiguration] identifier[createConfiguration] operator[SEP] identifier[INode] identifier[type] , identifier[String] identifier[projectName] operator[SEP] {
identifier[ILaunchConfiguration] identifier[config] operator[=] Other[null] operator[SEP] identifier[ILaunchConfigurationWorkingCopy] identifier[wc] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[ILaunchConfigurationType] identifier[configType] operator[=] identifier[getConfigurationType] operator[SEP] operator[SEP] operator[SEP] identifier[wc] operator[=] identifier[configType] operator[SEP] identifier[newInstance] operator[SEP] Other[null] , identifier[getLaunchManager] operator[SEP] operator[SEP] operator[SEP] identifier[generateLaunchConfigurationName] operator[SEP] identifier[projectName] operator[+] literal[String] operator[+] identifier[AstNameUtil] operator[SEP] identifier[getName] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_PROJECT] , identifier[projectName] operator[SEP] operator[SEP] identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_CREATE_COVERAGE] , literal[boolean] operator[SEP] operator[SEP] identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_DEFAULT] , identifier[getModuleName] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_OPERATION] , identifier[getOperationName] operator[SEP] identifier[type] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isStaticAccessRequired] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_MODULE] , identifier[getModuleName] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_EXPRESSION] , identifier[getModuleName] operator[SEP] identifier[type] operator[SEP] operator[+] literal[String] operator[+] identifier[getOperationName] operator[SEP] identifier[type] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_MODULE] , identifier[getModuleNameLaunch] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_EXPRESSION] , literal[String] operator[+] identifier[getModuleNameLaunch] operator[SEP] identifier[type] operator[SEP] operator[+] literal[String] operator[+] identifier[getOperationName] operator[SEP] identifier[type] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_STATIC_OPERATION] , identifier[isStaticAccessRequired] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[wc] operator[SEP] identifier[setAttribute] operator[SEP] identifier[IDebugConstants] operator[SEP] identifier[VDM_LAUNCH_CONFIG_ENABLE_LOGGING] , literal[boolean] operator[SEP] operator[SEP] identifier[config] operator[=] identifier[wc] operator[SEP] identifier[doSave] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CoreException] identifier[exception] operator[SEP] {
identifier[MessageDialog] operator[SEP] identifier[openError] operator[SEP] identifier[VdmDebugPlugin] operator[SEP] identifier[getActiveWorkbenchShell] operator[SEP] operator[SEP] , identifier[LauncherMessages] operator[SEP] identifier[VdmLaunchShortcut_3] , identifier[exception] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[config] operator[SEP]
}
|
public void setAttenuation(float constant, float linear, float quadratic) {
setFloat("attenuation_constant", constant);
setFloat("attenuation_linear", linear);
setFloat("attenuation_quadratic", quadratic);
} | class class_name[name] begin[{]
method[setAttenuation, return_type[void], modifier[public], parameter[constant, linear, quadratic]] begin[{]
call[.setFloat, parameter[literal["attenuation_constant"], member[.constant]]]
call[.setFloat, parameter[literal["attenuation_linear"], member[.linear]]]
call[.setFloat, parameter[literal["attenuation_quadratic"], member[.quadratic]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setAttenuation] operator[SEP] Keyword[float] identifier[constant] , Keyword[float] identifier[linear] , Keyword[float] identifier[quadratic] operator[SEP] {
identifier[setFloat] operator[SEP] literal[String] , identifier[constant] operator[SEP] operator[SEP] identifier[setFloat] operator[SEP] literal[String] , identifier[linear] operator[SEP] operator[SEP] identifier[setFloat] operator[SEP] literal[String] , identifier[quadratic] operator[SEP] operator[SEP]
}
|
@Override
public boolean isAcceptableChange(
Changes changes, Tree node, MethodSymbol symbol, VisitorState state) {
int numberOfChanges = changes.changedPairs().size();
return changes.totalOriginalCost() - changes.totalAssignmentCost()
>= threshold * numberOfChanges;
} | class class_name[name] begin[{]
method[isAcceptableChange, return_type[type[boolean]], modifier[public], parameter[changes, node, symbol, state]] begin[{]
local_variable[type[int], numberOfChanges]
return[binary_operation[binary_operation[call[changes.totalOriginalCost, parameter[]], -, call[changes.totalAssignmentCost, parameter[]]], >=, binary_operation[member[.threshold], *, member[.numberOfChanges]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isAcceptableChange] operator[SEP] identifier[Changes] identifier[changes] , identifier[Tree] identifier[node] , identifier[MethodSymbol] identifier[symbol] , identifier[VisitorState] identifier[state] operator[SEP] {
Keyword[int] identifier[numberOfChanges] operator[=] identifier[changes] operator[SEP] identifier[changedPairs] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[changes] operator[SEP] identifier[totalOriginalCost] operator[SEP] operator[SEP] operator[-] identifier[changes] operator[SEP] identifier[totalAssignmentCost] operator[SEP] operator[SEP] operator[>=] identifier[threshold] operator[*] identifier[numberOfChanges] operator[SEP]
}
|
public ScriptEngine getScriptEngineForName(String scriptEngineName, boolean cache) {
if(processApplicationScriptEngineResolver == null) {
synchronized (this) {
if(processApplicationScriptEngineResolver == null) {
processApplicationScriptEngineResolver = new ScriptEngineResolver(new ScriptEngineManager(getProcessApplicationClassloader()));
}
}
}
return processApplicationScriptEngineResolver.getScriptEngine(scriptEngineName, cache);
} | class class_name[name] begin[{]
method[getScriptEngineForName, return_type[type[ScriptEngine]], modifier[public], parameter[scriptEngineName, cache]] begin[{]
if[binary_operation[member[.processApplicationScriptEngineResolver], ==, literal[null]]] begin[{]
SYNCHRONIZED[THIS[]] BEGIN[{]
if[binary_operation[member[.processApplicationScriptEngineResolver], ==, literal[null]]] begin[{]
assign[member[.processApplicationScriptEngineResolver], ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProcessApplicationClassloader, 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=ScriptEngineManager, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ScriptEngineResolver, sub_type=None))]
else begin[{]
None
end[}]
END[}]
else begin[{]
None
end[}]
return[call[processApplicationScriptEngineResolver.getScriptEngine, parameter[member[.scriptEngineName], member[.cache]]]]
end[}]
END[}] | Keyword[public] identifier[ScriptEngine] identifier[getScriptEngineForName] operator[SEP] identifier[String] identifier[scriptEngineName] , Keyword[boolean] identifier[cache] operator[SEP] {
Keyword[if] operator[SEP] identifier[processApplicationScriptEngineResolver] operator[==] Other[null] operator[SEP] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
Keyword[if] operator[SEP] identifier[processApplicationScriptEngineResolver] operator[==] Other[null] operator[SEP] {
identifier[processApplicationScriptEngineResolver] operator[=] Keyword[new] identifier[ScriptEngineResolver] operator[SEP] Keyword[new] identifier[ScriptEngineManager] operator[SEP] identifier[getProcessApplicationClassloader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[processApplicationScriptEngineResolver] operator[SEP] identifier[getScriptEngine] operator[SEP] identifier[scriptEngineName] , identifier[cache] operator[SEP] operator[SEP]
}
|
public static ParticleSystem loadConfiguredSystem(File ref)
throws IOException {
return loadConfiguredSystem(new FileInputStream(ref), null, null, null);
} | class class_name[name] begin[{]
method[loadConfiguredSystem, return_type[type[ParticleSystem]], modifier[public static], parameter[ref]] begin[{]
return[call[.loadConfiguredSystem, parameter[ClassCreator(arguments=[MemberReference(member=ref, 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)), literal[null], literal[null], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ParticleSystem] identifier[loadConfiguredSystem] operator[SEP] identifier[File] identifier[ref] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[loadConfiguredSystem] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[ref] operator[SEP] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
public static Connection connect(Configuration conf) {
Class<? extends Connection> connectionClass = getConnectionClass();
try {
return connectionClass.getConstructor(Configuration.class).newInstance(conf);
} catch (Exception e) {
throw new IllegalStateException("Could not find an appropriate constructor for "
+ CONNECTION_CLASS.getCanonicalName(), e);
}
} | class class_name[name] begin[{]
method[connect, return_type[type[Connection]], modifier[public static], parameter[conf]] begin[{]
local_variable[type[Class], connectionClass]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Configuration, sub_type=None))], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=connectionClass, selectors=[MethodInvocation(arguments=[MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not find an appropriate constructor for "), operandr=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=CONNECTION_CLASS, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Connection] identifier[connect] operator[SEP] identifier[Configuration] identifier[conf] operator[SEP] {
identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Connection] operator[>] identifier[connectionClass] operator[=] identifier[getConnectionClass] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[connectionClass] operator[SEP] identifier[getConstructor] operator[SEP] identifier[Configuration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[conf] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[CONNECTION_CLASS] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public final AntlrDatatypeRuleToken ruleOpMulti() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
Token kw=null;
enterRule();
try {
// InternalSARL.g:8843:2: ( (kw= '*' | kw= '/' | kw= '%' ) )
// InternalSARL.g:8844:2: (kw= '*' | kw= '/' | kw= '%' )
{
// InternalSARL.g:8844:2: (kw= '*' | kw= '/' | kw= '%' )
int alt236=3;
switch ( input.LA(1) ) {
case 59:
{
alt236=1;
}
break;
case 70:
{
alt236=2;
}
break;
case 71:
{
alt236=3;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 236, 0, input);
throw nvae;
}
switch (alt236) {
case 1 :
// InternalSARL.g:8845:3: kw= '*'
{
kw=(Token)match(input,59,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getOpMultiAccess().getAsteriskKeyword_0());
}
}
break;
case 2 :
// InternalSARL.g:8851:3: kw= '/'
{
kw=(Token)match(input,70,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getOpMultiAccess().getSolidusKeyword_1());
}
}
break;
case 3 :
// InternalSARL.g:8857:3: kw= '%'
{
kw=(Token)match(input,71,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getOpMultiAccess().getPercentSignKeyword_2());
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} | class class_name[name] begin[{]
method[ruleOpMulti, return_type[type[AntlrDatatypeRuleToken]], modifier[final public], parameter[]] begin[{]
local_variable[type[AntlrDatatypeRuleToken], current]
local_variable[type[Token], kw]
call[.enterRule, parameter[]]
TryStatement(block=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), name=alt236)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=59)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt236, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=70)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt236, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=71)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt236, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=236), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=59), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=merge, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getOpMultiAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getAsteriskKeyword_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=70), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=merge, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getOpMultiAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getSolidusKeyword_1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=71), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=merge, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getOpMultiAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getPercentSignKeyword_2, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt236, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=leaveRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.current]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[AntlrDatatypeRuleToken] identifier[ruleOpMulti] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[AntlrDatatypeRuleToken] identifier[current] operator[=] Keyword[new] identifier[AntlrDatatypeRuleToken] operator[SEP] operator[SEP] operator[SEP] identifier[Token] identifier[kw] operator[=] Other[null] operator[SEP] identifier[enterRule] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
{
Keyword[int] identifier[alt236] operator[=] Other[3] operator[SEP] Keyword[switch] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] {
Keyword[case] Other[59] operator[:] {
identifier[alt236] operator[=] Other[1] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[70] operator[:] {
identifier[alt236] operator[=] Other[2] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[71] operator[:] {
identifier[alt236] operator[=] Other[3] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[SEP] {
identifier[state] operator[SEP] identifier[failed] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[current] operator[SEP]
}
identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[236] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt236] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[kw] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , Other[59] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[current] operator[SEP] identifier[merge] operator[SEP] identifier[kw] operator[SEP] operator[SEP] identifier[newLeafNode] operator[SEP] identifier[kw] , identifier[grammarAccess] operator[SEP] identifier[getOpMultiAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getAsteriskKeyword_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] {
identifier[kw] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , Other[70] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[current] operator[SEP] identifier[merge] operator[SEP] identifier[kw] operator[SEP] operator[SEP] identifier[newLeafNode] operator[SEP] identifier[kw] , identifier[grammarAccess] operator[SEP] identifier[getOpMultiAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getSolidusKeyword_1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] {
identifier[kw] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , Other[71] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[current] operator[SEP] identifier[merge] operator[SEP] identifier[kw] operator[SEP] operator[SEP] identifier[newLeafNode] operator[SEP] identifier[kw] , identifier[grammarAccess] operator[SEP] identifier[getOpMultiAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getPercentSignKeyword_2] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[leaveRule] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[current] operator[SEP]
}
|
public static Date stringToDate(String strString, int ibScale) throws Exception
{
Date objData;
Exception except = null;
initGlobals(); // Make sure you have the utilities
if ((strString == null) || (strString.equals(Constant.BLANK)))
return null;
for (int i = 1; i <= 6; i++)
{
DateFormat df = null;
switch (i)
{
case 1:
df = gDateTimeFormat;break;
case 2:
df = gDateShortTimeFormat;break;
case 3:
df = gDateFormat;break;
case 4:
df = gDateShortFormat;break;
case 5:
default:
df = gTimeFormat;break;
case 6:
df= gGMTDateTimeFormat;break;
}
try {
synchronized (gCalendar)
{
objData = df.parse(strString);
if (ibScale != -1)
{
DataConverters.gCalendar.setTime(objData);
if (ibScale == Constant.DATE_ONLY)
{
DataConverters.gCalendar.set(Calendar.HOUR_OF_DAY, 0);
DataConverters.gCalendar.set(Calendar.MINUTE, 0);
DataConverters.gCalendar.set(Calendar.SECOND, 0);
DataConverters.gCalendar.set(Calendar.MILLISECOND, 0);
}
if (ibScale == Constant.TIME_ONLY)
{
DataConverters.gCalendar.set(Calendar.YEAR, Constant.FIRST_YEAR);
DataConverters.gCalendar.set(Calendar.MONTH, Calendar.JANUARY);
DataConverters.gCalendar.set(Calendar.DATE, 1);
}
DataConverters.gCalendar.set(Calendar.MILLISECOND, 0);
objData = DataConverters.gCalendar.getTime();
}
}
return objData;
} catch (ParseException ex) {
except = ex;
// continue with the next parse
}
}
if (except != null)
throw except;
return null;
} | class class_name[name] begin[{]
method[stringToDate, return_type[type[Date]], modifier[public static], parameter[strString, ibScale]] begin[{]
local_variable[type[Date], objData]
local_variable[type[Exception], except]
call[.initGlobals, parameter[]]
if[binary_operation[binary_operation[member[.strString], ==, literal[null]], ||, call[strString.equals, parameter[member[Constant.BLANK]]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=df)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DateFormat, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gDateTimeFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gDateShortTimeFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gDateFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gDateShortFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gTimeFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gGMTDateTimeFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), TryStatement(block=[SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=objData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=strString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=df, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ibScale, 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=MethodInvocation(arguments=[MemberReference(member=objData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ibScale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DATE_ONLY, postfix_operators=[], prefix_operators=[], qualifier=Constant, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=HOUR_OF_DAY, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MINUTE, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SECOND, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MILLISECOND, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ibScale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TIME_ONLY, postfix_operators=[], prefix_operators=[], qualifier=Constant, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=YEAR, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), MemberReference(member=FIRST_YEAR, postfix_operators=[], prefix_operators=[], qualifier=Constant, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MONTH, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), MemberReference(member=JANUARY, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MILLISECOND, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=set, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=objData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=DataConverters.gCalendar, selectors=[], type_arguments=None)), label=None)]))], label=None, lock=MemberReference(member=gCalendar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ReturnStatement(expression=MemberReference(member=objData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=except, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['ParseException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), 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)
if[binary_operation[member[.except], !=, literal[null]]] begin[{]
ThrowStatement(expression=MemberReference(member=except, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Date] identifier[stringToDate] operator[SEP] identifier[String] identifier[strString] , Keyword[int] identifier[ibScale] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[Date] identifier[objData] operator[SEP] identifier[Exception] identifier[except] operator[=] Other[null] operator[SEP] identifier[initGlobals] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strString] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[strString] operator[SEP] identifier[equals] operator[SEP] identifier[Constant] operator[SEP] identifier[BLANK] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] Other[6] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[DateFormat] identifier[df] operator[=] Other[null] operator[SEP] Keyword[switch] operator[SEP] identifier[i] operator[SEP] {
Keyword[case] Other[1] operator[:] identifier[df] operator[=] identifier[gDateTimeFormat] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] identifier[df] operator[=] identifier[gDateShortTimeFormat] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] identifier[df] operator[=] identifier[gDateFormat] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] identifier[df] operator[=] identifier[gDateShortFormat] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[5] operator[:] Keyword[default] operator[:] identifier[df] operator[=] identifier[gTimeFormat] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[6] operator[:] identifier[df] operator[=] identifier[gGMTDateTimeFormat] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[try] {
Keyword[synchronized] operator[SEP] identifier[gCalendar] operator[SEP] {
identifier[objData] operator[=] identifier[df] operator[SEP] identifier[parse] operator[SEP] identifier[strString] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ibScale] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[setTime] operator[SEP] identifier[objData] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ibScale] operator[==] identifier[Constant] operator[SEP] identifier[DATE_ONLY] operator[SEP] {
identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] , Other[0] operator[SEP] operator[SEP] identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] , Other[0] operator[SEP] operator[SEP] identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] , Other[0] operator[SEP] operator[SEP] identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] , Other[0] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ibScale] operator[==] identifier[Constant] operator[SEP] identifier[TIME_ONLY] operator[SEP] {
identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[YEAR] , identifier[Constant] operator[SEP] identifier[FIRST_YEAR] operator[SEP] operator[SEP] identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MONTH] , identifier[Calendar] operator[SEP] identifier[JANUARY] operator[SEP] operator[SEP] identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[DATE] , Other[1] operator[SEP] operator[SEP]
}
identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] , Other[0] operator[SEP] operator[SEP] identifier[objData] operator[=] identifier[DataConverters] operator[SEP] identifier[gCalendar] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[objData] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[ex] operator[SEP] {
identifier[except] operator[=] identifier[ex] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[except] operator[!=] Other[null] operator[SEP] Keyword[throw] identifier[except] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static linkset_channel_binding[] get(nitro_service service, String id) throws Exception{
linkset_channel_binding obj = new linkset_channel_binding();
obj.set_id(id);
linkset_channel_binding response[] = (linkset_channel_binding[]) obj.get_resources(service);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[linkset_channel_binding]], modifier[public static], parameter[service, id]] begin[{]
local_variable[type[linkset_channel_binding], obj]
call[obj.set_id, parameter[member[.id]]]
local_variable[type[linkset_channel_binding], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[linkset_channel_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[linkset_channel_binding] identifier[obj] operator[=] Keyword[new] identifier[linkset_channel_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_id] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[linkset_channel_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[linkset_channel_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Observable<T> create(ObservableOnSubscribe<T> source) {
ObjectHelper.requireNonNull(source, "source is null");
return RxJavaPlugins.onAssembly(new ObservableCreate<T>(source));
} | class class_name[name] begin[{]
method[create, return_type[type[Observable]], modifier[public static], parameter[source]] begin[{]
call[ObjectHelper.requireNonNull, parameter[member[.source], literal["source is null"]]]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ObservableCreate, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Observable] operator[<] identifier[T] operator[>] identifier[create] operator[SEP] identifier[ObservableOnSubscribe] operator[<] identifier[T] operator[>] identifier[source] operator[SEP] {
identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[source] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ObservableCreate] operator[<] identifier[T] operator[>] operator[SEP] identifier[source] operator[SEP] operator[SEP] operator[SEP]
}
|
public ListAlertsResponse listAlerts(ListAlertsRequest params) throws ApiException {
Integer limit = params.getLimit();
String sort = params.getSort().getValue();
Integer offset = params.getOffset();
String order = params.getOrder().getValue();
String query = params.getQuery();
String searchIdentifier = params.getSearchIdentifier();
String searchIdentifierType = params.getSearchIdentifierType().getValue();
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v2/alerts";
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "order", order));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "searchIdentifier", searchIdentifier));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "searchIdentifierType", searchIdentifierType));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[]{"GenieKey"};
GenericType<ListAlertsResponse> localVarReturnType = new GenericType<ListAlertsResponse>() {
};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} | class class_name[name] begin[{]
method[listAlerts, return_type[type[ListAlertsResponse]], modifier[public], parameter[params]] begin[{]
local_variable[type[Integer], limit]
local_variable[type[String], sort]
local_variable[type[Integer], offset]
local_variable[type[String], order]
local_variable[type[String], query]
local_variable[type[String], searchIdentifier]
local_variable[type[String], searchIdentifierType]
local_variable[type[Object], localVarPostBody]
local_variable[type[String], localVarPath]
local_variable[type[List], localVarQueryParams]
local_variable[type[Map], localVarHeaderParams]
local_variable[type[Map], localVarFormParams]
call[localVarQueryParams.addAll, parameter[call[apiClient.parameterToPairs, parameter[literal[""], literal["limit"], member[.limit]]]]]
call[localVarQueryParams.addAll, parameter[call[apiClient.parameterToPairs, parameter[literal[""], literal["sort"], member[.sort]]]]]
call[localVarQueryParams.addAll, parameter[call[apiClient.parameterToPairs, parameter[literal[""], literal["offset"], member[.offset]]]]]
call[localVarQueryParams.addAll, parameter[call[apiClient.parameterToPairs, parameter[literal[""], literal["order"], member[.order]]]]]
call[localVarQueryParams.addAll, parameter[call[apiClient.parameterToPairs, parameter[literal[""], literal["query"], member[.query]]]]]
call[localVarQueryParams.addAll, parameter[call[apiClient.parameterToPairs, parameter[literal[""], literal["searchIdentifier"], member[.searchIdentifier]]]]]
call[localVarQueryParams.addAll, parameter[call[apiClient.parameterToPairs, parameter[literal[""], literal["searchIdentifierType"], member[.searchIdentifierType]]]]]
local_variable[type[String], localVarAccepts]
local_variable[type[String], localVarAccept]
local_variable[type[String], localVarContentTypes]
local_variable[type[String], localVarContentType]
local_variable[type[String], localVarAuthNames]
local_variable[type[GenericType], localVarReturnType]
return[call[apiClient.invokeAPI, parameter[member[.localVarPath], literal["GET"], member[.localVarQueryParams], member[.localVarPostBody], member[.localVarHeaderParams], member[.localVarFormParams], member[.localVarAccept], member[.localVarContentType], member[.localVarAuthNames], member[.localVarReturnType]]]]
end[}]
END[}] | Keyword[public] identifier[ListAlertsResponse] identifier[listAlerts] operator[SEP] identifier[ListAlertsRequest] identifier[params] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[Integer] identifier[limit] operator[=] identifier[params] operator[SEP] identifier[getLimit] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[sort] operator[=] identifier[params] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[offset] operator[=] identifier[params] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[order] operator[=] identifier[params] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[query] operator[=] identifier[params] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[searchIdentifier] operator[=] identifier[params] operator[SEP] identifier[getSearchIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[searchIdentifierType] operator[=] identifier[params] operator[SEP] identifier[getSearchIdentifierType] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[localVarPostBody] operator[=] Other[null] operator[SEP] identifier[String] identifier[localVarPath] operator[=] literal[String] operator[SEP] identifier[List] operator[<] identifier[Pair] operator[>] identifier[localVarQueryParams] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Pair] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[localVarHeaderParams] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[localVarFormParams] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[localVarQueryParams] operator[SEP] identifier[addAll] operator[SEP] identifier[apiClient] operator[SEP] identifier[parameterToPairs] operator[SEP] literal[String] , literal[String] , identifier[limit] operator[SEP] operator[SEP] operator[SEP] identifier[localVarQueryParams] operator[SEP] identifier[addAll] operator[SEP] identifier[apiClient] operator[SEP] identifier[parameterToPairs] operator[SEP] literal[String] , literal[String] , identifier[sort] operator[SEP] operator[SEP] operator[SEP] identifier[localVarQueryParams] operator[SEP] identifier[addAll] operator[SEP] identifier[apiClient] operator[SEP] identifier[parameterToPairs] operator[SEP] literal[String] , literal[String] , identifier[offset] operator[SEP] operator[SEP] operator[SEP] identifier[localVarQueryParams] operator[SEP] identifier[addAll] operator[SEP] identifier[apiClient] operator[SEP] identifier[parameterToPairs] operator[SEP] literal[String] , literal[String] , identifier[order] operator[SEP] operator[SEP] operator[SEP] identifier[localVarQueryParams] operator[SEP] identifier[addAll] operator[SEP] identifier[apiClient] operator[SEP] identifier[parameterToPairs] operator[SEP] literal[String] , literal[String] , identifier[query] operator[SEP] operator[SEP] operator[SEP] identifier[localVarQueryParams] operator[SEP] identifier[addAll] operator[SEP] identifier[apiClient] operator[SEP] identifier[parameterToPairs] operator[SEP] literal[String] , literal[String] , identifier[searchIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[localVarQueryParams] operator[SEP] identifier[addAll] operator[SEP] identifier[apiClient] operator[SEP] identifier[parameterToPairs] operator[SEP] literal[String] , literal[String] , identifier[searchIdentifierType] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[localVarAccepts] operator[=] {
literal[String]
} operator[SEP] Keyword[final] identifier[String] identifier[localVarAccept] operator[=] identifier[apiClient] operator[SEP] identifier[selectHeaderAccept] operator[SEP] identifier[localVarAccepts] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[localVarContentTypes] operator[=] {
} operator[SEP] Keyword[final] identifier[String] identifier[localVarContentType] operator[=] identifier[apiClient] operator[SEP] identifier[selectHeaderContentType] operator[SEP] identifier[localVarContentTypes] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[localVarAuthNames] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
literal[String]
} operator[SEP] identifier[GenericType] operator[<] identifier[ListAlertsResponse] operator[>] identifier[localVarReturnType] operator[=] Keyword[new] identifier[GenericType] operator[<] identifier[ListAlertsResponse] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[invokeAPI] operator[SEP] identifier[localVarPath] , literal[String] , identifier[localVarQueryParams] , identifier[localVarPostBody] , identifier[localVarHeaderParams] , identifier[localVarFormParams] , identifier[localVarAccept] , identifier[localVarContentType] , identifier[localVarAuthNames] , identifier[localVarReturnType] operator[SEP] operator[SEP]
}
|
public void setDriftThreshold(double driftThreshold)
{
if(driftThreshold <= 0 || Double.isNaN(driftThreshold) || Double.isInfinite(driftThreshold))
throw new IllegalArgumentException("Dritf threshold must be positive, not " + driftThreshold);
this.driftThreshold = driftThreshold;
} | class class_name[name] begin[{]
method[setDriftThreshold, return_type[void], modifier[public], parameter[driftThreshold]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.driftThreshold], <=, literal[0]], ||, call[Double.isNaN, parameter[member[.driftThreshold]]]], ||, call[Double.isInfinite, parameter[member[.driftThreshold]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Dritf threshold must be positive, not "), operandr=MemberReference(member=driftThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.driftThreshold]], member[.driftThreshold]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDriftThreshold] operator[SEP] Keyword[double] identifier[driftThreshold] operator[SEP] {
Keyword[if] operator[SEP] identifier[driftThreshold] operator[<=] Other[0] operator[||] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[driftThreshold] operator[SEP] operator[||] identifier[Double] operator[SEP] identifier[isInfinite] operator[SEP] identifier[driftThreshold] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[driftThreshold] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[driftThreshold] operator[=] identifier[driftThreshold] operator[SEP]
}
|
private static AckEvent unmarshall(ByteBuf json) throws IOException {
JsonNode jsonNode = Jackson.getObjectMapper().readTree(json.toString(CharsetUtil.UTF_8));
return UNMARSHALLER.unmarshall(jsonNode);
} | class class_name[name] begin[{]
method[unmarshall, return_type[type[AckEvent]], modifier[private static], parameter[json]] begin[{]
local_variable[type[JsonNode], jsonNode]
return[call[UNMARSHALLER.unmarshall, parameter[member[.jsonNode]]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[AckEvent] identifier[unmarshall] operator[SEP] identifier[ByteBuf] identifier[json] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[JsonNode] identifier[jsonNode] operator[=] identifier[Jackson] operator[SEP] identifier[getObjectMapper] operator[SEP] operator[SEP] operator[SEP] identifier[readTree] operator[SEP] identifier[json] operator[SEP] identifier[toString] operator[SEP] identifier[CharsetUtil] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[UNMARSHALLER] operator[SEP] identifier[unmarshall] operator[SEP] identifier[jsonNode] operator[SEP] operator[SEP]
}
|
public static Result onUiAsync(Action action) {
if (Looper.myLooper() == Looper.getMainLooper()) {
action.call();
return new ActionAsyncTask(action, true);
}
ActionAsyncTask task = new ActionAsyncTask(action);
getUiPoster().async(task);
return task;
} | class class_name[name] begin[{]
method[onUiAsync, return_type[type[Result]], modifier[public static], parameter[action]] begin[{]
if[binary_operation[call[Looper.myLooper, parameter[]], ==, call[Looper.getMainLooper, parameter[]]]] begin[{]
call[action.call, parameter[]]
return[ClassCreator(arguments=[MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActionAsyncTask, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[ActionAsyncTask], task]
call[.getUiPoster, parameter[]]
return[member[.task]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Result] identifier[onUiAsync] operator[SEP] identifier[Action] identifier[action] operator[SEP] {
Keyword[if] operator[SEP] identifier[Looper] operator[SEP] identifier[myLooper] operator[SEP] operator[SEP] operator[==] identifier[Looper] operator[SEP] identifier[getMainLooper] operator[SEP] operator[SEP] operator[SEP] {
identifier[action] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ActionAsyncTask] operator[SEP] identifier[action] , literal[boolean] operator[SEP] operator[SEP]
}
identifier[ActionAsyncTask] identifier[task] operator[=] Keyword[new] identifier[ActionAsyncTask] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[getUiPoster] operator[SEP] operator[SEP] operator[SEP] identifier[async] operator[SEP] identifier[task] operator[SEP] operator[SEP] Keyword[return] identifier[task] operator[SEP]
}
|
public void entry(Object... argArray) {
if (instanceofLAL && logger.isTraceEnabled(ENTRY_MARKER)) {
String messagePattern = null;
if (argArray.length < ENTRY_MESSAGE_ARRAY_LEN) {
messagePattern = ENTRY_MESSAGE_ARRAY[argArray.length];
} else {
messagePattern = buildMessagePattern(argArray.length);
}
FormattingTuple tp = MessageFormatter.arrayFormat(messagePattern, argArray);
((LocationAwareLogger) logger).log(ENTRY_MARKER, FQCN, LocationAwareLogger.TRACE_INT, tp.getMessage(), argArray, tp.getThrowable());
}
} | class class_name[name] begin[{]
method[entry, return_type[void], modifier[public], parameter[argArray]] begin[{]
if[binary_operation[member[.instanceofLAL], &&, call[logger.isTraceEnabled, parameter[member[.ENTRY_MARKER]]]]] begin[{]
local_variable[type[String], messagePattern]
if[binary_operation[member[argArray.length], <, member[.ENTRY_MESSAGE_ARRAY_LEN]]] begin[{]
assign[member[.messagePattern], member[.ENTRY_MESSAGE_ARRAY]]
else begin[{]
assign[member[.messagePattern], call[.buildMessagePattern, parameter[member[argArray.length]]]]
end[}]
local_variable[type[FormattingTuple], tp]
Cast(expression=MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocationAwareLogger, sub_type=None))
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[entry] operator[SEP] identifier[Object] operator[...] identifier[argArray] operator[SEP] {
Keyword[if] operator[SEP] identifier[instanceofLAL] operator[&&] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] identifier[ENTRY_MARKER] operator[SEP] operator[SEP] {
identifier[String] identifier[messagePattern] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[argArray] operator[SEP] identifier[length] operator[<] identifier[ENTRY_MESSAGE_ARRAY_LEN] operator[SEP] {
identifier[messagePattern] operator[=] identifier[ENTRY_MESSAGE_ARRAY] operator[SEP] identifier[argArray] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[messagePattern] operator[=] identifier[buildMessagePattern] operator[SEP] identifier[argArray] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
identifier[FormattingTuple] identifier[tp] operator[=] identifier[MessageFormatter] operator[SEP] identifier[arrayFormat] operator[SEP] identifier[messagePattern] , identifier[argArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LocationAwareLogger] operator[SEP] identifier[logger] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[ENTRY_MARKER] , identifier[FQCN] , identifier[LocationAwareLogger] operator[SEP] identifier[TRACE_INT] , identifier[tp] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[argArray] , identifier[tp] operator[SEP] identifier[getThrowable] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public List<String> harvestCapturedDetail() {
List<String> harvested = m_capturedDiagnosticDetail;
m_capturedDiagnosticDetail = null;
return harvested;
} | class class_name[name] begin[{]
method[harvestCapturedDetail, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], harvested]
assign[member[.m_capturedDiagnosticDetail], literal[null]]
return[member[.harvested]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[harvestCapturedDetail] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[harvested] operator[=] identifier[m_capturedDiagnosticDetail] operator[SEP] identifier[m_capturedDiagnosticDetail] operator[=] Other[null] operator[SEP] Keyword[return] identifier[harvested] operator[SEP]
}
|
private void updateMetadata(SegmentProperties segmentProperties) {
this.metadata.setStorageLength(segmentProperties.getLength());
if (segmentProperties.isSealed() && !this.metadata.isSealedInStorage()) {
this.metadata.markSealed();
this.metadata.markSealedInStorage();
}
} | class class_name[name] begin[{]
method[updateMetadata, return_type[void], modifier[private], parameter[segmentProperties]] begin[{]
THIS[member[None.metadata]call[None.setStorageLength, parameter[call[segmentProperties.getLength, parameter[]]]]]
if[binary_operation[call[segmentProperties.isSealed, parameter[]], &&, THIS[member[None.metadata]call[None.isSealedInStorage, parameter[]]]]] begin[{]
THIS[member[None.metadata]call[None.markSealed, parameter[]]]
THIS[member[None.metadata]call[None.markSealedInStorage, parameter[]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateMetadata] operator[SEP] identifier[SegmentProperties] identifier[segmentProperties] operator[SEP] {
Keyword[this] operator[SEP] identifier[metadata] operator[SEP] identifier[setStorageLength] operator[SEP] identifier[segmentProperties] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[segmentProperties] operator[SEP] identifier[isSealed] operator[SEP] operator[SEP] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[metadata] operator[SEP] identifier[isSealedInStorage] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[metadata] operator[SEP] identifier[markSealed] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[metadata] operator[SEP] identifier[markSealedInStorage] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void visit(Functor functor)
{
if (traverser.isEnteringContext())
{
enterFunctor(functor);
}
else if (traverser.isLeavingContext())
{
leaveFunctor(functor);
functor.setTermTraverser(null);
}
} | class class_name[name] begin[{]
method[visit, return_type[void], modifier[public], parameter[functor]] begin[{]
if[call[traverser.isEnteringContext, parameter[]]] begin[{]
call[.enterFunctor, parameter[member[.functor]]]
else begin[{]
if[call[traverser.isLeavingContext, parameter[]]] begin[{]
call[.leaveFunctor, parameter[member[.functor]]]
call[functor.setTermTraverser, parameter[literal[null]]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[visit] operator[SEP] identifier[Functor] identifier[functor] operator[SEP] {
Keyword[if] operator[SEP] identifier[traverser] operator[SEP] identifier[isEnteringContext] operator[SEP] operator[SEP] operator[SEP] {
identifier[enterFunctor] operator[SEP] identifier[functor] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[traverser] operator[SEP] identifier[isLeavingContext] operator[SEP] operator[SEP] operator[SEP] {
identifier[leaveFunctor] operator[SEP] identifier[functor] operator[SEP] operator[SEP] identifier[functor] operator[SEP] identifier[setTermTraverser] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
}
|
public Observable<Page<PublicIPAddressInner>> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) {
return listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName)
.map(new Func1<ServiceResponse<Page<PublicIPAddressInner>>, Page<PublicIPAddressInner>>() {
@Override
public Page<PublicIPAddressInner> call(ServiceResponse<Page<PublicIPAddressInner>> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[listVirtualMachineScaleSetPublicIPAddressesAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, virtualMachineScaleSetName]] begin[{]
return[call[.listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.virtualMachineScaleSetName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[PublicIPAddressInner] operator[>] operator[>] identifier[listVirtualMachineScaleSetPublicIPAddressesAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[virtualMachineScaleSetName] operator[SEP] {
Keyword[return] identifier[listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[virtualMachineScaleSetName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[PublicIPAddressInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[PublicIPAddressInner] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[PublicIPAddressInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[PublicIPAddressInner] operator[>] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static Polygon envelopeToPolygon( Envelope2D envelope ) {
double w = envelope.getMinX();
double e = envelope.getMaxX();
double s = envelope.getMinY();
double n = envelope.getMaxY();
Coordinate[] coords = new Coordinate[5];
coords[0] = new Coordinate(w, n);
coords[1] = new Coordinate(e, n);
coords[2] = new Coordinate(e, s);
coords[3] = new Coordinate(w, s);
coords[4] = new Coordinate(w, n);
GeometryFactory gf = GeometryUtilities.gf();
LinearRing linearRing = gf.createLinearRing(coords);
Polygon polygon = gf.createPolygon(linearRing, null);
return polygon;
} | class class_name[name] begin[{]
method[envelopeToPolygon, return_type[type[Polygon]], modifier[public static], parameter[envelope]] begin[{]
local_variable[type[double], w]
local_variable[type[double], e]
local_variable[type[double], s]
local_variable[type[double], n]
local_variable[type[Coordinate], coords]
assign[member[.coords], ClassCreator(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, 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=Coordinate, sub_type=None))]
assign[member[.coords], ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, 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=Coordinate, sub_type=None))]
assign[member[.coords], ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, 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=Coordinate, sub_type=None))]
assign[member[.coords], ClassCreator(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, 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=Coordinate, sub_type=None))]
assign[member[.coords], ClassCreator(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, 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=Coordinate, sub_type=None))]
local_variable[type[GeometryFactory], gf]
local_variable[type[LinearRing], linearRing]
local_variable[type[Polygon], polygon]
return[member[.polygon]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Polygon] identifier[envelopeToPolygon] operator[SEP] identifier[Envelope2D] identifier[envelope] operator[SEP] {
Keyword[double] identifier[w] operator[=] identifier[envelope] operator[SEP] identifier[getMinX] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[e] operator[=] identifier[envelope] operator[SEP] identifier[getMaxX] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[s] operator[=] identifier[envelope] operator[SEP] identifier[getMinY] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[n] operator[=] identifier[envelope] operator[SEP] identifier[getMaxY] operator[SEP] operator[SEP] operator[SEP] identifier[Coordinate] operator[SEP] operator[SEP] identifier[coords] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] Other[5] operator[SEP] operator[SEP] identifier[coords] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] identifier[w] , identifier[n] operator[SEP] operator[SEP] identifier[coords] operator[SEP] Other[1] operator[SEP] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] identifier[e] , identifier[n] operator[SEP] operator[SEP] identifier[coords] operator[SEP] Other[2] operator[SEP] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] identifier[e] , identifier[s] operator[SEP] operator[SEP] identifier[coords] operator[SEP] Other[3] operator[SEP] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] identifier[w] , identifier[s] operator[SEP] operator[SEP] identifier[coords] operator[SEP] Other[4] operator[SEP] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] identifier[w] , identifier[n] operator[SEP] operator[SEP] identifier[GeometryFactory] identifier[gf] operator[=] identifier[GeometryUtilities] operator[SEP] identifier[gf] operator[SEP] operator[SEP] operator[SEP] identifier[LinearRing] identifier[linearRing] operator[=] identifier[gf] operator[SEP] identifier[createLinearRing] operator[SEP] identifier[coords] operator[SEP] operator[SEP] identifier[Polygon] identifier[polygon] operator[=] identifier[gf] operator[SEP] identifier[createPolygon] operator[SEP] identifier[linearRing] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[polygon] operator[SEP]
}
|
protected I_CmsSearchDocument appendLocales(
I_CmsSearchDocument document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extraction,
List<CmsProperty> properties,
List<CmsProperty> propertiesSearched) {
return document;
} | class class_name[name] begin[{]
method[appendLocales, return_type[type[I_CmsSearchDocument]], modifier[protected], parameter[document, cms, resource, extraction, properties, propertiesSearched]] begin[{]
return[member[.document]]
end[}]
END[}] | Keyword[protected] identifier[I_CmsSearchDocument] identifier[appendLocales] operator[SEP] identifier[I_CmsSearchDocument] identifier[document] , identifier[CmsObject] identifier[cms] , identifier[CmsResource] identifier[resource] , identifier[I_CmsExtractionResult] identifier[extraction] , identifier[List] operator[<] identifier[CmsProperty] operator[>] identifier[properties] , identifier[List] operator[<] identifier[CmsProperty] operator[>] identifier[propertiesSearched] operator[SEP] {
Keyword[return] identifier[document] operator[SEP]
}
|
public String render(String content, RenderContext context) {
init();
FilterContext filterContext = new BaseFilterContext();
filterContext.setRenderContext(context);
return fp.filter(content, filterContext);
} | class class_name[name] begin[{]
method[render, return_type[type[String]], modifier[public], parameter[content, context]] begin[{]
call[.init, parameter[]]
local_variable[type[FilterContext], filterContext]
call[filterContext.setRenderContext, parameter[member[.context]]]
return[call[fp.filter, parameter[member[.content], member[.filterContext]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[render] operator[SEP] identifier[String] identifier[content] , identifier[RenderContext] identifier[context] operator[SEP] {
identifier[init] operator[SEP] operator[SEP] operator[SEP] identifier[FilterContext] identifier[filterContext] operator[=] Keyword[new] identifier[BaseFilterContext] operator[SEP] operator[SEP] operator[SEP] identifier[filterContext] operator[SEP] identifier[setRenderContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[return] identifier[fp] operator[SEP] identifier[filter] operator[SEP] identifier[content] , identifier[filterContext] operator[SEP] operator[SEP]
}
|
private void handleDropSitemapEntry(
final CmsSitemapTreeItem sitemapEntry,
final I_CmsDropTarget target,
CmsClientSitemapEntry parent) {
if (isChangedPosition(sitemapEntry, target, true)) {
// moving a tree entry around
final CmsClientSitemapEntry entry = sitemapEntry.getSitemapEntry();
m_controller.ensureUniqueName(parent, entry.getName(), new I_CmsSimpleCallback<String>() {
public void execute(String uniqueName) {
if (!uniqueName.equals(entry.getName()) && isChangedPosition(sitemapEntry, target, false)) {
m_controller.editAndChangeName(
entry,
uniqueName,
Collections.<CmsPropertyModification> emptyList(),
entry.isNew(),
CmsReloadMode.none);
m_controller.move(entry, m_insertPath + uniqueName + "/", m_insertIndex);
} else {
m_controller.move(entry, m_insertPath + entry.getName() + "/", m_insertIndex);
}
}
});
} else {
sitemapEntry.resetEntry();
}
} | class class_name[name] begin[{]
method[handleDropSitemapEntry, return_type[void], modifier[private], parameter[sitemapEntry, target, parent]] begin[{]
if[call[.isChangedPosition, parameter[member[.sitemapEntry], member[.target], literal[true]]]] begin[{]
local_variable[type[CmsClientSitemapEntry], entry]
call[m_controller.ensureUniqueName, parameter[member[.parent], call[entry.getName, parameter[]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=uniqueName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=sitemapEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=isChangedPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_insertPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), MemberReference(member=m_insertIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=move, postfix_operators=[], prefix_operators=[], qualifier=m_controller, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uniqueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsPropertyModification, sub_type=None))]), MethodInvocation(arguments=[], member=isNew, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=none, postfix_operators=[], prefix_operators=[], qualifier=CmsReloadMode, selectors=[])], member=editAndChangeName, postfix_operators=[], prefix_operators=[], qualifier=m_controller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_insertPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=uniqueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), MemberReference(member=m_insertIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=move, postfix_operators=[], prefix_operators=[], qualifier=m_controller, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=uniqueName, type=ReferenceType(arguments=None, dimensions=[], name=String, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=I_CmsSimpleCallback, sub_type=None))]]
else begin[{]
call[sitemapEntry.resetEntry, parameter[]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[handleDropSitemapEntry] operator[SEP] Keyword[final] identifier[CmsSitemapTreeItem] identifier[sitemapEntry] , Keyword[final] identifier[I_CmsDropTarget] identifier[target] , identifier[CmsClientSitemapEntry] identifier[parent] operator[SEP] {
Keyword[if] operator[SEP] identifier[isChangedPosition] operator[SEP] identifier[sitemapEntry] , identifier[target] , literal[boolean] operator[SEP] operator[SEP] {
Keyword[final] identifier[CmsClientSitemapEntry] identifier[entry] operator[=] identifier[sitemapEntry] operator[SEP] identifier[getSitemapEntry] operator[SEP] operator[SEP] operator[SEP] identifier[m_controller] operator[SEP] identifier[ensureUniqueName] operator[SEP] identifier[parent] , identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Keyword[new] identifier[I_CmsSimpleCallback] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[String] identifier[uniqueName] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[uniqueName] operator[SEP] identifier[equals] operator[SEP] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[isChangedPosition] operator[SEP] identifier[sitemapEntry] , identifier[target] , literal[boolean] operator[SEP] operator[SEP] {
identifier[m_controller] operator[SEP] identifier[editAndChangeName] operator[SEP] identifier[entry] , identifier[uniqueName] , identifier[Collections] operator[SEP] operator[<] identifier[CmsPropertyModification] operator[>] identifier[emptyList] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[isNew] operator[SEP] operator[SEP] , identifier[CmsReloadMode] operator[SEP] identifier[none] operator[SEP] operator[SEP] identifier[m_controller] operator[SEP] identifier[move] operator[SEP] identifier[entry] , identifier[m_insertPath] operator[+] identifier[uniqueName] operator[+] literal[String] , identifier[m_insertIndex] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[m_controller] operator[SEP] identifier[move] operator[SEP] identifier[entry] , identifier[m_insertPath] operator[+] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[m_insertIndex] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sitemapEntry] operator[SEP] identifier[resetEntry] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static AdminClient getAdminClient(String url) {
ClientConfig config = new ClientConfig().setBootstrapUrls(url)
.setConnectionTimeout(5, TimeUnit.SECONDS);
AdminClientConfig adminConfig = new AdminClientConfig().setAdminSocketTimeoutSec(5);
return new AdminClient(adminConfig, config);
} | class class_name[name] begin[{]
method[getAdminClient, return_type[type[AdminClient]], modifier[public static], parameter[url]] begin[{]
local_variable[type[ClientConfig], config]
local_variable[type[AdminClientConfig], adminConfig]
return[ClassCreator(arguments=[MemberReference(member=adminConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, 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=AdminClient, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[AdminClient] identifier[getAdminClient] operator[SEP] identifier[String] identifier[url] operator[SEP] {
identifier[ClientConfig] identifier[config] operator[=] Keyword[new] identifier[ClientConfig] operator[SEP] operator[SEP] operator[SEP] identifier[setBootstrapUrls] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[setConnectionTimeout] operator[SEP] Other[5] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] identifier[AdminClientConfig] identifier[adminConfig] operator[=] Keyword[new] identifier[AdminClientConfig] operator[SEP] operator[SEP] operator[SEP] identifier[setAdminSocketTimeoutSec] operator[SEP] Other[5] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AdminClient] operator[SEP] identifier[adminConfig] , identifier[config] operator[SEP] operator[SEP]
}
|
public String addUnits( String value ) {
StringBuffer buff = new StringBuffer(100);
long bytes = Long.parseLong(value);
if( bytes < 1000000 ) {
buff.append(value);
buff.append("B");
} else {
int unit = 1000;
int exp = (int) (Math.log(bytes) / Math.log(unit));
String pre = "kMGTPE".charAt(exp-1)+"";
String ov = String.format("%.1f%sB", bytes / Math.pow(unit, exp), pre);
buff.append(ov);
}
return buff.toString();
} | class class_name[name] begin[{]
method[addUnits, return_type[type[String]], modifier[public], parameter[value]] begin[{]
local_variable[type[StringBuffer], buff]
local_variable[type[long], bytes]
if[binary_operation[member[.bytes], <, literal[1000000]]] begin[{]
call[buff.append, parameter[member[.value]]]
call[buff.append, parameter[literal["B"]]]
else begin[{]
local_variable[type[int], unit]
local_variable[type[int], exp]
local_variable[type[String], pre]
local_variable[type[String], ov]
call[buff.append, parameter[member[.ov]]]
end[}]
return[call[buff.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[addUnits] operator[SEP] identifier[String] identifier[value] operator[SEP] {
identifier[StringBuffer] identifier[buff] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[100] operator[SEP] operator[SEP] Keyword[long] identifier[bytes] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bytes] operator[<] Other[1000000] operator[SEP] {
identifier[buff] operator[SEP] identifier[append] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[buff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[int] identifier[unit] operator[=] Other[1000] operator[SEP] Keyword[int] identifier[exp] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[bytes] operator[SEP] operator[/] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[unit] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pre] operator[=] literal[String] operator[SEP] identifier[charAt] operator[SEP] identifier[exp] operator[-] Other[1] operator[SEP] operator[+] literal[String] operator[SEP] identifier[String] identifier[ov] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[bytes] operator[/] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[unit] , identifier[exp] operator[SEP] , identifier[pre] operator[SEP] operator[SEP] identifier[buff] operator[SEP] identifier[append] operator[SEP] identifier[ov] operator[SEP] operator[SEP]
}
Keyword[return] identifier[buff] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized boolean addChild(String child) {
if (children == null) {
// let's be conservative on the typical number of children
children = new HashSet<String>(8);
}
return children.add(child);
} | class class_name[name] begin[{]
method[addChild, return_type[type[boolean]], modifier[synchronized public], parameter[child]] begin[{]
if[binary_operation[member[.children], ==, literal[null]]] begin[{]
assign[member[.children], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))]
else begin[{]
None
end[}]
return[call[children.add, parameter[member[.child]]]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[addChild] operator[SEP] identifier[String] identifier[child] operator[SEP] {
Keyword[if] operator[SEP] identifier[children] operator[==] Other[null] operator[SEP] {
identifier[children] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] Other[8] operator[SEP] operator[SEP]
}
Keyword[return] identifier[children] operator[SEP] identifier[add] operator[SEP] identifier[child] operator[SEP] operator[SEP]
}
|
@Override
public Map<Class<? extends Saga>, SagaHandlersMap> scanHandledMessageTypes() {
if (scanResult == null) {
populateSagaHandlers();
}
return scanResult;
} | class class_name[name] begin[{]
method[scanHandledMessageTypes, return_type[type[Map]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.scanResult], ==, literal[null]]] begin[{]
call[.populateSagaHandlers, parameter[]]
else begin[{]
None
end[}]
return[member[.scanResult]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Saga] operator[>] , identifier[SagaHandlersMap] operator[>] identifier[scanHandledMessageTypes] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[scanResult] operator[==] Other[null] operator[SEP] {
identifier[populateSagaHandlers] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[scanResult] operator[SEP]
}
|
private void resizeNow() {
invalidate();
// find the validate root; adapted from the package-private SwingUtilities.getValidateRoot
Container root = null;
Container c=this;
for (; c != null; c = c.getParent()) {
if (!c.isDisplayable() || c instanceof CellRendererPane) {
return;
}
if (c.isValidateRoot()) {
root = c;
break;
}
}
if (root == null) return;
for (; c != null; c = c.getParent()) {
if (!c.isDisplayable() || !c.isVisible()) {
return;
}
if (c instanceof Window || c instanceof Applet) {
break;
}
}
if (c==null) return;
root.validate();
repaint();
} | class class_name[name] begin[{]
method[resizeNow, return_type[void], modifier[private], parameter[]] begin[{]
call[.invalidate, parameter[]]
local_variable[type[Container], root]
local_variable[type[Container], c]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isDisplayable, postfix_operators=[], prefix_operators=['!'], qualifier=c, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=CellRendererPane, sub_type=None), operator=instanceof), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isValidateRoot, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=None, update=[Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None))]), label=None)
if[binary_operation[member[.root], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isDisplayable, postfix_operators=[], prefix_operators=['!'], qualifier=c, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isVisible, postfix_operators=[], prefix_operators=['!'], qualifier=c, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Window, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Applet, sub_type=None), operator=instanceof), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=None, update=[Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None))]), label=None)
if[binary_operation[member[.c], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[root.validate, parameter[]]
call[.repaint, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[resizeNow] operator[SEP] operator[SEP] {
identifier[invalidate] operator[SEP] operator[SEP] operator[SEP] identifier[Container] identifier[root] operator[=] Other[null] operator[SEP] identifier[Container] identifier[c] operator[=] Keyword[this] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[c] operator[!=] Other[null] operator[SEP] identifier[c] operator[=] identifier[c] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[c] operator[SEP] identifier[isDisplayable] operator[SEP] operator[SEP] operator[||] identifier[c] Keyword[instanceof] identifier[CellRendererPane] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[isValidateRoot] operator[SEP] operator[SEP] operator[SEP] {
identifier[root] operator[=] identifier[c] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[root] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[c] operator[!=] Other[null] operator[SEP] identifier[c] operator[=] identifier[c] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[c] operator[SEP] identifier[isDisplayable] operator[SEP] operator[SEP] operator[||] operator[!] identifier[c] operator[SEP] identifier[isVisible] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] Keyword[instanceof] identifier[Window] operator[||] identifier[c] Keyword[instanceof] identifier[Applet] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[c] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[root] operator[SEP] identifier[validate] operator[SEP] operator[SEP] operator[SEP] identifier[repaint] operator[SEP] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.