code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
@Override
public ConnectionFactory createConnectionFactory(JmsJcaConnectionFactory jcaConnectionFactory) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "createConnectionFactory", jcaConnectionFactory);
ConnectionFactory cf = new JmsManagedConnectionFactoryImpl(jcaConnectionFactory);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "createConnectionFactory", cf);
return cf;
} | class class_name[name] begin[{]
method[createConnectionFactory, return_type[type[ConnectionFactory]], modifier[public], parameter[jcaConnectionFactory]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["createConnectionFactory"], member[.jcaConnectionFactory]]]
else begin[{]
None
end[}]
local_variable[type[ConnectionFactory], cf]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["createConnectionFactory"], member[.cf]]]
else begin[{]
None
end[}]
return[member[.cf]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ConnectionFactory] identifier[createConnectionFactory] operator[SEP] identifier[JmsJcaConnectionFactory] identifier[jcaConnectionFactory] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[jcaConnectionFactory] operator[SEP] operator[SEP] identifier[ConnectionFactory] identifier[cf] operator[=] Keyword[new] identifier[JmsManagedConnectionFactoryImpl] operator[SEP] identifier[jcaConnectionFactory] 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] Keyword[this] , identifier[tc] , literal[String] , identifier[cf] operator[SEP] operator[SEP] Keyword[return] identifier[cf] operator[SEP]
}
|
public static String getLocalisedText(final Locale locale, final String text) {
String message = null;
String resourceBundleBaseName = getResourceBundleBaseName();
if (!Util.empty(resourceBundleBaseName)) {
Locale effectiveLocale = locale;
if (effectiveLocale == null) {
effectiveLocale = getEffectiveLocale();
}
try {
// TODO: This is slow
ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleBaseName, effectiveLocale);
message = bundle.getString(text);
} catch (MissingResourceException e) {
// Fall back to the Configuration mechanism for the default internal messages
if (text != null && text.startsWith(ConfigurationProperties.INTERNAL_MESSAGE_PREFIX)) {
message = ConfigurationProperties.getInternalMessage(text);
}
if (message == null && !MISSING_RESOURCES.contains(locale)) {
LOG.error("Missing resource mapping for locale: " + locale + ", text: " + text);
MISSING_RESOURCES.add(locale);
}
}
} else if (text != null && text.startsWith(ConfigurationProperties.INTERNAL_MESSAGE_PREFIX)) {
// Fall back to the Configuration mechanism for the default internal messages
message = ConfigurationProperties.getInternalMessage(text);
}
return message;
} | class class_name[name] begin[{]
method[getLocalisedText, return_type[type[String]], modifier[public static], parameter[locale, text]] begin[{]
local_variable[type[String], message]
local_variable[type[String], resourceBundleBaseName]
if[call[Util.empty, parameter[member[.resourceBundleBaseName]]]] begin[{]
local_variable[type[Locale], effectiveLocale]
if[binary_operation[member[.effectiveLocale], ==, literal[null]]] begin[{]
assign[member[.effectiveLocale], call[.getEffectiveLocale, parameter[]]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resourceBundleBaseName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=effectiveLocale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBundle, postfix_operators=[], prefix_operators=[], qualifier=ResourceBundle, selectors=[], type_arguments=None), name=bundle)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceBundle, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=INTERNAL_MESSAGE_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=ConfigurationProperties, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInternalMessage, postfix_operators=[], prefix_operators=[], qualifier=ConfigurationProperties, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=MISSING_RESOURCES, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing resource mapping for locale: "), operandr=MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", text: "), operator=+), operandr=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=MISSING_RESOURCES, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MissingResourceException']))], finally_block=None, label=None, resources=None)
else begin[{]
if[binary_operation[binary_operation[member[.text], !=, literal[null]], &&, call[text.startsWith, parameter[member[ConfigurationProperties.INTERNAL_MESSAGE_PREFIX]]]]] begin[{]
assign[member[.message], call[ConfigurationProperties.getInternalMessage, parameter[member[.text]]]]
else begin[{]
None
end[}]
end[}]
return[member[.message]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getLocalisedText] operator[SEP] Keyword[final] identifier[Locale] identifier[locale] , Keyword[final] identifier[String] identifier[text] operator[SEP] {
identifier[String] identifier[message] operator[=] Other[null] operator[SEP] identifier[String] identifier[resourceBundleBaseName] operator[=] identifier[getResourceBundleBaseName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Util] operator[SEP] identifier[empty] operator[SEP] identifier[resourceBundleBaseName] operator[SEP] operator[SEP] {
identifier[Locale] identifier[effectiveLocale] operator[=] identifier[locale] operator[SEP] Keyword[if] operator[SEP] identifier[effectiveLocale] operator[==] Other[null] operator[SEP] {
identifier[effectiveLocale] operator[=] identifier[getEffectiveLocale] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[ResourceBundle] identifier[bundle] operator[=] identifier[ResourceBundle] operator[SEP] identifier[getBundle] operator[SEP] identifier[resourceBundleBaseName] , identifier[effectiveLocale] operator[SEP] operator[SEP] identifier[message] operator[=] identifier[bundle] operator[SEP] identifier[getString] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MissingResourceException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[text] operator[!=] Other[null] operator[&&] identifier[text] operator[SEP] identifier[startsWith] operator[SEP] identifier[ConfigurationProperties] operator[SEP] identifier[INTERNAL_MESSAGE_PREFIX] operator[SEP] operator[SEP] {
identifier[message] operator[=] identifier[ConfigurationProperties] operator[SEP] identifier[getInternalMessage] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[&&] operator[!] identifier[MISSING_RESOURCES] operator[SEP] identifier[contains] operator[SEP] identifier[locale] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[locale] operator[+] literal[String] operator[+] identifier[text] operator[SEP] operator[SEP] identifier[MISSING_RESOURCES] operator[SEP] identifier[add] operator[SEP] identifier[locale] operator[SEP] operator[SEP]
}
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[text] operator[!=] Other[null] operator[&&] identifier[text] operator[SEP] identifier[startsWith] operator[SEP] identifier[ConfigurationProperties] operator[SEP] identifier[INTERNAL_MESSAGE_PREFIX] operator[SEP] operator[SEP] {
identifier[message] operator[=] identifier[ConfigurationProperties] operator[SEP] identifier[getInternalMessage] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
Keyword[return] identifier[message] operator[SEP]
}
|
public LiteDeviceDelegatingViewResolver createViewResolver(ViewResolver delegate) {
if (!(delegate instanceof Ordered)) {
throw new IllegalStateException("ViewResolver " + delegate
+ " should implement " + Ordered.class.getName());
}
int delegateOrder = ((Ordered) delegate).getOrder();
return createViewResolver(delegate, adjustOrder(delegateOrder));
} | class class_name[name] begin[{]
method[createViewResolver, return_type[type[LiteDeviceDelegatingViewResolver]], modifier[public], parameter[delegate]] begin[{]
if[binary_operation[member[.delegate], instanceof, type[Ordered]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ViewResolver "), operandr=MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" should implement "), operator=+), operandr=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=Ordered, sub_type=None)), 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[int], delegateOrder]
return[call[.createViewResolver, parameter[member[.delegate], call[.adjustOrder, parameter[member[.delegateOrder]]]]]]
end[}]
END[}] | Keyword[public] identifier[LiteDeviceDelegatingViewResolver] identifier[createViewResolver] operator[SEP] identifier[ViewResolver] identifier[delegate] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[delegate] Keyword[instanceof] identifier[Ordered] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[delegate] operator[+] literal[String] operator[+] identifier[Ordered] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[int] identifier[delegateOrder] operator[=] operator[SEP] operator[SEP] identifier[Ordered] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[createViewResolver] operator[SEP] identifier[delegate] , identifier[adjustOrder] operator[SEP] identifier[delegateOrder] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(DescribeScalingPoliciesRequest describeScalingPoliciesRequest, ProtocolMarshaller protocolMarshaller) {
if (describeScalingPoliciesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeScalingPoliciesRequest.getPolicyNames(), POLICYNAMES_BINDING);
protocolMarshaller.marshall(describeScalingPoliciesRequest.getServiceNamespace(), SERVICENAMESPACE_BINDING);
protocolMarshaller.marshall(describeScalingPoliciesRequest.getResourceId(), RESOURCEID_BINDING);
protocolMarshaller.marshall(describeScalingPoliciesRequest.getScalableDimension(), SCALABLEDIMENSION_BINDING);
protocolMarshaller.marshall(describeScalingPoliciesRequest.getMaxResults(), MAXRESULTS_BINDING);
protocolMarshaller.marshall(describeScalingPoliciesRequest.getNextToken(), NEXTTOKEN_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[describeScalingPoliciesRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.describeScalingPoliciesRequest], ==, 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=getPolicyNames, postfix_operators=[], prefix_operators=[], qualifier=describeScalingPoliciesRequest, selectors=[], type_arguments=None), MemberReference(member=POLICYNAMES_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServiceNamespace, postfix_operators=[], prefix_operators=[], qualifier=describeScalingPoliciesRequest, selectors=[], type_arguments=None), MemberReference(member=SERVICENAMESPACE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResourceId, postfix_operators=[], prefix_operators=[], qualifier=describeScalingPoliciesRequest, selectors=[], type_arguments=None), MemberReference(member=RESOURCEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getScalableDimension, postfix_operators=[], prefix_operators=[], qualifier=describeScalingPoliciesRequest, selectors=[], type_arguments=None), MemberReference(member=SCALABLEDIMENSION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=describeScalingPoliciesRequest, selectors=[], type_arguments=None), MemberReference(member=MAXRESULTS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=describeScalingPoliciesRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_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[DescribeScalingPoliciesRequest] identifier[describeScalingPoliciesRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[describeScalingPoliciesRequest] 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[describeScalingPoliciesRequest] operator[SEP] identifier[getPolicyNames] operator[SEP] operator[SEP] , identifier[POLICYNAMES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeScalingPoliciesRequest] operator[SEP] identifier[getServiceNamespace] operator[SEP] operator[SEP] , identifier[SERVICENAMESPACE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeScalingPoliciesRequest] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] , identifier[RESOURCEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeScalingPoliciesRequest] operator[SEP] identifier[getScalableDimension] operator[SEP] operator[SEP] , identifier[SCALABLEDIMENSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeScalingPoliciesRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeScalingPoliciesRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_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 Map<String, Map<String, VariantSet>> getSkinMapping(ResourceBrowser rsBrowser, JawrConfig config) {
Map<String, Map<String, VariantSet>> currentSkinMapping = new HashMap<>();
PropertiesConfigHelper props = new PropertiesConfigHelper(config.getConfigProperties(), JawrConstant.CSS_TYPE);
Set<String> skinRootDirectories = props.getPropertyAsSet(JawrConstant.SKIN_DEFAULT_ROOT_DIRS);
if (skinMappingType.equals(JawrConstant.SKIN_TYPE_MAPPING_SKIN_LOCALE)) {
updateSkinMappingUsingTypeSkinLocale(rsBrowser, config, currentSkinMapping, skinRootDirectories);
} else {
updateSkinMappingUsingTypeLocaleSkin(rsBrowser, config, currentSkinMapping, skinRootDirectories);
}
return currentSkinMapping;
} | class class_name[name] begin[{]
method[getSkinMapping, return_type[type[Map]], modifier[public], parameter[rsBrowser, config]] begin[{]
local_variable[type[Map], currentSkinMapping]
local_variable[type[PropertiesConfigHelper], props]
local_variable[type[Set], skinRootDirectories]
if[call[skinMappingType.equals, parameter[member[JawrConstant.SKIN_TYPE_MAPPING_SKIN_LOCALE]]]] begin[{]
call[.updateSkinMappingUsingTypeSkinLocale, parameter[member[.rsBrowser], member[.config], member[.currentSkinMapping], member[.skinRootDirectories]]]
else begin[{]
call[.updateSkinMappingUsingTypeLocaleSkin, parameter[member[.rsBrowser], member[.config], member[.currentSkinMapping], member[.skinRootDirectories]]]
end[}]
return[member[.currentSkinMapping]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[VariantSet] operator[>] operator[>] identifier[getSkinMapping] operator[SEP] identifier[ResourceBrowser] identifier[rsBrowser] , identifier[JawrConfig] identifier[config] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[VariantSet] operator[>] operator[>] identifier[currentSkinMapping] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[PropertiesConfigHelper] identifier[props] operator[=] Keyword[new] identifier[PropertiesConfigHelper] operator[SEP] identifier[config] operator[SEP] identifier[getConfigProperties] operator[SEP] operator[SEP] , identifier[JawrConstant] operator[SEP] identifier[CSS_TYPE] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[skinRootDirectories] operator[=] identifier[props] operator[SEP] identifier[getPropertyAsSet] operator[SEP] identifier[JawrConstant] operator[SEP] identifier[SKIN_DEFAULT_ROOT_DIRS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[skinMappingType] operator[SEP] identifier[equals] operator[SEP] identifier[JawrConstant] operator[SEP] identifier[SKIN_TYPE_MAPPING_SKIN_LOCALE] operator[SEP] operator[SEP] {
identifier[updateSkinMappingUsingTypeSkinLocale] operator[SEP] identifier[rsBrowser] , identifier[config] , identifier[currentSkinMapping] , identifier[skinRootDirectories] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[updateSkinMappingUsingTypeLocaleSkin] operator[SEP] identifier[rsBrowser] , identifier[config] , identifier[currentSkinMapping] , identifier[skinRootDirectories] operator[SEP] operator[SEP]
}
Keyword[return] identifier[currentSkinMapping] operator[SEP]
}
|
public static final boolean hasScript(int c, int sc) {
int scriptX=UCharacterProperty.INSTANCE.getAdditional(c, 0)&UCharacterProperty.SCRIPT_X_MASK;
if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
return sc==scriptX;
}
char[] scriptExtensions=UCharacterProperty.INSTANCE.m_scriptExtensions_;
int scx=scriptX&UCharacterProperty.SCRIPT_MASK_; // index into scriptExtensions
if(scriptX>=UCharacterProperty.SCRIPT_X_WITH_OTHER) {
scx=scriptExtensions[scx+1];
}
if(sc>0x7fff) {
// Guard against bogus input that would
// make us go past the Script_Extensions terminator.
return false;
}
while(sc>scriptExtensions[scx]) {
++scx;
}
return sc==(scriptExtensions[scx]&0x7fff);
} | class class_name[name] begin[{]
method[hasScript, return_type[type[boolean]], modifier[final public static], parameter[c, sc]] begin[{]
local_variable[type[int], scriptX]
if[binary_operation[member[.scriptX], <, member[UCharacterProperty.SCRIPT_X_WITH_COMMON]]] begin[{]
return[binary_operation[member[.sc], ==, member[.scriptX]]]
else begin[{]
None
end[}]
local_variable[type[char], scriptExtensions]
local_variable[type[int], scx]
if[binary_operation[member[.scriptX], >=, member[UCharacterProperty.SCRIPT_X_WITH_OTHER]]] begin[{]
assign[member[.scx], member[.scriptExtensions]]
else begin[{]
None
end[}]
if[binary_operation[member[.sc], >, literal[0x7fff]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
while[binary_operation[member[.sc], >, member[.scriptExtensions]]] begin[{]
member[.scx]
end[}]
return[binary_operation[member[.sc], ==, binary_operation[member[.scriptExtensions], &, literal[0x7fff]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] Keyword[boolean] identifier[hasScript] operator[SEP] Keyword[int] identifier[c] , Keyword[int] identifier[sc] operator[SEP] {
Keyword[int] identifier[scriptX] operator[=] identifier[UCharacterProperty] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getAdditional] operator[SEP] identifier[c] , Other[0] operator[SEP] operator[&] identifier[UCharacterProperty] operator[SEP] identifier[SCRIPT_X_MASK] operator[SEP] Keyword[if] operator[SEP] identifier[scriptX] operator[<] identifier[UCharacterProperty] operator[SEP] identifier[SCRIPT_X_WITH_COMMON] operator[SEP] {
Keyword[return] identifier[sc] operator[==] identifier[scriptX] operator[SEP]
}
Keyword[char] operator[SEP] operator[SEP] identifier[scriptExtensions] operator[=] identifier[UCharacterProperty] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[m_scriptExtensions_] operator[SEP] Keyword[int] identifier[scx] operator[=] identifier[scriptX] operator[&] identifier[UCharacterProperty] operator[SEP] identifier[SCRIPT_MASK_] operator[SEP] Keyword[if] operator[SEP] identifier[scriptX] operator[>=] identifier[UCharacterProperty] operator[SEP] identifier[SCRIPT_X_WITH_OTHER] operator[SEP] {
identifier[scx] operator[=] identifier[scriptExtensions] operator[SEP] identifier[scx] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sc] operator[>] literal[Integer] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[while] operator[SEP] identifier[sc] operator[>] identifier[scriptExtensions] operator[SEP] identifier[scx] operator[SEP] operator[SEP] {
operator[++] identifier[scx] operator[SEP]
}
Keyword[return] identifier[sc] operator[==] operator[SEP] identifier[scriptExtensions] operator[SEP] identifier[scx] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP]
}
|
private static ECPoint decompressKey(BigInteger xBN, boolean yBit) {
X9IntegerConverter x9 = new X9IntegerConverter();
byte[] compEnc = x9.integerToBytes(xBN, 1 + x9.getByteLength(CURVE.getCurve()));
compEnc[0] = (byte)(yBit ? 0x03 : 0x02);
return CURVE.getCurve().decodePoint(compEnc);
} | class class_name[name] begin[{]
method[decompressKey, return_type[type[ECPoint]], modifier[private static], parameter[xBN, yBit]] begin[{]
local_variable[type[X9IntegerConverter], x9]
local_variable[type[byte], compEnc]
assign[member[.compEnc], Cast(expression=TernaryExpression(condition=MemberReference(member=yBit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x02), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x03)), type=BasicType(dimensions=[], name=byte))]
return[call[CURVE.getCurve, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[ECPoint] identifier[decompressKey] operator[SEP] identifier[BigInteger] identifier[xBN] , Keyword[boolean] identifier[yBit] operator[SEP] {
identifier[X9IntegerConverter] identifier[x9] operator[=] Keyword[new] identifier[X9IntegerConverter] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[compEnc] operator[=] identifier[x9] operator[SEP] identifier[integerToBytes] operator[SEP] identifier[xBN] , Other[1] operator[+] identifier[x9] operator[SEP] identifier[getByteLength] operator[SEP] identifier[CURVE] operator[SEP] identifier[getCurve] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[compEnc] operator[SEP] Other[0] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[yBit] operator[?] literal[Integer] operator[:] literal[Integer] operator[SEP] operator[SEP] Keyword[return] identifier[CURVE] operator[SEP] identifier[getCurve] operator[SEP] operator[SEP] operator[SEP] identifier[decodePoint] operator[SEP] identifier[compEnc] operator[SEP] operator[SEP]
}
|
public static Config load(final ClassLoader loader) {
final ConfigParseOptions withLoader = ConfigParseOptions.defaults().setClassLoader(loader);
return ConfigImpl.computeCachedConfig(loader, "load", new Callable<Config>() {
@Override
public Config call() {
return load(loader, defaultApplication(withLoader));
}
});
} | class class_name[name] begin[{]
method[load, return_type[type[Config]], modifier[public static], parameter[loader]] begin[{]
local_variable[type[ConfigParseOptions], withLoader]
return[call[ConfigImpl.computeCachedConfig, parameter[member[.loader], literal["load"], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=loader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=withLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=defaultApplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=load, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Config, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Config, sub_type=None))], dimensions=None, name=Callable, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Config] identifier[load] operator[SEP] Keyword[final] identifier[ClassLoader] identifier[loader] operator[SEP] {
Keyword[final] identifier[ConfigParseOptions] identifier[withLoader] operator[=] identifier[ConfigParseOptions] operator[SEP] identifier[defaults] operator[SEP] operator[SEP] operator[SEP] identifier[setClassLoader] operator[SEP] identifier[loader] operator[SEP] operator[SEP] Keyword[return] identifier[ConfigImpl] operator[SEP] identifier[computeCachedConfig] operator[SEP] identifier[loader] , literal[String] , Keyword[new] identifier[Callable] operator[<] identifier[Config] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Config] identifier[call] operator[SEP] operator[SEP] {
Keyword[return] identifier[load] operator[SEP] identifier[loader] , identifier[defaultApplication] operator[SEP] identifier[withLoader] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@Override
public int read() throws IOException {
// Read from the queue
synchronized(file) {
while(true) {
long len=file.getLength();
if(len>=1) {
long pos=file.getFirstIndex();
file.file.seek(pos+16);
int b=file.file.read();
if(b==-1) throw new EOFException("Unexpected EOF");
addStats(1);
long newFirstIndex=pos+1;
while(newFirstIndex>=file.maxFifoLength) newFirstIndex-=file.maxFifoLength;
file.setFirstIndex(newFirstIndex);
file.setLength(len-1);
file.notify();
return b;
}
try {
file.wait();
} catch(InterruptedException err) {
InterruptedIOException ioErr=new InterruptedIOException();
ioErr.initCause(err);
throw ioErr;
}
}
}
} | class class_name[name] begin[{]
method[read, return_type[type[int]], modifier[public], parameter[]] begin[{]
SYNCHRONIZED[member[.file]] BEGIN[{]
while[literal[true]] begin[{]
local_variable[type[long], len]
if[binary_operation[member[.len], >=, literal[1]]] begin[{]
local_variable[type[long], pos]
call[file.file.seek, parameter[binary_operation[member[.pos], +, literal[16]]]]
local_variable[type[int], b]
if[binary_operation[member[.b], ==, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected EOF")], 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[}]
call[.addStats, parameter[literal[1]]]
local_variable[type[long], newFirstIndex]
while[binary_operation[member[.newFirstIndex], >=, member[file.maxFifoLength]]] begin[{]
assign[member[.newFirstIndex], member[file.maxFifoLength]]
end[}]
call[file.setFirstIndex, parameter[member[.newFirstIndex]]]
call[file.setLength, parameter[binary_operation[member[.len], -, literal[1]]]]
call[file.notify, parameter[]]
return[member[.b]]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=wait, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(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=InterruptedIOException, sub_type=None)), name=ioErr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InterruptedIOException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=err, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=ioErr, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ioErr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=err, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[read] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[synchronized] operator[SEP] identifier[file] operator[SEP] {
Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[long] identifier[len] operator[=] identifier[file] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>=] Other[1] operator[SEP] {
Keyword[long] identifier[pos] operator[=] identifier[file] operator[SEP] identifier[getFirstIndex] operator[SEP] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[file] operator[SEP] identifier[seek] operator[SEP] identifier[pos] operator[+] Other[16] operator[SEP] operator[SEP] Keyword[int] identifier[b] operator[=] identifier[file] operator[SEP] identifier[file] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[addStats] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[long] identifier[newFirstIndex] operator[=] identifier[pos] operator[+] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[newFirstIndex] operator[>=] identifier[file] operator[SEP] identifier[maxFifoLength] operator[SEP] identifier[newFirstIndex] operator[-=] identifier[file] operator[SEP] identifier[maxFifoLength] operator[SEP] identifier[file] operator[SEP] identifier[setFirstIndex] operator[SEP] identifier[newFirstIndex] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[setLength] operator[SEP] identifier[len] operator[-] Other[1] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[b] operator[SEP]
}
Keyword[try] {
identifier[file] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[err] operator[SEP] {
identifier[InterruptedIOException] identifier[ioErr] operator[=] Keyword[new] identifier[InterruptedIOException] operator[SEP] operator[SEP] operator[SEP] identifier[ioErr] operator[SEP] identifier[initCause] operator[SEP] identifier[err] operator[SEP] operator[SEP] Keyword[throw] identifier[ioErr] operator[SEP]
}
}
}
}
|
public static ClientCollection getCollection(final String uri, final AuthStrategy authStrategy) throws ProponoException {
return new ClientCollection(uri, authStrategy);
} | class class_name[name] begin[{]
method[getCollection, return_type[type[ClientCollection]], modifier[public static], parameter[uri, authStrategy]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authStrategy, 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=ClientCollection, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ClientCollection] identifier[getCollection] operator[SEP] Keyword[final] identifier[String] identifier[uri] , Keyword[final] identifier[AuthStrategy] identifier[authStrategy] operator[SEP] Keyword[throws] identifier[ProponoException] {
Keyword[return] Keyword[new] identifier[ClientCollection] operator[SEP] identifier[uri] , identifier[authStrategy] operator[SEP] operator[SEP]
}
|
@Override
public void handle(final Activity context, final SocializeAction action, Location location, final String text, final SocialNetworkListener listener) {
ShareType shareType = getShareType();
final SocialNetwork network = SocialNetwork.valueOf(shareType);
PropagationInfoResponse propagationInfoResponse = action.getPropagationInfoResponse();
if(propagationInfoResponse != null) {
final PropagationInfo propagationInfo = propagationInfoResponse.getPropagationInfo(shareType);
if(propagationInfo != null) {
try {
if(loopyService.isLoopyEnabled()) {
if(shareType.equals(ShareType.OTHER)) {
loopyService.showShareDialog(context, "", text, action.getEntity(), propagationInfo, listener);
} else {
loopyService.getTrackableUrl(action.getEntity(), shareType, propagationInfo.getEntityUrl(), new ShareCallback() {
@Override
public void onResult(Item item, Throwable error) {
PropagationInfo infoInUse = loopyService.setShortlinks(propagationInfo, item, error);
try {
handle(context, action, text, infoInUse, listener);
} catch (Exception e) {
if(logger != null) {
logger.error("Error handling share", e);
}
if(listener != null) {
listener.onNetworkError(context, network, e);
}
}
}
});
}
} else {
handle(context, action, text, propagationInfo, listener);
}
}
catch (Exception e) {
if(logger != null) {
logger.error("Error handling share", e);
}
if(listener != null) {
listener.onNetworkError(context, network, e);
}
}
}
else {
logError(context, network, "No propagation info found for type [" +
shareType +
"]. Share will not propagate", listener);
}
}
else {
logError(context, network, "No propagation info found for type [" +
shareType +
"]. Share will not propagate", listener);
}
} | class class_name[name] begin[{]
method[handle, return_type[void], modifier[public], parameter[context, action, location, text, listener]] begin[{]
local_variable[type[ShareType], shareType]
local_variable[type[SocialNetwork], network]
local_variable[type[PropagationInfoResponse], propagationInfoResponse]
if[binary_operation[member[.propagationInfoResponse], !=, literal[null]]] begin[{]
local_variable[type[PropagationInfo], propagationInfo]
if[binary_operation[member[.propagationInfo], !=, literal[null]]] begin[{]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isLoopyEnabled, postfix_operators=[], prefix_operators=[], qualifier=loopyService, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propagationInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=OTHER, postfix_operators=[], prefix_operators=[], qualifier=ShareType, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=shareType, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None), MemberReference(member=shareType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEntityUrl, postfix_operators=[], prefix_operators=[], qualifier=propagationInfo, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=propagationInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setShortlinks, postfix_operators=[], prefix_operators=[], qualifier=loopyService, selectors=[], type_arguments=None), name=infoInUse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropagationInfo, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=infoInUse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error handling share"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=network, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onNetworkError, postfix_operators=[], prefix_operators=[], qualifier=listener, 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)], documentation=None, modifiers={'public'}, name=onResult, parameters=[FormalParameter(annotations=[], modifiers=set(), name=item, type=ReferenceType(arguments=None, dimensions=[], name=Item, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=error, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShareCallback, sub_type=None))], member=getTrackableUrl, postfix_operators=[], prefix_operators=[], qualifier=loopyService, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None), MemberReference(member=propagationInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=showShareDialog, postfix_operators=[], prefix_operators=[], qualifier=loopyService, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error handling share"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=network, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onNetworkError, postfix_operators=[], prefix_operators=[], qualifier=listener, 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[{]
call[.logError, parameter[member[.context], member[.network], binary_operation[binary_operation[literal["No propagation info found for type ["], +, member[.shareType]], +, literal["]. Share will not propagate"]], member[.listener]]]
end[}]
else begin[{]
call[.logError, parameter[member[.context], member[.network], binary_operation[binary_operation[literal["No propagation info found for type ["], +, member[.shareType]], +, literal["]. Share will not propagate"]], member[.listener]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] Keyword[final] identifier[Activity] identifier[context] , Keyword[final] identifier[SocializeAction] identifier[action] , identifier[Location] identifier[location] , Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[SocialNetworkListener] identifier[listener] operator[SEP] {
identifier[ShareType] identifier[shareType] operator[=] identifier[getShareType] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[SocialNetwork] identifier[network] operator[=] identifier[SocialNetwork] operator[SEP] identifier[valueOf] operator[SEP] identifier[shareType] operator[SEP] operator[SEP] identifier[PropagationInfoResponse] identifier[propagationInfoResponse] operator[=] identifier[action] operator[SEP] identifier[getPropagationInfoResponse] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propagationInfoResponse] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[PropagationInfo] identifier[propagationInfo] operator[=] identifier[propagationInfoResponse] operator[SEP] identifier[getPropagationInfo] operator[SEP] identifier[shareType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propagationInfo] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[loopyService] operator[SEP] identifier[isLoopyEnabled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[shareType] operator[SEP] identifier[equals] operator[SEP] identifier[ShareType] operator[SEP] identifier[OTHER] operator[SEP] operator[SEP] {
identifier[loopyService] operator[SEP] identifier[showShareDialog] operator[SEP] identifier[context] , literal[String] , identifier[text] , identifier[action] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] , identifier[propagationInfo] , identifier[listener] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[loopyService] operator[SEP] identifier[getTrackableUrl] operator[SEP] identifier[action] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] , identifier[shareType] , identifier[propagationInfo] operator[SEP] identifier[getEntityUrl] operator[SEP] operator[SEP] , Keyword[new] identifier[ShareCallback] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onResult] operator[SEP] identifier[Item] identifier[item] , identifier[Throwable] identifier[error] operator[SEP] {
identifier[PropagationInfo] identifier[infoInUse] operator[=] identifier[loopyService] operator[SEP] identifier[setShortlinks] operator[SEP] identifier[propagationInfo] , identifier[item] , identifier[error] operator[SEP] operator[SEP] Keyword[try] {
identifier[handle] operator[SEP] identifier[context] , identifier[action] , identifier[text] , identifier[infoInUse] , identifier[listener] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[logger] operator[!=] Other[null] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listener] operator[!=] Other[null] operator[SEP] {
identifier[listener] operator[SEP] identifier[onNetworkError] operator[SEP] identifier[context] , identifier[network] , identifier[e] operator[SEP] operator[SEP]
}
}
}
} operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[handle] operator[SEP] identifier[context] , identifier[action] , identifier[text] , identifier[propagationInfo] , identifier[listener] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[logger] operator[!=] Other[null] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listener] operator[!=] Other[null] operator[SEP] {
identifier[listener] operator[SEP] identifier[onNetworkError] operator[SEP] identifier[context] , identifier[network] , identifier[e] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[logError] operator[SEP] identifier[context] , identifier[network] , literal[String] operator[+] identifier[shareType] operator[+] literal[String] , identifier[listener] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[logError] operator[SEP] identifier[context] , identifier[network] , literal[String] operator[+] identifier[shareType] operator[+] literal[String] , identifier[listener] operator[SEP] operator[SEP]
}
}
|
protected static MessageDigest prepareMessageDigest(final String principal, final String service) throws NoSuchAlgorithmException {
val md = MessageDigest.getInstance("SHA");
if (StringUtils.isNotBlank(service)) {
md.update(service.getBytes(StandardCharsets.UTF_8));
md.update(CONST_SEPARATOR);
}
md.update(principal.getBytes(StandardCharsets.UTF_8));
md.update(CONST_SEPARATOR);
return md;
} | class class_name[name] begin[{]
method[prepareMessageDigest, return_type[type[MessageDigest]], modifier[static protected], parameter[principal, service]] begin[{]
local_variable[type[val], md]
if[call[StringUtils.isNotBlank, parameter[member[.service]]]] begin[{]
call[md.update, parameter[call[service.getBytes, parameter[member[StandardCharsets.UTF_8]]]]]
call[md.update, parameter[member[.CONST_SEPARATOR]]]
else begin[{]
None
end[}]
call[md.update, parameter[call[principal.getBytes, parameter[member[StandardCharsets.UTF_8]]]]]
call[md.update, parameter[member[.CONST_SEPARATOR]]]
return[member[.md]]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[MessageDigest] identifier[prepareMessageDigest] operator[SEP] Keyword[final] identifier[String] identifier[principal] , Keyword[final] identifier[String] identifier[service] operator[SEP] Keyword[throws] identifier[NoSuchAlgorithmException] {
identifier[val] identifier[md] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[service] operator[SEP] operator[SEP] {
identifier[md] operator[SEP] identifier[update] operator[SEP] identifier[service] operator[SEP] identifier[getBytes] operator[SEP] identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] identifier[md] operator[SEP] identifier[update] operator[SEP] identifier[CONST_SEPARATOR] operator[SEP] operator[SEP]
}
identifier[md] operator[SEP] identifier[update] operator[SEP] identifier[principal] operator[SEP] identifier[getBytes] operator[SEP] identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] identifier[md] operator[SEP] identifier[update] operator[SEP] identifier[CONST_SEPARATOR] operator[SEP] operator[SEP] Keyword[return] identifier[md] operator[SEP]
}
|
public static void writePropsNoJarDependency(final Map<String, String> properties,
final Writer writer) throws IOException {
writer.write("{\n");
int size = properties.size();
for (final Map.Entry<String, String> entry : properties.entrySet()) {
// tab the space
writer.write('\t');
// Write key
writer.write(quoteAndClean(entry.getKey()));
writer.write(':');
writer.write(quoteAndClean(entry.getValue()));
size -= 1;
// Add comma only if it's not the last one
if (size > 0) {
writer.write(',');
}
writer.write('\n');
}
writer.write("}");
} | class class_name[name] begin[{]
method[writePropsNoJarDependency, return_type[void], modifier[public static], parameter[properties, writer]] begin[{]
call[writer.write, parameter[literal["{\n"]]]
local_variable[type[int], size]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=quoteAndClean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=quoteAndClean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
call[writer.write, parameter[literal["}"]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[writePropsNoJarDependency] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[properties] , Keyword[final] identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[properties] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[properties] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[quoteAndClean] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[quoteAndClean] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[-=] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>] Other[0] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public static boolean isIterableOrMap(final Class<?> elementClass) {
// TODO(nchalko) handle iterables everywhere this is called.
return elementClass.isArray() || Iterable.class.isAssignableFrom(elementClass)
|| Map.class.isAssignableFrom(elementClass);
} | class class_name[name] begin[{]
method[isIterableOrMap, return_type[type[boolean]], modifier[public static], parameter[elementClass]] begin[{]
return[binary_operation[binary_operation[call[elementClass.isArray, parameter[]], ||, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=elementClass, 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=Iterable, sub_type=None))], ||, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=elementClass, 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=Map, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isIterableOrMap] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[elementClass] operator[SEP] {
Keyword[return] identifier[elementClass] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[||] identifier[Iterable] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[elementClass] operator[SEP] operator[||] identifier[Map] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[elementClass] operator[SEP] operator[SEP]
}
|
public static final <A> Collection<A> toLazyCollection(final Stream<A> stream) {
return SeqUtils.toLazyCollection(stream.iterator());
} | class class_name[name] begin[{]
method[toLazyCollection, return_type[type[Collection]], modifier[final public static], parameter[stream]] begin[{]
return[call[SeqUtils.toLazyCollection, parameter[call[stream.iterator, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] operator[<] identifier[A] operator[>] identifier[Collection] operator[<] identifier[A] operator[>] identifier[toLazyCollection] operator[SEP] Keyword[final] identifier[Stream] operator[<] identifier[A] operator[>] identifier[stream] operator[SEP] {
Keyword[return] identifier[SeqUtils] operator[SEP] identifier[toLazyCollection] operator[SEP] identifier[stream] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private static Map<String, String> buildMap(final Collection<String> lines) throws IllegalArgumentException
{
final Map<String, String> map;
if (lines == null)
{
throw new IllegalArgumentException("Environment must not be null.");
}
map = new HashMap<>();
for (String line : lines)
{
int colonPosition;
String key;
String value;
colonPosition = line.indexOf(':');
// no colon on the line?
if (colonPosition < 0)
{
continue;
}
// key doesn't start with agi_ or ogi_?
if (!line.startsWith("agi_") && !line.startsWith("ogi_"))
{
continue;
}
// first colon in line is last character -> no value present?
if (line.length() < colonPosition + 2)
{
continue;
}
key = line.substring(4, colonPosition).toLowerCase(Locale.ENGLISH);
value = line.substring(colonPosition + 2);
if (value.length() != 0)
{
map.put(key, value);
}
}
return map;
} | class class_name[name] begin[{]
method[buildMap, return_type[type[Map]], modifier[private static], parameter[lines]] begin[{]
local_variable[type[Map], map]
if[binary_operation[member[.lines], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Environment must not be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.map], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=colonPosition)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=colonPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=colonPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="agi_")], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=line, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ogi_")], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=line, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=colonPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), MemberReference(member=colonPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[MemberReference(member=ENGLISH, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[])], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=colonPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=lines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.map]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[buildMap] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[lines] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[SEP] Keyword[if] operator[SEP] identifier[lines] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[line] operator[:] identifier[lines] operator[SEP] {
Keyword[int] identifier[colonPosition] operator[SEP] identifier[String] identifier[key] operator[SEP] identifier[String] identifier[value] operator[SEP] identifier[colonPosition] operator[=] identifier[line] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colonPosition] operator[<] Other[0] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[colonPosition] operator[+] Other[2] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[key] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[4] , identifier[colonPosition] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] identifier[colonPosition] operator[+] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[map] operator[SEP]
}
|
public String get(final Object key) {
if (this._current.containsKey(key)) {
return this._current.get(key);
} else if (this._parent != null) {
return this._parent.get(key);
} else {
return null;
}
} | class class_name[name] begin[{]
method[get, return_type[type[String]], modifier[public], parameter[key]] begin[{]
if[THIS[member[None._current]call[None.containsKey, parameter[member[.key]]]]] begin[{]
return[THIS[member[None._current]call[None.get, parameter[member[.key]]]]]
else begin[{]
if[binary_operation[THIS[member[None._parent]], !=, literal[null]]] begin[{]
return[THIS[member[None._parent]call[None.get, parameter[member[.key]]]]]
else begin[{]
return[literal[null]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] identifier[String] identifier[get] operator[SEP] Keyword[final] identifier[Object] identifier[key] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[_current] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[_current] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[_parent] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[_parent] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public static void checkEventCriteria(final AttributeImpl attribute) throws DevFailed {
// Check if value is not numerical (always true for State and String)
if (attribute.isState() || attribute.isString()) {
return;
}
// Else check criteria
final EventProperties props = attribute.getProperties().getEventProp();
if (props.arch_event.period.equals(Constants.NOT_SPECIFIED)
&& props.arch_event.abs_change.equals(Constants.NOT_SPECIFIED)
&& props.arch_event.rel_change.equals(Constants.NOT_SPECIFIED)) {
throw DevFailedUtils.newDevFailed(ExceptionMessages.EVENT_CRITERIA_NOT_SET,
"Archive event properties (archive_abs_change or "
+ "archive_rel_change or archive_period) for attribute " + attribute.getName()
+ " are not set");
}
} | class class_name[name] begin[{]
method[checkEventCriteria, return_type[void], modifier[public static], parameter[attribute]] begin[{]
if[binary_operation[call[attribute.isState, parameter[]], ||, call[attribute.isString, parameter[]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[EventProperties], props]
if[binary_operation[binary_operation[call[props.arch_event.period.equals, parameter[member[Constants.NOT_SPECIFIED]]], &&, call[props.arch_event.abs_change.equals, parameter[member[Constants.NOT_SPECIFIED]]]], &&, call[props.arch_event.rel_change.equals, parameter[member[Constants.NOT_SPECIFIED]]]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=EVENT_CRITERIA_NOT_SET, postfix_operators=[], prefix_operators=[], qualifier=ExceptionMessages, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Archive event properties (archive_abs_change or "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="archive_rel_change or archive_period) for attribute "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" are not set"), operator=+)], member=newDevFailed, postfix_operators=[], prefix_operators=[], qualifier=DevFailedUtils, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[checkEventCriteria] operator[SEP] Keyword[final] identifier[AttributeImpl] identifier[attribute] operator[SEP] Keyword[throws] identifier[DevFailed] {
Keyword[if] operator[SEP] identifier[attribute] operator[SEP] identifier[isState] operator[SEP] operator[SEP] operator[||] identifier[attribute] operator[SEP] identifier[isString] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[final] identifier[EventProperties] identifier[props] operator[=] identifier[attribute] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[getEventProp] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[props] operator[SEP] identifier[arch_event] operator[SEP] identifier[period] operator[SEP] identifier[equals] operator[SEP] identifier[Constants] operator[SEP] identifier[NOT_SPECIFIED] operator[SEP] operator[&&] identifier[props] operator[SEP] identifier[arch_event] operator[SEP] identifier[abs_change] operator[SEP] identifier[equals] operator[SEP] identifier[Constants] operator[SEP] identifier[NOT_SPECIFIED] operator[SEP] operator[&&] identifier[props] operator[SEP] identifier[arch_event] operator[SEP] identifier[rel_change] operator[SEP] identifier[equals] operator[SEP] identifier[Constants] operator[SEP] identifier[NOT_SPECIFIED] operator[SEP] operator[SEP] {
Keyword[throw] identifier[DevFailedUtils] operator[SEP] identifier[newDevFailed] operator[SEP] identifier[ExceptionMessages] operator[SEP] identifier[EVENT_CRITERIA_NOT_SET] , literal[String] operator[+] literal[String] operator[+] identifier[attribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
private String getWrappedResourceName(Resource resource)
{
String resourceName = resource.getResourceName();
if (resourceName != null)
{
return resourceName;
}
if (resource instanceof ResourceWrapper)
{
return getWrappedResourceName(((ResourceWrapper) resource).getWrapped());
}
return null;
} | class class_name[name] begin[{]
method[getWrappedResourceName, return_type[type[String]], modifier[private], parameter[resource]] begin[{]
local_variable[type[String], resourceName]
if[binary_operation[member[.resourceName], !=, literal[null]]] begin[{]
return[member[.resourceName]]
else begin[{]
None
end[}]
if[binary_operation[member[.resource], instanceof, type[ResourceWrapper]]] begin[{]
return[call[.getWrappedResourceName, parameter[Cast(expression=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ResourceWrapper, sub_type=None))]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[getWrappedResourceName] operator[SEP] identifier[Resource] identifier[resource] operator[SEP] {
identifier[String] identifier[resourceName] operator[=] identifier[resource] operator[SEP] identifier[getResourceName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceName] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[resourceName] operator[SEP]
}
Keyword[if] operator[SEP] identifier[resource] Keyword[instanceof] identifier[ResourceWrapper] operator[SEP] {
Keyword[return] identifier[getWrappedResourceName] operator[SEP] operator[SEP] operator[SEP] identifier[ResourceWrapper] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[getWrapped] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void checkHttpURL(String document, String userAgent,
ErrorHandler errorHandler)
throws IOException, SAXException {
CookieHandler.setDefault(
new CookieManager(null, CookiePolicy.ACCEPT_ALL));
validator.reset();
httpRes = new PrudentHttpEntityResolver(-1, true, errorHandler);
if (this.allowCss) {
httpRes.setAllowCss(true);
}
httpRes.setAllowHtml(true);
httpRes.setUserAgent(userAgent);
try {
documentInput = (TypedInputSource) httpRes.resolveEntity(null,
document);
String contentType = documentInput.getType();
documentInput.setSystemId(document);
for (String param : contentType.replace(" ", "").split(";")) {
if (param.startsWith("charset=")) {
documentInput.setEncoding(param.split("=", 2)[1]);
break;
}
}
if (documentInput.getType().startsWith("text/css")) {
checkAsCss(documentInput);
} else if (documentInput.getType().startsWith("text/html")) {
checkAsHTML(documentInput);
} else {
checkAsXML(documentInput);
}
} catch (ResourceNotRetrievableException e) {
}
} | class class_name[name] begin[{]
method[checkHttpURL, return_type[void], modifier[public], parameter[document, userAgent, errorHandler]] begin[{]
call[CookieHandler.setDefault, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=ACCEPT_ALL, postfix_operators=[], prefix_operators=[], qualifier=CookiePolicy, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CookieManager, sub_type=None))]]
call[validator.reset, parameter[]]
assign[member[.httpRes], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=errorHandler, 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=PrudentHttpEntityResolver, sub_type=None))]
if[THIS[member[None.allowCss]]] begin[{]
call[httpRes.setAllowCss, parameter[literal[true]]]
else begin[{]
None
end[}]
call[httpRes.setAllowHtml, parameter[literal[true]]]
call[httpRes.setUserAgent, parameter[member[.userAgent]]]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=documentInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveEntity, postfix_operators=[], prefix_operators=[], qualifier=httpRes, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TypedInputSource, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=documentInput, selectors=[], type_arguments=None), name=contentType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSystemId, postfix_operators=[], prefix_operators=[], qualifier=documentInput, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="charset=")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="="), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=split, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], type_arguments=None)], member=setEncoding, postfix_operators=[], prefix_operators=[], qualifier=documentInput, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=contentType, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=documentInput, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="text/css")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=documentInput, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="text/html")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkAsXML, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkAsHTML, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=documentInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkAsCss, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ResourceNotRetrievableException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[checkHttpURL] operator[SEP] identifier[String] identifier[document] , identifier[String] identifier[userAgent] , identifier[ErrorHandler] identifier[errorHandler] operator[SEP] Keyword[throws] identifier[IOException] , identifier[SAXException] {
identifier[CookieHandler] operator[SEP] identifier[setDefault] operator[SEP] Keyword[new] identifier[CookieManager] operator[SEP] Other[null] , identifier[CookiePolicy] operator[SEP] identifier[ACCEPT_ALL] operator[SEP] operator[SEP] operator[SEP] identifier[validator] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[httpRes] operator[=] Keyword[new] identifier[PrudentHttpEntityResolver] operator[SEP] operator[-] Other[1] , literal[boolean] , identifier[errorHandler] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[allowCss] operator[SEP] {
identifier[httpRes] operator[SEP] identifier[setAllowCss] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[httpRes] operator[SEP] identifier[setAllowHtml] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[httpRes] operator[SEP] identifier[setUserAgent] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] Keyword[try] {
identifier[documentInput] operator[=] operator[SEP] identifier[TypedInputSource] operator[SEP] identifier[httpRes] operator[SEP] identifier[resolveEntity] operator[SEP] Other[null] , identifier[document] operator[SEP] operator[SEP] identifier[String] identifier[contentType] operator[=] identifier[documentInput] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[documentInput] operator[SEP] identifier[setSystemId] operator[SEP] identifier[document] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[param] operator[:] identifier[contentType] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[param] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[documentInput] operator[SEP] identifier[setEncoding] operator[SEP] identifier[param] operator[SEP] identifier[split] operator[SEP] literal[String] , Other[2] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[documentInput] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[checkAsCss] operator[SEP] identifier[documentInput] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[documentInput] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[checkAsHTML] operator[SEP] identifier[documentInput] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[checkAsXML] operator[SEP] identifier[documentInput] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[ResourceNotRetrievableException] identifier[e] operator[SEP] {
}
}
|
public static Class<?> getBoxingClass(Type t) throws BugError
{
Type boxingClass = BOXING_MAP.get(t);
if(boxingClass == null) {
if(!BOXING_MAP.values().contains(t)) {
throw new BugError("Trying to get boxing class from not boxed type.");
}
boxingClass = t;
}
return (Class<?>)boxingClass;
} | class class_name[name] begin[{]
method[getBoxingClass, return_type[type[Class]], modifier[public static], parameter[t]] begin[{]
local_variable[type[Type], boxingClass]
if[binary_operation[member[.boxingClass], ==, literal[null]]] begin[{]
if[call[BOXING_MAP.values, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trying to get boxing class from not boxed type.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BugError, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.boxingClass], member[.t]]
else begin[{]
None
end[}]
return[Cast(expression=MemberReference(member=boxingClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[getBoxingClass] operator[SEP] identifier[Type] identifier[t] operator[SEP] Keyword[throws] identifier[BugError] {
identifier[Type] identifier[boxingClass] operator[=] identifier[BOXING_MAP] operator[SEP] identifier[get] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[boxingClass] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[BOXING_MAP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[t] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BugError] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[boxingClass] operator[=] identifier[t] operator[SEP]
}
Keyword[return] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[boxingClass] operator[SEP]
}
|
protected void skipInternalSubset()
throws XMLStreamException
{
while (true) {
int i = getNextAfterWS();
if (i < 0) {
// Error for internal subset
throwUnexpectedEOF(SUFFIX_IN_DTD_INTERNAL);
}
if (i == '%') { // parameter entity
skipPE();
continue;
}
if (i == '<') {
/* Let's determine type here, and call appropriate skip
* methods.
*/
char c = getNextSkippingPEs();
if (c == '?') { // xml decl?
/* Not sure if PIs are really allowed in DTDs, but let's
* just allow them until proven otherwise. XML declaration
* is legal in the beginning, anyhow
*/
skipPI();
} else if (c == '!') { // ignore/include, comment, declaration?
c = getNextSkippingPEs();
if (c == '[') {
/* Shouldn't really get these, as they are not allowed
* in the internal subset? So let's just leave it
* as is, and see what happens. :-)
*/
;
} else if (c == '-') { // plain comment
skipComment();
} else if (c >= 'A' && c <= 'Z') {
skipDeclaration(c);
} else {
/* Hmmh, let's not care too much; but we need to try
* to match the closing gt-char nonetheless?
*/
skipDeclaration(c);
}
} else {
/* Shouldn't fail (since we are to completely ignore
* subset); let's just push it back and continue.
*/
--mInputPtr;
}
continue;
}
if (i == ']') {
// Int. subset has no conditional sections, has to be the end...
/* 18-Jul-2004, TSa: Let's just make sure it happened
* in the main input source, not at external entity...
*/
if (mInput != mRootInput) {
throwParseError("Encountered int. subset end marker ']]>' in an expanded entity; has to be at main level.");
}
// End of internal subset
break;
}
throwUnexpectedChar(i, SUFFIX_IN_DTD_INTERNAL+"; expected a '<' to start a directive, or \"]>\" to end internal subset.");
}
} | class class_name[name] begin[{]
method[skipInternalSubset, return_type[void], modifier[protected], parameter[]] begin[{]
while[literal[true]] begin[{]
local_variable[type[int], i]
if[binary_operation[member[.i], <, literal[0]]] begin[{]
call[.throwUnexpectedEOF, parameter[member[.SUFFIX_IN_DTD_INTERNAL]]]
else begin[{]
None
end[}]
if[binary_operation[member[.i], ==, literal['%']]] begin[{]
call[.skipPE, parameter[]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.i], ==, literal['<']]] begin[{]
local_variable[type[char], c]
if[binary_operation[member[.c], ==, literal['?']]] begin[{]
call[.skipPI, parameter[]]
else begin[{]
if[binary_operation[member[.c], ==, literal['!']]] begin[{]
assign[member[.c], call[.getNextSkippingPEs, parameter[]]]
if[binary_operation[member[.c], ==, literal['[']]] begin[{]
Statement(label=None)
else begin[{]
if[binary_operation[member[.c], ==, literal['-']]] begin[{]
call[.skipComment, parameter[]]
else begin[{]
if[binary_operation[binary_operation[member[.c], >=, literal['A']], &&, binary_operation[member[.c], <=, literal['Z']]]] begin[{]
call[.skipDeclaration, parameter[member[.c]]]
else begin[{]
call[.skipDeclaration, parameter[member[.c]]]
end[}]
end[}]
end[}]
else begin[{]
member[.mInputPtr]
end[}]
end[}]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.i], ==, literal[']']]] begin[{]
if[binary_operation[member[.mInput], !=, member[.mRootInput]]] begin[{]
call[.throwParseError, parameter[literal["Encountered int. subset end marker ']]>' in an expanded entity; has to be at main level."]]]
else begin[{]
None
end[}]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[.throwUnexpectedChar, parameter[member[.i], binary_operation[member[.SUFFIX_IN_DTD_INTERNAL], +, literal["; expected a '<' to start a directive, or \"]>\" to end internal subset."]]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[skipInternalSubset] operator[SEP] operator[SEP] Keyword[throws] identifier[XMLStreamException] {
Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[int] identifier[i] operator[=] identifier[getNextAfterWS] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] Other[0] operator[SEP] {
identifier[throwUnexpectedEOF] operator[SEP] identifier[SUFFIX_IN_DTD_INTERNAL] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[i] operator[==] literal[String] operator[SEP] {
identifier[skipPE] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[i] operator[==] literal[String] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[getNextSkippingPEs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[skipPI] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[c] operator[=] identifier[getNextSkippingPEs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[skipComment] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] {
identifier[skipDeclaration] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[skipDeclaration] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
Keyword[else] {
operator[--] identifier[mInputPtr] operator[SEP]
}
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[i] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[mInput] operator[!=] identifier[mRootInput] operator[SEP] {
identifier[throwParseError] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
identifier[throwUnexpectedChar] operator[SEP] identifier[i] , identifier[SUFFIX_IN_DTD_INTERNAL] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
public KNXNetworkLink newLink(final TSupplier<? extends KNXNetworkLink> creator)
throws KNXException, InterruptedException
{
return new Link<KNXNetworkLink>(creator, this);
} | class class_name[name] begin[{]
method[newLink, return_type[type[KNXNetworkLink]], modifier[public], parameter[creator]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=creator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=KNXNetworkLink, sub_type=None))], dimensions=None, name=Link, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[KNXNetworkLink] identifier[newLink] operator[SEP] Keyword[final] identifier[TSupplier] operator[<] operator[?] Keyword[extends] identifier[KNXNetworkLink] operator[>] identifier[creator] operator[SEP] Keyword[throws] identifier[KNXException] , identifier[InterruptedException] {
Keyword[return] Keyword[new] identifier[Link] operator[<] identifier[KNXNetworkLink] operator[>] operator[SEP] identifier[creator] , Keyword[this] operator[SEP] operator[SEP]
}
|
public Observable<Page<OpenShiftManagedClusterInner>> listByResourceGroupAsync(final String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
.map(new Func1<ServiceResponse<Page<OpenShiftManagedClusterInner>>, Page<OpenShiftManagedClusterInner>>() {
@Override
public Page<OpenShiftManagedClusterInner> call(ServiceResponse<Page<OpenShiftManagedClusterInner>> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[listByResourceGroupAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName]] begin[{]
return[call[.listByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] operator[>] operator[>] identifier[listByResourceGroupAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] operator[SEP] {
Keyword[return] identifier[listByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] 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 Map<String, String> getKeywordMap(ApplicationContext context) {
Map<String, String> keywordToBeanMap = new HashMap<String, String>();
// Retrieve beans implementing the Keyword interface.
String[] beanNames = context.getBeanNamesForType(Keyword.class);
for (String beanName : beanNames) {
Object bean = context.getBean(beanName);
// Retrieve keyword information
KeywordInfo keywordInfo = AnnotationUtils.findAnnotation(bean.getClass(), KeywordInfo.class);
// Set keyword name as specified in the keyword info, or if information is not available, use bean name.
String keywordName = keywordInfo != null ? keywordInfo.name() : beanName;
if (keywordToBeanMap.put(keywordName, beanName) != null) {
// If map already contains the keyword name, throw an exception. Keywords should be unique.
throw new RuntimeException("Multiple definitions for keyword '" + keywordName + "' exists.");
}
}
return keywordToBeanMap;
} | class class_name[name] begin[{]
method[getKeywordMap, return_type[type[Map]], modifier[public static], parameter[context]] begin[{]
local_variable[type[Map], keywordToBeanMap]
local_variable[type[String], beanNames]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=beanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBean, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), name=bean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=bean, selectors=[], type_arguments=None), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KeywordInfo, sub_type=None))], member=findAnnotation, postfix_operators=[], prefix_operators=[], qualifier=AnnotationUtils, selectors=[], type_arguments=None), name=keywordInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeywordInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=keywordInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=beanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=keywordInfo, selectors=[], type_arguments=None)), name=keywordName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=keywordName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=beanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=keywordToBeanMap, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Multiple definitions for keyword '"), operandr=MemberReference(member=keywordName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' exists."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=beanNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=beanName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.keywordToBeanMap]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getKeywordMap] operator[SEP] identifier[ApplicationContext] identifier[context] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[keywordToBeanMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[beanNames] operator[=] identifier[context] operator[SEP] identifier[getBeanNamesForType] operator[SEP] identifier[Keyword] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[beanName] operator[:] identifier[beanNames] operator[SEP] {
identifier[Object] identifier[bean] operator[=] identifier[context] operator[SEP] identifier[getBean] operator[SEP] identifier[beanName] operator[SEP] operator[SEP] identifier[KeywordInfo] identifier[keywordInfo] operator[=] identifier[AnnotationUtils] operator[SEP] identifier[findAnnotation] operator[SEP] identifier[bean] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[KeywordInfo] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[String] identifier[keywordName] operator[=] identifier[keywordInfo] operator[!=] Other[null] operator[?] identifier[keywordInfo] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[:] identifier[beanName] operator[SEP] Keyword[if] operator[SEP] identifier[keywordToBeanMap] operator[SEP] identifier[put] operator[SEP] identifier[keywordName] , identifier[beanName] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[keywordName] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[keywordToBeanMap] operator[SEP]
}
|
private ContainerCreateConfig add(String name, String value) {
if (value != null) {
createConfig.addProperty(name, value);
}
return this;
} | class class_name[name] begin[{]
method[add, return_type[type[ContainerCreateConfig]], modifier[private], parameter[name, value]] begin[{]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
call[createConfig.addProperty, parameter[member[.name], member[.value]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[private] identifier[ContainerCreateConfig] identifier[add] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[createConfig] operator[SEP] identifier[addProperty] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static RoboconfCompletionProposal basicProposal( String s, String lastWord, boolean trim ) {
return new RoboconfCompletionProposal( s, trim ? s.trim() : s, null, lastWord.length());
} | class class_name[name] begin[{]
method[basicProposal, return_type[type[RoboconfCompletionProposal]], modifier[public static], parameter[s, lastWord, trim]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MemberReference(member=trim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=lastWord, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RoboconfCompletionProposal, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[RoboconfCompletionProposal] identifier[basicProposal] operator[SEP] identifier[String] identifier[s] , identifier[String] identifier[lastWord] , Keyword[boolean] identifier[trim] operator[SEP] {
Keyword[return] Keyword[new] identifier[RoboconfCompletionProposal] operator[SEP] identifier[s] , identifier[trim] operator[?] identifier[s] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[:] identifier[s] , Other[null] , identifier[lastWord] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public List<FogbugzEvent> getEventsForCase(int id) {
try {
HashMap<String, String> params = new HashMap<String, String>(); // Hashmap defaults to <String, String>
params.put("cmd", "search");
params.put("q", Integer.toString(id));
params.put("cols", "events");
Document doc = this.getFogbugzDocument(params);
List<FogbugzEvent> eventList = new ArrayList<FogbugzEvent>();
NodeList eventsNodeList = doc.getElementsByTagName("event");
if (eventsNodeList != null && eventsNodeList.getLength() != 0) {
for (int i = 0; i < eventsNodeList.getLength(); i++) {
Element currentNode = (Element) eventsNodeList.item(i);
// Construct event object from retrieved data.
eventList.add(new FogbugzEvent(
Integer.parseInt(currentNode.getElementsByTagName("ixBugEvent").item(0).getTextContent()), // eventid
id, // caseid
currentNode.getElementsByTagName("sVerb").item(0).getTextContent(), // verb
Integer.parseInt(currentNode.getElementsByTagName("ixPerson").item(0).getTextContent()), // person
Integer.parseInt(currentNode.getElementsByTagName("ixPersonAssignedTo").item(0).getTextContent()), // personAssignedTo
DatatypeConverter.parseDateTime(currentNode.getElementsByTagName("dt").item(0).getTextContent()).getTime(), // dateTime
currentNode.getElementsByTagName("evtDescription").item(0).getTextContent(), // evtDescription
currentNode.getElementsByTagName("sPerson").item(0).getTextContent() // sPerson
));
}
}
return eventList;
} catch (Exception e) {
FogbugzManager.log.log(Level.SEVERE, "Exception while fetching case " + Integer.toString(id), e);
}
return null;
} | class class_name[name] begin[{]
method[getEventsForCase, return_type[type[List]], modifier[public], parameter[id]] 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), name=params)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashMap, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cmd"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="search")], member=put, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="q"), MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cols"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="events")], member=put, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFogbugzDocument, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=doc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Document, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FogbugzEvent, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=eventList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FogbugzEvent, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="event")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=doc, selectors=[], type_arguments=None), name=eventsNodeList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=eventsNodeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=eventsNodeList, 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=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=eventsNodeList, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=currentNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ixBugEvent")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=currentNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sVerb")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=currentNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ixPerson")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=currentNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ixPersonAssignedTo")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=currentNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dt")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=currentNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseDateTime, postfix_operators=[], prefix_operators=[], qualifier=DatatypeConverter, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="evtDescription")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=currentNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sPerson")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=currentNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FogbugzEvent, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=eventList, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=eventsNodeList, 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=MemberReference(member=eventList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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 while fetching case "), operandr=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=FogbugzManager.log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[FogbugzEvent] operator[>] identifier[getEventsForCase] operator[SEP] Keyword[int] identifier[id] operator[SEP] {
Keyword[try] {
identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Document] identifier[doc] operator[=] Keyword[this] operator[SEP] identifier[getFogbugzDocument] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[FogbugzEvent] operator[>] identifier[eventList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[FogbugzEvent] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[eventsNodeList] operator[=] identifier[doc] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eventsNodeList] operator[!=] Other[null] operator[&&] identifier[eventsNodeList] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[eventsNodeList] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Element] identifier[currentNode] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[eventsNodeList] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[eventList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[FogbugzEvent] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[currentNode] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] , identifier[id] , identifier[currentNode] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] , identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[currentNode] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] , identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[currentNode] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] , identifier[DatatypeConverter] operator[SEP] identifier[parseDateTime] operator[SEP] identifier[currentNode] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] , identifier[currentNode] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] , identifier[currentNode] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[eventList] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[FogbugzManager] operator[SEP] identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[id] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void renderFrame(int frameNumber, Bitmap bitmap) {
Canvas canvas = new Canvas(bitmap);
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC);
// If blending is required, prepare the canvas with the nearest cached frame.
int nextIndex;
if (!isKeyFrame(frameNumber)) {
// Blending is required. nextIndex points to the next index to render onto the canvas.
nextIndex = prepareCanvasWithClosestCachedFrame(frameNumber - 1, canvas);
} else {
// Blending isn't required. Start at the frame we're trying to render.
nextIndex = frameNumber;
}
// Iterate from nextIndex to the frame number just preceding the one we're trying to render
// and composite them in order according to the Disposal Method.
for (int index = nextIndex; index < frameNumber; index++) {
AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(index);
DisposalMethod disposalMethod = frameInfo.disposalMethod;
if (disposalMethod == DisposalMethod.DISPOSE_TO_PREVIOUS) {
continue;
}
if (frameInfo.blendOperation == BlendOperation.NO_BLEND) {
disposeToBackground(canvas, frameInfo);
}
mAnimatedDrawableBackend.renderFrame(index, canvas);
mCallback.onIntermediateResult(index, bitmap);
if (disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND) {
disposeToBackground(canvas, frameInfo);
}
}
AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(frameNumber);
if (frameInfo.blendOperation == BlendOperation.NO_BLEND) {
disposeToBackground(canvas, frameInfo);
}
// Finally, we render the current frame. We don't dispose it.
mAnimatedDrawableBackend.renderFrame(frameNumber, canvas);
} | class class_name[name] begin[{]
method[renderFrame, return_type[void], modifier[public], parameter[frameNumber, bitmap]] begin[{]
local_variable[type[Canvas], canvas]
call[canvas.drawColor, parameter[member[Color.TRANSPARENT], member[PorterDuff.Mode.SRC]]]
local_variable[type[int], nextIndex]
if[call[.isKeyFrame, parameter[member[.frameNumber]]]] begin[{]
assign[member[.nextIndex], call[.prepareCanvasWithClosestCachedFrame, parameter[binary_operation[member[.frameNumber], -, literal[1]], member[.canvas]]]]
else begin[{]
assign[member[.nextIndex], member[.frameNumber]]
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFrameInfo, postfix_operators=[], prefix_operators=[], qualifier=mAnimatedDrawableBackend, selectors=[], type_arguments=None), name=frameInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnimatedDrawableFrameInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=disposalMethod, postfix_operators=[], prefix_operators=[], qualifier=frameInfo, selectors=[]), name=disposalMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DisposalMethod, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=disposalMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DISPOSE_TO_PREVIOUS, postfix_operators=[], prefix_operators=[], qualifier=DisposalMethod, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=blendOperation, postfix_operators=[], prefix_operators=[], qualifier=frameInfo, selectors=[]), operandr=MemberReference(member=NO_BLEND, postfix_operators=[], prefix_operators=[], qualifier=BlendOperation, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=canvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=frameInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=disposeToBackground, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=canvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=renderFrame, postfix_operators=[], prefix_operators=[], qualifier=mAnimatedDrawableBackend, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bitmap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onIntermediateResult, postfix_operators=[], prefix_operators=[], qualifier=mCallback, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=disposalMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DISPOSE_TO_BACKGROUND, postfix_operators=[], prefix_operators=[], qualifier=DisposalMethod, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=canvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=frameInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=disposeToBackground, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=frameNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=nextIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[AnimatedDrawableFrameInfo], frameInfo]
if[binary_operation[member[frameInfo.blendOperation], ==, member[BlendOperation.NO_BLEND]]] begin[{]
call[.disposeToBackground, parameter[member[.canvas], member[.frameInfo]]]
else begin[{]
None
end[}]
call[mAnimatedDrawableBackend.renderFrame, parameter[member[.frameNumber], member[.canvas]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[renderFrame] operator[SEP] Keyword[int] identifier[frameNumber] , identifier[Bitmap] identifier[bitmap] operator[SEP] {
identifier[Canvas] identifier[canvas] operator[=] Keyword[new] identifier[Canvas] operator[SEP] identifier[bitmap] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[drawColor] operator[SEP] identifier[Color] operator[SEP] identifier[TRANSPARENT] , identifier[PorterDuff] operator[SEP] identifier[Mode] operator[SEP] identifier[SRC] operator[SEP] operator[SEP] Keyword[int] identifier[nextIndex] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isKeyFrame] operator[SEP] identifier[frameNumber] operator[SEP] operator[SEP] {
identifier[nextIndex] operator[=] identifier[prepareCanvasWithClosestCachedFrame] operator[SEP] identifier[frameNumber] operator[-] Other[1] , identifier[canvas] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[nextIndex] operator[=] identifier[frameNumber] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[nextIndex] operator[SEP] identifier[index] operator[<] identifier[frameNumber] operator[SEP] identifier[index] operator[++] operator[SEP] {
identifier[AnimatedDrawableFrameInfo] identifier[frameInfo] operator[=] identifier[mAnimatedDrawableBackend] operator[SEP] identifier[getFrameInfo] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[DisposalMethod] identifier[disposalMethod] operator[=] identifier[frameInfo] operator[SEP] identifier[disposalMethod] operator[SEP] Keyword[if] operator[SEP] identifier[disposalMethod] operator[==] identifier[DisposalMethod] operator[SEP] identifier[DISPOSE_TO_PREVIOUS] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[frameInfo] operator[SEP] identifier[blendOperation] operator[==] identifier[BlendOperation] operator[SEP] identifier[NO_BLEND] operator[SEP] {
identifier[disposeToBackground] operator[SEP] identifier[canvas] , identifier[frameInfo] operator[SEP] operator[SEP]
}
identifier[mAnimatedDrawableBackend] operator[SEP] identifier[renderFrame] operator[SEP] identifier[index] , identifier[canvas] operator[SEP] operator[SEP] identifier[mCallback] operator[SEP] identifier[onIntermediateResult] operator[SEP] identifier[index] , identifier[bitmap] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[disposalMethod] operator[==] identifier[DisposalMethod] operator[SEP] identifier[DISPOSE_TO_BACKGROUND] operator[SEP] {
identifier[disposeToBackground] operator[SEP] identifier[canvas] , identifier[frameInfo] operator[SEP] operator[SEP]
}
}
identifier[AnimatedDrawableFrameInfo] identifier[frameInfo] operator[=] identifier[mAnimatedDrawableBackend] operator[SEP] identifier[getFrameInfo] operator[SEP] identifier[frameNumber] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[frameInfo] operator[SEP] identifier[blendOperation] operator[==] identifier[BlendOperation] operator[SEP] identifier[NO_BLEND] operator[SEP] {
identifier[disposeToBackground] operator[SEP] identifier[canvas] , identifier[frameInfo] operator[SEP] operator[SEP]
}
identifier[mAnimatedDrawableBackend] operator[SEP] identifier[renderFrame] operator[SEP] identifier[frameNumber] , identifier[canvas] operator[SEP] operator[SEP]
}
|
public static void addColTimes(DenseDoubleMatrix2D matrix, long diag, long fromRow, long col,
double factor) {
long rows = matrix.getRowCount();
for (long row = fromRow; row < rows; row++) {
matrix.setDouble(matrix.getDouble(row, col) - factor * matrix.getDouble(row, diag),
row, col);
}
} | class class_name[name] begin[{]
method[addColTimes, return_type[void], modifier[public static], parameter[matrix, diag, fromRow, col, factor]] begin[{]
local_variable[type[long], rows]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=factor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=diag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[], type_arguments=None), operator=*), operator=-), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDouble, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=fromRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=long)), update=[MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[addColTimes] operator[SEP] identifier[DenseDoubleMatrix2D] identifier[matrix] , Keyword[long] identifier[diag] , Keyword[long] identifier[fromRow] , Keyword[long] identifier[col] , Keyword[double] identifier[factor] operator[SEP] {
Keyword[long] identifier[rows] operator[=] identifier[matrix] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[long] identifier[row] operator[=] identifier[fromRow] operator[SEP] identifier[row] operator[<] identifier[rows] operator[SEP] identifier[row] operator[++] operator[SEP] {
identifier[matrix] operator[SEP] identifier[setDouble] operator[SEP] identifier[matrix] operator[SEP] identifier[getDouble] operator[SEP] identifier[row] , identifier[col] operator[SEP] operator[-] identifier[factor] operator[*] identifier[matrix] operator[SEP] identifier[getDouble] operator[SEP] identifier[row] , identifier[diag] operator[SEP] , identifier[row] , identifier[col] operator[SEP] operator[SEP]
}
}
|
public static <T extends CharSequence> Collection<T> removeBlank(Collection<T> collection) {
return filter(collection, new Filter<T>() {
@Override
public boolean accept(T t) {
return false == StrUtil.isBlank(t);
}
});
} | class class_name[name] begin[{]
method[removeBlank, return_type[type[Collection]], modifier[public static], parameter[collection]] begin[{]
return[call[.filter, parameter[member[.collection], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operandr=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StrUtil, selectors=[], type_arguments=None), operator===), label=None)], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), 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=T, sub_type=None))], dimensions=None, name=Filter, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[CharSequence] operator[>] identifier[Collection] operator[<] identifier[T] operator[>] identifier[removeBlank] operator[SEP] identifier[Collection] operator[<] identifier[T] operator[>] identifier[collection] operator[SEP] {
Keyword[return] identifier[filter] operator[SEP] identifier[collection] , Keyword[new] identifier[Filter] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[T] identifier[t] operator[SEP] {
Keyword[return] literal[boolean] operator[==] identifier[StrUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@Override
public void remove( final Session session ) {
remove( session, session.getNote( MemcachedSessionService.NODE_FAILURE ) != Boolean.TRUE );
} | class class_name[name] begin[{]
method[remove, return_type[void], modifier[public], parameter[session]] begin[{]
call[.remove, parameter[member[.session], binary_operation[call[session.getNote, parameter[member[MemcachedSessionService.NODE_FAILURE]]], !=, member[Boolean.TRUE]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[remove] operator[SEP] Keyword[final] identifier[Session] identifier[session] operator[SEP] {
identifier[remove] operator[SEP] identifier[session] , identifier[session] operator[SEP] identifier[getNote] operator[SEP] identifier[MemcachedSessionService] operator[SEP] identifier[NODE_FAILURE] operator[SEP] operator[!=] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP]
}
|
public BaseTile getFringeTile (MisoSceneModel scene, int col, int row,
Map<FringeTile, WeakReference<FringeTile>> fringes, Map<Long, BufferedImage> masks)
{
// get the tileset id of the base tile we are considering
int underset = adjustTileSetId(scene.getBaseTileId(col, row) >> 16);
// start with a clean temporary fringer map
_fringers.clear();
boolean passable = true;
// walk through our influence tiles
for (int y = row - 1, maxy = row + 2; y < maxy; y++) {
for (int x = col - 1, maxx = col + 2; x < maxx; x++) {
// we sensibly do not consider ourselves
if ((x == col) && (y == row)) {
continue;
}
// determine the tileset for this tile
int btid = scene.getBaseTileId(x, y);
int baseset = adjustTileSetId((btid <= 0) ?
scene.getDefaultBaseTileSet() : (btid >> 16));
// determine if it fringes on our tile
int pri = _fringeconf.fringesOn(baseset, underset);
if (pri == -1) {
continue;
}
FringerRec fringer = (FringerRec)_fringers.get(baseset);
if (fringer == null) {
fringer = new FringerRec(baseset, pri);
_fringers.put(baseset, fringer);
}
// now turn on the appropriate fringebits
fringer.bits |= FLAGMATRIX[y - row + 1][x - col + 1];
// See if a tile that fringes on us kills our passability,
// but don't count the default base tile against us, as
// we allow users to splash in the water.
if (passable && (btid > 0)) {
try {
BaseTile bt = (BaseTile)_tmgr.getTile(btid);
passable = bt.isPassable();
} catch (NoSuchTileSetException nstse) {
log.warning("Autofringer couldn't find a base set while attempting to " +
"figure passability", nstse);
}
}
}
}
// if nothing fringed, we're done
int numfringers = _fringers.size();
if (numfringers == 0) {
return null;
}
// otherwise compose a FringeTile from the specified fringes
FringerRec[] frecs = new FringerRec[numfringers];
for (int ii = 0, pp = 0; ii < 16; ii++) {
FringerRec rec = (FringerRec)_fringers.getValue(ii);
if (rec != null) {
frecs[pp++] = rec;
}
}
return composeFringeTile(frecs, fringes, TileUtil.getTileHash(col, row), passable, masks);
} | class class_name[name] begin[{]
method[getFringeTile, return_type[type[BaseTile]], modifier[public], parameter[scene, col, row, fringes, masks]] begin[{]
local_variable[type[int], underset]
call[_fringers.clear, parameter[]]
local_variable[type[boolean], passable]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBaseTileId, postfix_operators=[], prefix_operators=[], qualifier=scene, selectors=[], type_arguments=None), name=btid)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=btid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), if_false=BinaryOperation(operandl=MemberReference(member=btid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), if_true=MethodInvocation(arguments=[], member=getDefaultBaseTileSet, postfix_operators=[], prefix_operators=[], qualifier=scene, selectors=[], type_arguments=None))], member=adjustTileSetId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=baseset)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=baseset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=underset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fringesOn, postfix_operators=[], prefix_operators=[], qualifier=_fringeconf, selectors=[], type_arguments=None), name=pri)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pri, 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=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=baseset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_fringers, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FringerRec, sub_type=None)), name=fringer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FringerRec, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fringer, 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=fringer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=baseset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pri, 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=FringerRec, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=baseset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fringer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=_fringers, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bits, postfix_operators=[], prefix_operators=[], qualifier=fringer, selectors=[]), type=|=, value=MemberReference(member=FLAGMATRIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=passable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=btid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=btid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTile, postfix_operators=[], prefix_operators=[], qualifier=_tmgr, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BaseTile, sub_type=None)), name=bt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BaseTile, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=passable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=isPassable, postfix_operators=[], prefix_operators=[], qualifier=bt, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Autofringer couldn't find a base set while attempting to "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="figure passability"), operator=+), MemberReference(member=nstse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warning, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nstse, types=['NoSuchTileSetException']))], finally_block=None, label=None, resources=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=x), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), name=maxx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=y), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), name=maxy)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[int], numfringers]
if[binary_operation[member[.numfringers], ==, literal[0]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[FringerRec], frecs]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=_fringers, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FringerRec, sub_type=None)), name=rec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FringerRec, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rec, 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=frecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pp, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=rec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ii), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=pp)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[.composeFringeTile, parameter[member[.frecs], member[.fringes], call[TileUtil.getTileHash, parameter[member[.col], member[.row]]], member[.passable], member[.masks]]]]
end[}]
END[}] | Keyword[public] identifier[BaseTile] identifier[getFringeTile] operator[SEP] identifier[MisoSceneModel] identifier[scene] , Keyword[int] identifier[col] , Keyword[int] identifier[row] , identifier[Map] operator[<] identifier[FringeTile] , identifier[WeakReference] operator[<] identifier[FringeTile] operator[>] operator[>] identifier[fringes] , identifier[Map] operator[<] identifier[Long] , identifier[BufferedImage] operator[>] identifier[masks] operator[SEP] {
Keyword[int] identifier[underset] operator[=] identifier[adjustTileSetId] operator[SEP] identifier[scene] operator[SEP] identifier[getBaseTileId] operator[SEP] identifier[col] , identifier[row] operator[SEP] operator[>] operator[>] Other[16] operator[SEP] operator[SEP] identifier[_fringers] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[passable] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[row] operator[-] Other[1] , identifier[maxy] operator[=] identifier[row] operator[+] Other[2] operator[SEP] identifier[y] operator[<] identifier[maxy] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] identifier[col] operator[-] Other[1] , identifier[maxx] operator[=] identifier[col] operator[+] Other[2] operator[SEP] identifier[x] operator[<] identifier[maxx] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[x] operator[==] identifier[col] operator[SEP] operator[&&] operator[SEP] identifier[y] operator[==] identifier[row] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[int] identifier[btid] operator[=] identifier[scene] operator[SEP] identifier[getBaseTileId] operator[SEP] identifier[x] , identifier[y] operator[SEP] operator[SEP] Keyword[int] identifier[baseset] operator[=] identifier[adjustTileSetId] operator[SEP] operator[SEP] identifier[btid] operator[<=] Other[0] operator[SEP] operator[?] identifier[scene] operator[SEP] identifier[getDefaultBaseTileSet] operator[SEP] operator[SEP] operator[:] operator[SEP] identifier[btid] operator[>] operator[>] Other[16] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pri] operator[=] identifier[_fringeconf] operator[SEP] identifier[fringesOn] operator[SEP] identifier[baseset] , identifier[underset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pri] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[FringerRec] identifier[fringer] operator[=] operator[SEP] identifier[FringerRec] operator[SEP] identifier[_fringers] operator[SEP] identifier[get] operator[SEP] identifier[baseset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fringer] operator[==] Other[null] operator[SEP] {
identifier[fringer] operator[=] Keyword[new] identifier[FringerRec] operator[SEP] identifier[baseset] , identifier[pri] operator[SEP] operator[SEP] identifier[_fringers] operator[SEP] identifier[put] operator[SEP] identifier[baseset] , identifier[fringer] operator[SEP] operator[SEP]
}
identifier[fringer] operator[SEP] identifier[bits] operator[|=] identifier[FLAGMATRIX] operator[SEP] identifier[y] operator[-] identifier[row] operator[+] Other[1] operator[SEP] operator[SEP] identifier[x] operator[-] identifier[col] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[passable] operator[&&] operator[SEP] identifier[btid] operator[>] Other[0] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[BaseTile] identifier[bt] operator[=] operator[SEP] identifier[BaseTile] operator[SEP] identifier[_tmgr] operator[SEP] identifier[getTile] operator[SEP] identifier[btid] operator[SEP] operator[SEP] identifier[passable] operator[=] identifier[bt] operator[SEP] identifier[isPassable] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchTileSetException] identifier[nstse] operator[SEP] {
identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[+] literal[String] , identifier[nstse] operator[SEP] operator[SEP]
}
}
}
}
Keyword[int] identifier[numfringers] operator[=] identifier[_fringers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numfringers] operator[==] Other[0] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[FringerRec] operator[SEP] operator[SEP] identifier[frecs] operator[=] Keyword[new] identifier[FringerRec] operator[SEP] identifier[numfringers] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] , identifier[pp] operator[=] Other[0] operator[SEP] identifier[ii] operator[<] Other[16] operator[SEP] identifier[ii] operator[++] operator[SEP] {
identifier[FringerRec] identifier[rec] operator[=] operator[SEP] identifier[FringerRec] operator[SEP] identifier[_fringers] operator[SEP] identifier[getValue] operator[SEP] identifier[ii] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rec] operator[!=] Other[null] operator[SEP] {
identifier[frecs] operator[SEP] identifier[pp] operator[++] operator[SEP] operator[=] identifier[rec] operator[SEP]
}
}
Keyword[return] identifier[composeFringeTile] operator[SEP] identifier[frecs] , identifier[fringes] , identifier[TileUtil] operator[SEP] identifier[getTileHash] operator[SEP] identifier[col] , identifier[row] operator[SEP] , identifier[passable] , identifier[masks] operator[SEP] operator[SEP]
}
|
public NotificationChain basicSetArrayType(JvmArrayType newArrayType, NotificationChain msgs)
{
JvmArrayType oldArrayType = arrayType;
arrayType = newArrayType;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TypesPackage.JVM_COMPONENT_TYPE__ARRAY_TYPE, oldArrayType, newArrayType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
} | class class_name[name] begin[{]
method[basicSetArrayType, return_type[type[NotificationChain]], modifier[public], parameter[newArrayType, msgs]] begin[{]
local_variable[type[JvmArrayType], oldArrayType]
assign[member[.arrayType], member[.newArrayType]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
local_variable[type[ENotificationImpl], notification]
if[binary_operation[member[.msgs], ==, literal[null]]] begin[{]
assign[member[.msgs], member[.notification]]
else begin[{]
call[msgs.add, parameter[member[.notification]]]
end[}]
else begin[{]
None
end[}]
return[member[.msgs]]
end[}]
END[}] | Keyword[public] identifier[NotificationChain] identifier[basicSetArrayType] operator[SEP] identifier[JvmArrayType] identifier[newArrayType] , identifier[NotificationChain] identifier[msgs] operator[SEP] {
identifier[JvmArrayType] identifier[oldArrayType] operator[=] identifier[arrayType] operator[SEP] identifier[arrayType] operator[=] identifier[newArrayType] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] {
identifier[ENotificationImpl] identifier[notification] operator[=] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[TypesPackage] operator[SEP] identifier[JVM_COMPONENT_TYPE__ARRAY_TYPE] , identifier[oldArrayType] , identifier[newArrayType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msgs] operator[==] Other[null] operator[SEP] identifier[msgs] operator[=] identifier[notification] operator[SEP] Keyword[else] identifier[msgs] operator[SEP] identifier[add] operator[SEP] identifier[notification] operator[SEP] operator[SEP]
}
Keyword[return] identifier[msgs] operator[SEP]
}
|
public final void reCalc() {
parent.getFormulaEvaluator().clearAllCachedResultValues();
try {
parent.getFormulaEvaluator().evaluateAll();
} catch (Exception ex) {
// skip the formula exception when recalc but log it
LOG.log(Level.SEVERE,
" recalc formula error : " + ex.getLocalizedMessage(),
ex);
}
} | class class_name[name] begin[{]
method[reCalc, return_type[void], modifier[final public], parameter[]] begin[{]
call[parent.getFormulaEvaluator, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getFormulaEvaluator, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[MethodInvocation(arguments=[], member=evaluateAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" recalc formula error : "), operandr=MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), operator=+), MemberReference(member=ex, 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=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[reCalc] operator[SEP] operator[SEP] {
identifier[parent] operator[SEP] identifier[getFormulaEvaluator] operator[SEP] operator[SEP] operator[SEP] identifier[clearAllCachedResultValues] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[parent] operator[SEP] identifier[getFormulaEvaluator] operator[SEP] operator[SEP] operator[SEP] identifier[evaluateAll] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[ex] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP]
}
}
|
public void processingInstruction(String target, String data)
throws org.xml.sax.SAXException
{
// Process any pending starDocument and startElement first.
flushPending();
// Use a fairly nasty hack to tell if the next node is supposed to be
// unescaped text.
if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING))
{
startNonEscaping();
}
else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING))
{
endNonEscaping();
}
else
{
try
{
// clean up any pending things first
if (m_elemContext.m_startTagOpen)
{
closeStartTag();
m_elemContext.m_startTagOpen = false;
}
else if (m_cdataTagOpen)
{
closeCDATA();
}
else if (m_needToCallStartDocument)
{
startDocumentInternal();
}
/*
* Perhaps processing instructions can be written out in HTML before
* the DOCTYPE, in which case this could be emitted with the
* startElement call, that knows the name of the document element
* doing it right.
*/
if (true == m_needToOutputDocTypeDecl)
outputDocTypeDecl("html"); // best guess for the upcoming element
if (shouldIndent())
indent();
final java.io.Writer writer = m_writer;
//writer.write("<?" + target);
writer.write("<?");
writer.write(target);
if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0)))
writer.write(' ');
//writer.write(data + ">"); // different from XML
writer.write(data); // different from XML
writer.write('>'); // different from XML
// Always output a newline char if not inside of an
// element. The whitespace is not significant in that
// case.
if (m_elemContext.m_currentElemDepth <= 0)
outputLineSep();
m_startNewLine = true;
}
catch(IOException e)
{
throw new SAXException(e);
}
}
// now generate the PI event
if (m_tracer != null)
super.fireEscapingEvent(target, data);
} | class class_name[name] begin[{]
method[processingInstruction, return_type[void], modifier[public], parameter[target, data]] begin[{]
call[.flushPending, parameter[]]
if[call[target.equals, parameter[member[Result.PI_DISABLE_OUTPUT_ESCAPING]]]] begin[{]
call[.startNonEscaping, parameter[]]
else begin[{]
if[call[target.equals, parameter[member[Result.PI_ENABLE_OUTPUT_ESCAPING]]]] begin[{]
call[.endNonEscaping, parameter[]]
else begin[{]
TryStatement(block=[IfStatement(condition=MemberReference(member=m_startTagOpen, postfix_operators=[], prefix_operators=[], qualifier=m_elemContext, selectors=[]), else_statement=IfStatement(condition=MemberReference(member=m_cdataTagOpen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=IfStatement(condition=MemberReference(member=m_needToCallStartDocument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=startDocumentInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=closeCDATA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=closeStartTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_startTagOpen, postfix_operators=[], prefix_operators=[], qualifier=m_elemContext, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operandr=MemberReference(member=m_needToOutputDocTypeDecl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="html")], member=outputDocTypeDecl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=shouldIndent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=m_writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=writer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=io, sub_type=ReferenceType(arguments=None, dimensions=None, name=Writer, sub_type=None)))), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<?")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None)], member=isSpaceChar, postfix_operators=[], prefix_operators=['!'], qualifier=Character, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_currentElemDepth, postfix_operators=[], prefix_operators=[], qualifier=m_elemContext, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=outputLineSep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_startNewLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), 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=SAXException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
if[binary_operation[member[.m_tracer], !=, literal[null]]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fireEscapingEvent, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[processingInstruction] operator[SEP] identifier[String] identifier[target] , identifier[String] identifier[data] operator[SEP] Keyword[throws] identifier[org] operator[SEP] identifier[xml] operator[SEP] identifier[sax] operator[SEP] identifier[SAXException] {
identifier[flushPending] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[SEP] identifier[equals] operator[SEP] identifier[Result] operator[SEP] identifier[PI_DISABLE_OUTPUT_ESCAPING] operator[SEP] operator[SEP] {
identifier[startNonEscaping] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[target] operator[SEP] identifier[equals] operator[SEP] identifier[Result] operator[SEP] identifier[PI_ENABLE_OUTPUT_ESCAPING] operator[SEP] operator[SEP] {
identifier[endNonEscaping] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[m_elemContext] operator[SEP] identifier[m_startTagOpen] operator[SEP] {
identifier[closeStartTag] operator[SEP] operator[SEP] operator[SEP] identifier[m_elemContext] operator[SEP] identifier[m_startTagOpen] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[m_cdataTagOpen] operator[SEP] {
identifier[closeCDATA] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[m_needToCallStartDocument] operator[SEP] {
identifier[startDocumentInternal] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[m_needToOutputDocTypeDecl] operator[SEP] identifier[outputDocTypeDecl] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shouldIndent] operator[SEP] operator[SEP] operator[SEP] identifier[indent] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[Writer] identifier[writer] operator[=] identifier[m_writer] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[!] identifier[Character] operator[SEP] identifier[isSpaceChar] operator[SEP] identifier[data] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_elemContext] operator[SEP] identifier[m_currentElemDepth] operator[<=] Other[0] operator[SEP] identifier[outputLineSep] operator[SEP] operator[SEP] operator[SEP] identifier[m_startNewLine] operator[=] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SAXException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[m_tracer] operator[!=] Other[null] operator[SEP] Keyword[super] operator[SEP] identifier[fireEscapingEvent] operator[SEP] identifier[target] , identifier[data] operator[SEP] operator[SEP]
}
|
public void checkDataInnerRules(ValidationData data, Object bodyObj) {
data.getValidationRules().stream().filter(vr -> vr.isUse()).forEach(rule -> {
if (data.isListChild()) {
this.checkPointListChild(data, rule, bodyObj, rule.getStandardValue());
} else {
this.checkPoint(data, rule, bodyObj, rule.getStandardValue());
}
});
} | class class_name[name] begin[{]
method[checkDataInnerRules, return_type[void], modifier[public], parameter[data, bodyObj]] begin[{]
call[data.getValidationRules, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[checkDataInnerRules] operator[SEP] identifier[ValidationData] identifier[data] , identifier[Object] identifier[bodyObj] operator[SEP] {
identifier[data] operator[SEP] identifier[getValidationRules] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[vr] operator[->] identifier[vr] operator[SEP] identifier[isUse] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[rule] operator[->] {
Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[isListChild] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[checkPointListChild] operator[SEP] identifier[data] , identifier[rule] , identifier[bodyObj] , identifier[rule] operator[SEP] identifier[getStandardValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[checkPoint] operator[SEP] identifier[data] , identifier[rule] , identifier[bodyObj] , identifier[rule] operator[SEP] identifier[getStandardValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@Deprecated
@WorkerThread
public static LottieResult<LottieComposition> fromJsonSync(JSONObject json, @Nullable String cacheKey) {
return fromJsonStringSync(json.toString(), cacheKey);
} | class class_name[name] begin[{]
method[fromJsonSync, return_type[type[LottieResult]], modifier[public static], parameter[json, cacheKey]] begin[{]
return[call[.fromJsonStringSync, parameter[call[json.toString, parameter[]], member[.cacheKey]]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] annotation[@] identifier[WorkerThread] Keyword[public] Keyword[static] identifier[LottieResult] operator[<] identifier[LottieComposition] operator[>] identifier[fromJsonSync] operator[SEP] identifier[JSONObject] identifier[json] , annotation[@] identifier[Nullable] identifier[String] identifier[cacheKey] operator[SEP] {
Keyword[return] identifier[fromJsonStringSync] operator[SEP] identifier[json] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[cacheKey] operator[SEP] operator[SEP]
}
|
public final AntlrDatatypeRuleToken ruleQualifiedNameInStaticImport() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
Token kw=null;
AntlrDatatypeRuleToken this_ValidID_0 = null;
enterRule();
try {
// InternalXtype.g:1034:2: ( (this_ValidID_0= ruleValidID kw= '.' )+ )
// InternalXtype.g:1035:2: (this_ValidID_0= ruleValidID kw= '.' )+
{
// InternalXtype.g:1035:2: (this_ValidID_0= ruleValidID kw= '.' )+
int cnt20=0;
loop20:
do {
int alt20=2;
int LA20_0 = input.LA(1);
if ( (LA20_0==RULE_ID) ) {
int LA20_2 = input.LA(2);
if ( (LA20_2==18) ) {
alt20=1;
}
}
switch (alt20) {
case 1 :
// InternalXtype.g:1036:3: this_ValidID_0= ruleValidID kw= '.'
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getQualifiedNameInStaticImportAccess().getValidIDParserRuleCall_0());
}
pushFollow(FOLLOW_17);
this_ValidID_0=ruleValidID();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(this_ValidID_0);
}
if ( state.backtracking==0 ) {
afterParserOrEnumRuleCall();
}
kw=(Token)match(input,18,FOLLOW_23); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getQualifiedNameInStaticImportAccess().getFullStopKeyword_1());
}
}
break;
default :
if ( cnt20 >= 1 ) break loop20;
if (state.backtracking>0) {state.failed=true; return current;}
EarlyExitException eee =
new EarlyExitException(20, input);
throw eee;
}
cnt20++;
} while (true);
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} | class class_name[name] begin[{]
method[ruleQualifiedNameInStaticImport, return_type[type[AntlrDatatypeRuleToken]], modifier[final public], parameter[]] begin[{]
local_variable[type[AntlrDatatypeRuleToken], current]
local_variable[type[Token], kw]
local_variable[type[AntlrDatatypeRuleToken], this_ValidID_0]
call[.enterRule, parameter[]]
TryStatement(block=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=cnt20)], modifiers=set(), type=BasicType(dimensions=[], name=int)), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt20)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA20_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA20_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=RULE_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA20_2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA20_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt20, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]))])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQualifiedNameInStaticImportAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getValidIDParserRuleCall_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_17, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=this_ValidID_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleValidID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=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=this_ValidID_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=merge, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=afterParserOrEnumRuleCall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), 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=18), MemberReference(member=FOLLOW_23, 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=getQualifiedNameInStaticImportAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getFullStopKeyword_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=[], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cnt20, 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=BreakStatement(goto=loop20, 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=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=20), 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=EarlyExitException, sub_type=None)), name=eee)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EarlyExitException, sub_type=None)), ThrowStatement(expression=MemberReference(member=eee, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MemberReference(member=alt20, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=cnt20, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop20)]), 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[ruleQualifiedNameInStaticImport] 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[AntlrDatatypeRuleToken] identifier[this_ValidID_0] operator[=] Other[null] operator[SEP] identifier[enterRule] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
{
Keyword[int] identifier[cnt20] operator[=] Other[0] operator[SEP] identifier[loop20] operator[:] Keyword[do] {
Keyword[int] identifier[alt20] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA20_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA20_0] operator[==] identifier[RULE_ID] operator[SEP] operator[SEP] {
Keyword[int] identifier[LA20_2] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA20_2] operator[==] Other[18] operator[SEP] operator[SEP] {
identifier[alt20] operator[=] Other[1] operator[SEP]
}
}
Keyword[switch] operator[SEP] identifier[alt20] operator[SEP] {
Keyword[case] Other[1] operator[:] {
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getQualifiedNameInStaticImportAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getValidIDParserRuleCall_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pushFollow] operator[SEP] identifier[FOLLOW_17] operator[SEP] operator[SEP] identifier[this_ValidID_0] operator[=] identifier[ruleValidID] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] 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[this_ValidID_0] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[afterParserOrEnumRuleCall] operator[SEP] operator[SEP] operator[SEP]
}
identifier[kw] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , Other[18] , identifier[FOLLOW_23] 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[getQualifiedNameInStaticImportAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getFullStopKeyword_1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[cnt20] operator[>=] Other[1] operator[SEP] Keyword[break] identifier[loop20] operator[SEP] 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[EarlyExitException] identifier[eee] operator[=] Keyword[new] identifier[EarlyExitException] operator[SEP] Other[20] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[eee] operator[SEP]
}
identifier[cnt20] operator[++] operator[SEP]
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] 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 void run() {
int maxruns = this.maxruns, maxsmall = this.maxsmall;
double oldchi = getChiSq();
while(maxruns-- > 0) {
iterate();
double newchi = getChiSq(), deltachi = newchi - oldchi;
oldchi = newchi;
// stop condition: only a small improvement in Chi.
if(deltachi < 0 && deltachi > -small && --maxsmall < 0) {
break;
}
}
} | class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[int], maxruns]
local_variable[type[double], oldchi]
while[binary_operation[member[.maxruns], >, literal[0]]] begin[{]
call[.iterate, parameter[]]
local_variable[type[double], newchi]
assign[member[.oldchi], member[.newchi]]
if[binary_operation[binary_operation[binary_operation[member[.deltachi], <, literal[0]], &&, binary_operation[member[.deltachi], >, member[.small]]], &&, binary_operation[member[.maxsmall], <, literal[0]]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[int] identifier[maxruns] operator[=] Keyword[this] operator[SEP] identifier[maxruns] , identifier[maxsmall] operator[=] Keyword[this] operator[SEP] identifier[maxsmall] operator[SEP] Keyword[double] identifier[oldchi] operator[=] identifier[getChiSq] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[maxruns] operator[--] operator[>] Other[0] operator[SEP] {
identifier[iterate] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[newchi] operator[=] identifier[getChiSq] operator[SEP] operator[SEP] , identifier[deltachi] operator[=] identifier[newchi] operator[-] identifier[oldchi] operator[SEP] identifier[oldchi] operator[=] identifier[newchi] operator[SEP] Keyword[if] operator[SEP] identifier[deltachi] operator[<] Other[0] operator[&&] identifier[deltachi] operator[>] operator[-] identifier[small] operator[&&] operator[--] identifier[maxsmall] operator[<] Other[0] operator[SEP] {
Keyword[break] operator[SEP]
}
}
}
|
protected Response buildHeader(final WebApplicationService service, final Map<String, String> parameters) {
return DefaultResponse.getHeaderResponse(service.getOriginalUrl(), parameters);
} | class class_name[name] begin[{]
method[buildHeader, return_type[type[Response]], modifier[protected], parameter[service, parameters]] begin[{]
return[call[DefaultResponse.getHeaderResponse, parameter[call[service.getOriginalUrl, parameter[]], member[.parameters]]]]
end[}]
END[}] | Keyword[protected] identifier[Response] identifier[buildHeader] operator[SEP] Keyword[final] identifier[WebApplicationService] identifier[service] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] operator[SEP] {
Keyword[return] identifier[DefaultResponse] operator[SEP] identifier[getHeaderResponse] operator[SEP] identifier[service] operator[SEP] identifier[getOriginalUrl] operator[SEP] operator[SEP] , identifier[parameters] operator[SEP] operator[SEP]
}
|
public Observable<ServiceResponse<ListAccountSasResponseInner>> listAccountSASWithServiceResponseAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(parameters);
return service.listAccountSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ListAccountSasResponseInner>>>() {
@Override
public Observable<ServiceResponse<ListAccountSasResponseInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ListAccountSasResponseInner> clientResponse = listAccountSASDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} | class class_name[name] begin[{]
method[listAccountSASWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, accountName, parameters]] begin[{]
if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.accountName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter accountName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.parameters], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[Validator.validate, parameter[member[.parameters]]]
return[call[service.listAccountSAS, parameter[member[.resourceGroupName], member[.accountName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.parameters], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ListAccountSasResponseInner] operator[>] operator[>] identifier[listAccountSASWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[AccountSasParameters] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[accountName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[listAccountSAS] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[parameters] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ListAccountSasResponseInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ListAccountSasResponseInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] {
Keyword[try] {
identifier[ServiceResponse] operator[<] identifier[ListAccountSasResponseInner] operator[>] identifier[clientResponse] operator[=] identifier[listAccountSASDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
public TaskTerminateOptions withIfModifiedSince(DateTime ifModifiedSince) {
if (ifModifiedSince == null) {
this.ifModifiedSince = null;
} else {
this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince);
}
return this;
} | class class_name[name] begin[{]
method[withIfModifiedSince, return_type[type[TaskTerminateOptions]], modifier[public], parameter[ifModifiedSince]] begin[{]
if[binary_operation[member[.ifModifiedSince], ==, literal[null]]] begin[{]
assign[THIS[member[None.ifModifiedSince]], literal[null]]
else begin[{]
assign[THIS[member[None.ifModifiedSince]], ClassCreator(arguments=[MemberReference(member=ifModifiedSince, 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=DateTimeRfc1123, sub_type=None))]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[TaskTerminateOptions] identifier[withIfModifiedSince] operator[SEP] identifier[DateTime] identifier[ifModifiedSince] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifModifiedSince] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[ifModifiedSince] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[ifModifiedSince] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ifModifiedSince] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static Vector getRawLong(int[] data, int offset) {
Vector v = new Vector();
// TODO: Incorrecto. Repasar ...
// _val = struct.unpack('<l', _long)[0]
int val = 0;
v.add(new Integer(offset+32));
v.add(new Integer(val));
return v;
} | class class_name[name] begin[{]
method[getRawLong, return_type[type[Vector]], modifier[public static], parameter[data, offset]] begin[{]
local_variable[type[Vector], v]
local_variable[type[int], val]
call[v.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]
call[v.add, parameter[ClassCreator(arguments=[MemberReference(member=val, 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=Integer, sub_type=None))]]
return[member[.v]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Vector] identifier[getRawLong] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[data] , Keyword[int] identifier[offset] operator[SEP] {
identifier[Vector] identifier[v] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[val] operator[=] Other[0] operator[SEP] identifier[v] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[offset] operator[+] Other[32] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[val] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[v] operator[SEP]
}
|
@GET
public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
throw new ServiceException(ServiceException.NOT_ALLOWED, "GET not implemented");
} | class class_name[name] begin[{]
method[get, return_type[type[JSONObject]], modifier[public], parameter[path, headers]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=NOT_ALLOWED, postfix_operators=[], prefix_operators=[], qualifier=ServiceException, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GET not implemented")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[GET] 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] {
Keyword[throw] Keyword[new] identifier[ServiceException] operator[SEP] identifier[ServiceException] operator[SEP] identifier[NOT_ALLOWED] , literal[String] operator[SEP] operator[SEP]
}
|
@Override
@FFDCIgnore(NoSuchMethodException.class)
public XAResource getXAResource(Serializable xaresinfo) throws XAResourceNotAvailableException {
XAResource xa = null;
if (xaresinfo != null) {
@SuppressWarnings("unchecked")
ArrayList<Byte> byteList = (ArrayList<Byte>) xaresinfo;
byte[] bytes = new byte[byteList.size()];
int i = 0;
for (Byte b : byteList)
bytes[i++] = b;
try {
ActivationConfig config = (ActivationConfig) Utils.deserialize(bytes);
Object activationSpec = createActivationSpec(config.getActivationConfigProps(),
config.getAuthenticationAlias(),
null,
config.getDestinationRef(),
null,
config.getApplicationName());
if (qmidenabled) {
Class<? extends Object> mcImplClass = activationSpec.getClass();
try {
String qmid = config.getQmid();
Method m = mcImplClass.getMethod("setQmid", new Class[] { String.class });
m.invoke(activationSpec, qmid);
} catch (NoSuchMethodException nsme) {
qmidenabled = false;
} catch (InvocationTargetException ite) {
qmidenabled = false;
}
}
BootstrapContextImpl bootstrapContext = bootstrapContextRef.getServiceWithException();
ActivationSpec[] actspecs = new ActivationSpec[] { (ActivationSpec) activationSpec };
XAResource[] resources = bootstrapContext.resourceAdapter.getXAResources(actspecs);
if (resources != null && resources.length == 1) {
xa = resources[0];
} else if (resources != null && resources.length > 1) {
throw new IllegalStateException(Utils.getMessage("J2CA8800.multiple.xa.resources", bootstrapContext.getResourceAdapterName(), id));
}
} catch (Exception e) {
throw new XAResourceNotAvailableException(e);
}
}
return xa;
} | class class_name[name] begin[{]
method[getXAResource, return_type[type[XAResource]], modifier[public], parameter[xaresinfo]] begin[{]
local_variable[type[XAResource], xa]
if[binary_operation[member[.xaresinfo], !=, literal[null]]] begin[{]
local_variable[type[ArrayList], byteList]
local_variable[type[byte], bytes]
local_variable[type[int], i]
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), control=EnhancedForControl(iterable=MemberReference(member=byteList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Byte, sub_type=None))), label=None)
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deserialize, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ActivationConfig, sub_type=None)), name=config)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ActivationConfig, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getActivationConfigProps, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAuthenticationAlias, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getDestinationRef, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getApplicationName, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None)], member=createActivationSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=activationSpec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MemberReference(member=qmidenabled, 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=getClass, postfix_operators=[], prefix_operators=[], qualifier=activationSpec, selectors=[], type_arguments=None), name=mcImplClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Class, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getQmid, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), name=qmid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setQmid"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=mcImplClass, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=activationSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=qmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=qmidenabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nsme, types=['NoSuchMethodException'])), CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=qmidenabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ite, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getServiceWithException, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContextRef, selectors=[], type_arguments=None), name=bootstrapContext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BootstrapContextImpl, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Cast(expression=MemberReference(member=activationSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ActivationSpec, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActivationSpec, sub_type=None)), name=actspecs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=ActivationSpec, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=actspecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getXAResources, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContext.resourceAdapter, selectors=[], type_arguments=None), name=resources)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=XAResource, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resources, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resources, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="J2CA8800.multiple.xa.resources"), MethodInvocation(arguments=[], member=getResourceAdapterName, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContext, selectors=[], type_arguments=None), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=xa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), 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=XAResourceNotAvailableException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.xa]]
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[FFDCIgnore] operator[SEP] identifier[NoSuchMethodException] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[XAResource] identifier[getXAResource] operator[SEP] identifier[Serializable] identifier[xaresinfo] operator[SEP] Keyword[throws] identifier[XAResourceNotAvailableException] {
identifier[XAResource] identifier[xa] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[xaresinfo] operator[!=] Other[null] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[ArrayList] operator[<] identifier[Byte] operator[>] identifier[byteList] operator[=] operator[SEP] identifier[ArrayList] operator[<] identifier[Byte] operator[>] operator[SEP] identifier[xaresinfo] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[byteList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Byte] identifier[b] operator[:] identifier[byteList] operator[SEP] identifier[bytes] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[b] operator[SEP] Keyword[try] {
identifier[ActivationConfig] identifier[config] operator[=] operator[SEP] identifier[ActivationConfig] operator[SEP] identifier[Utils] operator[SEP] identifier[deserialize] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[Object] identifier[activationSpec] operator[=] identifier[createActivationSpec] operator[SEP] identifier[config] operator[SEP] identifier[getActivationConfigProps] operator[SEP] operator[SEP] , identifier[config] operator[SEP] identifier[getAuthenticationAlias] operator[SEP] operator[SEP] , Other[null] , identifier[config] operator[SEP] identifier[getDestinationRef] operator[SEP] operator[SEP] , Other[null] , identifier[config] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[qmidenabled] operator[SEP] {
identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Object] operator[>] identifier[mcImplClass] operator[=] identifier[activationSpec] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[String] identifier[qmid] operator[=] identifier[config] operator[SEP] identifier[getQmid] operator[SEP] operator[SEP] operator[SEP] identifier[Method] identifier[m] operator[=] identifier[mcImplClass] operator[SEP] identifier[getMethod] operator[SEP] literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] Keyword[class]
} operator[SEP] operator[SEP] identifier[m] operator[SEP] identifier[invoke] operator[SEP] identifier[activationSpec] , identifier[qmid] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[nsme] operator[SEP] {
identifier[qmidenabled] operator[=] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[ite] operator[SEP] {
identifier[qmidenabled] operator[=] literal[boolean] operator[SEP]
}
}
identifier[BootstrapContextImpl] identifier[bootstrapContext] operator[=] identifier[bootstrapContextRef] operator[SEP] identifier[getServiceWithException] operator[SEP] operator[SEP] operator[SEP] identifier[ActivationSpec] operator[SEP] operator[SEP] identifier[actspecs] operator[=] Keyword[new] identifier[ActivationSpec] operator[SEP] operator[SEP] {
operator[SEP] identifier[ActivationSpec] operator[SEP] identifier[activationSpec]
} operator[SEP] identifier[XAResource] operator[SEP] operator[SEP] identifier[resources] operator[=] identifier[bootstrapContext] operator[SEP] identifier[resourceAdapter] operator[SEP] identifier[getXAResources] operator[SEP] identifier[actspecs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[!=] Other[null] operator[&&] identifier[resources] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] {
identifier[xa] operator[=] identifier[resources] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[resources] operator[!=] Other[null] operator[&&] identifier[resources] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[Utils] operator[SEP] identifier[getMessage] operator[SEP] literal[String] , identifier[bootstrapContext] operator[SEP] identifier[getResourceAdapterName] operator[SEP] operator[SEP] , identifier[id] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[XAResourceNotAvailableException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[xa] operator[SEP]
}
|
@Override
public int getPendingCount() {
if (log.isDebugEnabled()) log.debug("Pending Count = " + latch.getCount());
return (int) latch.getCount();
} | class class_name[name] begin[{]
method[getPendingCount, return_type[type[int]], modifier[public], parameter[]] begin[{]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[binary_operation[literal["Pending Count = "], +, call[latch.getCount, parameter[]]]]]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=latch, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getPendingCount] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[latch] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[int] operator[SEP] identifier[latch] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP]
}
|
public void splitupNoSort(ArrayModifiableDBIDs ind, int begin, int end, int dim, Random rand) {
final int nele = end - begin;
dim = dim % projectedPoints.length;// choose a projection of points
DoubleDataStore tpro = projectedPoints[dim];
// save set such that used for density or neighborhood computation
// sets should be roughly minSplitSize
if(nele > minSplitSize * (1 - sizeTolerance) && nele < minSplitSize * (1 + sizeTolerance)) {
// sort set, since need median element later
ind.sort(begin, end, new DataStoreUtil.AscendingByDoubleDataStore(tpro));
splitsets.add(DBIDUtil.newArray(ind.slice(begin, end)));
}
// compute splitting element
// do not store set or even sort set, since it is too large
if(nele > minSplitSize) {
// splits can be performed either by distance (between min,maxCoord) or by
// picking a point randomly(picking index of point)
// outcome is similar
// int minInd splitByDistance(ind, nele, tpro);
int minInd = splitRandomly(ind, begin, end, tpro, rand);
// split set recursively
// position used for splitting the projected points into two
// sets used for recursive splitting
int splitpos = minInd + 1;
splitupNoSort(ind, begin, splitpos, dim + 1, rand);
splitupNoSort(ind, splitpos, end, dim + 1, rand);
}
} | class class_name[name] begin[{]
method[splitupNoSort, return_type[void], modifier[public], parameter[ind, begin, end, dim, rand]] begin[{]
local_variable[type[int], nele]
assign[member[.dim], binary_operation[member[.dim], %, member[projectedPoints.length]]]
local_variable[type[DoubleDataStore], tpro]
if[binary_operation[binary_operation[member[.nele], >, binary_operation[member[.minSplitSize], *, binary_operation[literal[1], -, member[.sizeTolerance]]]], &&, binary_operation[member[.nele], <, binary_operation[member[.minSplitSize], *, binary_operation[literal[1], +, member[.sizeTolerance]]]]]] begin[{]
call[ind.sort, parameter[member[.begin], member[.end], ClassCreator(arguments=[MemberReference(member=tpro, 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=DataStoreUtil, sub_type=ReferenceType(arguments=None, dimensions=None, name=AscendingByDoubleDataStore, sub_type=None)))]]
call[splitsets.add, parameter[call[DBIDUtil.newArray, parameter[call[ind.slice, parameter[member[.begin], member[.end]]]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.nele], >, member[.minSplitSize]]] begin[{]
local_variable[type[int], minInd]
local_variable[type[int], splitpos]
call[.splitupNoSort, parameter[member[.ind], member[.begin], member[.splitpos], binary_operation[member[.dim], +, literal[1]], member[.rand]]]
call[.splitupNoSort, parameter[member[.ind], member[.splitpos], member[.end], binary_operation[member[.dim], +, literal[1]], member[.rand]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[splitupNoSort] operator[SEP] identifier[ArrayModifiableDBIDs] identifier[ind] , Keyword[int] identifier[begin] , Keyword[int] identifier[end] , Keyword[int] identifier[dim] , identifier[Random] identifier[rand] operator[SEP] {
Keyword[final] Keyword[int] identifier[nele] operator[=] identifier[end] operator[-] identifier[begin] operator[SEP] identifier[dim] operator[=] identifier[dim] operator[%] identifier[projectedPoints] operator[SEP] identifier[length] operator[SEP] identifier[DoubleDataStore] identifier[tpro] operator[=] identifier[projectedPoints] operator[SEP] identifier[dim] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nele] operator[>] identifier[minSplitSize] operator[*] operator[SEP] Other[1] operator[-] identifier[sizeTolerance] operator[SEP] operator[&&] identifier[nele] operator[<] identifier[minSplitSize] operator[*] operator[SEP] Other[1] operator[+] identifier[sizeTolerance] operator[SEP] operator[SEP] {
identifier[ind] operator[SEP] identifier[sort] operator[SEP] identifier[begin] , identifier[end] , Keyword[new] identifier[DataStoreUtil] operator[SEP] identifier[AscendingByDoubleDataStore] operator[SEP] identifier[tpro] operator[SEP] operator[SEP] operator[SEP] identifier[splitsets] operator[SEP] identifier[add] operator[SEP] identifier[DBIDUtil] operator[SEP] identifier[newArray] operator[SEP] identifier[ind] operator[SEP] identifier[slice] operator[SEP] identifier[begin] , identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[nele] operator[>] identifier[minSplitSize] operator[SEP] {
Keyword[int] identifier[minInd] operator[=] identifier[splitRandomly] operator[SEP] identifier[ind] , identifier[begin] , identifier[end] , identifier[tpro] , identifier[rand] operator[SEP] operator[SEP] Keyword[int] identifier[splitpos] operator[=] identifier[minInd] operator[+] Other[1] operator[SEP] identifier[splitupNoSort] operator[SEP] identifier[ind] , identifier[begin] , identifier[splitpos] , identifier[dim] operator[+] Other[1] , identifier[rand] operator[SEP] operator[SEP] identifier[splitupNoSort] operator[SEP] identifier[ind] , identifier[splitpos] , identifier[end] , identifier[dim] operator[+] Other[1] , identifier[rand] operator[SEP] operator[SEP]
}
}
|
@Override
public WSJobInstance getJobInstanceFromExecution(long executionId) throws NoSuchJobExecutionException, JobSecurityException {
long instanceId = persistenceManagerService.getJobInstanceIdFromExecutionId(authorizedExecutionRead(executionId));
return persistenceManagerService.getJobInstance(instanceId);
} | class class_name[name] begin[{]
method[getJobInstanceFromExecution, return_type[type[WSJobInstance]], modifier[public], parameter[executionId]] begin[{]
local_variable[type[long], instanceId]
return[call[persistenceManagerService.getJobInstance, parameter[member[.instanceId]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[WSJobInstance] identifier[getJobInstanceFromExecution] operator[SEP] Keyword[long] identifier[executionId] operator[SEP] Keyword[throws] identifier[NoSuchJobExecutionException] , identifier[JobSecurityException] {
Keyword[long] identifier[instanceId] operator[=] identifier[persistenceManagerService] operator[SEP] identifier[getJobInstanceIdFromExecutionId] operator[SEP] identifier[authorizedExecutionRead] operator[SEP] identifier[executionId] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[persistenceManagerService] operator[SEP] identifier[getJobInstance] operator[SEP] identifier[instanceId] operator[SEP] operator[SEP]
}
|
public static <E> Optional<E> maybeFirst(Iterator<E> iterator) {
return new MaybeFirstElement<E>().apply(iterator);
} | class class_name[name] begin[{]
method[maybeFirst, return_type[type[Optional]], modifier[public static], parameter[iterator]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=iterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=None, name=MaybeFirstElement, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[Optional] operator[<] identifier[E] operator[>] identifier[maybeFirst] operator[SEP] identifier[Iterator] operator[<] identifier[E] operator[>] identifier[iterator] operator[SEP] {
Keyword[return] Keyword[new] identifier[MaybeFirstElement] operator[<] identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[apply] operator[SEP] identifier[iterator] operator[SEP] operator[SEP]
}
|
public Class<?> getEJBPrimaryKeyClass(J2EEName j2eeName) {
Class<?> rtnPKeyClass = null;
BeanMetaData bmd = internalBeanMetaDataStore.get(j2eeName);
if (bmd != null) {
rtnPKeyClass = bmd.pKeyClass;
}
return rtnPKeyClass;
} | class class_name[name] begin[{]
method[getEJBPrimaryKeyClass, return_type[type[Class]], modifier[public], parameter[j2eeName]] begin[{]
local_variable[type[Class], rtnPKeyClass]
local_variable[type[BeanMetaData], bmd]
if[binary_operation[member[.bmd], !=, literal[null]]] begin[{]
assign[member[.rtnPKeyClass], member[bmd.pKeyClass]]
else begin[{]
None
end[}]
return[member[.rtnPKeyClass]]
end[}]
END[}] | Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[getEJBPrimaryKeyClass] operator[SEP] identifier[J2EEName] identifier[j2eeName] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[rtnPKeyClass] operator[=] Other[null] operator[SEP] identifier[BeanMetaData] identifier[bmd] operator[=] identifier[internalBeanMetaDataStore] operator[SEP] identifier[get] operator[SEP] identifier[j2eeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bmd] operator[!=] Other[null] operator[SEP] {
identifier[rtnPKeyClass] operator[=] identifier[bmd] operator[SEP] identifier[pKeyClass] operator[SEP]
}
Keyword[return] identifier[rtnPKeyClass] operator[SEP]
}
|
public static <T> ParallelFlux<T> from(Publisher<? extends T> source,
int parallelism) {
return from(source,
parallelism, Queues.SMALL_BUFFER_SIZE,
Queues.small());
} | class class_name[name] begin[{]
method[from, return_type[type[ParallelFlux]], modifier[public static], parameter[source, parallelism]] begin[{]
return[call[.from, parameter[member[.source], member[.parallelism], member[Queues.SMALL_BUFFER_SIZE], call[Queues.small, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[ParallelFlux] operator[<] identifier[T] operator[>] identifier[from] operator[SEP] identifier[Publisher] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[source] , Keyword[int] identifier[parallelism] operator[SEP] {
Keyword[return] identifier[from] operator[SEP] identifier[source] , identifier[parallelism] , identifier[Queues] operator[SEP] identifier[SMALL_BUFFER_SIZE] , identifier[Queues] operator[SEP] identifier[small] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private RawResponse getResponse(URL url, HttpURLConnection conn, CookieJar cookieJar, String method)
throws IOException {
// read result
int status = conn.getResponseCode();
String host = url.getHost().toLowerCase();
String statusLine = null;
// headers and cookies
List<Header> headerList = new ArrayList<>();
List<Cookie> cookies = new ArrayList<>();
int index = 0;
while (true) {
String key = conn.getHeaderFieldKey(index);
String value = conn.getHeaderField(index);
if (value == null) {
break;
}
index++;
//status line
if (key == null) {
statusLine = value;
continue;
}
headerList.add(new Header(key, value));
if (key.equalsIgnoreCase(NAME_SET_COOKIE)) {
Cookie c = Cookies.parseCookie(value, host, Cookies.calculatePath(url.getPath()));
if (c != null) {
cookies.add(c);
}
}
}
Headers headers = new Headers(headerList);
InputStream input;
try {
input = conn.getInputStream();
} catch (IOException e) {
input = conn.getErrorStream();
}
if (input == null) {
input = InputStreams.empty();
}
// update session
cookieJar.storeCookies(cookies);
return new RawResponse(method, url.toExternalForm(), status, statusLine == null ? "" : statusLine,
cookies, headers, input, conn);
} | class class_name[name] begin[{]
method[getResponse, return_type[type[RawResponse]], modifier[private], parameter[url, conn, cookieJar, method]] begin[{]
local_variable[type[int], status]
local_variable[type[String], host]
local_variable[type[String], statusLine]
local_variable[type[List], headerList]
local_variable[type[List], cookies]
local_variable[type[int], index]
while[literal[true]] begin[{]
local_variable[type[String], key]
local_variable[type[String], value]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
member[.index]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
assign[member[.statusLine], member[.value]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[headerList.add, parameter[ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Header, sub_type=None))]]
if[call[key.equalsIgnoreCase, parameter[member[.NAME_SET_COOKIE]]]] begin[{]
local_variable[type[Cookie], c]
if[binary_operation[member[.c], !=, literal[null]]] begin[{]
call[cookies.add, parameter[member[.c]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
local_variable[type[Headers], headers]
local_variable[type[InputStream], input]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getErrorStream, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.input], ==, literal[null]]] begin[{]
assign[member[.input], call[InputStreams.empty, parameter[]]]
else begin[{]
None
end[}]
call[cookieJar.storeCookies, parameter[member[.cookies]]]
return[ClassCreator(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toExternalForm, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=statusLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=statusLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")), MemberReference(member=cookies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conn, 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=RawResponse, sub_type=None))]
end[}]
END[}] | Keyword[private] identifier[RawResponse] identifier[getResponse] operator[SEP] identifier[URL] identifier[url] , identifier[HttpURLConnection] identifier[conn] , identifier[CookieJar] identifier[cookieJar] , identifier[String] identifier[method] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[status] operator[=] identifier[conn] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[host] operator[=] identifier[url] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[statusLine] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[Header] operator[>] identifier[headerList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Cookie] operator[>] identifier[cookies] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[String] identifier[key] operator[=] identifier[conn] operator[SEP] identifier[getHeaderFieldKey] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[conn] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[index] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
identifier[statusLine] operator[=] identifier[value] operator[SEP] Keyword[continue] operator[SEP]
}
identifier[headerList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Header] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[NAME_SET_COOKIE] operator[SEP] operator[SEP] {
identifier[Cookie] identifier[c] operator[=] identifier[Cookies] operator[SEP] identifier[parseCookie] operator[SEP] identifier[value] , identifier[host] , identifier[Cookies] operator[SEP] identifier[calculatePath] operator[SEP] identifier[url] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] Other[null] operator[SEP] {
identifier[cookies] operator[SEP] identifier[add] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
}
identifier[Headers] identifier[headers] operator[=] Keyword[new] identifier[Headers] operator[SEP] identifier[headerList] operator[SEP] operator[SEP] identifier[InputStream] identifier[input] operator[SEP] Keyword[try] {
identifier[input] operator[=] identifier[conn] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[input] operator[=] identifier[conn] operator[SEP] identifier[getErrorStream] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] {
identifier[input] operator[=] identifier[InputStreams] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP]
}
identifier[cookieJar] operator[SEP] identifier[storeCookies] operator[SEP] identifier[cookies] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[RawResponse] operator[SEP] identifier[method] , identifier[url] operator[SEP] identifier[toExternalForm] operator[SEP] operator[SEP] , identifier[status] , identifier[statusLine] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[statusLine] , identifier[cookies] , identifier[headers] , identifier[input] , identifier[conn] operator[SEP] operator[SEP]
}
|
private void readElement_1_0(Namespace namespace, XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
final EnumSet<Element> encountered = EnumSet.noneOf(Element.class);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
// check the element namespace.
if (Namespace.JacORB_1_0 != Namespace.forUri(reader.getNamespaceURI()))
throw unexpectedElement(reader);
final Element element = Element.forName(reader.getLocalName());
// there can be multiple property elements.
if (!encountered.add(element) && element != Element.PROPERTY) {
throw duplicateNamedElement(reader, element.getLocalName());
}
switch (element) {
case ORB: {
this.parseORBConfig_1_0(reader, node);
break;
}
case POA: {
this.parsePOAConfig(namespace, reader, node);
break;
}
case INTEROP: {
this.parseInteropConfig(reader, node);
break;
}
case SECURITY: {
this.parseSecurityConfig_1_0(reader, node);
break;
}
case PROPERTY: {
ModelNode propertiesNode = node.get(JacORBSubsystemConstants.PROPERTIES);
this.parseGenericProperty_1_0(reader, propertiesNode);
break;
}
case ORB_INITIALIZERS: {
this.parseORBInitializersConfig_1_0(reader, node);
break;
}
default: {
throw unexpectedElement(reader);
}
}
}
} | class class_name[name] begin[{]
method[readElement_1_0, return_type[void], modifier[private], parameter[namespace, reader, node]] begin[{]
local_variable[type[EnumSet], encountered]
while[binary_operation[call[reader.hasNext, parameter[]], &&, binary_operation[call[reader.nextTag, parameter[]], !=, member[.END_ELEMENT]]]] begin[{]
if[binary_operation[member[Namespace.JacORB_1_0], !=, call[Namespace.forUri, parameter[call[reader.getNamespaceURI, parameter[]]]]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
local_variable[type[Element], element]
if[binary_operation[call[encountered.add, parameter[member[.element]]], &&, binary_operation[member[.element], !=, member[Element.PROPERTY]]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)], member=duplicateNamedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=['ORB'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseORBConfig_1_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['POA'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parsePOAConfig, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['INTEROP'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInteropConfig, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['SECURITY'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseSecurityConfig_1_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['PROPERTY'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=PROPERTIES, postfix_operators=[], prefix_operators=[], qualifier=JacORBSubsystemConstants, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), name=propertiesNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModelNode, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertiesNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseGenericProperty_1_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['ORB_INITIALIZERS'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseORBInitializersConfig_1_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])])], expression=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[readElement_1_0] operator[SEP] identifier[Namespace] identifier[namespace] , identifier[XMLExtendedStreamReader] identifier[reader] , identifier[ModelNode] identifier[node] operator[SEP] Keyword[throws] identifier[XMLStreamException] {
Keyword[final] identifier[EnumSet] operator[<] identifier[Element] operator[>] identifier[encountered] operator[=] identifier[EnumSet] operator[SEP] identifier[noneOf] operator[SEP] identifier[Element] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[reader] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[reader] operator[SEP] identifier[nextTag] operator[SEP] operator[SEP] operator[!=] identifier[END_ELEMENT] operator[SEP] {
Keyword[if] operator[SEP] identifier[Namespace] operator[SEP] identifier[JacORB_1_0] operator[!=] identifier[Namespace] operator[SEP] identifier[forUri] operator[SEP] identifier[reader] operator[SEP] identifier[getNamespaceURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP] Keyword[final] identifier[Element] identifier[element] operator[=] identifier[Element] operator[SEP] identifier[forName] operator[SEP] identifier[reader] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[encountered] operator[SEP] identifier[add] operator[SEP] identifier[element] operator[SEP] operator[&&] identifier[element] operator[!=] identifier[Element] operator[SEP] identifier[PROPERTY] operator[SEP] {
Keyword[throw] identifier[duplicateNamedElement] operator[SEP] identifier[reader] , identifier[element] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[element] operator[SEP] {
Keyword[case] identifier[ORB] operator[:] {
Keyword[this] operator[SEP] identifier[parseORBConfig_1_0] operator[SEP] identifier[reader] , identifier[node] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[POA] operator[:] {
Keyword[this] operator[SEP] identifier[parsePOAConfig] operator[SEP] identifier[namespace] , identifier[reader] , identifier[node] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[INTEROP] operator[:] {
Keyword[this] operator[SEP] identifier[parseInteropConfig] operator[SEP] identifier[reader] , identifier[node] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[SECURITY] operator[:] {
Keyword[this] operator[SEP] identifier[parseSecurityConfig_1_0] operator[SEP] identifier[reader] , identifier[node] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[PROPERTY] operator[:] {
identifier[ModelNode] identifier[propertiesNode] operator[=] identifier[node] operator[SEP] identifier[get] operator[SEP] identifier[JacORBSubsystemConstants] operator[SEP] identifier[PROPERTIES] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parseGenericProperty_1_0] operator[SEP] identifier[reader] , identifier[propertiesNode] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[case] identifier[ORB_INITIALIZERS] operator[:] {
Keyword[this] operator[SEP] identifier[parseORBInitializersConfig_1_0] operator[SEP] identifier[reader] , identifier[node] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[default] operator[:] {
Keyword[throw] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP]
}
}
}
}
|
@MapMethod
public List<Object> values(Map<String,Object> m){
List<Object> l = Objects.newArrayList();
for(Object k:m.values()){
l.add(k);
}
return l;
} | class class_name[name] begin[{]
method[values, return_type[type[List]], modifier[public], parameter[m]] begin[{]
local_variable[type[List], l]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=k)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[member[.l]]
end[}]
END[}] | annotation[@] identifier[MapMethod] Keyword[public] identifier[List] operator[<] identifier[Object] operator[>] identifier[values] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[m] operator[SEP] {
identifier[List] operator[<] identifier[Object] operator[>] identifier[l] operator[=] identifier[Objects] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[k] operator[:] identifier[m] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[k] operator[SEP] operator[SEP]
}
Keyword[return] identifier[l] operator[SEP]
}
|
public static Object getRequestBody(PageContext pc, boolean deserialized, Object defaultValue) {
HttpServletRequest req = pc.getHttpServletRequest();
MimeType contentType = getContentType(pc);
String strContentType = contentType == MimeType.ALL ? null : contentType.toString();
Charset cs = getCharacterEncoding(pc, req);
boolean isBinary = !(strContentType == null || HTTPUtil.isTextMimeType(contentType) || strContentType.toLowerCase().startsWith("application/x-www-form-urlencoded"));
if (req.getContentLength() > -1) {
ServletInputStream is = null;
try {
byte[] data = IOUtil.toBytes(is = req.getInputStream());// new byte[req.getContentLength()];
Object obj = NULL;
if (deserialized) {
int format = MimeType.toFormat(contentType, -1);
obj = toObject(pc, data, format, cs, obj);
}
if (obj == NULL) {
if (isBinary) obj = data;
else obj = toString(data, cs);
}
return obj;
}
catch (Exception e) {
pc.getConfig().getLog("application").error("request", e);
return defaultValue;
}
finally {
IOUtil.closeEL(is);
}
}
return defaultValue;
} | class class_name[name] begin[{]
method[getRequestBody, return_type[type[Object]], modifier[public static], parameter[pc, deserialized, defaultValue]] begin[{]
local_variable[type[HttpServletRequest], req]
local_variable[type[MimeType], contentType]
local_variable[type[String], strContentType]
local_variable[type[Charset], cs]
local_variable[type[boolean], isBinary]
if[binary_operation[call[req.getContentLength, parameter[]], >, literal[1]]] begin[{]
local_variable[type[ServletInputStream], is]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None))], member=toBytes, postfix_operators=[], prefix_operators=[], qualifier=IOUtil, selectors=[], type_arguments=None), name=data)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MemberReference(member=deserialized, 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=[MemberReference(member=contentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=toFormat, postfix_operators=[], prefix_operators=[], qualifier=MimeType, selectors=[], type_arguments=None), name=format)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=pc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=isBinary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))])), ReturnStatement(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getConfig, postfix_operators=[], prefix_operators=[], qualifier=pc, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="application")], member=getLog, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="request"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeEL, postfix_operators=[], prefix_operators=[], qualifier=IOUtil, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
return[member[.defaultValue]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[getRequestBody] operator[SEP] identifier[PageContext] identifier[pc] , Keyword[boolean] identifier[deserialized] , identifier[Object] identifier[defaultValue] operator[SEP] {
identifier[HttpServletRequest] identifier[req] operator[=] identifier[pc] operator[SEP] identifier[getHttpServletRequest] operator[SEP] operator[SEP] operator[SEP] identifier[MimeType] identifier[contentType] operator[=] identifier[getContentType] operator[SEP] identifier[pc] operator[SEP] operator[SEP] identifier[String] identifier[strContentType] operator[=] identifier[contentType] operator[==] identifier[MimeType] operator[SEP] identifier[ALL] operator[?] Other[null] operator[:] identifier[contentType] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Charset] identifier[cs] operator[=] identifier[getCharacterEncoding] operator[SEP] identifier[pc] , identifier[req] operator[SEP] operator[SEP] Keyword[boolean] identifier[isBinary] operator[=] operator[!] operator[SEP] identifier[strContentType] operator[==] Other[null] operator[||] identifier[HTTPUtil] operator[SEP] identifier[isTextMimeType] operator[SEP] identifier[contentType] operator[SEP] operator[||] identifier[strContentType] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[req] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] {
identifier[ServletInputStream] identifier[is] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[IOUtil] operator[SEP] identifier[toBytes] operator[SEP] identifier[is] operator[=] identifier[req] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[obj] operator[=] identifier[NULL] operator[SEP] Keyword[if] operator[SEP] identifier[deserialized] operator[SEP] {
Keyword[int] identifier[format] operator[=] identifier[MimeType] operator[SEP] identifier[toFormat] operator[SEP] identifier[contentType] , operator[-] Other[1] operator[SEP] operator[SEP] identifier[obj] operator[=] identifier[toObject] operator[SEP] identifier[pc] , identifier[data] , identifier[format] , identifier[cs] , identifier[obj] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[obj] operator[==] identifier[NULL] operator[SEP] {
Keyword[if] operator[SEP] identifier[isBinary] operator[SEP] identifier[obj] operator[=] identifier[data] operator[SEP] Keyword[else] identifier[obj] operator[=] identifier[toString] operator[SEP] identifier[data] , identifier[cs] operator[SEP] operator[SEP]
}
Keyword[return] identifier[obj] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[pc] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getLog] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] identifier[defaultValue] operator[SEP]
}
Keyword[finally] {
identifier[IOUtil] operator[SEP] identifier[closeEL] operator[SEP] identifier[is] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[defaultValue] operator[SEP]
}
|
private void compileFallbackQueriesAndUpdateCatalog(Database db,
String query,
List<VoltXMLElement> fallbackQueryXMLs,
MaterializedViewInfo matviewinfo) throws VoltCompilerException {
DatabaseEstimates estimates = new DatabaseEstimates();
for (int i=0; i<fallbackQueryXMLs.size(); ++i) {
String key = String.valueOf(i);
Statement fallbackQueryStmt = matviewinfo.getFallbackquerystmts().add(key);
VoltXMLElement fallbackQueryXML = fallbackQueryXMLs.get(i);
fallbackQueryStmt.setSqltext(query);
StatementCompiler.compileStatementAndUpdateCatalog(m_compiler,
m_hsql,
db,
estimates,
fallbackQueryStmt,
fallbackQueryXML,
fallbackQueryStmt.getSqltext(),
null, // no user-supplied join order
DeterminismMode.FASTER,
StatementPartitioning.forceSP());
}
} | class class_name[name] begin[{]
method[compileFallbackQueriesAndUpdateCatalog, return_type[void], modifier[private], parameter[db, query, fallbackQueryXMLs, matviewinfo]] begin[{]
local_variable[type[DatabaseEstimates], estimates]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFallbackquerystmts, postfix_operators=[], prefix_operators=[], qualifier=matviewinfo, selectors=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=fallbackQueryStmt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Statement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=fallbackQueryXMLs, selectors=[], type_arguments=None), name=fallbackQueryXML)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VoltXMLElement, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSqltext, postfix_operators=[], prefix_operators=[], qualifier=fallbackQueryStmt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_compiler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_hsql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=db, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=estimates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fallbackQueryStmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fallbackQueryXML, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSqltext, postfix_operators=[], prefix_operators=[], qualifier=fallbackQueryStmt, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=FASTER, postfix_operators=[], prefix_operators=[], qualifier=DeterminismMode, selectors=[]), MethodInvocation(arguments=[], member=forceSP, postfix_operators=[], prefix_operators=[], qualifier=StatementPartitioning, selectors=[], type_arguments=None)], member=compileStatementAndUpdateCatalog, postfix_operators=[], prefix_operators=[], qualifier=StatementCompiler, selectors=[], type_arguments=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=fallbackQueryXMLs, 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)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[compileFallbackQueriesAndUpdateCatalog] operator[SEP] identifier[Database] identifier[db] , identifier[String] identifier[query] , identifier[List] operator[<] identifier[VoltXMLElement] operator[>] identifier[fallbackQueryXMLs] , identifier[MaterializedViewInfo] identifier[matviewinfo] operator[SEP] Keyword[throws] identifier[VoltCompilerException] {
identifier[DatabaseEstimates] identifier[estimates] operator[=] Keyword[new] identifier[DatabaseEstimates] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[fallbackQueryXMLs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[String] identifier[key] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Statement] identifier[fallbackQueryStmt] operator[=] identifier[matviewinfo] operator[SEP] identifier[getFallbackquerystmts] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[VoltXMLElement] identifier[fallbackQueryXML] operator[=] identifier[fallbackQueryXMLs] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[fallbackQueryStmt] operator[SEP] identifier[setSqltext] operator[SEP] identifier[query] operator[SEP] operator[SEP] identifier[StatementCompiler] operator[SEP] identifier[compileStatementAndUpdateCatalog] operator[SEP] identifier[m_compiler] , identifier[m_hsql] , identifier[db] , identifier[estimates] , identifier[fallbackQueryStmt] , identifier[fallbackQueryXML] , identifier[fallbackQueryStmt] operator[SEP] identifier[getSqltext] operator[SEP] operator[SEP] , Other[null] , identifier[DeterminismMode] operator[SEP] identifier[FASTER] , identifier[StatementPartitioning] operator[SEP] identifier[forceSP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected void updateText(PageElement pageElement, String textOrKey, CharSequence keysToSend, Object... args) throws TechnicalException, FailureException {
String value = getTextOrKey(textOrKey);
if (!"".equals(value)) {
try {
final WebElement element = Context.waitUntil(ExpectedConditions.elementToBeClickable(Utilities.getLocator(pageElement, args)));
element.clear();
if (DriverFactory.IE.equals(Context.getBrowser())) {
final String javascript = "arguments[0].value='" + value + "';";
((JavascriptExecutor) getDriver()).executeScript(javascript, element);
} else {
element.sendKeys(value);
}
if (keysToSend != null) {
element.sendKeys(keysToSend);
}
} catch (final Exception e) {
new Result.Failure<>(e.getMessage(), Messages.format(Messages.getMessage(Messages.FAIL_MESSAGE_ERROR_ON_INPUT), pageElement, pageElement.getPage().getApplication()), true,
pageElement.getPage().getCallBack());
}
} else {
logger.debug("Empty data provided. No need to update text. If you want clear data, you need use: \"I clear text in ...\"");
}
} | class class_name[name] begin[{]
method[updateText, return_type[void], modifier[protected], parameter[pageElement, textOrKey, keysToSend, args]] begin[{]
local_variable[type[String], value]
if[literal[""]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pageElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocator, postfix_operators=[], prefix_operators=[], qualifier=Utilities, selectors=[], type_arguments=None)], member=elementToBeClickable, postfix_operators=[], prefix_operators=[], qualifier=ExpectedConditions, selectors=[], type_arguments=None)], member=waitUntil, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[], type_arguments=None), name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=WebElement, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBrowser, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=DriverFactory.IE, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendKeys, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="arguments[0].value='"), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="';"), operator=+), name=javascript)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[], member=getDriver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JavascriptExecutor, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keysToSend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keysToSend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendKeys, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=FAIL_MESSAGE_ERROR_ON_INPUT, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None), MemberReference(member=pageElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPage, postfix_operators=[], prefix_operators=[], qualifier=pageElement, selectors=[MethodInvocation(arguments=[], member=getApplication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MethodInvocation(arguments=[], member=getPage, postfix_operators=[], prefix_operators=[], qualifier=pageElement, selectors=[MethodInvocation(arguments=[], member=getCallBack, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Result, sub_type=ReferenceType(arguments=[], dimensions=None, name=Failure, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
call[logger.debug, parameter[literal["Empty data provided. No need to update text. If you want clear data, you need use: \"I clear text in ...\""]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[updateText] operator[SEP] identifier[PageElement] identifier[pageElement] , identifier[String] identifier[textOrKey] , identifier[CharSequence] identifier[keysToSend] , identifier[Object] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[TechnicalException] , identifier[FailureException] {
identifier[String] identifier[value] operator[=] identifier[getTextOrKey] operator[SEP] identifier[textOrKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[WebElement] identifier[element] operator[=] identifier[Context] operator[SEP] identifier[waitUntil] operator[SEP] identifier[ExpectedConditions] operator[SEP] identifier[elementToBeClickable] operator[SEP] identifier[Utilities] operator[SEP] identifier[getLocator] operator[SEP] identifier[pageElement] , identifier[args] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DriverFactory] operator[SEP] identifier[IE] operator[SEP] identifier[equals] operator[SEP] identifier[Context] operator[SEP] identifier[getBrowser] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[javascript] operator[=] literal[String] operator[+] identifier[value] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[JavascriptExecutor] operator[SEP] identifier[getDriver] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[executeScript] operator[SEP] identifier[javascript] , identifier[element] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[element] operator[SEP] identifier[sendKeys] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[keysToSend] operator[!=] Other[null] operator[SEP] {
identifier[element] operator[SEP] identifier[sendKeys] operator[SEP] identifier[keysToSend] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] {
Keyword[new] identifier[Result] operator[SEP] identifier[Failure] operator[<] operator[>] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[Messages] operator[SEP] identifier[format] operator[SEP] identifier[Messages] operator[SEP] identifier[getMessage] operator[SEP] identifier[Messages] operator[SEP] identifier[FAIL_MESSAGE_ERROR_ON_INPUT] operator[SEP] , identifier[pageElement] , identifier[pageElement] operator[SEP] identifier[getPage] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] , literal[boolean] , identifier[pageElement] operator[SEP] identifier[getPage] operator[SEP] operator[SEP] operator[SEP] identifier[getCallBack] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
@RequestMapping(value = "projects/{projectId}/{type}/{id}", method = RequestMethod.PUT)
public Ack saveProjectPermission(@PathVariable ID projectId, @PathVariable PermissionTargetType type, @PathVariable int id, @RequestBody PermissionInput input) {
return accountService.saveProjectPermission(projectId, type, id, input);
} | class class_name[name] begin[{]
method[saveProjectPermission, return_type[type[Ack]], modifier[public], parameter[projectId, type, id, input]] begin[{]
return[call[accountService.saveProjectPermission, parameter[member[.projectId], member[.type], member[.id], member[.input]]]]
end[}]
END[}] | annotation[@] identifier[RequestMapping] operator[SEP] identifier[value] operator[=] literal[String] , identifier[method] operator[=] identifier[RequestMethod] operator[SEP] identifier[PUT] operator[SEP] Keyword[public] identifier[Ack] identifier[saveProjectPermission] operator[SEP] annotation[@] identifier[PathVariable] identifier[ID] identifier[projectId] , annotation[@] identifier[PathVariable] identifier[PermissionTargetType] identifier[type] , annotation[@] identifier[PathVariable] Keyword[int] identifier[id] , annotation[@] identifier[RequestBody] identifier[PermissionInput] identifier[input] operator[SEP] {
Keyword[return] identifier[accountService] operator[SEP] identifier[saveProjectPermission] operator[SEP] identifier[projectId] , identifier[type] , identifier[id] , identifier[input] operator[SEP] operator[SEP]
}
|
public static <E, T extends Iterable<E>> T defaultIfEmpty(T iterable, T defaultIterable) {
return iterable != null && iterable.iterator().hasNext() ? iterable : defaultIterable;
} | class class_name[name] begin[{]
method[defaultIfEmpty, return_type[type[T]], modifier[public static], parameter[iterable, defaultIterable]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=iterable, selectors=[MethodInvocation(arguments=[], member=hasNext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), if_false=MemberReference(member=defaultIterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[E] , identifier[T] Keyword[extends] identifier[Iterable] operator[<] identifier[E] operator[>] operator[>] identifier[T] identifier[defaultIfEmpty] operator[SEP] identifier[T] identifier[iterable] , identifier[T] identifier[defaultIterable] operator[SEP] {
Keyword[return] identifier[iterable] operator[!=] Other[null] operator[&&] identifier[iterable] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterable] operator[:] identifier[defaultIterable] operator[SEP]
}
|
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setApiSuchfeld1(JAXBElement<String> value) {
this.apiSuchfeld1 = value;
} | class class_name[name] begin[{]
method[setApiSuchfeld1, return_type[void], modifier[public], parameter[value]] begin[{]
assign[THIS[member[None.apiSuchfeld1]], member[.value]]
end[}]
END[}] | annotation[@] identifier[Generated] operator[SEP] identifier[value] operator[=] literal[String] , identifier[date] operator[=] literal[String] , identifier[comments] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[setApiSuchfeld1] operator[SEP] identifier[JAXBElement] operator[<] identifier[String] operator[>] identifier[value] operator[SEP] {
Keyword[this] operator[SEP] identifier[apiSuchfeld1] operator[=] identifier[value] operator[SEP]
}
|
public static NaaccrDictionary mergeDictionaries(NaaccrDictionary baseDictionary, NaaccrDictionary... userDictionaries) {
if (baseDictionary == null)
throw new RuntimeException("Base dictionary is required");
NaaccrDictionary result = new NaaccrDictionary();
result.setNaaccrVersion(baseDictionary.getNaaccrVersion());
result.setDictionaryUri(baseDictionary.getDictionaryUri() + "[merged]");
result.setSpecificationVersion(baseDictionary.getSpecificationVersion());
result.setDescription(baseDictionary.getDescription());
List<NaaccrDictionaryItem> items = new ArrayList<>(baseDictionary.getItems());
for (NaaccrDictionary userDictionary : userDictionaries)
items.addAll(userDictionary.getItems());
items.sort(Comparator.comparing(NaaccrDictionaryItem::getNaaccrId));
result.setItems(items);
List<NaaccrDictionaryGroupedItem> groupedItems = new ArrayList<>(baseDictionary.getGroupedItems());
for (NaaccrDictionary userDictionary : userDictionaries)
groupedItems.addAll(userDictionary.getGroupedItems());
groupedItems.sort(Comparator.comparing(NaaccrDictionaryItem::getNaaccrId));
result.setGroupedItems(groupedItems);
return result;
} | class class_name[name] begin[{]
method[mergeDictionaries, return_type[type[NaaccrDictionary]], modifier[public static], parameter[baseDictionary, userDictionaries]] begin[{]
if[binary_operation[member[.baseDictionary], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Base dictionary is required")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[NaaccrDictionary], result]
call[result.setNaaccrVersion, parameter[call[baseDictionary.getNaaccrVersion, parameter[]]]]
call[result.setDictionaryUri, parameter[binary_operation[call[baseDictionary.getDictionaryUri, parameter[]], +, literal["[merged]"]]]]
call[result.setSpecificationVersion, parameter[call[baseDictionary.getSpecificationVersion, parameter[]]]]
call[result.setDescription, parameter[call[baseDictionary.getDescription, parameter[]]]]
local_variable[type[List], items]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getItems, postfix_operators=[], prefix_operators=[], qualifier=userDictionary, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=items, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=userDictionaries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=userDictionary)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NaaccrDictionary, sub_type=None))), label=None)
call[items.sort, parameter[call[Comparator.comparing, parameter[MethodReference(expression=MemberReference(member=NaaccrDictionaryItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getNaaccrId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]]]
call[result.setItems, parameter[member[.items]]]
local_variable[type[List], groupedItems]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGroupedItems, postfix_operators=[], prefix_operators=[], qualifier=userDictionary, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=groupedItems, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=userDictionaries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=userDictionary)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NaaccrDictionary, sub_type=None))), label=None)
call[groupedItems.sort, parameter[call[Comparator.comparing, parameter[MethodReference(expression=MemberReference(member=NaaccrDictionaryItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getNaaccrId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]]]
call[result.setGroupedItems, parameter[member[.groupedItems]]]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[NaaccrDictionary] identifier[mergeDictionaries] operator[SEP] identifier[NaaccrDictionary] identifier[baseDictionary] , identifier[NaaccrDictionary] operator[...] identifier[userDictionaries] operator[SEP] {
Keyword[if] operator[SEP] identifier[baseDictionary] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[NaaccrDictionary] identifier[result] operator[=] Keyword[new] identifier[NaaccrDictionary] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setNaaccrVersion] operator[SEP] identifier[baseDictionary] operator[SEP] identifier[getNaaccrVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setDictionaryUri] operator[SEP] identifier[baseDictionary] operator[SEP] identifier[getDictionaryUri] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setSpecificationVersion] operator[SEP] identifier[baseDictionary] operator[SEP] identifier[getSpecificationVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setDescription] operator[SEP] identifier[baseDictionary] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[NaaccrDictionaryItem] operator[>] identifier[items] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[baseDictionary] operator[SEP] identifier[getItems] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[NaaccrDictionary] identifier[userDictionary] operator[:] identifier[userDictionaries] operator[SEP] identifier[items] operator[SEP] identifier[addAll] operator[SEP] identifier[userDictionary] operator[SEP] identifier[getItems] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[items] operator[SEP] identifier[sort] operator[SEP] identifier[Comparator] operator[SEP] identifier[comparing] operator[SEP] identifier[NaaccrDictionaryItem] operator[::] identifier[getNaaccrId] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setItems] operator[SEP] identifier[items] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[NaaccrDictionaryGroupedItem] operator[>] identifier[groupedItems] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[baseDictionary] operator[SEP] identifier[getGroupedItems] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[NaaccrDictionary] identifier[userDictionary] operator[:] identifier[userDictionaries] operator[SEP] identifier[groupedItems] operator[SEP] identifier[addAll] operator[SEP] identifier[userDictionary] operator[SEP] identifier[getGroupedItems] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[groupedItems] operator[SEP] identifier[sort] operator[SEP] identifier[Comparator] operator[SEP] identifier[comparing] operator[SEP] identifier[NaaccrDictionaryItem] operator[::] identifier[getNaaccrId] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setGroupedItems] operator[SEP] identifier[groupedItems] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
private void addReference(
final int sourcePosition,
final int referencePosition)
{
if (srcAndRefPositions == null) {
srcAndRefPositions = new int[6];
}
if (referenceCount >= srcAndRefPositions.length) {
int[] a = new int[srcAndRefPositions.length + 6];
System.arraycopy(srcAndRefPositions,
0,
a,
0,
srcAndRefPositions.length);
srcAndRefPositions = a;
}
srcAndRefPositions[referenceCount++] = sourcePosition;
srcAndRefPositions[referenceCount++] = referencePosition;
} | class class_name[name] begin[{]
method[addReference, return_type[void], modifier[private], parameter[sourcePosition, referencePosition]] begin[{]
if[binary_operation[member[.srcAndRefPositions], ==, literal[null]]] begin[{]
assign[member[.srcAndRefPositions], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
else begin[{]
None
end[}]
if[binary_operation[member[.referenceCount], >=, member[srcAndRefPositions.length]]] begin[{]
local_variable[type[int], a]
call[System.arraycopy, parameter[member[.srcAndRefPositions], literal[0], member[.a], literal[0], member[srcAndRefPositions.length]]]
assign[member[.srcAndRefPositions], member[.a]]
else begin[{]
None
end[}]
assign[member[.srcAndRefPositions], member[.sourcePosition]]
assign[member[.srcAndRefPositions], member[.referencePosition]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addReference] operator[SEP] Keyword[final] Keyword[int] identifier[sourcePosition] , Keyword[final] Keyword[int] identifier[referencePosition] operator[SEP] {
Keyword[if] operator[SEP] identifier[srcAndRefPositions] operator[==] Other[null] operator[SEP] {
identifier[srcAndRefPositions] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[6] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[referenceCount] operator[>=] identifier[srcAndRefPositions] operator[SEP] identifier[length] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[a] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[srcAndRefPositions] operator[SEP] identifier[length] operator[+] Other[6] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[srcAndRefPositions] , Other[0] , identifier[a] , Other[0] , identifier[srcAndRefPositions] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[srcAndRefPositions] operator[=] identifier[a] operator[SEP]
}
identifier[srcAndRefPositions] operator[SEP] identifier[referenceCount] operator[++] operator[SEP] operator[=] identifier[sourcePosition] operator[SEP] identifier[srcAndRefPositions] operator[SEP] identifier[referenceCount] operator[++] operator[SEP] operator[=] identifier[referencePosition] operator[SEP]
}
|
public static String getLocalhost() {
if (localhost == null) {
synchronized (HostAndPort.class) {
if (localhost == null) {
return localhost = getLocalHostQuietly();
}
}
}
return localhost;
} | class class_name[name] begin[{]
method[getLocalhost, return_type[type[String]], modifier[public static], parameter[]] begin[{]
if[binary_operation[member[.localhost], ==, literal[null]]] begin[{]
SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HostAndPort, sub_type=None))] BEGIN[{]
if[binary_operation[member[.localhost], ==, literal[null]]] begin[{]
return[assign[member[.localhost], call[.getLocalHostQuietly, parameter[]]]]
else begin[{]
None
end[}]
END[}]
else begin[{]
None
end[}]
return[member[.localhost]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getLocalhost] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[localhost] operator[==] Other[null] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[HostAndPort] operator[SEP] Keyword[class] operator[SEP] {
Keyword[if] operator[SEP] identifier[localhost] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[localhost] operator[=] identifier[getLocalHostQuietly] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[localhost] operator[SEP]
}
|
private void init(DelaunayTriangulation delaunay, int xCellCount, int yCellCount, BoundingBox region) {
indexDelaunay = delaunay;
indexRegion = region;
x_size = region.getWidth() / yCellCount;
y_size = region.getHeight() / xCellCount;
// The grid will hold a trinagle for each cell, so a point (x,y) will lie
// in the cell representing the grid partition of region to a
// xCellCount on yCellCount grid
grid = new Triangle[xCellCount][yCellCount];
Triangle colStartTriangle = indexDelaunay.find(middleOfCell(0, 0));
updateCellValues(0, 0, xCellCount - 1, yCellCount - 1, colStartTriangle);
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[private], parameter[delaunay, xCellCount, yCellCount, region]] begin[{]
assign[member[.indexDelaunay], member[.delaunay]]
assign[member[.indexRegion], member[.region]]
assign[member[.x_size], binary_operation[call[region.getWidth, parameter[]], /, member[.yCellCount]]]
assign[member[.y_size], binary_operation[call[region.getHeight, parameter[]], /, member[.xCellCount]]]
assign[member[.grid], ArrayCreator(dimensions=[MemberReference(member=xCellCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=yCellCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Triangle, sub_type=None))]
local_variable[type[Triangle], colStartTriangle]
call[.updateCellValues, parameter[literal[0], literal[0], binary_operation[member[.xCellCount], -, literal[1]], binary_operation[member[.yCellCount], -, literal[1]], member[.colStartTriangle]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[init] operator[SEP] identifier[DelaunayTriangulation] identifier[delaunay] , Keyword[int] identifier[xCellCount] , Keyword[int] identifier[yCellCount] , identifier[BoundingBox] identifier[region] operator[SEP] {
identifier[indexDelaunay] operator[=] identifier[delaunay] operator[SEP] identifier[indexRegion] operator[=] identifier[region] operator[SEP] identifier[x_size] operator[=] identifier[region] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[/] identifier[yCellCount] operator[SEP] identifier[y_size] operator[=] identifier[region] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[/] identifier[xCellCount] operator[SEP] identifier[grid] operator[=] Keyword[new] identifier[Triangle] operator[SEP] identifier[xCellCount] operator[SEP] operator[SEP] identifier[yCellCount] operator[SEP] operator[SEP] identifier[Triangle] identifier[colStartTriangle] operator[=] identifier[indexDelaunay] operator[SEP] identifier[find] operator[SEP] identifier[middleOfCell] operator[SEP] Other[0] , Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[updateCellValues] operator[SEP] Other[0] , Other[0] , identifier[xCellCount] operator[-] Other[1] , identifier[yCellCount] operator[-] Other[1] , identifier[colStartTriangle] operator[SEP] operator[SEP]
}
|
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx);
if (currentMessage != null && currentMessage.getExtras() != null) {
if (currentMessage.getExtras().refCnt() > 0) {
currentMessage.getExtras().release();
}
}
if (currentMessage != null && currentMessage.getFramingExtras() != null) {
if (currentMessage.getFramingExtras().refCnt() > 0) {
currentMessage.getFramingExtras().release();
}
}
resetDecoder();
} | class class_name[name] begin[{]
method[channelInactive, return_type[void], modifier[public], parameter[ctx]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=channelInactive, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[binary_operation[binary_operation[member[.currentMessage], !=, literal[null]], &&, binary_operation[call[currentMessage.getExtras, parameter[]], !=, literal[null]]]] begin[{]
if[binary_operation[call[currentMessage.getExtras, parameter[]], >, literal[0]]] begin[{]
call[currentMessage.getExtras, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.currentMessage], !=, literal[null]], &&, binary_operation[call[currentMessage.getFramingExtras, parameter[]], !=, literal[null]]]] begin[{]
if[binary_operation[call[currentMessage.getFramingExtras, parameter[]], >, literal[0]]] begin[{]
call[currentMessage.getFramingExtras, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[.resetDecoder, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[channelInactive] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[super] operator[SEP] identifier[channelInactive] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentMessage] operator[!=] Other[null] operator[&&] identifier[currentMessage] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentMessage] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] operator[SEP] identifier[refCnt] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[currentMessage] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[currentMessage] operator[!=] Other[null] operator[&&] identifier[currentMessage] operator[SEP] identifier[getFramingExtras] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentMessage] operator[SEP] identifier[getFramingExtras] operator[SEP] operator[SEP] operator[SEP] identifier[refCnt] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[currentMessage] operator[SEP] identifier[getFramingExtras] operator[SEP] operator[SEP] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[resetDecoder] operator[SEP] operator[SEP] operator[SEP]
}
|
public void changePropStatStatus(String oldStatus, String newStatus, String responseDescription) {
Assert.isNotNull(oldStatus);
Assert.isNotNull(newStatus);
Element firstHref = getFirstChild(root, "href"); //$NON-NLS-1$
Assert.isTrue(firstHref == null || getNextSibling(firstHref, new String[] {"href", "status"}) == null); //$NON-NLS-1$ //$NON-NLS-2$
Element propstat = getFirstChild(root, "propstat"); //$NON-NLS-1$
while (propstat != null) {
String status = getChildText(propstat, "status", true); //$NON-NLS-1$
if (oldStatus.equals(status)) {
setChild(propstat, "status", newStatus, PropStat.childNames, true); //$NON-NLS-1$
if (responseDescription == null) {
Element responsedescription = getLastChild(propstat, "responsedescription"); //$NON-NLS-1$
if (responsedescription != null)
propstat.removeChild(responsedescription);
} else
setChild(propstat, "responsedescription", //$NON-NLS-1$
responseDescription, PropStat.childNames, false);
}
propstat = getTwin(propstat, true);
}
} | class class_name[name] begin[{]
method[changePropStatStatus, return_type[void], modifier[public], parameter[oldStatus, newStatus, responseDescription]] begin[{]
call[Assert.isNotNull, parameter[member[.oldStatus]]]
call[Assert.isNotNull, parameter[member[.newStatus]]]
local_variable[type[Element], firstHref]
call[Assert.isTrue, parameter[binary_operation[binary_operation[member[.firstHref], ==, literal[null]], ||, binary_operation[call[.getNextSibling, parameter[member[.firstHref], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="href"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]], ==, literal[null]]]]]
local_variable[type[Element], propstat]
while[binary_operation[member[.propstat], !=, literal[null]]] begin[{]
local_variable[type[String], status]
if[call[oldStatus.equals, parameter[member[.status]]]] begin[{]
call[.setChild, parameter[member[.propstat], literal["status"], member[.newStatus], member[PropStat.childNames], literal[true]]]
if[binary_operation[member[.responseDescription], ==, literal[null]]] begin[{]
local_variable[type[Element], responsedescription]
if[binary_operation[member[.responsedescription], !=, literal[null]]] begin[{]
call[propstat.removeChild, parameter[member[.responsedescription]]]
else begin[{]
None
end[}]
else begin[{]
call[.setChild, parameter[member[.propstat], literal["responsedescription"], member[.responseDescription], member[PropStat.childNames], literal[false]]]
end[}]
else begin[{]
None
end[}]
assign[member[.propstat], call[.getTwin, parameter[member[.propstat], literal[true]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[changePropStatStatus] operator[SEP] identifier[String] identifier[oldStatus] , identifier[String] identifier[newStatus] , identifier[String] identifier[responseDescription] operator[SEP] {
identifier[Assert] operator[SEP] identifier[isNotNull] operator[SEP] identifier[oldStatus] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[isNotNull] operator[SEP] identifier[newStatus] operator[SEP] operator[SEP] identifier[Element] identifier[firstHref] operator[=] identifier[getFirstChild] operator[SEP] identifier[root] , literal[String] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[isTrue] operator[SEP] identifier[firstHref] operator[==] Other[null] operator[||] identifier[getNextSibling] operator[SEP] identifier[firstHref] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] identifier[Element] identifier[propstat] operator[=] identifier[getFirstChild] operator[SEP] identifier[root] , literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[propstat] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[status] operator[=] identifier[getChildText] operator[SEP] identifier[propstat] , literal[String] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldStatus] operator[SEP] identifier[equals] operator[SEP] identifier[status] operator[SEP] operator[SEP] {
identifier[setChild] operator[SEP] identifier[propstat] , literal[String] , identifier[newStatus] , identifier[PropStat] operator[SEP] identifier[childNames] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responseDescription] operator[==] Other[null] operator[SEP] {
identifier[Element] identifier[responsedescription] operator[=] identifier[getLastChild] operator[SEP] identifier[propstat] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responsedescription] operator[!=] Other[null] operator[SEP] identifier[propstat] operator[SEP] identifier[removeChild] operator[SEP] identifier[responsedescription] operator[SEP] operator[SEP]
}
Keyword[else] identifier[setChild] operator[SEP] identifier[propstat] , literal[String] , identifier[responseDescription] , identifier[PropStat] operator[SEP] identifier[childNames] , literal[boolean] operator[SEP] operator[SEP]
}
identifier[propstat] operator[=] identifier[getTwin] operator[SEP] identifier[propstat] , literal[boolean] operator[SEP] operator[SEP]
}
}
|
public Map<?, ?> getValueMap(String label) {
PrimitiveObject o = getPrimitiveObject(VALUE, label, ObjectUtil.MAP, "Map");
if (o == null) {
return null;
}
return (Map<?, ?>) o.getObject();
} | class class_name[name] begin[{]
method[getValueMap, return_type[type[Map]], modifier[public], parameter[label]] begin[{]
local_variable[type[PrimitiveObject], o]
if[binary_operation[member[.o], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Map, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[getValueMap] operator[SEP] identifier[String] identifier[label] operator[SEP] {
identifier[PrimitiveObject] identifier[o] operator[=] identifier[getPrimitiveObject] operator[SEP] identifier[VALUE] , identifier[label] , identifier[ObjectUtil] operator[SEP] identifier[MAP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[o] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String decode(String s, String enc, boolean decodeSlash, boolean formEncoding, StringBuilder buffer) {
buffer.setLength(0);
boolean needToChange = false;
int numChars = s.length();
int i = 0;
while (i < numChars) {
char c = s.charAt(i);
if (c == '+') {
if (formEncoding) {
buffer.append(' ');
i++;
needToChange = true;
} else {
i++;
buffer.append(c);
}
} else if (c == '%' || c > 127) {
/*
* Starting with this instance of a character
* that needs to be encoded, process all
* consecutive substrings of the form %xy. Each
* substring %xy will yield a byte. Convert all
* consecutive bytes obtained this way to whatever
* character(s) they represent in the provided
* encoding.
*
* Note that we need to decode the whole rest of the value, we can't just decode
* three characters. For multi code point characters there if the code point can be
* represented as an alphanumeric
*/
try {
// guess the size of the remaining bytes
// of remaining bytes
// this works for percent encoded characters,
// not so much for unencoded bytes
byte[] bytes = new byte[numChars - i + 1];
int pos = 0;
while ((i < numChars)) {
if (c == '%') {
char p1 = Character.toLowerCase(s.charAt(i + 1));
char p2 = Character.toLowerCase(s.charAt(i + 2));
if (!decodeSlash && ((p1 == '2' && p2 == 'f') || (p1 == '5' && p2 == 'c'))) {
if(pos + 2 >= bytes.length) {
bytes = expandBytes(bytes);
}
bytes[pos++] = (byte) c;
// should be copied with preserved upper/lower case
bytes[pos++] = (byte) s.charAt(i + 1);
bytes[pos++] = (byte) s.charAt(i + 2);
i += 3;
if (i < numChars) {
c = s.charAt(i);
}
continue;
}
int v = 0;
if (p1 >= '0' && p1 <= '9') {
v = (p1 - '0') << 4;
} else if (p1 >= 'a' && p1 <= 'f') {
v = (p1 - 'a' + 10) << 4;
} else {
throw UndertowMessages.MESSAGES.failedToDecodeURL(s, enc, null);
}
if (p2 >= '0' && p2 <= '9') {
v += (p2 - '0');
} else if (p2 >= 'a' && p2 <= 'f') {
v += (p2 - 'a' + 10);
} else {
throw UndertowMessages.MESSAGES.failedToDecodeURL(s, enc, null);
}
if (v < 0) {
throw UndertowMessages.MESSAGES.failedToDecodeURL(s, enc, null);
}
if(pos == bytes.length) {
bytes = expandBytes(bytes);
}
bytes[pos++] = (byte) v;
i += 3;
if (i < numChars) {
c = s.charAt(i);
}
} else if (c == '+' && formEncoding) {
if(pos == bytes.length) {
bytes = expandBytes(bytes);
}
bytes[pos++] = (byte) ' ';
++i;
if (i < numChars) {
c = s.charAt(i);
}
} else {
if (pos == bytes.length) {
bytes = expandBytes(bytes);
}
++i;
if(c >> 8 != 0) {
bytes[pos++] = (byte) (c >> 8);
if (pos == bytes.length) {
bytes = expandBytes(bytes);
}
bytes[pos++] = (byte) c;
} else {
bytes[pos++] = (byte) c;
if (i < numChars) {
c = s.charAt(i);
}
}
}
}
String decoded = new String(bytes, 0, pos, enc);
buffer.append(decoded);
} catch (NumberFormatException e) {
throw UndertowMessages.MESSAGES.failedToDecodeURL(s, enc, e);
} catch (UnsupportedEncodingException e) {
throw UndertowMessages.MESSAGES.failedToDecodeURL(s, enc, e);
}
needToChange = true;
break;
} else {
buffer.append(c);
i++;
}
}
return (needToChange ? buffer.toString() : s);
} | class class_name[name] begin[{]
method[decode, return_type[type[String]], modifier[public static], parameter[s, enc, decodeSlash, formEncoding, buffer]] begin[{]
call[buffer.setLength, parameter[literal[0]]]
local_variable[type[boolean], needToChange]
local_variable[type[int], numChars]
local_variable[type[int], i]
while[binary_operation[member[.i], <, member[.numChars]]] begin[{]
local_variable[type[char], c]
if[binary_operation[member[.c], ==, literal['+']]] begin[{]
if[member[.formEncoding]] begin[{]
call[buffer.append, parameter[literal[' ']]]
member[.i]
assign[member[.needToChange], literal[true]]
else begin[{]
member[.i]
call[buffer.append, parameter[member[.c]]]
end[}]
else begin[{]
if[binary_operation[binary_operation[member[.c], ==, literal['%']], ||, binary_operation[member[.c], >, literal[127]]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=numChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=bytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=pos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+'), operator===), operandr=MemberReference(member=formEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expandBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), type=BasicType(dimensions=[], name=byte))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expandBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expandBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), name=p1)], modifiers=set(), type=BasicType(dimensions=[], name=char)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), name=p2)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=decodeSlash, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='2'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), operator===), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='5'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='c'), operator===), operator=&&), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expandBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None)])), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=v)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), operator=<=), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=failedToDecodeURL, postfix_operators=[], prefix_operators=[], qualifier=UndertowMessages.MESSAGES, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=<<)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=<<)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), operator=<=), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=failedToDecodeURL, postfix_operators=[], prefix_operators=[], qualifier=UndertowMessages.MESSAGES, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=-)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=failedToDecodeURL, postfix_operators=[], prefix_operators=[], qualifier=UndertowMessages.MESSAGES, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expandBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None)]))]))]), condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=decoded)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=decoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=failedToDecodeURL, postfix_operators=[], prefix_operators=[], qualifier=UndertowMessages.MESSAGES, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException'])), CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=failedToDecodeURL, postfix_operators=[], prefix_operators=[], qualifier=UndertowMessages.MESSAGES, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
assign[member[.needToChange], literal[true]]
BreakStatement(goto=None, label=None)
else begin[{]
call[buffer.append, parameter[member[.c]]]
member[.i]
end[}]
end[}]
end[}]
return[TernaryExpression(condition=MemberReference(member=needToChange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[decode] operator[SEP] identifier[String] identifier[s] , identifier[String] identifier[enc] , Keyword[boolean] identifier[decodeSlash] , Keyword[boolean] identifier[formEncoding] , identifier[StringBuilder] identifier[buffer] operator[SEP] {
identifier[buffer] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[boolean] identifier[needToChange] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[numChars] operator[=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[numChars] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[formEncoding] operator[SEP] {
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[needToChange] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[i] operator[++] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[||] identifier[c] operator[>] Other[127] operator[SEP] {
Keyword[try] {
Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[numChars] operator[-] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[numChars] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[char] identifier[p1] operator[=] identifier[Character] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[char] identifier[p2] operator[=] identifier[Character] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[decodeSlash] operator[&&] operator[SEP] operator[SEP] identifier[p1] operator[==] literal[String] operator[&&] identifier[p2] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[p1] operator[==] literal[String] operator[&&] identifier[p2] operator[==] literal[String] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[pos] operator[+] Other[2] operator[>=] identifier[bytes] operator[SEP] identifier[length] operator[SEP] {
identifier[bytes] operator[=] identifier[expandBytes] operator[SEP] identifier[bytes] operator[SEP] operator[SEP]
}
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[c] operator[SEP] identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[2] operator[SEP] operator[SEP] identifier[i] operator[+=] Other[3] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[numChars] operator[SEP] {
identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[continue] operator[SEP]
}
Keyword[int] identifier[v] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[p1] operator[>=] literal[String] operator[&&] identifier[p1] operator[<=] literal[String] operator[SEP] {
identifier[v] operator[=] operator[SEP] identifier[p1] operator[-] literal[String] operator[SEP] operator[<<] Other[4] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[p1] operator[>=] literal[String] operator[&&] identifier[p1] operator[<=] literal[String] operator[SEP] {
identifier[v] operator[=] operator[SEP] identifier[p1] operator[-] literal[String] operator[+] Other[10] operator[SEP] operator[<<] Other[4] operator[SEP]
}
Keyword[else] {
Keyword[throw] identifier[UndertowMessages] operator[SEP] identifier[MESSAGES] operator[SEP] identifier[failedToDecodeURL] operator[SEP] identifier[s] , identifier[enc] , Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[p2] operator[>=] literal[String] operator[&&] identifier[p2] operator[<=] literal[String] operator[SEP] {
identifier[v] operator[+=] operator[SEP] identifier[p2] operator[-] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[p2] operator[>=] literal[String] operator[&&] identifier[p2] operator[<=] literal[String] operator[SEP] {
identifier[v] operator[+=] operator[SEP] identifier[p2] operator[-] literal[String] operator[+] Other[10] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] identifier[UndertowMessages] operator[SEP] identifier[MESSAGES] operator[SEP] identifier[failedToDecodeURL] operator[SEP] identifier[s] , identifier[enc] , Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[v] operator[<] Other[0] operator[SEP] {
Keyword[throw] identifier[UndertowMessages] operator[SEP] identifier[MESSAGES] operator[SEP] identifier[failedToDecodeURL] operator[SEP] identifier[s] , identifier[enc] , Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pos] operator[==] identifier[bytes] operator[SEP] identifier[length] operator[SEP] {
identifier[bytes] operator[=] identifier[expandBytes] operator[SEP] identifier[bytes] operator[SEP] operator[SEP]
}
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[v] operator[SEP] identifier[i] operator[+=] Other[3] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[numChars] operator[SEP] {
identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[&&] identifier[formEncoding] operator[SEP] {
Keyword[if] operator[SEP] identifier[pos] operator[==] identifier[bytes] operator[SEP] identifier[length] operator[SEP] {
identifier[bytes] operator[=] identifier[expandBytes] operator[SEP] identifier[bytes] operator[SEP] operator[SEP]
}
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] literal[String] operator[SEP] operator[++] identifier[i] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[numChars] operator[SEP] {
identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[pos] operator[==] identifier[bytes] operator[SEP] identifier[length] operator[SEP] {
identifier[bytes] operator[=] identifier[expandBytes] operator[SEP] identifier[bytes] operator[SEP] operator[SEP]
} operator[++] identifier[i] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>] operator[>] Other[8] operator[!=] Other[0] operator[SEP] {
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[c] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[==] identifier[bytes] operator[SEP] identifier[length] operator[SEP] {
identifier[bytes] operator[=] identifier[expandBytes] operator[SEP] identifier[bytes] operator[SEP] operator[SEP]
}
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[c] operator[SEP]
}
Keyword[else] {
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[c] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[numChars] operator[SEP] {
identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
}
}
}
identifier[String] identifier[decoded] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[bytes] , Other[0] , identifier[pos] , identifier[enc] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[decoded] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] {
Keyword[throw] identifier[UndertowMessages] operator[SEP] identifier[MESSAGES] operator[SEP] identifier[failedToDecodeURL] operator[SEP] identifier[s] , identifier[enc] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] {
Keyword[throw] identifier[UndertowMessages] operator[SEP] identifier[MESSAGES] operator[SEP] identifier[failedToDecodeURL] operator[SEP] identifier[s] , identifier[enc] , identifier[e] operator[SEP] operator[SEP]
}
identifier[needToChange] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[else] {
identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP]
}
}
Keyword[return] operator[SEP] identifier[needToChange] operator[?] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] identifier[s] operator[SEP] operator[SEP]
}
|
public Chain getCurrentChain(){
if ( current_model_pos >= structure.nrModels()){
return null;
}
List<Chain> model = structure.getModel(current_model_pos);
if ( current_chain_pos >= model.size() ){
return null;
}
return model.get(current_chain_pos);
} | class class_name[name] begin[{]
method[getCurrentChain, return_type[type[Chain]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.current_model_pos], >=, call[structure.nrModels, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[List], model]
if[binary_operation[member[.current_chain_pos], >=, call[model.size, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[model.get, parameter[member[.current_chain_pos]]]]
end[}]
END[}] | Keyword[public] identifier[Chain] identifier[getCurrentChain] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[current_model_pos] operator[>=] identifier[structure] operator[SEP] identifier[nrModels] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[List] operator[<] identifier[Chain] operator[>] identifier[model] operator[=] identifier[structure] operator[SEP] identifier[getModel] operator[SEP] identifier[current_model_pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[current_chain_pos] operator[>=] identifier[model] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] identifier[model] operator[SEP] identifier[get] operator[SEP] identifier[current_chain_pos] operator[SEP] operator[SEP]
}
|
public void marshall(ContinuousExportDescription continuousExportDescription, ProtocolMarshaller protocolMarshaller) {
if (continuousExportDescription == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(continuousExportDescription.getExportId(), EXPORTID_BINDING);
protocolMarshaller.marshall(continuousExportDescription.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(continuousExportDescription.getStatusDetail(), STATUSDETAIL_BINDING);
protocolMarshaller.marshall(continuousExportDescription.getS3Bucket(), S3BUCKET_BINDING);
protocolMarshaller.marshall(continuousExportDescription.getStartTime(), STARTTIME_BINDING);
protocolMarshaller.marshall(continuousExportDescription.getStopTime(), STOPTIME_BINDING);
protocolMarshaller.marshall(continuousExportDescription.getDataSource(), DATASOURCE_BINDING);
protocolMarshaller.marshall(continuousExportDescription.getSchemaStorageConfig(), SCHEMASTORAGECONFIG_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[continuousExportDescription, protocolMarshaller]] begin[{]
if[binary_operation[member[.continuousExportDescription], ==, 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=getExportId, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=EXPORTID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=STATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatusDetail, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=STATUSDETAIL_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getS3Bucket, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=S3BUCKET_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStartTime, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=STARTTIME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStopTime, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=STOPTIME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDataSource, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=DATASOURCE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSchemaStorageConfig, postfix_operators=[], prefix_operators=[], qualifier=continuousExportDescription, selectors=[], type_arguments=None), MemberReference(member=SCHEMASTORAGECONFIG_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[ContinuousExportDescription] identifier[continuousExportDescription] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[continuousExportDescription] 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[continuousExportDescription] operator[SEP] identifier[getExportId] operator[SEP] operator[SEP] , identifier[EXPORTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[continuousExportDescription] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[continuousExportDescription] operator[SEP] identifier[getStatusDetail] operator[SEP] operator[SEP] , identifier[STATUSDETAIL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[continuousExportDescription] operator[SEP] identifier[getS3Bucket] operator[SEP] operator[SEP] , identifier[S3BUCKET_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[continuousExportDescription] operator[SEP] identifier[getStartTime] operator[SEP] operator[SEP] , identifier[STARTTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[continuousExportDescription] operator[SEP] identifier[getStopTime] operator[SEP] operator[SEP] , identifier[STOPTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[continuousExportDescription] operator[SEP] identifier[getDataSource] operator[SEP] operator[SEP] , identifier[DATASOURCE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[continuousExportDescription] operator[SEP] identifier[getSchemaStorageConfig] operator[SEP] operator[SEP] , identifier[SCHEMASTORAGECONFIG_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 boolean isPublisherWrapped(AbstractProject<?, ?> project, Class<T> type) {
return find(project, type) != null;
} | class class_name[name] begin[{]
method[isPublisherWrapped, return_type[type[boolean]], modifier[public], parameter[project, type]] begin[{]
return[binary_operation[call[.find, parameter[member[.project], member[.type]]], !=, literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isPublisherWrapped] operator[SEP] identifier[AbstractProject] operator[<] operator[?] , operator[?] operator[>] identifier[project] , identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] {
Keyword[return] identifier[find] operator[SEP] identifier[project] , identifier[type] operator[SEP] operator[!=] Other[null] operator[SEP]
}
|
public SynchronizedCollection<? extends Space> getSpaces() {
synchronized (getSpaceRepositoryMutex()) {
return Collections3.synchronizedCollection(Collections.unmodifiableCollection(this.spaces.values()),
getSpaceRepositoryMutex());
}
} | class class_name[name] begin[{]
method[getSpaces, return_type[type[SynchronizedCollection]], modifier[public], parameter[]] begin[{]
SYNCHRONIZED[call[.getSpaceRepositoryMutex, parameter[]]] BEGIN[{]
return[call[Collections3.synchronizedCollection, parameter[call[Collections.unmodifiableCollection, parameter[THIS[member[None.spaces]call[None.values, parameter[]]]]], call[.getSpaceRepositoryMutex, parameter[]]]]]
END[}]
end[}]
END[}] | Keyword[public] identifier[SynchronizedCollection] operator[<] operator[?] Keyword[extends] identifier[Space] operator[>] identifier[getSpaces] operator[SEP] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[getSpaceRepositoryMutex] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Collections3] operator[SEP] identifier[synchronizedCollection] operator[SEP] identifier[Collections] operator[SEP] identifier[unmodifiableCollection] operator[SEP] Keyword[this] operator[SEP] identifier[spaces] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] , identifier[getSpaceRepositoryMutex] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void marshall(InstanceStateChangeReason instanceStateChangeReason, ProtocolMarshaller protocolMarshaller) {
if (instanceStateChangeReason == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(instanceStateChangeReason.getCode(), CODE_BINDING);
protocolMarshaller.marshall(instanceStateChangeReason.getMessage(), MESSAGE_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[instanceStateChangeReason, protocolMarshaller]] begin[{]
if[binary_operation[member[.instanceStateChangeReason], ==, 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=getCode, postfix_operators=[], prefix_operators=[], qualifier=instanceStateChangeReason, selectors=[], type_arguments=None), MemberReference(member=CODE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=instanceStateChangeReason, selectors=[], type_arguments=None), MemberReference(member=MESSAGE_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[InstanceStateChangeReason] identifier[instanceStateChangeReason] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[instanceStateChangeReason] 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[instanceStateChangeReason] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] , identifier[CODE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[instanceStateChangeReason] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[MESSAGE_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public synchronized void dispose() {
if (saslClient != null) {
try {
saslClient.dispose();
} catch (SaslException e) {
// ignore
} finally {
saslClient = null;
}
}
} | class class_name[name] begin[{]
method[dispose, return_type[void], modifier[synchronized public], parameter[]] begin[{]
if[binary_operation[member[.saslClient], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=dispose, postfix_operators=[], prefix_operators=[], qualifier=saslClient, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SaslException']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=saslClient, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[dispose] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[saslClient] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[saslClient] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SaslException] identifier[e] operator[SEP] {
}
Keyword[finally] {
identifier[saslClient] operator[=] Other[null] operator[SEP]
}
}
}
|
public synchronized boolean queueOrStartNonPersistentTimerAlarm(TimerNpImpl timer, EJBModuleMetaDataImpl module) {
if (ivStopping) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "not starting timer alarm after application stop: " + timer);
return false;
} else {
if (isStarted()) {
timer.schedule();
} else if (ivModuleBeingAddedLate != null && ivModuleBeingAddedLate != module) // d607800.CodRv
{
timer.schedule();
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "queueing timer alarm until full application start: " + timer);
if (ivQueuedNonPersistentTimers == null) {
ivQueuedNonPersistentTimers = new ArrayList<TimerNpImpl>();
}
ivQueuedNonPersistentTimers.add(timer);
}
}
return true;
} | class class_name[name] begin[{]
method[queueOrStartNonPersistentTimerAlarm, return_type[type[boolean]], modifier[synchronized public], parameter[timer, module]] begin[{]
if[member[.ivStopping]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[literal["not starting timer alarm after application stop: "], +, member[.timer]]]]
else begin[{]
None
end[}]
return[literal[false]]
else begin[{]
if[call[.isStarted, parameter[]]] begin[{]
call[timer.schedule, parameter[]]
else begin[{]
if[binary_operation[binary_operation[member[.ivModuleBeingAddedLate], !=, literal[null]], &&, binary_operation[member[.ivModuleBeingAddedLate], !=, member[.module]]]] begin[{]
call[timer.schedule, parameter[]]
else begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[literal["queueing timer alarm until full application start: "], +, member[.timer]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.ivQueuedNonPersistentTimers], ==, literal[null]]] begin[{]
assign[member[.ivQueuedNonPersistentTimers], 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=TimerNpImpl, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
call[ivQueuedNonPersistentTimers.add, parameter[member[.timer]]]
end[}]
end[}]
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[queueOrStartNonPersistentTimerAlarm] operator[SEP] identifier[TimerNpImpl] identifier[timer] , identifier[EJBModuleMetaDataImpl] identifier[module] operator[SEP] {
Keyword[if] operator[SEP] identifier[ivStopping] 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[+] identifier[timer] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[isStarted] operator[SEP] operator[SEP] operator[SEP] {
identifier[timer] operator[SEP] identifier[schedule] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[ivModuleBeingAddedLate] operator[!=] Other[null] operator[&&] identifier[ivModuleBeingAddedLate] operator[!=] identifier[module] operator[SEP] {
identifier[timer] operator[SEP] identifier[schedule] operator[SEP] 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[timer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivQueuedNonPersistentTimers] operator[==] Other[null] operator[SEP] {
identifier[ivQueuedNonPersistentTimers] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[TimerNpImpl] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ivQueuedNonPersistentTimers] operator[SEP] identifier[add] operator[SEP] identifier[timer] operator[SEP] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public TabularResult process(final InputStream inputStream, final Request request) {
CSVReader reader = new CSVReader(new InputStreamReader(inputStream));
try {
String[] headerRow = reader.readNext();
if (headerRow != null) {
HeaderDefinition headerDef = HeaderDefinition.of(Arrays.asList(headerRow));
List<Row> rows = new ArrayList<Row>();
String[] next = reader.readNext();
while (next != null) {
if (next.length > headerRow.length) {
// This row is not the same length as the header row, record how long it is so we can patch in a longer header afterwards.
String[] stretchedHeaderRow = new String[next.length];
System.arraycopy(headerRow, 0, stretchedHeaderRow, 0, headerRow.length);
for (int i = headerRow.length; i < next.length; i++) {
stretchedHeaderRow[i] = "Column " + i;
}
headerRow = stretchedHeaderRow;
headerDef = HeaderDefinition.of(Arrays.asList(headerRow)); // create a new header with the extended column labels.
// NOTE: we DON'T go back and patch rows that we've already created. This is because the only case the header is used is
// to look up rows by name, and given those rows don't contain data for those columns, the logic in Row now just returns
// null in that case (the case where you ask for a row that isn't present).
}
Row row = Row.of(headerDef, next);
rows.add(row);
next = reader.readNext();
}
reader.close();
return TabularResult.of(headerDef, rows);
} else {
reader.close();
throw new QuandlRuntimeException("No data returned");
}
} catch (IOException ioe) {
throw new QuandlRuntimeException("Error reading input stream", ioe);
}
} | class class_name[name] begin[{]
method[process, return_type[type[TabularResult]], modifier[public], parameter[inputStream, request]] begin[{]
local_variable[type[CSVReader], reader]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readNext, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=headerRow)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=headerRow, 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=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No data returned")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QuandlRuntimeException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=headerRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=HeaderDefinition, selectors=[], type_arguments=None), name=headerDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HeaderDefinition, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=rows)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readNext, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=next)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=headerRow, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=stretchedHeaderRow)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=headerRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=stretchedHeaderRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=headerRow, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stretchedHeaderRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Column "), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=headerRow, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=headerRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=stretchedHeaderRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=headerDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=headerRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=HeaderDefinition, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=headerDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Row, selectors=[], type_arguments=None), name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readNext, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=headerDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=TabularResult, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error reading input stream"), MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QuandlRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[TabularResult] identifier[process] operator[SEP] Keyword[final] identifier[InputStream] identifier[inputStream] , Keyword[final] identifier[Request] identifier[request] operator[SEP] {
identifier[CSVReader] identifier[reader] operator[=] Keyword[new] identifier[CSVReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[String] operator[SEP] operator[SEP] identifier[headerRow] operator[=] identifier[reader] operator[SEP] identifier[readNext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[headerRow] operator[!=] Other[null] operator[SEP] {
identifier[HeaderDefinition] identifier[headerDef] operator[=] identifier[HeaderDefinition] operator[SEP] identifier[of] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[headerRow] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Row] operator[>] identifier[rows] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Row] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[next] operator[=] identifier[reader] operator[SEP] identifier[readNext] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[next] operator[SEP] identifier[length] operator[>] identifier[headerRow] operator[SEP] identifier[length] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[stretchedHeaderRow] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[next] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[headerRow] , Other[0] , identifier[stretchedHeaderRow] , Other[0] , identifier[headerRow] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[headerRow] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[<] identifier[next] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[stretchedHeaderRow] operator[SEP] identifier[i] operator[SEP] operator[=] literal[String] operator[+] identifier[i] operator[SEP]
}
identifier[headerRow] operator[=] identifier[stretchedHeaderRow] operator[SEP] identifier[headerDef] operator[=] identifier[HeaderDefinition] operator[SEP] identifier[of] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[headerRow] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Row] identifier[row] operator[=] identifier[Row] operator[SEP] identifier[of] operator[SEP] identifier[headerDef] , identifier[next] operator[SEP] operator[SEP] identifier[rows] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[next] operator[=] identifier[reader] operator[SEP] identifier[readNext] operator[SEP] operator[SEP] operator[SEP]
}
identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[TabularResult] operator[SEP] identifier[of] operator[SEP] identifier[headerDef] , identifier[rows] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[QuandlRuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] {
Keyword[throw] Keyword[new] identifier[QuandlRuntimeException] operator[SEP] literal[String] , identifier[ioe] operator[SEP] operator[SEP]
}
}
|
public int[] extract_DevVarULongArray(Any in) throws DevFailed
{
int[] data = null;
try
{
data = DevVarULongArrayHelper.extract(in);
}
catch (BAD_OPERATION ex)
{
throw_bad_type("DevVarULongArray");
}
return data;
} | class class_name[name] begin[{]
method[extract_DevVarULongArray, return_type[type[int]], modifier[public], parameter[in]] begin[{]
local_variable[type[int], data]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extract, postfix_operators=[], prefix_operators=[], qualifier=DevVarULongArrayHelper, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DevVarULongArray")], member=throw_bad_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['BAD_OPERATION']))], finally_block=None, label=None, resources=None)
return[member[.data]]
end[}]
END[}] | Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[extract_DevVarULongArray] operator[SEP] identifier[Any] identifier[in] operator[SEP] Keyword[throws] identifier[DevFailed] {
Keyword[int] operator[SEP] operator[SEP] identifier[data] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[data] operator[=] identifier[DevVarULongArrayHelper] operator[SEP] identifier[extract] operator[SEP] identifier[in] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[BAD_OPERATION] identifier[ex] operator[SEP] {
identifier[throw_bad_type] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[data] operator[SEP]
}
|
public Reference addDetail() { //3
Reference t = new Reference();
if (this.detail == null)
this.detail = new ArrayList<Reference>();
this.detail.add(t);
return t;
} | class class_name[name] begin[{]
method[addDetail, return_type[type[Reference]], modifier[public], parameter[]] begin[{]
local_variable[type[Reference], t]
if[binary_operation[THIS[member[None.detail]], ==, literal[null]]] begin[{]
assign[THIS[member[None.detail]], 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=Reference, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
THIS[member[None.detail]call[None.add, parameter[member[.t]]]]
return[member[.t]]
end[}]
END[}] | Keyword[public] identifier[Reference] identifier[addDetail] operator[SEP] operator[SEP] {
identifier[Reference] identifier[t] operator[=] Keyword[new] identifier[Reference] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[detail] operator[==] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[detail] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Reference] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[detail] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP]
}
|
void printBanner() {
PrintStream printStream = System.out;
for (String lineLocal : BANNER) {
printStream.println(lineLocal);
}
printStream.print(line);
String version = Audit4jBanner.class.getPackage().getImplementationVersion();
if (version == null) {
printStream.println("(v" + CoreConstants.RELEASE_VERSION + ")");
} else {
printStream.println("(v" + version + ")");
}
printStream.println();
} | class class_name[name] begin[{]
method[printBanner, return_type[void], modifier[default], parameter[]] begin[{]
local_variable[type[PrintStream], printStream]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lineLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=printStream, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=BANNER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=lineLocal)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[printStream.print, parameter[member[.line]]]
local_variable[type[String], version]
if[binary_operation[member[.version], ==, literal[null]]] begin[{]
call[printStream.println, parameter[binary_operation[binary_operation[literal["(v"], +, member[CoreConstants.RELEASE_VERSION]], +, literal[")"]]]]
else begin[{]
call[printStream.println, parameter[binary_operation[binary_operation[literal["(v"], +, member[.version]], +, literal[")"]]]]
end[}]
call[printStream.println, parameter[]]
end[}]
END[}] | Keyword[void] identifier[printBanner] operator[SEP] operator[SEP] {
identifier[PrintStream] identifier[printStream] operator[=] identifier[System] operator[SEP] identifier[out] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[lineLocal] operator[:] identifier[BANNER] operator[SEP] {
identifier[printStream] operator[SEP] identifier[println] operator[SEP] identifier[lineLocal] operator[SEP] operator[SEP]
}
identifier[printStream] operator[SEP] identifier[print] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[String] identifier[version] operator[=] identifier[Audit4jBanner] operator[SEP] Keyword[class] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getImplementationVersion] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[==] Other[null] operator[SEP] {
identifier[printStream] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[CoreConstants] operator[SEP] identifier[RELEASE_VERSION] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[printStream] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[version] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[printStream] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP]
}
|
protected AstNode parseAlterStatement( DdlTokenStream tokens,
AstNode parentNode ) throws ParsingException {
assert tokens != null;
assert parentNode != null;
if (tokens.matches(ALTER, TABLE)) {
return parseAlterTableStatement(tokens, parentNode);
} else if (tokens.matches("ALTER", "DOMAIN")) {
markStartOfStatement(tokens);
tokens.consume("ALTER", "DOMAIN");
String domainName = parseName(tokens);
AstNode alterNode = nodeFactory().node(domainName, parentNode, TYPE_ALTER_DOMAIN_STATEMENT);
parseUntilTerminator(tokens);
markEndOfStatement(tokens, alterNode);
return alterNode;
}
return null;
} | class class_name[name] begin[{]
method[parseAlterStatement, return_type[type[AstNode]], modifier[protected], parameter[tokens, parentNode]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=tokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=parentNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
if[call[tokens.matches, parameter[member[.ALTER], member[.TABLE]]]] begin[{]
return[call[.parseAlterTableStatement, parameter[member[.tokens], member[.parentNode]]]]
else begin[{]
if[call[tokens.matches, parameter[literal["ALTER"], literal["DOMAIN"]]]] begin[{]
call[.markStartOfStatement, parameter[member[.tokens]]]
call[tokens.consume, parameter[literal["ALTER"], literal["DOMAIN"]]]
local_variable[type[String], domainName]
local_variable[type[AstNode], alterNode]
call[.parseUntilTerminator, parameter[member[.tokens]]]
call[.markEndOfStatement, parameter[member[.tokens], member[.alterNode]]]
return[member[.alterNode]]
else begin[{]
None
end[}]
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[protected] identifier[AstNode] identifier[parseAlterStatement] operator[SEP] identifier[DdlTokenStream] identifier[tokens] , identifier[AstNode] identifier[parentNode] operator[SEP] Keyword[throws] identifier[ParsingException] {
Keyword[assert] identifier[tokens] operator[!=] Other[null] operator[SEP] Keyword[assert] identifier[parentNode] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] identifier[ALTER] , identifier[TABLE] operator[SEP] operator[SEP] {
Keyword[return] identifier[parseAlterTableStatement] operator[SEP] identifier[tokens] , identifier[parentNode] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] {
identifier[markStartOfStatement] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] identifier[consume] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[domainName] operator[=] identifier[parseName] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] identifier[AstNode] identifier[alterNode] operator[=] identifier[nodeFactory] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[domainName] , identifier[parentNode] , identifier[TYPE_ALTER_DOMAIN_STATEMENT] operator[SEP] operator[SEP] identifier[parseUntilTerminator] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] identifier[markEndOfStatement] operator[SEP] identifier[tokens] , identifier[alterNode] operator[SEP] operator[SEP] Keyword[return] identifier[alterNode] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void setEscapingDirectives(
SoyNode node, Context context, List<EscapingMode> escapingModes) {
Preconditions.checkArgument(
(node instanceof PrintNode)
|| (node instanceof CallNode)
|| (node instanceof MsgFallbackGroupNode),
"Escaping directives may only be set for {print}, {msg}, or {call} nodes");
if (escapingModes != null) {
nodeToEscapingModes.put(node, ImmutableList.copyOf(escapingModes));
}
nodeToContext.put(node, context);
} | class class_name[name] begin[{]
method[setEscapingDirectives, return_type[void], modifier[public], parameter[node, context, escapingModes]] begin[{]
call[Preconditions.checkArgument, parameter[binary_operation[binary_operation[binary_operation[member[.node], instanceof, type[PrintNode]], ||, binary_operation[member[.node], instanceof, type[CallNode]]], ||, binary_operation[member[.node], instanceof, type[MsgFallbackGroupNode]]], literal["Escaping directives may only be set for {print}, {msg}, or {call} nodes"]]]
if[binary_operation[member[.escapingModes], !=, literal[null]]] begin[{]
call[nodeToEscapingModes.put, parameter[member[.node], call[ImmutableList.copyOf, parameter[member[.escapingModes]]]]]
else begin[{]
None
end[}]
call[nodeToContext.put, parameter[member[.node], member[.context]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setEscapingDirectives] operator[SEP] identifier[SoyNode] identifier[node] , identifier[Context] identifier[context] , identifier[List] operator[<] identifier[EscapingMode] operator[>] identifier[escapingModes] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] operator[SEP] identifier[node] Keyword[instanceof] identifier[PrintNode] operator[SEP] operator[||] operator[SEP] identifier[node] Keyword[instanceof] identifier[CallNode] operator[SEP] operator[||] operator[SEP] identifier[node] Keyword[instanceof] identifier[MsgFallbackGroupNode] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[escapingModes] operator[!=] Other[null] operator[SEP] {
identifier[nodeToEscapingModes] operator[SEP] identifier[put] operator[SEP] identifier[node] , identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[escapingModes] operator[SEP] operator[SEP] operator[SEP]
}
identifier[nodeToContext] operator[SEP] identifier[put] operator[SEP] identifier[node] , identifier[context] operator[SEP] operator[SEP]
}
|
private Pair<List<SSTableReader>, Multimap<DataTracker, SSTableReader>> getCompactingAndNonCompactingSSTables()
{
List<SSTableReader> allCompacting = new ArrayList<>();
Multimap<DataTracker, SSTableReader> allNonCompacting = HashMultimap.create();
for (Keyspace ks : Keyspace.all())
{
for (ColumnFamilyStore cfStore: ks.getColumnFamilyStores())
{
Set<SSTableReader> nonCompacting, allSSTables;
do
{
allSSTables = cfStore.getDataTracker().getSSTables();
nonCompacting = Sets.newHashSet(cfStore.getDataTracker().getUncompactingSSTables(allSSTables));
}
while (!(nonCompacting.isEmpty() || cfStore.getDataTracker().markCompacting(nonCompacting)));
allNonCompacting.putAll(cfStore.getDataTracker(), nonCompacting);
allCompacting.addAll(Sets.difference(allSSTables, nonCompacting));
}
}
return Pair.create(allCompacting, allNonCompacting);
} | class class_name[name] begin[{]
method[getCompactingAndNonCompactingSSTables, return_type[type[Pair]], modifier[private], parameter[]] begin[{]
local_variable[type[List], allCompacting]
local_variable[type[Multimap], allNonCompacting]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=nonCompacting), VariableDeclarator(dimensions=[], initializer=None, name=allSSTables)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SSTableReader, sub_type=None))], dimensions=[], name=Set, sub_type=None)), DoStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=allSSTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDataTracker, postfix_operators=[], prefix_operators=[], qualifier=cfStore, selectors=[MethodInvocation(arguments=[], member=getSSTables, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nonCompacting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDataTracker, postfix_operators=[], prefix_operators=[], qualifier=cfStore, selectors=[MethodInvocation(arguments=[MemberReference(member=allSSTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUncompactingSSTables, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newHashSet, postfix_operators=[], prefix_operators=[], qualifier=Sets, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=nonCompacting, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getDataTracker, postfix_operators=[], prefix_operators=[], qualifier=cfStore, selectors=[MethodInvocation(arguments=[MemberReference(member=nonCompacting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=markCompacting, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDataTracker, postfix_operators=[], prefix_operators=[], qualifier=cfStore, selectors=[], type_arguments=None), MemberReference(member=nonCompacting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=allNonCompacting, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=allSSTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nonCompacting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=difference, postfix_operators=[], prefix_operators=[], qualifier=Sets, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=allCompacting, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumnFamilyStores, postfix_operators=[], prefix_operators=[], qualifier=ks, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cfStore)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnFamilyStore, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=all, postfix_operators=[], prefix_operators=[], qualifier=Keyspace, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ks)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Keyspace, sub_type=None))), label=None)
return[call[Pair.create, parameter[member[.allCompacting], member[.allNonCompacting]]]]
end[}]
END[}] | Keyword[private] identifier[Pair] operator[<] identifier[List] operator[<] identifier[SSTableReader] operator[>] , identifier[Multimap] operator[<] identifier[DataTracker] , identifier[SSTableReader] operator[>] operator[>] identifier[getCompactingAndNonCompactingSSTables] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[SSTableReader] operator[>] identifier[allCompacting] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Multimap] operator[<] identifier[DataTracker] , identifier[SSTableReader] operator[>] identifier[allNonCompacting] operator[=] identifier[HashMultimap] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Keyspace] identifier[ks] operator[:] identifier[Keyspace] operator[SEP] identifier[all] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[ColumnFamilyStore] identifier[cfStore] operator[:] identifier[ks] operator[SEP] identifier[getColumnFamilyStores] operator[SEP] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[SSTableReader] operator[>] identifier[nonCompacting] , identifier[allSSTables] operator[SEP] Keyword[do] {
identifier[allSSTables] operator[=] identifier[cfStore] operator[SEP] identifier[getDataTracker] operator[SEP] operator[SEP] operator[SEP] identifier[getSSTables] operator[SEP] operator[SEP] operator[SEP] identifier[nonCompacting] operator[=] identifier[Sets] operator[SEP] identifier[newHashSet] operator[SEP] identifier[cfStore] operator[SEP] identifier[getDataTracker] operator[SEP] operator[SEP] operator[SEP] identifier[getUncompactingSSTables] operator[SEP] identifier[allSSTables] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] operator[!] operator[SEP] identifier[nonCompacting] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[cfStore] operator[SEP] identifier[getDataTracker] operator[SEP] operator[SEP] operator[SEP] identifier[markCompacting] operator[SEP] identifier[nonCompacting] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[allNonCompacting] operator[SEP] identifier[putAll] operator[SEP] identifier[cfStore] operator[SEP] identifier[getDataTracker] operator[SEP] operator[SEP] , identifier[nonCompacting] operator[SEP] operator[SEP] identifier[allCompacting] operator[SEP] identifier[addAll] operator[SEP] identifier[Sets] operator[SEP] identifier[difference] operator[SEP] identifier[allSSTables] , identifier[nonCompacting] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[Pair] operator[SEP] identifier[create] operator[SEP] identifier[allCompacting] , identifier[allNonCompacting] operator[SEP] operator[SEP]
}
|
public int getLength()
{
int length = 0;
for (TempBuffer ptr = _head; ptr != null; ptr = ptr.next()) {
length += ptr.length();
}
return length;
} | class class_name[name] begin[{]
method[getLength, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], length]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=ptr, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ptr, 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=_head, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=ptr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TempBuffer, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=ptr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=ptr, selectors=[], type_arguments=None))]), label=None)
return[member[.length]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getLength] operator[SEP] operator[SEP] {
Keyword[int] identifier[length] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[TempBuffer] identifier[ptr] operator[=] identifier[_head] operator[SEP] identifier[ptr] operator[!=] Other[null] operator[SEP] identifier[ptr] operator[=] identifier[ptr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
identifier[length] operator[+=] identifier[ptr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[length] operator[SEP]
}
|
public void marshall(ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes, ProtocolMarshaller protocolMarshaller) {
if (activityTaskFailedEventAttributes == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(activityTaskFailedEventAttributes.getReason(), REASON_BINDING);
protocolMarshaller.marshall(activityTaskFailedEventAttributes.getDetails(), DETAILS_BINDING);
protocolMarshaller.marshall(activityTaskFailedEventAttributes.getScheduledEventId(), SCHEDULEDEVENTID_BINDING);
protocolMarshaller.marshall(activityTaskFailedEventAttributes.getStartedEventId(), STARTEDEVENTID_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[activityTaskFailedEventAttributes, protocolMarshaller]] begin[{]
if[binary_operation[member[.activityTaskFailedEventAttributes], ==, 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=getReason, postfix_operators=[], prefix_operators=[], qualifier=activityTaskFailedEventAttributes, selectors=[], type_arguments=None), MemberReference(member=REASON_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDetails, postfix_operators=[], prefix_operators=[], qualifier=activityTaskFailedEventAttributes, selectors=[], type_arguments=None), MemberReference(member=DETAILS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getScheduledEventId, postfix_operators=[], prefix_operators=[], qualifier=activityTaskFailedEventAttributes, selectors=[], type_arguments=None), MemberReference(member=SCHEDULEDEVENTID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStartedEventId, postfix_operators=[], prefix_operators=[], qualifier=activityTaskFailedEventAttributes, selectors=[], type_arguments=None), MemberReference(member=STARTEDEVENTID_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[ActivityTaskFailedEventAttributes] identifier[activityTaskFailedEventAttributes] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[activityTaskFailedEventAttributes] 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[activityTaskFailedEventAttributes] operator[SEP] identifier[getReason] operator[SEP] operator[SEP] , identifier[REASON_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTaskFailedEventAttributes] operator[SEP] identifier[getDetails] operator[SEP] operator[SEP] , identifier[DETAILS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTaskFailedEventAttributes] operator[SEP] identifier[getScheduledEventId] operator[SEP] operator[SEP] , identifier[SCHEDULEDEVENTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityTaskFailedEventAttributes] operator[SEP] identifier[getStartedEventId] operator[SEP] operator[SEP] , identifier[STARTEDEVENTID_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]
}
}
|
@NonNull
public String event() {
String name = name();
if (!isNullOrEmpty(name)) {
return name;
}
return category();
} | class class_name[name] begin[{]
method[event, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[String], name]
if[call[.isNullOrEmpty, parameter[member[.name]]]] begin[{]
return[member[.name]]
else begin[{]
None
end[}]
return[call[.category, parameter[]]]
end[}]
END[}] | annotation[@] identifier[NonNull] Keyword[public] identifier[String] identifier[event] operator[SEP] operator[SEP] {
identifier[String] identifier[name] operator[=] identifier[name] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNullOrEmpty] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[return] identifier[name] operator[SEP]
}
Keyword[return] identifier[category] operator[SEP] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "typeId", scope = GetTypeChildren.class)
public JAXBElement<String> createGetTypeChildrenTypeId(String value) {
return new JAXBElement<String>(_GetTypeChildrenTypeId_QNAME,
String.class, GetTypeChildren.class, value);
} | class class_name[name] begin[{]
method[createGetTypeChildrenTypeId, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_GetTypeChildrenTypeId_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetTypeChildren, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[GetTypeChildren] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[String] operator[>] identifier[createGetTypeChildrenTypeId] operator[SEP] identifier[String] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[String] operator[>] operator[SEP] identifier[_GetTypeChildrenTypeId_QNAME] , identifier[String] operator[SEP] Keyword[class] , identifier[GetTypeChildren] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP]
}
|
@Override
public String quit() {
checkIsInMultiOrPipeline();
client.quit();
String quitReturn = client.getStatusCodeReply();
client.disconnect();
return quitReturn;
} | class class_name[name] begin[{]
method[quit, return_type[type[String]], modifier[public], parameter[]] begin[{]
call[.checkIsInMultiOrPipeline, parameter[]]
call[client.quit, parameter[]]
local_variable[type[String], quitReturn]
call[client.disconnect, parameter[]]
return[member[.quitReturn]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[quit] operator[SEP] operator[SEP] {
identifier[checkIsInMultiOrPipeline] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[quit] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[quitReturn] operator[=] identifier[client] operator[SEP] identifier[getStatusCodeReply] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[quitReturn] operator[SEP]
}
|
public PoolEvaluateAutoScaleHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
} | class class_name[name] begin[{]
method[withLastModified, return_type[type[PoolEvaluateAutoScaleHeaders]], modifier[public], parameter[lastModified]] begin[{]
if[binary_operation[member[.lastModified], ==, literal[null]]] begin[{]
assign[THIS[member[None.lastModified]], literal[null]]
else begin[{]
assign[THIS[member[None.lastModified]], ClassCreator(arguments=[MemberReference(member=lastModified, 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=DateTimeRfc1123, sub_type=None))]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[PoolEvaluateAutoScaleHeaders] identifier[withLastModified] operator[SEP] identifier[DateTime] identifier[lastModified] operator[SEP] {
Keyword[if] operator[SEP] identifier[lastModified] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[lastModified] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[lastModified] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
protected void openGalleryDialog() {
if (m_popup == null) {
m_popup = createPopup();
m_popup.center();
} else {
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getCurrentElement())) {
m_popup.searchElement(getCurrentElement());
} else {
m_popup.center();
}
}
} | class class_name[name] begin[{]
method[openGalleryDialog, return_type[void], modifier[protected], parameter[]] begin[{]
if[binary_operation[member[.m_popup], ==, literal[null]]] begin[{]
assign[member[.m_popup], call[.createPopup, parameter[]]]
call[m_popup.center, parameter[]]
else begin[{]
if[call[CmsStringUtil.isNotEmptyOrWhitespaceOnly, parameter[call[.getCurrentElement, parameter[]]]]] begin[{]
call[m_popup.searchElement, parameter[call[.getCurrentElement, parameter[]]]]
else begin[{]
call[m_popup.center, parameter[]]
end[}]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[openGalleryDialog] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_popup] operator[==] Other[null] operator[SEP] {
identifier[m_popup] operator[=] identifier[createPopup] operator[SEP] operator[SEP] operator[SEP] identifier[m_popup] operator[SEP] identifier[center] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isNotEmptyOrWhitespaceOnly] operator[SEP] identifier[getCurrentElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[m_popup] operator[SEP] identifier[searchElement] operator[SEP] identifier[getCurrentElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[m_popup] operator[SEP] identifier[center] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public void putLong(String key, long l) {
checkNotNull(key);
put(key, Long.toString(l));
} | class class_name[name] begin[{]
method[putLong, return_type[void], modifier[public], parameter[key, l]] begin[{]
call[.checkNotNull, parameter[member[.key]]]
call[.put, parameter[member[.key], call[Long.toString, parameter[member[.l]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[putLong] operator[SEP] identifier[String] identifier[key] , Keyword[long] identifier[l] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[l] operator[SEP] operator[SEP] operator[SEP]
}
|
public static int getRunPriority() {
String s = System.getProperty(RUN_PRIORITY_PROPERTY);
int priority = Thread.NORM_PRIORITY;
if (s != null) {
try {
priority = Integer.parseInt(s);
} catch (NumberFormatException ex) {
// priority remains Thread.NORM_PRIORITY
}
}
return priority;
} | class class_name[name] begin[{]
method[getRunPriority, return_type[type[int]], modifier[public static], parameter[]] begin[{]
local_variable[type[String], s]
local_variable[type[int], priority]
if[binary_operation[member[.s], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.priority]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[getRunPriority] operator[SEP] operator[SEP] {
identifier[String] identifier[s] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[RUN_PRIORITY_PROPERTY] operator[SEP] operator[SEP] Keyword[int] identifier[priority] operator[=] identifier[Thread] operator[SEP] identifier[NORM_PRIORITY] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[priority] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[ex] operator[SEP] {
}
}
Keyword[return] identifier[priority] operator[SEP]
}
|
public <T extends Enum<T>> T getEnum(Property<T> property, Class<T> enumClass) throws ConfigurationException {
return tryGet(property, s -> Enum.valueOf(enumClass, s));
} | class class_name[name] begin[{]
method[getEnum, return_type[type[T]], modifier[public], parameter[property, enumClass]] begin[{]
return[call[.tryGet, parameter[member[.property], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=enumClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Enum, selectors=[], type_arguments=None), parameters=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Enum] operator[<] identifier[T] operator[>] operator[>] identifier[T] identifier[getEnum] operator[SEP] identifier[Property] operator[<] identifier[T] operator[>] identifier[property] , identifier[Class] operator[<] identifier[T] operator[>] identifier[enumClass] operator[SEP] Keyword[throws] identifier[ConfigurationException] {
Keyword[return] identifier[tryGet] operator[SEP] identifier[property] , identifier[s] operator[->] identifier[Enum] operator[SEP] identifier[valueOf] operator[SEP] identifier[enumClass] , identifier[s] operator[SEP] operator[SEP] operator[SEP]
}
|
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
int context = getArg0AsNode(xctxt);
if(DTM.NULL == context)
return XString.EMPTYSTRING;
DTM dtm = xctxt.getDTM(context);
String s = (context != DTM.NULL) ? dtm.getLocalName(context) : "";
if(s.startsWith("#") || s.equals("xmlns"))
return XString.EMPTYSTRING;
return new XString(s);
} | class class_name[name] begin[{]
method[execute, return_type[type[XObject]], modifier[public], parameter[xctxt]] begin[{]
local_variable[type[int], context]
if[binary_operation[member[DTM.NULL], ==, member[.context]]] begin[{]
return[member[XString.EMPTYSTRING]]
else begin[{]
None
end[}]
local_variable[type[DTM], dtm]
local_variable[type[String], s]
if[binary_operation[call[s.startsWith, parameter[literal["#"]]], ||, call[s.equals, parameter[literal["xmlns"]]]]] begin[{]
return[member[XString.EMPTYSTRING]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[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=XString, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[XObject] identifier[execute] operator[SEP] identifier[XPathContext] identifier[xctxt] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] {
Keyword[int] identifier[context] operator[=] identifier[getArg0AsNode] operator[SEP] identifier[xctxt] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DTM] operator[SEP] identifier[NULL] operator[==] identifier[context] operator[SEP] Keyword[return] identifier[XString] operator[SEP] identifier[EMPTYSTRING] operator[SEP] identifier[DTM] identifier[dtm] operator[=] identifier[xctxt] operator[SEP] identifier[getDTM] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[=] operator[SEP] identifier[context] operator[!=] identifier[DTM] operator[SEP] identifier[NULL] operator[SEP] operator[?] identifier[dtm] operator[SEP] identifier[getLocalName] operator[SEP] identifier[context] operator[SEP] operator[:] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[s] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[XString] operator[SEP] identifier[EMPTYSTRING] operator[SEP] Keyword[return] Keyword[new] identifier[XString] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
|
private void circularByteBufferInitializer(int bufferCapacity, int bufferSize, int readPosition, int writePosition) {
if (bufferCapacity < 2) {
throw new IllegalArgumentException("Buffer capacity must be greater than 2 !");
}
if ((bufferSize < 0) || (bufferSize > bufferCapacity)) {
throw new IllegalArgumentException("Buffer size must be a value between 0 and "+bufferCapacity+" !");
}
if ((readPosition < 0) || (readPosition > bufferSize)) {
throw new IllegalArgumentException("Buffer read position must be a value between 0 and "+bufferSize+" !");
}
if ((writePosition < 0) || (writePosition > bufferSize)) {
throw new IllegalArgumentException("Buffer write position must be a value between 0 and "+bufferSize+" !");
}
this.buffer = new byte[bufferCapacity];
this.currentBufferSize = bufferSize;
this.currentReadPosition = readPosition;
this.currentWritePosition = writePosition;
} | class class_name[name] begin[{]
method[circularByteBufferInitializer, return_type[void], modifier[private], parameter[bufferCapacity, bufferSize, readPosition, writePosition]] begin[{]
if[binary_operation[member[.bufferCapacity], <, literal[2]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Buffer capacity must be greater than 2 !")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.bufferSize], <, literal[0]], ||, binary_operation[member[.bufferSize], >, member[.bufferCapacity]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Buffer size must be a value between 0 and "), operandr=MemberReference(member=bufferCapacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" !"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.readPosition], <, literal[0]], ||, binary_operation[member[.readPosition], >, member[.bufferSize]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Buffer read position must be a value between 0 and "), operandr=MemberReference(member=bufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" !"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.writePosition], <, literal[0]], ||, binary_operation[member[.writePosition], >, member[.bufferSize]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Buffer write position must be a value between 0 and "), operandr=MemberReference(member=bufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" !"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.buffer]], ArrayCreator(dimensions=[MemberReference(member=bufferCapacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))]
assign[THIS[member[None.currentBufferSize]], member[.bufferSize]]
assign[THIS[member[None.currentReadPosition]], member[.readPosition]]
assign[THIS[member[None.currentWritePosition]], member[.writePosition]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[circularByteBufferInitializer] operator[SEP] Keyword[int] identifier[bufferCapacity] , Keyword[int] identifier[bufferSize] , Keyword[int] identifier[readPosition] , Keyword[int] identifier[writePosition] operator[SEP] {
Keyword[if] operator[SEP] identifier[bufferCapacity] operator[<] Other[2] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[bufferSize] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[bufferSize] operator[>] identifier[bufferCapacity] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[bufferCapacity] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[readPosition] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[readPosition] operator[>] identifier[bufferSize] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[bufferSize] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[writePosition] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[writePosition] operator[>] identifier[bufferSize] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[bufferSize] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[bufferCapacity] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[currentBufferSize] operator[=] identifier[bufferSize] operator[SEP] Keyword[this] operator[SEP] identifier[currentReadPosition] operator[=] identifier[readPosition] operator[SEP] Keyword[this] operator[SEP] identifier[currentWritePosition] operator[=] identifier[writePosition] operator[SEP]
}
|
@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
public static int getDisplayWidth(WindowManager manager) {
Display display = manager.getDefaultDisplay();
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB_MR2) {
Point size = new Point();
display.getSize(size);
return size.x;
} else {
return display.getWidth();
}
} | class class_name[name] begin[{]
method[getDisplayWidth, return_type[type[int]], modifier[public static], parameter[manager]] begin[{]
local_variable[type[Display], display]
if[binary_operation[member[Build.VERSION.SDK_INT], >, member[Build.VERSION_CODES.HONEYCOMB_MR2]]] begin[{]
local_variable[type[Point], size]
call[display.getSize, parameter[member[.size]]]
return[member[size.x]]
else begin[{]
return[call[display.getWidth, parameter[]]]
end[}]
end[}]
END[}] | annotation[@] identifier[SuppressLint] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[int] identifier[getDisplayWidth] operator[SEP] identifier[WindowManager] identifier[manager] operator[SEP] {
identifier[Display] identifier[display] operator[=] identifier[manager] operator[SEP] identifier[getDefaultDisplay] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[HONEYCOMB_MR2] operator[SEP] {
identifier[Point] identifier[size] operator[=] Keyword[new] identifier[Point] operator[SEP] operator[SEP] operator[SEP] identifier[display] operator[SEP] identifier[getSize] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[return] identifier[size] operator[SEP] identifier[x] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[display] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public RadioBoxList<V> addListener(Listener listener) {
if(listener != null && !listeners.contains(listener)) {
listeners.add(listener);
}
return this;
} | class class_name[name] begin[{]
method[addListener, return_type[type[RadioBoxList]], modifier[public], parameter[listener]] begin[{]
if[binary_operation[binary_operation[member[.listener], !=, literal[null]], &&, call[listeners.contains, parameter[member[.listener]]]]] begin[{]
call[listeners.add, parameter[member[.listener]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[RadioBoxList] operator[<] identifier[V] operator[>] identifier[addListener] operator[SEP] identifier[Listener] identifier[listener] operator[SEP] {
Keyword[if] operator[SEP] identifier[listener] operator[!=] Other[null] operator[&&] operator[!] identifier[listeners] operator[SEP] identifier[contains] operator[SEP] identifier[listener] operator[SEP] operator[SEP] {
identifier[listeners] operator[SEP] identifier[add] operator[SEP] identifier[listener] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public List<String> generateSQLStatements() {
return getEntitiesSortedForInsert().stream()
.map(RedGEntity::getSQLString)
.collect(Collectors.toList());
} | class class_name[name] begin[{]
method[generateSQLStatements, return_type[type[List]], modifier[public], parameter[]] begin[{]
return[call[.getEntitiesSortedForInsert, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[generateSQLStatements] operator[SEP] operator[SEP] {
Keyword[return] identifier[getEntitiesSortedForInsert] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[RedGEntity] operator[::] identifier[getSQLString] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
static public String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
return getShim().getDisplayName(objectLocale, displayLocale);
} | class class_name[name] begin[{]
method[getDisplayName, return_type[type[String]], modifier[public static], parameter[objectLocale, displayLocale]] begin[{]
return[call[.getShim, parameter[]]]
end[}]
END[}] | Keyword[static] Keyword[public] identifier[String] identifier[getDisplayName] operator[SEP] identifier[ULocale] identifier[objectLocale] , identifier[ULocale] identifier[displayLocale] operator[SEP] {
Keyword[return] identifier[getShim] operator[SEP] operator[SEP] operator[SEP] identifier[getDisplayName] operator[SEP] identifier[objectLocale] , identifier[displayLocale] operator[SEP] operator[SEP]
}
|
public Set<MongoNamespace> getSynchronizedNamespaces() {
instanceLock.readLock().lock();
try {
return new HashSet<>(namespaces.keySet());
} finally {
instanceLock.readLock().unlock();
}
} | class class_name[name] begin[{]
method[getSynchronizedNamespaces, return_type[type[Set]], modifier[public], parameter[]] begin[{]
call[instanceLock.readLock, parameter[]]
TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=namespaces, 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)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readLock, postfix_operators=[], prefix_operators=[], qualifier=instanceLock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[Set] operator[<] identifier[MongoNamespace] operator[>] identifier[getSynchronizedNamespaces] operator[SEP] operator[SEP] {
identifier[instanceLock] operator[SEP] identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[namespaces] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[instanceLock] operator[SEP] identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] 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.