code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
public void marshall(CreateDirectConnectGatewayAssociationRequest createDirectConnectGatewayAssociationRequest, ProtocolMarshaller protocolMarshaller) {
if (createDirectConnectGatewayAssociationRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createDirectConnectGatewayAssociationRequest.getDirectConnectGatewayId(), DIRECTCONNECTGATEWAYID_BINDING);
protocolMarshaller.marshall(createDirectConnectGatewayAssociationRequest.getGatewayId(), GATEWAYID_BINDING);
protocolMarshaller.marshall(createDirectConnectGatewayAssociationRequest.getAddAllowedPrefixesToDirectConnectGateway(),
ADDALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_BINDING);
protocolMarshaller.marshall(createDirectConnectGatewayAssociationRequest.getVirtualGatewayId(), VIRTUALGATEWAYID_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[createDirectConnectGatewayAssociationRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.createDirectConnectGatewayAssociationRequest], ==, 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=getDirectConnectGatewayId, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=DIRECTCONNECTGATEWAYID_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=getGatewayId, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=GATEWAYID_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=getAddAllowedPrefixesToDirectConnectGateway, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=ADDALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_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=getVirtualGatewayId, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=VIRTUALGATEWAYID_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[CreateDirectConnectGatewayAssociationRequest] identifier[createDirectConnectGatewayAssociationRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[createDirectConnectGatewayAssociationRequest] 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[createDirectConnectGatewayAssociationRequest] operator[SEP] identifier[getDirectConnectGatewayId] operator[SEP] operator[SEP] , identifier[DIRECTCONNECTGATEWAYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayAssociationRequest] operator[SEP] identifier[getGatewayId] operator[SEP] operator[SEP] , identifier[GATEWAYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayAssociationRequest] operator[SEP] identifier[getAddAllowedPrefixesToDirectConnectGateway] operator[SEP] operator[SEP] , identifier[ADDALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayAssociationRequest] operator[SEP] identifier[getVirtualGatewayId] operator[SEP] operator[SEP] , identifier[VIRTUALGATEWAYID_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]
}
}
|
StructuredQuery.Builder buildQuery() {
StructuredQuery.Builder structuredQuery = StructuredQuery.newBuilder();
structuredQuery.addFrom(
StructuredQuery.CollectionSelector.newBuilder().setCollectionId(path.getId()));
if (options.fieldFilters.size() == 1) {
Filter filter = options.fieldFilters.get(0).toProto();
if (filter.hasFieldFilter()) {
structuredQuery.getWhereBuilder().setFieldFilter(filter.getFieldFilter());
} else {
Preconditions.checkState(
filter.hasUnaryFilter(), "Expected a UnaryFilter or a FieldFilter.");
structuredQuery.getWhereBuilder().setUnaryFilter(filter.getUnaryFilter());
}
} else if (options.fieldFilters.size() > 1) {
Filter.Builder filter = Filter.newBuilder();
StructuredQuery.CompositeFilter.Builder compositeFilter =
StructuredQuery.CompositeFilter.newBuilder();
compositeFilter.setOp(CompositeFilter.Operator.AND);
for (FieldFilter fieldFilter : options.fieldFilters) {
compositeFilter.addFilters(fieldFilter.toProto());
}
filter.setCompositeFilter(compositeFilter.build());
structuredQuery.setWhere(filter.build());
}
if (!options.fieldOrders.isEmpty()) {
for (FieldOrder order : options.fieldOrders) {
structuredQuery.addOrderBy(order.toProto());
}
}
if (!options.fieldProjections.isEmpty()) {
structuredQuery.getSelectBuilder().addAllFields(options.fieldProjections);
}
if (options.limit != -1) {
structuredQuery.setLimit(Int32Value.newBuilder().setValue(options.limit));
}
if (options.offset != -1) {
structuredQuery.setOffset(options.offset);
}
if (options.startCursor != null) {
structuredQuery.setStartAt(options.startCursor);
}
if (options.endCursor != null) {
structuredQuery.setEndAt(options.endCursor);
}
return structuredQuery;
}
|
class class_name[name] begin[{]
method[buildQuery, return_type[type[StructuredQuery]], modifier[default], parameter[]] begin[{]
local_variable[type[StructuredQuery], structuredQuery]
call[structuredQuery.addFrom, parameter[call[StructuredQuery.CollectionSelector.newBuilder, parameter[]]]]
if[binary_operation[call[options.fieldFilters.size, parameter[]], ==, literal[1]]] begin[{]
local_variable[type[Filter], filter]
if[call[filter.hasFieldFilter, parameter[]]] begin[{]
call[structuredQuery.getWhereBuilder, parameter[]]
else begin[{]
call[Preconditions.checkState, parameter[call[filter.hasUnaryFilter, parameter[]], literal["Expected a UnaryFilter or a FieldFilter."]]]
call[structuredQuery.getWhereBuilder, parameter[]]
end[}]
else begin[{]
if[binary_operation[call[options.fieldFilters.size, parameter[]], >, literal[1]]] begin[{]
local_variable[type[Filter], filter]
local_variable[type[StructuredQuery], compositeFilter]
call[compositeFilter.setOp, parameter[member[CompositeFilter.Operator.AND]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toProto, postfix_operators=[], prefix_operators=[], qualifier=fieldFilter, selectors=[], type_arguments=None)], member=addFilters, postfix_operators=[], prefix_operators=[], qualifier=compositeFilter, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fieldFilters, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fieldFilter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldFilter, sub_type=None))), label=None)
call[filter.setCompositeFilter, parameter[call[compositeFilter.build, parameter[]]]]
call[structuredQuery.setWhere, parameter[call[filter.build, parameter[]]]]
else begin[{]
None
end[}]
end[}]
if[call[options.fieldOrders.isEmpty, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toProto, postfix_operators=[], prefix_operators=[], qualifier=order, selectors=[], type_arguments=None)], member=addOrderBy, postfix_operators=[], prefix_operators=[], qualifier=structuredQuery, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fieldOrders, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=order)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldOrder, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[call[options.fieldProjections.isEmpty, parameter[]]] begin[{]
call[structuredQuery.getSelectBuilder, parameter[]]
else begin[{]
None
end[}]
if[binary_operation[member[options.limit], !=, literal[1]]] begin[{]
call[structuredQuery.setLimit, parameter[call[Int32Value.newBuilder, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[options.offset], !=, literal[1]]] begin[{]
call[structuredQuery.setOffset, parameter[member[options.offset]]]
else begin[{]
None
end[}]
if[binary_operation[member[options.startCursor], !=, literal[null]]] begin[{]
call[structuredQuery.setStartAt, parameter[member[options.startCursor]]]
else begin[{]
None
end[}]
if[binary_operation[member[options.endCursor], !=, literal[null]]] begin[{]
call[structuredQuery.setEndAt, parameter[member[options.endCursor]]]
else begin[{]
None
end[}]
return[member[.structuredQuery]]
end[}]
END[}]
|
identifier[StructuredQuery] operator[SEP] identifier[Builder] identifier[buildQuery] operator[SEP] operator[SEP] {
identifier[StructuredQuery] operator[SEP] identifier[Builder] identifier[structuredQuery] operator[=] identifier[StructuredQuery] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[structuredQuery] operator[SEP] identifier[addFrom] operator[SEP] identifier[StructuredQuery] operator[SEP] identifier[CollectionSelector] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setCollectionId] operator[SEP] identifier[path] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[fieldFilters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[Filter] identifier[filter] operator[=] identifier[options] operator[SEP] identifier[fieldFilters] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[toProto] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[hasFieldFilter] operator[SEP] operator[SEP] operator[SEP] {
identifier[structuredQuery] operator[SEP] identifier[getWhereBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setFieldFilter] operator[SEP] identifier[filter] operator[SEP] identifier[getFieldFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[filter] operator[SEP] identifier[hasUnaryFilter] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[structuredQuery] operator[SEP] identifier[getWhereBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setUnaryFilter] operator[SEP] identifier[filter] operator[SEP] identifier[getUnaryFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[fieldFilters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[Filter] operator[SEP] identifier[Builder] identifier[filter] operator[=] identifier[Filter] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[StructuredQuery] operator[SEP] identifier[CompositeFilter] operator[SEP] identifier[Builder] identifier[compositeFilter] operator[=] identifier[StructuredQuery] operator[SEP] identifier[CompositeFilter] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[compositeFilter] operator[SEP] identifier[setOp] operator[SEP] identifier[CompositeFilter] operator[SEP] identifier[Operator] operator[SEP] identifier[AND] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FieldFilter] identifier[fieldFilter] operator[:] identifier[options] operator[SEP] identifier[fieldFilters] operator[SEP] {
identifier[compositeFilter] operator[SEP] identifier[addFilters] operator[SEP] identifier[fieldFilter] operator[SEP] identifier[toProto] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[filter] operator[SEP] identifier[setCompositeFilter] operator[SEP] identifier[compositeFilter] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[structuredQuery] operator[SEP] identifier[setWhere] operator[SEP] identifier[filter] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[options] operator[SEP] identifier[fieldOrders] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[FieldOrder] identifier[order] operator[:] identifier[options] operator[SEP] identifier[fieldOrders] operator[SEP] {
identifier[structuredQuery] operator[SEP] identifier[addOrderBy] operator[SEP] identifier[order] operator[SEP] identifier[toProto] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[options] operator[SEP] identifier[fieldProjections] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[structuredQuery] operator[SEP] identifier[getSelectBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addAllFields] operator[SEP] identifier[options] operator[SEP] identifier[fieldProjections] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[limit] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[structuredQuery] operator[SEP] identifier[setLimit] operator[SEP] identifier[Int32Value] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[options] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[offset] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[structuredQuery] operator[SEP] identifier[setOffset] operator[SEP] identifier[options] operator[SEP] identifier[offset] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[startCursor] operator[!=] Other[null] operator[SEP] {
identifier[structuredQuery] operator[SEP] identifier[setStartAt] operator[SEP] identifier[options] operator[SEP] identifier[startCursor] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[endCursor] operator[!=] Other[null] operator[SEP] {
identifier[structuredQuery] operator[SEP] identifier[setEndAt] operator[SEP] identifier[options] operator[SEP] identifier[endCursor] operator[SEP] operator[SEP]
}
Keyword[return] identifier[structuredQuery] operator[SEP]
}
|
void start( Instance instance, PluginInterface plugin )
throws IOException {
String instancePath = InstanceHelpers.computeInstancePath( instance );
if( instance.getStatus() != InstanceStatus.DEPLOYED_STOPPED
&& instance.getStatus() != InstanceStatus.WAITING_FOR_ANCESTOR ) {
this.logger.fine( instancePath + " cannot be started. Prerequisite status: DEPLOYED_STOPPED or WAITING_FOR_ANCESTOR (but was " + instance.getStatus() + ")." );
} else if( instance.getParent() != null
&& instance.getParent().getStatus() != InstanceStatus.DEPLOYED_STARTED ) {
// An element cannot start if its parent is not started.
// However, if the parent is unresolved (or waiting for its parent to start),
// then we can mark this instance as ready to start with its parent.
this.logger.fine( instancePath + " cannot be started because its parent is not started. Parent status: " + instance.getParent().getStatus() + "." );
if( instance.getParent().getStatus() == InstanceStatus.UNRESOLVED
|| instance.getParent().getStatus() == InstanceStatus.WAITING_FOR_ANCESTOR ) {
instance.setStatus( InstanceStatus.WAITING_FOR_ANCESTOR );
this.logger.fine( instancePath + " will start as soon as its parent starts." );
}
} else {
// Otherwise, start it
try {
if( ImportHelpers.hasAllRequiredImports( instance, this.logger )) {
instance.data.put( FORCE, "whatever" );
updateStateFromImports( instance, plugin, null, null );
} else {
this.logger.fine(
"Instance " + InstanceHelpers.computeInstancePath( instance )
+ " cannot be started, dependencies are missing. Requesting exports from other agents." );
instance.setStatus( InstanceStatus.UNRESOLVED );
this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));
this.messagingClient.requestExportsFromOtherAgents( instance );
}
} catch( PluginException e ) {
this.logger.severe( "An error occured while starting " + InstanceHelpers.computeInstancePath( instance ));
Utils.logException( this.logger, e );
instance.setStatus( InstanceStatus.DEPLOYED_STOPPED );
this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));
}
}
}
|
class class_name[name] begin[{]
method[start, return_type[void], modifier[default], parameter[instance, plugin]] begin[{]
local_variable[type[String], instancePath]
if[binary_operation[binary_operation[call[instance.getStatus, parameter[]], !=, member[InstanceStatus.DEPLOYED_STOPPED]], &&, binary_operation[call[instance.getStatus, parameter[]], !=, member[InstanceStatus.WAITING_FOR_ANCESTOR]]]] begin[{]
THIS[member[None.logger]call[None.fine, parameter[binary_operation[binary_operation[binary_operation[member[.instancePath], +, literal[" cannot be started. Prerequisite status: DEPLOYED_STOPPED or WAITING_FOR_ANCESTOR (but was "]], +, call[instance.getStatus, parameter[]]], +, literal[")."]]]]]
else begin[{]
if[binary_operation[binary_operation[call[instance.getParent, parameter[]], !=, literal[null]], &&, binary_operation[call[instance.getParent, parameter[]], !=, member[InstanceStatus.DEPLOYED_STARTED]]]] begin[{]
THIS[member[None.logger]call[None.fine, parameter[binary_operation[binary_operation[binary_operation[member[.instancePath], +, literal[" cannot be started because its parent is not started. Parent status: "]], +, call[instance.getParent, parameter[]]], +, literal["."]]]]]
if[binary_operation[binary_operation[call[instance.getParent, parameter[]], ==, member[InstanceStatus.UNRESOLVED]], ||, binary_operation[call[instance.getParent, parameter[]], ==, member[InstanceStatus.WAITING_FOR_ANCESTOR]]]] begin[{]
call[instance.setStatus, parameter[member[InstanceStatus.WAITING_FOR_ANCESTOR]]]
THIS[member[None.logger]call[None.fine, parameter[binary_operation[member[.instancePath], +, literal[" will start as soon as its parent starts."]]]]]
else begin[{]
None
end[}]
else begin[{]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=hasAllRequiredImports, postfix_operators=[], prefix_operators=[], qualifier=ImportHelpers, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Instance "), operandr=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeInstancePath, postfix_operators=[], prefix_operators=[], qualifier=InstanceHelpers, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" cannot be started, dependencies are missing. Requesting exports from other agents."), operator=+)], member=fine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=UNRESOLVED, postfix_operators=[], prefix_operators=[], qualifier=InstanceStatus, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=messagingClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=appName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=instance, 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=MsgNotifInstanceChanged, sub_type=None))], member=sendMessageToTheDm, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=messagingClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requestExportsFromOtherAgents, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FORCE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="whatever")], member=put, postfix_operators=[], prefix_operators=[], qualifier=instance.data, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=updateStateFromImports, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occured while starting "), operandr=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeInstancePath, postfix_operators=[], prefix_operators=[], qualifier=InstanceHelpers, selectors=[], type_arguments=None), operator=+)], member=severe, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logException, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEPLOYED_STOPPED, postfix_operators=[], prefix_operators=[], qualifier=InstanceStatus, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=messagingClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=appName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=instance, 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=MsgNotifInstanceChanged, sub_type=None))], member=sendMessageToTheDm, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PluginException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
end[}]
END[}]
|
Keyword[void] identifier[start] operator[SEP] identifier[Instance] identifier[instance] , identifier[PluginInterface] identifier[plugin] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[instancePath] operator[=] identifier[InstanceHelpers] operator[SEP] identifier[computeInstancePath] operator[SEP] identifier[instance] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instance] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[!=] identifier[InstanceStatus] operator[SEP] identifier[DEPLOYED_STOPPED] operator[&&] identifier[instance] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[!=] identifier[InstanceStatus] operator[SEP] identifier[WAITING_FOR_ANCESTOR] operator[SEP] {
Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[fine] operator[SEP] identifier[instancePath] operator[+] literal[String] operator[+] identifier[instance] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[instance] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[instance] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[!=] identifier[InstanceStatus] operator[SEP] identifier[DEPLOYED_STARTED] operator[SEP] {
Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[fine] operator[SEP] identifier[instancePath] operator[+] literal[String] operator[+] identifier[instance] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instance] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[InstanceStatus] operator[SEP] identifier[UNRESOLVED] operator[||] identifier[instance] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[InstanceStatus] operator[SEP] identifier[WAITING_FOR_ANCESTOR] operator[SEP] {
identifier[instance] operator[SEP] identifier[setStatus] operator[SEP] identifier[InstanceStatus] operator[SEP] identifier[WAITING_FOR_ANCESTOR] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[fine] operator[SEP] identifier[instancePath] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[ImportHelpers] operator[SEP] identifier[hasAllRequiredImports] operator[SEP] identifier[instance] , Keyword[this] operator[SEP] identifier[logger] operator[SEP] operator[SEP] {
identifier[instance] operator[SEP] identifier[data] operator[SEP] identifier[put] operator[SEP] identifier[FORCE] , literal[String] operator[SEP] operator[SEP] identifier[updateStateFromImports] operator[SEP] identifier[instance] , identifier[plugin] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[InstanceHelpers] operator[SEP] identifier[computeInstancePath] operator[SEP] identifier[instance] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[instance] operator[SEP] identifier[setStatus] operator[SEP] identifier[InstanceStatus] operator[SEP] identifier[UNRESOLVED] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[messagingClient] operator[SEP] identifier[sendMessageToTheDm] operator[SEP] Keyword[new] identifier[MsgNotifInstanceChanged] operator[SEP] Keyword[this] operator[SEP] identifier[appName] , identifier[instance] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[messagingClient] operator[SEP] identifier[requestExportsFromOtherAgents] operator[SEP] identifier[instance] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[PluginException] identifier[e] operator[SEP] {
Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[InstanceHelpers] operator[SEP] identifier[computeInstancePath] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[logException] operator[SEP] Keyword[this] operator[SEP] identifier[logger] , identifier[e] operator[SEP] operator[SEP] identifier[instance] operator[SEP] identifier[setStatus] operator[SEP] identifier[InstanceStatus] operator[SEP] identifier[DEPLOYED_STOPPED] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[messagingClient] operator[SEP] identifier[sendMessageToTheDm] operator[SEP] Keyword[new] identifier[MsgNotifInstanceChanged] operator[SEP] Keyword[this] operator[SEP] identifier[appName] , identifier[instance] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public ClusterNode getRunnableNode(String host, LocalityLevel maxLevel,
ResourceType type, Set<String> excluded) {
if (host == null) {
RunnableIndices r = typeToIndices.get(type);
return r.getRunnableNodeForAny(excluded);
}
RequestedNode node = resolve(host, type);
return getRunnableNode(node, maxLevel, type, excluded);
}
|
class class_name[name] begin[{]
method[getRunnableNode, return_type[type[ClusterNode]], modifier[public], parameter[host, maxLevel, type, excluded]] begin[{]
if[binary_operation[member[.host], ==, literal[null]]] begin[{]
local_variable[type[RunnableIndices], r]
return[call[r.getRunnableNodeForAny, parameter[member[.excluded]]]]
else begin[{]
None
end[}]
local_variable[type[RequestedNode], node]
return[call[.getRunnableNode, parameter[member[.node], member[.maxLevel], member[.type], member[.excluded]]]]
end[}]
END[}]
|
Keyword[public] identifier[ClusterNode] identifier[getRunnableNode] operator[SEP] identifier[String] identifier[host] , identifier[LocalityLevel] identifier[maxLevel] , identifier[ResourceType] identifier[type] , identifier[Set] operator[<] identifier[String] operator[>] identifier[excluded] operator[SEP] {
Keyword[if] operator[SEP] identifier[host] operator[==] Other[null] operator[SEP] {
identifier[RunnableIndices] identifier[r] operator[=] identifier[typeToIndices] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[r] operator[SEP] identifier[getRunnableNodeForAny] operator[SEP] identifier[excluded] operator[SEP] operator[SEP]
}
identifier[RequestedNode] identifier[node] operator[=] identifier[resolve] operator[SEP] identifier[host] , identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[getRunnableNode] operator[SEP] identifier[node] , identifier[maxLevel] , identifier[type] , identifier[excluded] operator[SEP] operator[SEP]
}
|
public Observable<Integer> addSubListAsync(UUID appId, String versionId, UUID clEntityId, WordListObject wordListCreateObject) {
return addSubListWithServiceResponseAsync(appId, versionId, clEntityId, wordListCreateObject).map(new Func1<ServiceResponse<Integer>, Integer>() {
@Override
public Integer call(ServiceResponse<Integer> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[addSubListAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, clEntityId, wordListCreateObject]] begin[{]
return[call[.addSubListWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.clEntityId], member[.wordListCreateObject]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[Integer] operator[>] identifier[addSubListAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[UUID] identifier[clEntityId] , identifier[WordListObject] identifier[wordListCreateObject] operator[SEP] {
Keyword[return] identifier[addSubListWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[clEntityId] , identifier[wordListCreateObject] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Integer] operator[>] , identifier[Integer] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Integer] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Integer] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public void setContentRect(int width, int height, int paddingLeft, int paddingTop, int paddingRight,
int paddingBottom) {
chartWidth = width;
chartHeight = height;
maxContentRect.set(paddingLeft, paddingTop, width - paddingRight, height - paddingBottom);
contentRectMinusAxesMargins.set(maxContentRect);
contentRectMinusAllMargins.set(maxContentRect);
}
|
class class_name[name] begin[{]
method[setContentRect, return_type[void], modifier[public], parameter[width, height, paddingLeft, paddingTop, paddingRight, paddingBottom]] begin[{]
assign[member[.chartWidth], member[.width]]
assign[member[.chartHeight], member[.height]]
call[maxContentRect.set, parameter[member[.paddingLeft], member[.paddingTop], binary_operation[member[.width], -, member[.paddingRight]], binary_operation[member[.height], -, member[.paddingBottom]]]]
call[contentRectMinusAxesMargins.set, parameter[member[.maxContentRect]]]
call[contentRectMinusAllMargins.set, parameter[member[.maxContentRect]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setContentRect] operator[SEP] Keyword[int] identifier[width] , Keyword[int] identifier[height] , Keyword[int] identifier[paddingLeft] , Keyword[int] identifier[paddingTop] , Keyword[int] identifier[paddingRight] , Keyword[int] identifier[paddingBottom] operator[SEP] {
identifier[chartWidth] operator[=] identifier[width] operator[SEP] identifier[chartHeight] operator[=] identifier[height] operator[SEP] identifier[maxContentRect] operator[SEP] identifier[set] operator[SEP] identifier[paddingLeft] , identifier[paddingTop] , identifier[width] operator[-] identifier[paddingRight] , identifier[height] operator[-] identifier[paddingBottom] operator[SEP] operator[SEP] identifier[contentRectMinusAxesMargins] operator[SEP] identifier[set] operator[SEP] identifier[maxContentRect] operator[SEP] operator[SEP] identifier[contentRectMinusAllMargins] operator[SEP] identifier[set] operator[SEP] identifier[maxContentRect] operator[SEP] operator[SEP]
}
|
private boolean registerAndConfirmIfImIt() throws ClusterInfoException {
// reset the subdir watcher
final Collection<String> imItSubdirs = utils.persistentGetSubdir(utils.leaderDir, this);
// "there can be only one"
if (imItSubdirs.size() > 1)
throw new ClusterInfoException(
"This is IMPOSSIBLE. There's more than one subdir of " + utils.leaderDir + ". They include " + imItSubdirs);
// make sure it's still mine.
@SuppressWarnings("unchecked")
final C registered = (C) session.getData(utils.masterDetermineDir, null);
return utils.thisNodeAddress.equals(registered); // am I it, or not?
}
|
class class_name[name] begin[{]
method[registerAndConfirmIfImIt, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
local_variable[type[Collection], imItSubdirs]
if[binary_operation[call[imItSubdirs.size, parameter[]], >, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This is IMPOSSIBLE. There's more than one subdir of "), operandr=MemberReference(member=leaderDir, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". They include "), operator=+), operandr=MemberReference(member=imItSubdirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClusterInfoException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[C], registered]
return[call[utils.thisNodeAddress.equals, parameter[member[.registered]]]]
end[}]
END[}]
|
Keyword[private] Keyword[boolean] identifier[registerAndConfirmIfImIt] operator[SEP] operator[SEP] Keyword[throws] identifier[ClusterInfoException] {
Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[imItSubdirs] operator[=] identifier[utils] operator[SEP] identifier[persistentGetSubdir] operator[SEP] identifier[utils] operator[SEP] identifier[leaderDir] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[imItSubdirs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[ClusterInfoException] operator[SEP] literal[String] operator[+] identifier[utils] operator[SEP] identifier[leaderDir] operator[+] literal[String] operator[+] identifier[imItSubdirs] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[C] identifier[registered] operator[=] operator[SEP] identifier[C] operator[SEP] identifier[session] operator[SEP] identifier[getData] operator[SEP] identifier[utils] operator[SEP] identifier[masterDetermineDir] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[utils] operator[SEP] identifier[thisNodeAddress] operator[SEP] identifier[equals] operator[SEP] identifier[registered] operator[SEP] operator[SEP]
}
|
protected String [] getHeaderRow(String masterlanguage, String[] languages) {
List<String> headerRow = new ArrayList<>();
headerRow.add(AbstractFile.KEY_HEADER);
headerRow.add(AbstractFile.STATUS_HEADER);
if (!ArrayUtils.contains(languages, masterlanguage)) {
headerRow.add(AbstractFile.MASTER_HEADER + " (" + masterlanguage + ")");
}
for (String language : languages) {
headerRow.add(AbstractFile.VALUE_HEADER + " (" + language + ")");
}
headerRow.add(AbstractFile.CONTEXT_HEADER);
return headerRow.toArray(new String[headerRow.size()]);
}
|
class class_name[name] begin[{]
method[getHeaderRow, return_type[type[String]], modifier[protected], parameter[masterlanguage, languages]] begin[{]
local_variable[type[List], headerRow]
call[headerRow.add, parameter[member[AbstractFile.KEY_HEADER]]]
call[headerRow.add, parameter[member[AbstractFile.STATUS_HEADER]]]
if[call[ArrayUtils.contains, parameter[member[.languages], member[.masterlanguage]]]] begin[{]
call[headerRow.add, parameter[binary_operation[binary_operation[binary_operation[member[AbstractFile.MASTER_HEADER], +, literal[" ("]], +, member[.masterlanguage]], +, literal[")"]]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=VALUE_HEADER, postfix_operators=[], prefix_operators=[], qualifier=AbstractFile, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ("), operator=+), operandr=MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=add, postfix_operators=[], prefix_operators=[], qualifier=headerRow, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=languages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=language)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[headerRow.add, parameter[member[AbstractFile.CONTEXT_HEADER]]]
return[call[headerRow.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=headerRow, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]
end[}]
END[}]
|
Keyword[protected] identifier[String] operator[SEP] operator[SEP] identifier[getHeaderRow] operator[SEP] identifier[String] identifier[masterlanguage] , identifier[String] operator[SEP] operator[SEP] identifier[languages] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[headerRow] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[headerRow] operator[SEP] identifier[add] operator[SEP] identifier[AbstractFile] operator[SEP] identifier[KEY_HEADER] operator[SEP] operator[SEP] identifier[headerRow] operator[SEP] identifier[add] operator[SEP] identifier[AbstractFile] operator[SEP] identifier[STATUS_HEADER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ArrayUtils] operator[SEP] identifier[contains] operator[SEP] identifier[languages] , identifier[masterlanguage] operator[SEP] operator[SEP] {
identifier[headerRow] operator[SEP] identifier[add] operator[SEP] identifier[AbstractFile] operator[SEP] identifier[MASTER_HEADER] operator[+] literal[String] operator[+] identifier[masterlanguage] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[language] operator[:] identifier[languages] operator[SEP] {
identifier[headerRow] operator[SEP] identifier[add] operator[SEP] identifier[AbstractFile] operator[SEP] identifier[VALUE_HEADER] operator[+] literal[String] operator[+] identifier[language] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[headerRow] operator[SEP] identifier[add] operator[SEP] identifier[AbstractFile] operator[SEP] identifier[CONTEXT_HEADER] operator[SEP] operator[SEP] Keyword[return] identifier[headerRow] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[headerRow] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void configure() {
InputStream inputStream = null;
try {
URL configUrl = getConfigUrl();
if (configUrl == null) {
throw new ConfigurationException("esigate.properties configuration file "
+ "was not found in the classpath");
}
inputStream = configUrl.openStream();
Properties merged = new Properties();
if (inputStream != null) {
Properties props = new Properties();
props.load(inputStream);
merged.putAll(props);
}
configure(merged);
} catch (IOException e) {
throw new ConfigurationException("Error loading configuration", e);
} finally {
try {
if (inputStream != null) {
inputStream.close();
}
} catch (IOException e) {
throw new ConfigurationException("failed to close stream", e);
}
}
}
|
class class_name[name] begin[{]
method[configure, return_type[void], modifier[public static], parameter[]] begin[{]
local_variable[type[InputStream], inputStream]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConfigUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=configUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=configUrl, 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=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="esigate.properties configuration file "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="was not found in the classpath"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigurationException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openStream, postfix_operators=[], prefix_operators=[], qualifier=configUrl, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None)), name=merged)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None)), name=props)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=merged, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=merged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=configure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error loading configuration"), 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=ConfigurationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=inputStream, 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=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=inputStream, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to close stream"), 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=ConfigurationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)], label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[configure] operator[SEP] operator[SEP] {
identifier[InputStream] identifier[inputStream] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[URL] identifier[configUrl] operator[=] identifier[getConfigUrl] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configUrl] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConfigurationException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[inputStream] operator[=] identifier[configUrl] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] identifier[Properties] identifier[merged] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inputStream] operator[!=] Other[null] operator[SEP] {
identifier[Properties] identifier[props] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[load] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[merged] operator[SEP] identifier[putAll] operator[SEP] identifier[props] operator[SEP] operator[SEP]
}
identifier[configure] operator[SEP] identifier[merged] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConfigurationException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[inputStream] operator[!=] Other[null] operator[SEP] {
identifier[inputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConfigurationException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public ExternalServiceAlertConditionCache externalServiceAlertConditions(long policyId)
{
ExternalServiceAlertConditionCache cache = externalServiceConditions.get(policyId);
if(cache == null)
externalServiceConditions.put(policyId, cache = new ExternalServiceAlertConditionCache(policyId));
return cache;
}
|
class class_name[name] begin[{]
method[externalServiceAlertConditions, return_type[type[ExternalServiceAlertConditionCache]], modifier[public], parameter[policyId]] begin[{]
local_variable[type[ExternalServiceAlertConditionCache], cache]
if[binary_operation[member[.cache], ==, literal[null]]] begin[{]
call[externalServiceConditions.put, parameter[member[.policyId], assign[member[.cache], ClassCreator(arguments=[MemberReference(member=policyId, 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=ExternalServiceAlertConditionCache, sub_type=None))]]]
else begin[{]
None
end[}]
return[member[.cache]]
end[}]
END[}]
|
Keyword[public] identifier[ExternalServiceAlertConditionCache] identifier[externalServiceAlertConditions] operator[SEP] Keyword[long] identifier[policyId] operator[SEP] {
identifier[ExternalServiceAlertConditionCache] identifier[cache] operator[=] identifier[externalServiceConditions] operator[SEP] identifier[get] operator[SEP] identifier[policyId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cache] operator[==] Other[null] operator[SEP] identifier[externalServiceConditions] operator[SEP] identifier[put] operator[SEP] identifier[policyId] , identifier[cache] operator[=] Keyword[new] identifier[ExternalServiceAlertConditionCache] operator[SEP] identifier[policyId] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cache] operator[SEP]
}
|
public void info(
String sourceClass,
String sourceMethod,
String msg
)
{
logp(Level.INFO, sourceClass, sourceMethod, msg);
}
|
class class_name[name] begin[{]
method[info, return_type[void], modifier[public], parameter[sourceClass, sourceMethod, msg]] begin[{]
call[.logp, parameter[member[Level.INFO], member[.sourceClass], member[.sourceMethod], member[.msg]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[info] operator[SEP] identifier[String] identifier[sourceClass] , identifier[String] identifier[sourceMethod] , identifier[String] identifier[msg] operator[SEP] {
identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[INFO] , identifier[sourceClass] , identifier[sourceMethod] , identifier[msg] operator[SEP] operator[SEP]
}
|
public void setOrientation (int orientation)
{
GroupLayout gl = (orientation == HORIZONTAL) ?
(GroupLayout)new HGroupLayout() : new VGroupLayout();
gl.setPolicy(GroupLayout.EQUALIZE);
setLayout(gl);
}
|
class class_name[name] begin[{]
method[setOrientation, return_type[void], modifier[public], parameter[orientation]] begin[{]
local_variable[type[GroupLayout], gl]
call[gl.setPolicy, parameter[member[GroupLayout.EQUALIZE]]]
call[.setLayout, parameter[member[.gl]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setOrientation] operator[SEP] Keyword[int] identifier[orientation] operator[SEP] {
identifier[GroupLayout] identifier[gl] operator[=] operator[SEP] identifier[orientation] operator[==] identifier[HORIZONTAL] operator[SEP] operator[?] operator[SEP] identifier[GroupLayout] operator[SEP] Keyword[new] identifier[HGroupLayout] operator[SEP] operator[SEP] operator[:] Keyword[new] identifier[VGroupLayout] operator[SEP] operator[SEP] operator[SEP] identifier[gl] operator[SEP] identifier[setPolicy] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[EQUALIZE] operator[SEP] operator[SEP] identifier[setLayout] operator[SEP] identifier[gl] operator[SEP] operator[SEP]
}
|
protected boolean checkPackageLocators(String classPackageName) {
if (packageLocators != null && !disablePackageLocatorsScanning && classPackageName.length() > 0
&& (packageLocatorsBasePackage == null || classPackageName.startsWith(packageLocatorsBasePackage))) {
for (String packageLocator : packageLocators) {
String[] splitted = classPackageName.split("\\.");
if (es.cenobit.struts2.json.util.StringUtils.contains(splitted, packageLocator, false))
return true;
}
}
return false;
}
|
class class_name[name] begin[{]
method[checkPackageLocators, return_type[type[boolean]], modifier[protected], parameter[classPackageName]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.packageLocators], !=, literal[null]], &&, member[.disablePackageLocatorsScanning]], &&, binary_operation[call[classPackageName.length, parameter[]], >, literal[0]]], &&, binary_operation[binary_operation[member[.packageLocatorsBasePackage], ==, literal[null]], ||, call[classPackageName.startsWith, parameter[member[.packageLocatorsBasePackage]]]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\.")], member=split, postfix_operators=[], prefix_operators=[], qualifier=classPackageName, selectors=[], type_arguments=None), name=splitted)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=splitted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=packageLocator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=es.cenobit.struts2.json.util.StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=packageLocators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=packageLocator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}]
|
Keyword[protected] Keyword[boolean] identifier[checkPackageLocators] operator[SEP] identifier[String] identifier[classPackageName] operator[SEP] {
Keyword[if] operator[SEP] identifier[packageLocators] operator[!=] Other[null] operator[&&] operator[!] identifier[disablePackageLocatorsScanning] operator[&&] identifier[classPackageName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[SEP] identifier[packageLocatorsBasePackage] operator[==] Other[null] operator[||] identifier[classPackageName] operator[SEP] identifier[startsWith] operator[SEP] identifier[packageLocatorsBasePackage] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[packageLocator] operator[:] identifier[packageLocators] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[splitted] operator[=] identifier[classPackageName] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[es] operator[SEP] identifier[cenobit] operator[SEP] identifier[struts2] operator[SEP] identifier[json] operator[SEP] identifier[util] operator[SEP] identifier[StringUtils] operator[SEP] identifier[contains] operator[SEP] identifier[splitted] , identifier[packageLocator] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static double elementMin( DMatrix6x6 a ) {
double min = a.a11;
if( a.a12 < min ) min = a.a12;
if( a.a13 < min ) min = a.a13;
if( a.a14 < min ) min = a.a14;
if( a.a15 < min ) min = a.a15;
if( a.a16 < min ) min = a.a16;
if( a.a21 < min ) min = a.a21;
if( a.a22 < min ) min = a.a22;
if( a.a23 < min ) min = a.a23;
if( a.a24 < min ) min = a.a24;
if( a.a25 < min ) min = a.a25;
if( a.a26 < min ) min = a.a26;
if( a.a31 < min ) min = a.a31;
if( a.a32 < min ) min = a.a32;
if( a.a33 < min ) min = a.a33;
if( a.a34 < min ) min = a.a34;
if( a.a35 < min ) min = a.a35;
if( a.a36 < min ) min = a.a36;
if( a.a41 < min ) min = a.a41;
if( a.a42 < min ) min = a.a42;
if( a.a43 < min ) min = a.a43;
if( a.a44 < min ) min = a.a44;
if( a.a45 < min ) min = a.a45;
if( a.a46 < min ) min = a.a46;
if( a.a51 < min ) min = a.a51;
if( a.a52 < min ) min = a.a52;
if( a.a53 < min ) min = a.a53;
if( a.a54 < min ) min = a.a54;
if( a.a55 < min ) min = a.a55;
if( a.a56 < min ) min = a.a56;
if( a.a61 < min ) min = a.a61;
if( a.a62 < min ) min = a.a62;
if( a.a63 < min ) min = a.a63;
if( a.a64 < min ) min = a.a64;
if( a.a65 < min ) min = a.a65;
if( a.a66 < min ) min = a.a66;
return min;
}
|
class class_name[name] begin[{]
method[elementMin, return_type[type[double]], modifier[public static], parameter[a]] begin[{]
local_variable[type[double], min]
if[binary_operation[member[a.a12], <, member[.min]]] begin[{]
assign[member[.min], member[a.a12]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a13], <, member[.min]]] begin[{]
assign[member[.min], member[a.a13]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a14], <, member[.min]]] begin[{]
assign[member[.min], member[a.a14]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a15], <, member[.min]]] begin[{]
assign[member[.min], member[a.a15]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a16], <, member[.min]]] begin[{]
assign[member[.min], member[a.a16]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a21], <, member[.min]]] begin[{]
assign[member[.min], member[a.a21]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a22], <, member[.min]]] begin[{]
assign[member[.min], member[a.a22]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a23], <, member[.min]]] begin[{]
assign[member[.min], member[a.a23]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a24], <, member[.min]]] begin[{]
assign[member[.min], member[a.a24]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a25], <, member[.min]]] begin[{]
assign[member[.min], member[a.a25]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a26], <, member[.min]]] begin[{]
assign[member[.min], member[a.a26]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a31], <, member[.min]]] begin[{]
assign[member[.min], member[a.a31]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a32], <, member[.min]]] begin[{]
assign[member[.min], member[a.a32]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a33], <, member[.min]]] begin[{]
assign[member[.min], member[a.a33]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a34], <, member[.min]]] begin[{]
assign[member[.min], member[a.a34]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a35], <, member[.min]]] begin[{]
assign[member[.min], member[a.a35]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a36], <, member[.min]]] begin[{]
assign[member[.min], member[a.a36]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a41], <, member[.min]]] begin[{]
assign[member[.min], member[a.a41]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a42], <, member[.min]]] begin[{]
assign[member[.min], member[a.a42]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a43], <, member[.min]]] begin[{]
assign[member[.min], member[a.a43]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a44], <, member[.min]]] begin[{]
assign[member[.min], member[a.a44]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a45], <, member[.min]]] begin[{]
assign[member[.min], member[a.a45]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a46], <, member[.min]]] begin[{]
assign[member[.min], member[a.a46]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a51], <, member[.min]]] begin[{]
assign[member[.min], member[a.a51]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a52], <, member[.min]]] begin[{]
assign[member[.min], member[a.a52]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a53], <, member[.min]]] begin[{]
assign[member[.min], member[a.a53]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a54], <, member[.min]]] begin[{]
assign[member[.min], member[a.a54]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a55], <, member[.min]]] begin[{]
assign[member[.min], member[a.a55]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a56], <, member[.min]]] begin[{]
assign[member[.min], member[a.a56]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a61], <, member[.min]]] begin[{]
assign[member[.min], member[a.a61]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a62], <, member[.min]]] begin[{]
assign[member[.min], member[a.a62]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a63], <, member[.min]]] begin[{]
assign[member[.min], member[a.a63]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a64], <, member[.min]]] begin[{]
assign[member[.min], member[a.a64]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a65], <, member[.min]]] begin[{]
assign[member[.min], member[a.a65]]
else begin[{]
None
end[}]
if[binary_operation[member[a.a66], <, member[.min]]] begin[{]
assign[member[.min], member[a.a66]]
else begin[{]
None
end[}]
return[member[.min]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[double] identifier[elementMin] operator[SEP] identifier[DMatrix6x6] identifier[a] operator[SEP] {
Keyword[double] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a11] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a12] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a12] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a13] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a13] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a14] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a14] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a15] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a15] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a16] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a16] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a21] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a21] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a22] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a22] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a23] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a23] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a24] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a24] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a25] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a25] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a26] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a26] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a31] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a31] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a32] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a32] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a33] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a33] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a34] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a34] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a35] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a35] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a36] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a36] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a41] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a41] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a42] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a42] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a43] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a43] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a44] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a44] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a45] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a45] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a46] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a46] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a51] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a51] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a52] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a52] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a53] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a53] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a54] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a54] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a55] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a55] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a56] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a56] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a61] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a61] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a62] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a62] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a63] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a63] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a64] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a64] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a65] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a65] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[a66] operator[<] identifier[min] operator[SEP] identifier[min] operator[=] identifier[a] operator[SEP] identifier[a66] operator[SEP] Keyword[return] identifier[min] operator[SEP]
}
|
public static boolean isCurrency(String value) {
String check = "^(\\d+(?:\\.\\d{1,2})?)$";
return match(check, Pattern.CASE_INSENSITIVE, value);
}
|
class class_name[name] begin[{]
method[isCurrency, return_type[type[boolean]], modifier[public static], parameter[value]] begin[{]
local_variable[type[String], check]
return[call[.match, parameter[member[.check], member[Pattern.CASE_INSENSITIVE], member[.value]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[isCurrency] operator[SEP] identifier[String] identifier[value] operator[SEP] {
identifier[String] identifier[check] operator[=] literal[String] operator[SEP] Keyword[return] identifier[match] operator[SEP] identifier[check] , identifier[Pattern] operator[SEP] identifier[CASE_INSENSITIVE] , identifier[value] operator[SEP] operator[SEP]
}
|
public Annotation getRef() {
if (ArgumentMention_Type.featOkTst && ((ArgumentMention_Type)jcasType).casFeat_ref == null)
jcasType.jcas.throwFeatMissing("ref", "de.julielab.jules.types.ArgumentMention");
return (Annotation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((ArgumentMention_Type)jcasType).casFeatCode_ref)));}
|
class class_name[name] begin[{]
method[getRef, return_type[type[Annotation]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[ArgumentMention_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ArgumentMention_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["ref"], literal["de.julielab.jules.types.ArgumentMention"]]]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=addr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ArgumentMention_Type, sub_type=None))], member=ll_getRefValue, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None)], member=ll_getFSForRef, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[Annotation] identifier[getRef] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ArgumentMention_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[ArgumentMention_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_ref] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getFSForRef] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[ArgumentMention_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_ref] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Observable<DatabaseInner> getByRecommendedElasticPoolAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName, String databaseName) {
return getByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() {
@Override
public DatabaseInner call(ServiceResponse<DatabaseInner> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[getByRecommendedElasticPoolAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, serverName, recommendedElasticPoolName, databaseName]] begin[{]
return[call[.getByRecommendedElasticPoolWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.recommendedElasticPoolName], member[.databaseName]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[DatabaseInner] operator[>] identifier[getByRecommendedElasticPoolAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[recommendedElasticPoolName] , identifier[String] identifier[databaseName] operator[SEP] {
Keyword[return] identifier[getByRecommendedElasticPoolWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[recommendedElasticPoolName] , identifier[databaseName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[DatabaseInner] operator[>] , identifier[DatabaseInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[DatabaseInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[DatabaseInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
protected void createAnimators(@NonNull ViewGroup sceneRoot,
@NonNull TransitionValuesMaps startValues,
@NonNull TransitionValuesMaps endValues,
@NonNull ArrayList<TransitionValues> startValuesList,
@NonNull ArrayList<TransitionValues> endValuesList) {
if (DBG) {
Log.d(LOG_TAG, "createAnimators() for " + this);
}
ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();
long minStartDelay = Long.MAX_VALUE;
int minAnimator = mAnimators.size();
SparseArray<Long> startDelays = new SparseArray<Long>();
int startValuesListCount = startValuesList.size();
for (int i = 0; i < startValuesListCount; ++i) {
TransitionValues start = startValuesList.get(i);
TransitionValues end = endValuesList.get(i);
if (start != null && !start.targetedTransitions.contains(this)) {
start = null;
}
if (end != null && !end.targetedTransitions.contains(this)) {
end = null;
}
if (start == null && end == null) {
continue;
}
// Only bother trying to animate with values that differ between start/end
boolean isChanged = start == null || end == null || isTransitionRequired(start, end);
if (isChanged) {
if (DBG) {
View view = (end != null) ? end.view : start.view;
Log.d(LOG_TAG, " differing start/end values for view " + view);
if (start == null || end == null) {
Log.d(LOG_TAG, " " + ((start == null) ?
"start null, end non-null" : "start non-null, end null"));
} else {
for (String key : start.values.keySet()) {
Object startValue = start.values.get(key);
Object endValue = end.values.get(key);
if (startValue != endValue && !startValue.equals(endValue)) {
Log.d(LOG_TAG, " " + key + ": start(" + startValue +
"), end(" + endValue + ")");
}
}
}
}
// TODO: what to do about targetIds and itemIds?
Animator animator = createAnimator(sceneRoot, start, end);
if (animator != null) {
// Save animation info for future cancellation purposes
View view;
TransitionValues infoValues = null;
if (end != null) {
view = end.view;
String[] properties = getTransitionProperties();
if (properties != null && properties.length > 0) {
infoValues = new TransitionValues(view);
TransitionValues newValues = endValues.viewValues.get(view);
if (newValues != null) {
for (int j = 0; j < properties.length; ++j) {
infoValues.values.put(properties[j],
newValues.values.get(properties[j]));
}
}
synchronized (sRunningAnimators) {
int numExistingAnims = runningAnimators.size();
for (int j = 0; j < numExistingAnims; ++j) {
Animator anim = runningAnimators.keyAt(j);
AnimationInfo info = runningAnimators.get(anim);
if (info.values != null && info.view == view && info.name.equals(getName())) {
if (info.values.equals(infoValues)) {
// Favor the old animator
animator = null;
break;
}
}
}
}
}
} else {
view = start.view;
}
if (animator != null) {
if (mPropagation != null) {
long delay = mPropagation
.getStartDelay(sceneRoot, this, start, end);
startDelays.put(mAnimators.size(), delay);
minStartDelay = Math.min(delay, minStartDelay);
}
AnimationInfo info = new AnimationInfo(view, getName(), this,
ViewUtils.getWindowId(sceneRoot), infoValues);
runningAnimators.put(animator, info);
mAnimators.add(animator);
}
}
}
}
if (startDelays.size() != 0) {
for (int i = 0; i < startDelays.size(); i++) {
int index = startDelays.keyAt(i);
Animator animator = mAnimators.get(index);
long delay = startDelays.valueAt(i) - minStartDelay + animator.getStartDelay();
animator.setStartDelay(delay);
}
}
}
|
class class_name[name] begin[{]
method[createAnimators, return_type[void], modifier[protected], parameter[sceneRoot, startValues, endValues, startValuesList, endValuesList]] begin[{]
if[member[.DBG]] begin[{]
call[Log.d, parameter[member[.LOG_TAG], binary_operation[literal["createAnimators() for "], +, THIS[]]]]
else begin[{]
None
end[}]
local_variable[type[ArrayMap], runningAnimators]
local_variable[type[long], minStartDelay]
local_variable[type[int], minAnimator]
local_variable[type[SparseArray], startDelays]
local_variable[type[int], startValuesListCount]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=startValuesList, selectors=[], type_arguments=None), name=start)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransitionValues, 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=endValuesList, selectors=[], type_arguments=None), name=end)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransitionValues, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=start.targetedTransitions, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=end.targetedTransitions, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTransitionRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), name=isChanged)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=isChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=DBG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=start, selectors=[]), if_true=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=end, selectors=[])), name=view)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=View, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG_TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" differing start/end values for view "), operandr=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=start.values, selectors=[], type_arguments=None), name=startValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=end.values, selectors=[], type_arguments=None), name=endValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=startValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=endValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=endValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=startValue, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG_TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": start("), operator=+), operandr=MemberReference(member=startValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="), end("), operator=+), operandr=MemberReference(member=endValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=start.values, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG_TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="start non-null, end null"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="start null, end non-null")), operator=+)], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sceneRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createAnimator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=animator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Animator, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=animator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=view)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=View, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=infoValues)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransitionValues, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=start, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=end, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTransitionProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=properties)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=properties, 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=properties, 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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=infoValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=view, 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=TransitionValues, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=endValues.viewValues, selectors=[], type_arguments=None), name=newValues)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransitionValues, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newValues, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MethodInvocation(arguments=[MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=newValues.values, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=infoValues.values, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)])), SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=runningAnimators, selectors=[], type_arguments=None), name=numExistingAnims)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keyAt, postfix_operators=[], prefix_operators=[], qualifier=runningAnimators, selectors=[], type_arguments=None), name=anim)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Animator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=anim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=runningAnimators, selectors=[], type_arguments=None), name=info)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnimationInfo, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[]), operandr=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=info.name, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=infoValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=info.values, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=animator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), BreakStatement(goto=None, label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numExistingAnims, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)], label=None, lock=MemberReference(member=sRunningAnimators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=animator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mPropagation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sceneRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStartDelay, postfix_operators=[], prefix_operators=[], qualifier=mPropagation, selectors=[], type_arguments=None), name=delay)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=mAnimators, selectors=[], type_arguments=None), MemberReference(member=delay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=startDelays, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=minStartDelay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=delay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minStartDelay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[MemberReference(member=sceneRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWindowId, postfix_operators=[], prefix_operators=[], qualifier=ViewUtils, selectors=[], type_arguments=None), MemberReference(member=infoValues, 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=AnimationInfo, sub_type=None)), name=info)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnimationInfo, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=animator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=runningAnimators, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=animator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=mAnimators, selectors=[], type_arguments=None), label=None)]))]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startValuesListCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
if[binary_operation[call[startDelays.size, parameter[]], !=, literal[0]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keyAt, postfix_operators=[], prefix_operators=[], qualifier=startDelays, selectors=[], type_arguments=None), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mAnimators, selectors=[], type_arguments=None), name=animator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Animator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueAt, postfix_operators=[], prefix_operators=[], qualifier=startDelays, selectors=[], type_arguments=None), operandr=MemberReference(member=minStartDelay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MethodInvocation(arguments=[], member=getStartDelay, postfix_operators=[], prefix_operators=[], qualifier=animator, selectors=[], type_arguments=None), operator=+), name=delay)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=delay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStartDelay, postfix_operators=[], prefix_operators=[], qualifier=animator, 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=startDelays, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[createAnimators] operator[SEP] annotation[@] identifier[NonNull] identifier[ViewGroup] identifier[sceneRoot] , annotation[@] identifier[NonNull] identifier[TransitionValuesMaps] identifier[startValues] , annotation[@] identifier[NonNull] identifier[TransitionValuesMaps] identifier[endValues] , annotation[@] identifier[NonNull] identifier[ArrayList] operator[<] identifier[TransitionValues] operator[>] identifier[startValuesList] , annotation[@] identifier[NonNull] identifier[ArrayList] operator[<] identifier[TransitionValues] operator[>] identifier[endValuesList] operator[SEP] {
Keyword[if] operator[SEP] identifier[DBG] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[LOG_TAG] , literal[String] operator[+] Keyword[this] operator[SEP] operator[SEP]
}
identifier[ArrayMap] operator[<] identifier[Animator] , identifier[AnimationInfo] operator[>] identifier[runningAnimators] operator[=] identifier[getRunningAnimators] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[minStartDelay] operator[=] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[int] identifier[minAnimator] operator[=] identifier[mAnimators] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[SparseArray] operator[<] identifier[Long] operator[>] identifier[startDelays] operator[=] Keyword[new] identifier[SparseArray] operator[<] identifier[Long] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[startValuesListCount] operator[=] identifier[startValuesList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[startValuesListCount] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[TransitionValues] identifier[start] operator[=] identifier[startValuesList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[TransitionValues] identifier[end] operator[=] identifier[endValuesList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[!=] Other[null] operator[&&] operator[!] identifier[start] operator[SEP] identifier[targetedTransitions] operator[SEP] identifier[contains] operator[SEP] Keyword[this] operator[SEP] operator[SEP] {
identifier[start] operator[=] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[end] operator[!=] Other[null] operator[&&] operator[!] identifier[end] operator[SEP] identifier[targetedTransitions] operator[SEP] identifier[contains] operator[SEP] Keyword[this] operator[SEP] operator[SEP] {
identifier[end] operator[=] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[start] operator[==] Other[null] operator[&&] identifier[end] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[boolean] identifier[isChanged] operator[=] identifier[start] operator[==] Other[null] operator[||] identifier[end] operator[==] Other[null] operator[||] identifier[isTransitionRequired] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isChanged] operator[SEP] {
Keyword[if] operator[SEP] identifier[DBG] operator[SEP] {
identifier[View] identifier[view] operator[=] operator[SEP] identifier[end] operator[!=] Other[null] operator[SEP] operator[?] identifier[end] operator[SEP] identifier[view] operator[:] identifier[start] operator[SEP] identifier[view] operator[SEP] identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[LOG_TAG] , literal[String] operator[+] identifier[view] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[==] Other[null] operator[||] identifier[end] operator[==] Other[null] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[LOG_TAG] , literal[String] operator[+] operator[SEP] operator[SEP] identifier[start] operator[==] Other[null] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[start] operator[SEP] identifier[values] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Object] identifier[startValue] operator[=] identifier[start] operator[SEP] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[Object] identifier[endValue] operator[=] identifier[end] operator[SEP] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startValue] operator[!=] identifier[endValue] operator[&&] operator[!] identifier[startValue] operator[SEP] identifier[equals] operator[SEP] identifier[endValue] operator[SEP] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[LOG_TAG] , literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[startValue] operator[+] literal[String] operator[+] identifier[endValue] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
}
}
identifier[Animator] identifier[animator] operator[=] identifier[createAnimator] operator[SEP] identifier[sceneRoot] , identifier[start] , identifier[end] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[animator] operator[!=] Other[null] operator[SEP] {
identifier[View] identifier[view] operator[SEP] identifier[TransitionValues] identifier[infoValues] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[!=] Other[null] operator[SEP] {
identifier[view] operator[=] identifier[end] operator[SEP] identifier[view] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[properties] operator[=] identifier[getTransitionProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[!=] Other[null] operator[&&] identifier[properties] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[infoValues] operator[=] Keyword[new] identifier[TransitionValues] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[TransitionValues] identifier[newValues] operator[=] identifier[endValues] operator[SEP] identifier[viewValues] operator[SEP] identifier[get] operator[SEP] identifier[view] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newValues] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[properties] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[j] operator[SEP] {
identifier[infoValues] operator[SEP] identifier[values] operator[SEP] identifier[put] operator[SEP] identifier[properties] operator[SEP] identifier[j] operator[SEP] , identifier[newValues] operator[SEP] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[properties] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[synchronized] operator[SEP] identifier[sRunningAnimators] operator[SEP] {
Keyword[int] identifier[numExistingAnims] operator[=] identifier[runningAnimators] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[numExistingAnims] operator[SEP] operator[++] identifier[j] operator[SEP] {
identifier[Animator] identifier[anim] operator[=] identifier[runningAnimators] operator[SEP] identifier[keyAt] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[AnimationInfo] identifier[info] operator[=] identifier[runningAnimators] operator[SEP] identifier[get] operator[SEP] identifier[anim] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[info] operator[SEP] identifier[values] operator[!=] Other[null] operator[&&] identifier[info] operator[SEP] identifier[view] operator[==] identifier[view] operator[&&] identifier[info] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[info] operator[SEP] identifier[values] operator[SEP] identifier[equals] operator[SEP] identifier[infoValues] operator[SEP] operator[SEP] {
identifier[animator] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP]
}
}
}
}
}
}
Keyword[else] {
identifier[view] operator[=] identifier[start] operator[SEP] identifier[view] operator[SEP]
}
Keyword[if] operator[SEP] identifier[animator] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[mPropagation] operator[!=] Other[null] operator[SEP] {
Keyword[long] identifier[delay] operator[=] identifier[mPropagation] operator[SEP] identifier[getStartDelay] operator[SEP] identifier[sceneRoot] , Keyword[this] , identifier[start] , identifier[end] operator[SEP] operator[SEP] identifier[startDelays] operator[SEP] identifier[put] operator[SEP] identifier[mAnimators] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[delay] operator[SEP] operator[SEP] identifier[minStartDelay] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[delay] , identifier[minStartDelay] operator[SEP] operator[SEP]
}
identifier[AnimationInfo] identifier[info] operator[=] Keyword[new] identifier[AnimationInfo] operator[SEP] identifier[view] , identifier[getName] operator[SEP] operator[SEP] , Keyword[this] , identifier[ViewUtils] operator[SEP] identifier[getWindowId] operator[SEP] identifier[sceneRoot] operator[SEP] , identifier[infoValues] operator[SEP] operator[SEP] identifier[runningAnimators] operator[SEP] identifier[put] operator[SEP] identifier[animator] , identifier[info] operator[SEP] operator[SEP] identifier[mAnimators] operator[SEP] identifier[add] operator[SEP] identifier[animator] operator[SEP] operator[SEP]
}
}
}
}
Keyword[if] operator[SEP] identifier[startDelays] operator[SEP] identifier[size] 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[startDelays] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[index] operator[=] identifier[startDelays] operator[SEP] identifier[keyAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Animator] identifier[animator] operator[=] identifier[mAnimators] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[long] identifier[delay] operator[=] identifier[startDelays] operator[SEP] identifier[valueAt] operator[SEP] identifier[i] operator[SEP] operator[-] identifier[minStartDelay] operator[+] identifier[animator] operator[SEP] identifier[getStartDelay] operator[SEP] operator[SEP] operator[SEP] identifier[animator] operator[SEP] identifier[setStartDelay] operator[SEP] identifier[delay] operator[SEP] operator[SEP]
}
}
}
|
long getYearMonthDayMillis(int year, int month, int dayOfMonth) {
long millis = getYearMillis(year);
millis += getTotalMillisByYearMonth(year, month);
return millis + (dayOfMonth - 1) * (long)DateTimeConstants.MILLIS_PER_DAY;
}
|
class class_name[name] begin[{]
method[getYearMonthDayMillis, return_type[type[long]], modifier[default], parameter[year, month, dayOfMonth]] begin[{]
local_variable[type[long], millis]
assign[member[.millis], call[.getTotalMillisByYearMonth, parameter[member[.year], member[.month]]]]
return[binary_operation[member[.millis], +, binary_operation[binary_operation[member[.dayOfMonth], -, literal[1]], *, Cast(expression=MemberReference(member=MILLIS_PER_DAY, postfix_operators=[], prefix_operators=[], qualifier=DateTimeConstants, selectors=[]), type=BasicType(dimensions=[], name=long))]]]
end[}]
END[}]
|
Keyword[long] identifier[getYearMonthDayMillis] operator[SEP] Keyword[int] identifier[year] , Keyword[int] identifier[month] , Keyword[int] identifier[dayOfMonth] operator[SEP] {
Keyword[long] identifier[millis] operator[=] identifier[getYearMillis] operator[SEP] identifier[year] operator[SEP] operator[SEP] identifier[millis] operator[+=] identifier[getTotalMillisByYearMonth] operator[SEP] identifier[year] , identifier[month] operator[SEP] operator[SEP] Keyword[return] identifier[millis] operator[+] operator[SEP] identifier[dayOfMonth] operator[-] Other[1] operator[SEP] operator[*] operator[SEP] Keyword[long] operator[SEP] identifier[DateTimeConstants] operator[SEP] identifier[MILLIS_PER_DAY] operator[SEP]
}
|
private boolean trySimplifyUnusedResultInternal(Node tree, ArrayDeque<Node> sideEffectRoots) {
// Special cases for conditional expressions that may be using results.
switch (tree.getToken()) {
case HOOK:
// Try to remove one or more of the conditional children and transform the HOOK to an
// equivalent operation. Remember that if either value branch still exists, the result of
// the predicate expression is being used, and so cannot be removed.
// x() ? foo() : 1 --> x() && foo()
// x() ? 1 : foo() --> x() || foo()
// x() ? 1 : 1 --> x()
// x ? 1 : 1 --> null
Node trueNode = trySimplifyUnusedResult(tree.getSecondChild());
Node falseNode = trySimplifyUnusedResult(tree.getLastChild());
if (trueNode == null && falseNode != null) {
checkState(tree.hasTwoChildren(), tree);
tree.setToken(Token.OR);
sideEffectRoots.addLast(tree);
return false; // The node type was changed.
} else if (trueNode != null && falseNode == null) {
checkState(tree.hasTwoChildren(), tree);
tree.setToken(Token.AND);
sideEffectRoots.addLast(tree);
return false; // The node type was changed.
} else if (trueNode == null && falseNode == null) {
// Don't bother adding true and false branch children to make the AST valid; this HOOK is
// going to be deleted. We just need to collect any side-effects from the predicate
// expression.
trySimplifyUnusedResultInternal(tree.getOnlyChild(), sideEffectRoots);
return false; // This HOOK must be cleaned up.
} else {
sideEffectRoots.addLast(tree);
return hasFixedPointParent(tree);
}
case AND:
case OR:
// Try to remove the second operand from a AND or OR operations. Remember that if the second
// child still exists, the result of the first expression is being used, and so cannot be
// removed.
// x() || f --> x()
// x() && f --> x()
Node conditionalResultNode = trySimplifyUnusedResult(tree.getLastChild());
if (conditionalResultNode == null) {
// Don't bother adding a second child to make the AST valid; this op is going to be
// deleted. We just need to collect any side-effects from the predicate first child.
trySimplifyUnusedResultInternal(tree.getOnlyChild(), sideEffectRoots);
return false; // This op must be cleaned up.
} else {
sideEffectRoots.addLast(tree);
return hasFixedPointParent(tree);
}
case FUNCTION:
// Functions that aren't being invoked are dead. If they were invoked we'd see the CALL
// before arriving here. We don't want to look at any children since they'll never execute.
return false;
default:
// This is the meat of this function. It covers the general case of nodes which are unused
if (nodeTypeMayHaveSideEffects(tree)) {
sideEffectRoots.addLast(tree);
return hasFixedPointParent(tree);
} else if (!tree.hasChildren()) {
return false; // A node must have children or side-effects to be at fixed-point.
}
boolean atFixedPoint = hasFixedPointParent(tree);
for (Node child = tree.getFirstChild(); child != null; child = child.getNext()) {
atFixedPoint &= trySimplifyUnusedResultInternal(child, sideEffectRoots);
}
return atFixedPoint;
}
}
|
class class_name[name] begin[{]
method[trySimplifyUnusedResultInternal, return_type[type[boolean]], modifier[private], parameter[tree, sideEffectRoots]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['HOOK'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSecondChild, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None)], member=trySimplifyUnusedResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=trueNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLastChild, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None)], member=trySimplifyUnusedResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=falseNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=trueNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=falseNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=trueNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=falseNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=trueNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=falseNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLast, postfix_operators=[], prefix_operators=[], qualifier=sideEffectRoots, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasFixedPointParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOnlyChild, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), MemberReference(member=sideEffectRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trySimplifyUnusedResultInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=hasTwoChildren, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=AND, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[])], member=setToken, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLast, postfix_operators=[], prefix_operators=[], qualifier=sideEffectRoots, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=hasTwoChildren, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OR, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[])], member=setToken, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLast, postfix_operators=[], prefix_operators=[], qualifier=sideEffectRoots, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), SwitchStatementCase(case=['AND', 'OR'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLastChild, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None)], member=trySimplifyUnusedResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=conditionalResultNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=conditionalResultNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLast, postfix_operators=[], prefix_operators=[], qualifier=sideEffectRoots, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasFixedPointParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOnlyChild, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), MemberReference(member=sideEffectRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trySimplifyUnusedResultInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), SwitchStatementCase(case=['FUNCTION'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nodeTypeMayHaveSideEffects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=hasChildren, postfix_operators=[], prefix_operators=['!'], qualifier=tree, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLast, postfix_operators=[], prefix_operators=[], qualifier=sideEffectRoots, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasFixedPointParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasFixedPointParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=atFixedPoint)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=atFixedPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=&=, value=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sideEffectRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trySimplifyUnusedResultInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=child, 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=MethodInvocation(arguments=[], member=getFirstChild, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNext, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None))]), label=None), ReturnStatement(expression=MemberReference(member=atFixedPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[], member=getToken, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), label=None)
end[}]
END[}]
|
Keyword[private] Keyword[boolean] identifier[trySimplifyUnusedResultInternal] operator[SEP] identifier[Node] identifier[tree] , identifier[ArrayDeque] operator[<] identifier[Node] operator[>] identifier[sideEffectRoots] operator[SEP] {
Keyword[switch] operator[SEP] identifier[tree] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[HOOK] operator[:] identifier[Node] identifier[trueNode] operator[=] identifier[trySimplifyUnusedResult] operator[SEP] identifier[tree] operator[SEP] identifier[getSecondChild] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[falseNode] operator[=] identifier[trySimplifyUnusedResult] operator[SEP] identifier[tree] operator[SEP] identifier[getLastChild] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trueNode] operator[==] Other[null] operator[&&] identifier[falseNode] operator[!=] Other[null] operator[SEP] {
identifier[checkState] operator[SEP] identifier[tree] operator[SEP] identifier[hasTwoChildren] operator[SEP] operator[SEP] , identifier[tree] operator[SEP] operator[SEP] identifier[tree] operator[SEP] identifier[setToken] operator[SEP] identifier[Token] operator[SEP] identifier[OR] operator[SEP] operator[SEP] identifier[sideEffectRoots] operator[SEP] identifier[addLast] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[trueNode] operator[!=] Other[null] operator[&&] identifier[falseNode] operator[==] Other[null] operator[SEP] {
identifier[checkState] operator[SEP] identifier[tree] operator[SEP] identifier[hasTwoChildren] operator[SEP] operator[SEP] , identifier[tree] operator[SEP] operator[SEP] identifier[tree] operator[SEP] identifier[setToken] operator[SEP] identifier[Token] operator[SEP] identifier[AND] operator[SEP] operator[SEP] identifier[sideEffectRoots] operator[SEP] identifier[addLast] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[trueNode] operator[==] Other[null] operator[&&] identifier[falseNode] operator[==] Other[null] operator[SEP] {
identifier[trySimplifyUnusedResultInternal] operator[SEP] identifier[tree] operator[SEP] identifier[getOnlyChild] operator[SEP] operator[SEP] , identifier[sideEffectRoots] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[sideEffectRoots] operator[SEP] identifier[addLast] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[return] identifier[hasFixedPointParent] operator[SEP] identifier[tree] operator[SEP] operator[SEP]
}
Keyword[case] identifier[AND] operator[:] Keyword[case] identifier[OR] operator[:] identifier[Node] identifier[conditionalResultNode] operator[=] identifier[trySimplifyUnusedResult] operator[SEP] identifier[tree] operator[SEP] identifier[getLastChild] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conditionalResultNode] operator[==] Other[null] operator[SEP] {
identifier[trySimplifyUnusedResultInternal] operator[SEP] identifier[tree] operator[SEP] identifier[getOnlyChild] operator[SEP] operator[SEP] , identifier[sideEffectRoots] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[sideEffectRoots] operator[SEP] identifier[addLast] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[return] identifier[hasFixedPointParent] operator[SEP] identifier[tree] operator[SEP] operator[SEP]
}
Keyword[case] identifier[FUNCTION] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[nodeTypeMayHaveSideEffects] operator[SEP] identifier[tree] operator[SEP] operator[SEP] {
identifier[sideEffectRoots] operator[SEP] identifier[addLast] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[return] identifier[hasFixedPointParent] operator[SEP] identifier[tree] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[tree] operator[SEP] identifier[hasChildren] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[boolean] identifier[atFixedPoint] operator[=] identifier[hasFixedPointParent] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Node] identifier[child] operator[=] identifier[tree] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[child] operator[!=] Other[null] operator[SEP] identifier[child] operator[=] identifier[child] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[atFixedPoint] operator[&=] identifier[trySimplifyUnusedResultInternal] operator[SEP] identifier[child] , identifier[sideEffectRoots] operator[SEP] operator[SEP]
}
Keyword[return] identifier[atFixedPoint] operator[SEP]
}
}
|
private static Set<String> introspectPropertyViews(PropertyDescriptor propertyDescriptor, Field field) {
Set<String> views = Sets.newHashSet();
if (propertyDescriptor.getReadMethod() != null) {
applyPropertyViews(views, propertyDescriptor.getReadMethod().getAnnotations());
}
if (propertyDescriptor.getWriteMethod() != null) {
applyPropertyViews(views, propertyDescriptor.getWriteMethod().getAnnotations());
}
if (field != null) {
applyPropertyViews(views, field.getAnnotations());
}
if (views.isEmpty() && SquigglyConfig.isPropertyAddNonAnnotatedFieldsToBaseView()) {
return Collections.singleton(PropertyView.BASE_VIEW);
}
return views;
}
|
class class_name[name] begin[{]
method[introspectPropertyViews, return_type[type[Set]], modifier[private static], parameter[propertyDescriptor, field]] begin[{]
local_variable[type[Set], views]
if[binary_operation[call[propertyDescriptor.getReadMethod, parameter[]], !=, literal[null]]] begin[{]
call[.applyPropertyViews, parameter[member[.views], call[propertyDescriptor.getReadMethod, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[call[propertyDescriptor.getWriteMethod, parameter[]], !=, literal[null]]] begin[{]
call[.applyPropertyViews, parameter[member[.views], call[propertyDescriptor.getWriteMethod, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.field], !=, literal[null]]] begin[{]
call[.applyPropertyViews, parameter[member[.views], call[field.getAnnotations, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[call[views.isEmpty, parameter[]], &&, call[SquigglyConfig.isPropertyAddNonAnnotatedFieldsToBaseView, parameter[]]]] begin[{]
return[call[Collections.singleton, parameter[member[PropertyView.BASE_VIEW]]]]
else begin[{]
None
end[}]
return[member[.views]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[Set] operator[<] identifier[String] operator[>] identifier[introspectPropertyViews] operator[SEP] identifier[PropertyDescriptor] identifier[propertyDescriptor] , identifier[Field] identifier[field] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[views] operator[=] identifier[Sets] operator[SEP] identifier[newHashSet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propertyDescriptor] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[applyPropertyViews] operator[SEP] identifier[views] , identifier[propertyDescriptor] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyDescriptor] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[applyPropertyViews] operator[SEP] identifier[views] , identifier[propertyDescriptor] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[field] operator[!=] Other[null] operator[SEP] {
identifier[applyPropertyViews] operator[SEP] identifier[views] , identifier[field] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[views] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[SquigglyConfig] operator[SEP] identifier[isPropertyAddNonAnnotatedFieldsToBaseView] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[singleton] operator[SEP] identifier[PropertyView] operator[SEP] identifier[BASE_VIEW] operator[SEP] operator[SEP]
}
Keyword[return] identifier[views] operator[SEP]
}
|
protected void doRead(HttpServletRequest request,
HttpServletResponse response, String tunnelUUID)
throws GuacamoleException {
// Get tunnel, ensure tunnel exists
GuacamoleTunnel tunnel = getTunnel(tunnelUUID);
// Ensure tunnel is open
if (!tunnel.isOpen())
throw new GuacamoleResourceNotFoundException("Tunnel is closed.");
// Obtain exclusive read access
GuacamoleReader reader = tunnel.acquireReader();
try {
// Note that although we are sending text, Webkit browsers will
// buffer 1024 bytes before starting a normal stream if we use
// anything but application/octet-stream.
response.setContentType("application/octet-stream");
response.setHeader("Cache-Control", "no-cache");
// Get writer for response
Writer out = new BufferedWriter(new OutputStreamWriter(
response.getOutputStream(), "UTF-8"));
// Stream data to response, ensuring output stream is closed
try {
// Deregister tunnel and throw error if we reach EOF without
// having ever sent any data
char[] message = reader.read();
if (message == null)
throw new GuacamoleConnectionClosedException("Tunnel reached end of stream.");
// For all messages, until another stream is ready (we send at least one message)
do {
// Get message output bytes
out.write(message, 0, message.length);
// Flush if we expect to wait
if (!reader.available()) {
out.flush();
response.flushBuffer();
}
// No more messages another stream can take over
if (tunnel.hasQueuedReaderThreads())
break;
} while (tunnel.isOpen() && (message = reader.read()) != null);
// Close tunnel immediately upon EOF
if (message == null) {
deregisterTunnel(tunnel);
tunnel.close();
}
// End-of-instructions marker
out.write("0.;");
out.flush();
response.flushBuffer();
}
// Send end-of-stream marker and close tunnel if connection is closed
catch (GuacamoleConnectionClosedException e) {
// Deregister and close
deregisterTunnel(tunnel);
tunnel.close();
// End-of-instructions marker
out.write("0.;");
out.flush();
response.flushBuffer();
}
catch (GuacamoleException e) {
// Deregister and close
deregisterTunnel(tunnel);
tunnel.close();
throw e;
}
// Always close output stream
finally {
out.close();
}
}
catch (IOException e) {
// Log typically frequent I/O error if desired
logger.debug("Error writing to servlet output stream", e);
// Deregister and close
deregisterTunnel(tunnel);
tunnel.close();
}
finally {
tunnel.releaseReader();
}
}
|
class class_name[name] begin[{]
method[doRead, return_type[void], modifier[protected], parameter[request, response, tunnelUUID]] begin[{]
local_variable[type[GuacamoleTunnel], tunnel]
if[call[tunnel.isOpen, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tunnel is closed.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GuacamoleResourceNotFoundException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[GuacamoleReader], reader]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="application/octet-stream")], member=setContentType, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cache-Control"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no-cache")], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OutputStreamWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedWriter, sub_type=None)), name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Writer, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=message)], modifiers=set(), type=BasicType(dimensions=[None], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=message, 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=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tunnel reached end of stream.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GuacamoleConnectionClosedException, sub_type=None)), label=None)), DoStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=['!'], qualifier=reader, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flushBuffer, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=hasQueuedReaderThreads, postfix_operators=[], prefix_operators=[], qualifier=tunnel, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isOpen, postfix_operators=[], prefix_operators=[], qualifier=tunnel, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=message, 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=tunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deregisterTunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=tunnel, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.;")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flushBuffer, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deregisterTunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=tunnel, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.;")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flushBuffer, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GuacamoleConnectionClosedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deregisterTunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=tunnel, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GuacamoleException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error writing to servlet output stream"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deregisterTunnel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=tunnel, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=releaseReader, postfix_operators=[], prefix_operators=[], qualifier=tunnel, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[doRead] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] , identifier[String] identifier[tunnelUUID] operator[SEP] Keyword[throws] identifier[GuacamoleException] {
identifier[GuacamoleTunnel] identifier[tunnel] operator[=] identifier[getTunnel] operator[SEP] identifier[tunnelUUID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[tunnel] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[GuacamoleResourceNotFoundException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[GuacamoleReader] identifier[reader] operator[=] identifier[tunnel] operator[SEP] identifier[acquireReader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[response] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Writer] identifier[out] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[OutputStreamWriter] operator[SEP] identifier[response] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[char] operator[SEP] operator[SEP] identifier[message] operator[=] identifier[reader] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[GuacamoleConnectionClosedException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[do] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[message] , Other[0] , identifier[message] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[reader] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] {
identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[tunnel] operator[SEP] identifier[hasQueuedReaderThreads] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[while] operator[SEP] identifier[tunnel] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[message] operator[=] identifier[reader] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[SEP] {
identifier[deregisterTunnel] operator[SEP] identifier[tunnel] operator[SEP] operator[SEP] identifier[tunnel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[GuacamoleConnectionClosedException] identifier[e] operator[SEP] {
identifier[deregisterTunnel] operator[SEP] identifier[tunnel] operator[SEP] operator[SEP] identifier[tunnel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[GuacamoleException] identifier[e] operator[SEP] {
identifier[deregisterTunnel] operator[SEP] identifier[tunnel] operator[SEP] operator[SEP] identifier[tunnel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
Keyword[finally] {
identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[deregisterTunnel] operator[SEP] identifier[tunnel] operator[SEP] operator[SEP] identifier[tunnel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[tunnel] operator[SEP] identifier[releaseReader] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public AbortEnvironmentUpdateResult abortEnvironmentUpdate(AbortEnvironmentUpdateRequest request) {
request = beforeClientExecution(request);
return executeAbortEnvironmentUpdate(request);
}
|
class class_name[name] begin[{]
method[abortEnvironmentUpdate, return_type[type[AbortEnvironmentUpdateResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeAbortEnvironmentUpdate, parameter[member[.request]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[AbortEnvironmentUpdateResult] identifier[abortEnvironmentUpdate] operator[SEP] identifier[AbortEnvironmentUpdateRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeAbortEnvironmentUpdate] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private static void senSegmentFile(String infile, String outfile, JVnSenSegmenter senSegmenter ){
try{
BufferedReader in = new BufferedReader(new InputStreamReader(
new FileInputStream(infile), "UTF-8"));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(outfile), "UTF-8"));
String para = "", line = "", text = "";
while ((line = in.readLine()) != null){
if (!line.equals("")){
if (line.charAt(0) == '#'){
//skip comment line
text += line + "\n";
continue;
}
para = senSegmenter.senSegment(line).trim();
text += para.trim() + "\n\n";
}
else{
//blank line
text += "\n";
}
}
text = text.trim();
out.write(text);
out.newLine();
in.close();
out.close();
}
catch (Exception e){
System.out.println("Error in sensegment file " + infile);
}
}
|
class class_name[name] begin[{]
method[senSegmentFile, return_type[void], modifier[private static], parameter[infile, outfile, senSegmenter]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=infile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=outfile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OutputStreamWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedWriter, sub_type=None)), name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=para), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=line), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=text)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=line, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='#'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=para, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=senSegment, postfix_operators=[], prefix_operators=[], qualifier=senSegmenter, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=para, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n\n"), operator=+)), label=None)]))]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=newLine, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error in sensegment file "), operandr=MemberReference(member=infile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[void] identifier[senSegmentFile] operator[SEP] identifier[String] identifier[infile] , identifier[String] identifier[outfile] , identifier[JVnSenSegmenter] identifier[senSegmenter] operator[SEP] {
Keyword[try] {
identifier[BufferedReader] identifier[in] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[infile] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[BufferedWriter] identifier[out] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[OutputStreamWriter] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[outfile] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[para] operator[=] literal[String] , identifier[line] operator[=] literal[String] , identifier[text] operator[=] literal[String] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[line] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[text] operator[+=] identifier[line] operator[+] literal[String] operator[SEP] Keyword[continue] operator[SEP]
}
identifier[para] operator[=] identifier[senSegmenter] operator[SEP] identifier[senSegment] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[text] operator[+=] identifier[para] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP]
}
Keyword[else] {
identifier[text] operator[+=] literal[String] operator[SEP]
}
}
identifier[text] operator[=] identifier[text] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[newLine] operator[SEP] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[infile] operator[SEP] operator[SEP]
}
}
|
public static boolean isValidLineNumber(Code obj, int pc) {
LineNumberTable lnt = obj.getLineNumberTable();
if (lnt == null)
return true;
LineNumber[] lineNumbers = lnt.getLineNumberTable();
if (lineNumbers == null)
return true;
int lo = 0;
int hi = lineNumbers.length - 1;
int mid = 0;
int linePC = 0;
while (lo <= hi) {
mid = (lo + hi) >>> 1;
linePC = lineNumbers[mid].getStartPC();
if (linePC == pc)
break;
if (linePC < pc)
lo = mid + 1;
else
hi = mid - 1;
}
int lineNo = lineNumbers[mid].getLineNumber();
for (int i = 0; i < lineNumbers.length; i++) {
if ((mid != i) && (lineNumbers[i].getLineNumber() == lineNo))
return false;
}
return true;
}
|
class class_name[name] begin[{]
method[isValidLineNumber, return_type[type[boolean]], modifier[public static], parameter[obj, pc]] begin[{]
local_variable[type[LineNumberTable], lnt]
if[binary_operation[member[.lnt], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[LineNumber], lineNumbers]
if[binary_operation[member[.lineNumbers], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[int], lo]
local_variable[type[int], hi]
local_variable[type[int], mid]
local_variable[type[int], linePC]
while[binary_operation[member[.lo], <=, member[.hi]]] begin[{]
assign[member[.mid], binary_operation[binary_operation[member[.lo], +, member[.hi]], >>>, literal[1]]]
assign[member[.linePC], member[.lineNumbers]]
if[binary_operation[member[.linePC], ==, member[.pc]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.linePC], <, member[.pc]]] begin[{]
assign[member[.lo], binary_operation[member[.mid], +, literal[1]]]
else begin[{]
assign[member[.hi], binary_operation[member[.mid], -, literal[1]]]
end[}]
end[}]
local_variable[type[int], lineNo]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=lineNumbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MemberReference(member=lineNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), 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=lineNumbers, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[isValidLineNumber] operator[SEP] identifier[Code] identifier[obj] , Keyword[int] identifier[pc] operator[SEP] {
identifier[LineNumberTable] identifier[lnt] operator[=] identifier[obj] operator[SEP] identifier[getLineNumberTable] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lnt] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[LineNumber] operator[SEP] operator[SEP] identifier[lineNumbers] operator[=] identifier[lnt] operator[SEP] identifier[getLineNumberTable] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lineNumbers] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[int] identifier[lo] operator[=] Other[0] operator[SEP] Keyword[int] identifier[hi] operator[=] identifier[lineNumbers] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[int] identifier[mid] operator[=] Other[0] operator[SEP] Keyword[int] identifier[linePC] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[lo] operator[<=] identifier[hi] operator[SEP] {
identifier[mid] operator[=] operator[SEP] identifier[lo] operator[+] identifier[hi] operator[SEP] operator[>] operator[>] operator[>] Other[1] operator[SEP] identifier[linePC] operator[=] identifier[lineNumbers] operator[SEP] identifier[mid] operator[SEP] operator[SEP] identifier[getStartPC] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[linePC] operator[==] identifier[pc] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[linePC] operator[<] identifier[pc] operator[SEP] identifier[lo] operator[=] identifier[mid] operator[+] Other[1] operator[SEP] Keyword[else] identifier[hi] operator[=] identifier[mid] operator[-] Other[1] operator[SEP]
}
Keyword[int] identifier[lineNo] operator[=] identifier[lineNumbers] operator[SEP] identifier[mid] operator[SEP] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[lineNumbers] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[mid] operator[!=] identifier[i] operator[SEP] operator[&&] operator[SEP] identifier[lineNumbers] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[==] identifier[lineNo] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public Model filter(Model model) {
if(model == null || model.getLevel() != BioPAXLevel.L2)
return model; // nothing to do
preparePep2PEIDMap(model);
final Model newModel = factory.createModel();
newModel.getNameSpacePrefixMap().putAll(model.getNameSpacePrefixMap());
newModel.setXmlBase(model.getXmlBase());
// facilitate the conversion
normalize(model);
// First, map classes (and only set ID) if possible (pre-processing)
for(BioPAXElement bpe : model.getObjects()) {
Level3Element l3element = mapClass(bpe);
if(l3element != null) {
newModel.add(l3element);
} else {
log.debug("Skipping " + bpe + " " + bpe.getModelInterface().getSimpleName());
}
}
/* process each L2 element (mapping properties),
* except for pEPs and oCVs that must be processed as values
* (anyway, we do not want dangling elements)
*/
for(BioPAXElement e : model.getObjects()) {
if(e instanceof physicalEntityParticipant
|| e instanceof openControlledVocabulary) {
continue;
}
// map properties
traverse((Level2Element) e, newModel);
}
log.info("Done: new L3 model contains " + newModel.getObjects().size() + " BioPAX individuals.");
// fix new model (e.g., add PathwayStep's processes to the pathway components ;))
normalize(newModel);
return newModel;
}
|
class class_name[name] begin[{]
method[filter, return_type[type[Model]], modifier[public], parameter[model]] begin[{]
if[binary_operation[binary_operation[member[.model], ==, literal[null]], ||, binary_operation[call[model.getLevel, parameter[]], !=, member[BioPAXLevel.L2]]]] begin[{]
return[member[.model]]
else begin[{]
None
end[}]
call[.preparePep2PEIDMap, parameter[member[.model]]]
local_variable[type[Model], newModel]
call[newModel.getNameSpacePrefixMap, parameter[]]
call[newModel.setXmlBase, parameter[call[model.getXmlBase, parameter[]]]]
call[.normalize, parameter[member[.model]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bpe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mapClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=l3element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Level3Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=l3element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping "), operandr=MemberReference(member=bpe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[], member=getModelInterface, postfix_operators=[], prefix_operators=[], qualifier=bpe, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=l3element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newModel, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getObjects, postfix_operators=[], prefix_operators=[], qualifier=model, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bpe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BioPAXElement, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=physicalEntityParticipant, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=openControlledVocabulary, sub_type=None), operator=instanceof), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Level2Element, sub_type=None)), MemberReference(member=newModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getObjects, postfix_operators=[], prefix_operators=[], qualifier=model, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BioPAXElement, sub_type=None))), label=None)
call[log.info, parameter[binary_operation[binary_operation[literal["Done: new L3 model contains "], +, call[newModel.getObjects, parameter[]]], +, literal[" BioPAX individuals."]]]]
call[.normalize, parameter[member[.newModel]]]
return[member[.newModel]]
end[}]
END[}]
|
Keyword[public] identifier[Model] identifier[filter] operator[SEP] identifier[Model] identifier[model] operator[SEP] {
Keyword[if] operator[SEP] identifier[model] operator[==] Other[null] operator[||] identifier[model] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[!=] identifier[BioPAXLevel] operator[SEP] identifier[L2] operator[SEP] Keyword[return] identifier[model] operator[SEP] identifier[preparePep2PEIDMap] operator[SEP] identifier[model] operator[SEP] operator[SEP] Keyword[final] identifier[Model] identifier[newModel] operator[=] identifier[factory] operator[SEP] identifier[createModel] operator[SEP] operator[SEP] operator[SEP] identifier[newModel] operator[SEP] identifier[getNameSpacePrefixMap] operator[SEP] operator[SEP] operator[SEP] identifier[putAll] operator[SEP] identifier[model] operator[SEP] identifier[getNameSpacePrefixMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[newModel] operator[SEP] identifier[setXmlBase] operator[SEP] identifier[model] operator[SEP] identifier[getXmlBase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[normalize] operator[SEP] identifier[model] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BioPAXElement] identifier[bpe] operator[:] identifier[model] operator[SEP] identifier[getObjects] operator[SEP] operator[SEP] operator[SEP] {
identifier[Level3Element] identifier[l3element] operator[=] identifier[mapClass] operator[SEP] identifier[bpe] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l3element] operator[!=] Other[null] operator[SEP] {
identifier[newModel] operator[SEP] identifier[add] operator[SEP] identifier[l3element] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[bpe] operator[+] literal[String] operator[+] identifier[bpe] operator[SEP] identifier[getModelInterface] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[BioPAXElement] identifier[e] operator[:] identifier[model] operator[SEP] identifier[getObjects] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[physicalEntityParticipant] operator[||] identifier[e] Keyword[instanceof] identifier[openControlledVocabulary] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[traverse] operator[SEP] operator[SEP] identifier[Level2Element] operator[SEP] identifier[e] , identifier[newModel] operator[SEP] operator[SEP]
}
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[newModel] operator[SEP] identifier[getObjects] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[normalize] operator[SEP] identifier[newModel] operator[SEP] operator[SEP] Keyword[return] identifier[newModel] operator[SEP]
}
|
@Nonnull
@ReturnsMutableCopy
public static byte [] decodeFromFile (@Nonnull final String filename) throws IOException
{
// Setup some useful variables
final File file = new File (filename);
// Check for size of file
if (file.length () > Integer.MAX_VALUE)
throw new IOException ("File is too big for this convenience method (" + file.length () + " bytes).");
final byte [] buffer = new byte [(int) file.length ()];
// Open a stream
try (final Base64InputStream bis = new Base64InputStream (FileHelper.getBufferedInputStream (file), DECODE))
{
int nOfs = 0;
int numBytes;
// Read until done
while ((numBytes = bis.read (buffer, nOfs, 4096)) >= 0)
{
nOfs += numBytes;
}
// Save in a variable to return
final byte [] decodedData = new byte [nOfs];
System.arraycopy (buffer, 0, decodedData, 0, nOfs);
return decodedData;
}
}
|
class class_name[name] begin[{]
method[decodeFromFile, return_type[type[byte]], modifier[public static], parameter[filename]] begin[{]
local_variable[type[File], file]
if[binary_operation[call[file.length, parameter[]], >, member[Integer.MAX_VALUE]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File is too big for this convenience method ("), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" bytes)."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[byte], buffer]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=nOfs)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=numBytes)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nOfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=numBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=numBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nOfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)], member=read, postfix_operators=[], prefix_operators=[], qualifier=bis, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=nOfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=decodedData)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=decodedData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=nOfs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=decodedData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=bis, type=ReferenceType(arguments=None, dimensions=[], name=Base64InputStream, sub_type=None), value=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBufferedInputStream, postfix_operators=[], prefix_operators=[], qualifier=FileHelper, selectors=[], type_arguments=None), MemberReference(member=DECODE, 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=Base64InputStream, sub_type=None)))])
end[}]
END[}]
|
annotation[@] identifier[Nonnull] annotation[@] identifier[ReturnsMutableCopy] Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[decodeFromFile] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[String] identifier[filename] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[file] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] Keyword[final] identifier[Base64InputStream] identifier[bis] operator[=] Keyword[new] identifier[Base64InputStream] operator[SEP] identifier[FileHelper] operator[SEP] identifier[getBufferedInputStream] operator[SEP] identifier[file] operator[SEP] , identifier[DECODE] operator[SEP] operator[SEP] {
Keyword[int] identifier[nOfs] operator[=] Other[0] operator[SEP] Keyword[int] identifier[numBytes] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[numBytes] operator[=] identifier[bis] operator[SEP] identifier[read] operator[SEP] identifier[buffer] , identifier[nOfs] , Other[4096] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
identifier[nOfs] operator[+=] identifier[numBytes] operator[SEP]
}
Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[decodedData] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[nOfs] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[buffer] , Other[0] , identifier[decodedData] , Other[0] , identifier[nOfs] operator[SEP] operator[SEP] Keyword[return] identifier[decodedData] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public EList<IfcRelDecomposes> getIsDecomposedBy() {
return (EList<IfcRelDecomposes>) eGet(Ifc2x3tc1Package.Literals.IFC_OBJECT_DEFINITION__IS_DECOMPOSED_BY, true);
}
|
class class_name[name] begin[{]
method[getIsDecomposedBy, return_type[type[EList]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_OBJECT_DEFINITION__IS_DECOMPOSED_BY, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcRelDecomposes, sub_type=None))], dimensions=[], name=EList, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[EList] operator[<] identifier[IfcRelDecomposes] operator[>] identifier[getIsDecomposedBy] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcRelDecomposes] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_OBJECT_DEFINITION__IS_DECOMPOSED_BY] , literal[boolean] operator[SEP] operator[SEP]
}
|
@Override
public boolean authorize(AuthenticationResult authResult, WebRequest webRequest, String uriName) {
HttpServletRequest req = webRequest.getHttpServletRequest();
boolean isAuthorized = jaccServiceRef.getService().isAuthorized(getApplicationName(), getModuleName(), uriName, req.getMethod(), req, authResult.getSubject());
//String[] methodNameArray = new String[] { req.getMethod() };
//WebResourcePermission webPerm = new WebResourcePermission(uriName, methodNameArray);
WebReply reply = isAuthorized ? new PermitReply() : DENY_AUTHZ_FAILED;
if (isAuthorized) {
AuditAuthenticationResult auditAuthResult = new AuditAuthenticationResult(AuditAuthResult.SUCCESS, authResult.getSubject(), AuditEvent.CRED_TYPE_BASIC, null, AuditEvent.OUTCOME_SUCCESS);
Audit.audit(Audit.EventID.SECURITY_AUTHZ_02, webRequest, authResult, uriName, AuditConstants.WEB_CONTAINER, Integer.valueOf(reply.getStatusCode()));
} else {
AuditAuthenticationResult auditAuthResult = new AuditAuthenticationResult(AuditAuthResult.FAILURE, authResult.getSubject(), AuditEvent.CRED_TYPE_BASIC, null, AuditEvent.OUTCOME_FAILURE);
Audit.audit(Audit.EventID.SECURITY_AUTHZ_02, webRequest, authResult, uriName, AuditConstants.WEB_CONTAINER, Integer.valueOf(reply.getStatusCode()));
}
if (!isAuthorized) {
String authUserName = authResult.getUserName();
String authRealm = authResult.getRealm();
String appName = webRequest.getApplicationName();
if (authRealm != null && authUserName != null) {
Tr.audit(tc, "SEC_JACC_AUTHZ_FAILED", authUserName.concat(":").concat(authRealm), appName, uriName);
} else {
// We have a subject if we got this far, use it to determine the name
authUserName = authResult.getSubject().getPrincipals(WSPrincipal.class).iterator().next().getName();
//WebReply reply = isAuthorized ? new PermitReply() : DENY_AUTHZ_FAILED;
Tr.audit(tc, "SEC_JACC_AUTHZ_FAILED", authUserName, appName, uriName);
}
//WebReply reply = isAuthorized ? new PermitReply() : DENY_AUTHZ_FAILED;
//Audit.audit(Audit.EventID.SECURITY_AUTHZ_01, webRequest, authResult, uriName, Integer.valueOf(reply.getStatusCode()));
}
return isAuthorized;
}
|
class class_name[name] begin[{]
method[authorize, return_type[type[boolean]], modifier[public], parameter[authResult, webRequest, uriName]] begin[{]
local_variable[type[HttpServletRequest], req]
local_variable[type[boolean], isAuthorized]
local_variable[type[WebReply], reply]
if[member[.isAuthorized]] begin[{]
local_variable[type[AuditAuthenticationResult], auditAuthResult]
call[Audit.audit, parameter[member[Audit.EventID.SECURITY_AUTHZ_02], member[.webRequest], member[.authResult], member[.uriName], member[AuditConstants.WEB_CONTAINER], call[Integer.valueOf, parameter[call[reply.getStatusCode, parameter[]]]]]]
else begin[{]
local_variable[type[AuditAuthenticationResult], auditAuthResult]
call[Audit.audit, parameter[member[Audit.EventID.SECURITY_AUTHZ_02], member[.webRequest], member[.authResult], member[.uriName], member[AuditConstants.WEB_CONTAINER], call[Integer.valueOf, parameter[call[reply.getStatusCode, parameter[]]]]]]
end[}]
if[member[.isAuthorized]] begin[{]
local_variable[type[String], authUserName]
local_variable[type[String], authRealm]
local_variable[type[String], appName]
if[binary_operation[binary_operation[member[.authRealm], !=, literal[null]], &&, binary_operation[member[.authUserName], !=, literal[null]]]] begin[{]
call[Tr.audit, parameter[member[.tc], literal["SEC_JACC_AUTHZ_FAILED"], call[authUserName.concat, parameter[literal[":"]]], member[.appName], member[.uriName]]]
else begin[{]
assign[member[.authUserName], call[authResult.getSubject, parameter[]]]
call[Tr.audit, parameter[member[.tc], literal["SEC_JACC_AUTHZ_FAILED"], member[.authUserName], member[.appName], member[.uriName]]]
end[}]
else begin[{]
None
end[}]
return[member[.isAuthorized]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[authorize] operator[SEP] identifier[AuthenticationResult] identifier[authResult] , identifier[WebRequest] identifier[webRequest] , identifier[String] identifier[uriName] operator[SEP] {
identifier[HttpServletRequest] identifier[req] operator[=] identifier[webRequest] operator[SEP] identifier[getHttpServletRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isAuthorized] operator[=] identifier[jaccServiceRef] operator[SEP] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[isAuthorized] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] , identifier[getModuleName] operator[SEP] operator[SEP] , identifier[uriName] , identifier[req] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] , identifier[req] , identifier[authResult] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[WebReply] identifier[reply] operator[=] identifier[isAuthorized] operator[?] Keyword[new] identifier[PermitReply] operator[SEP] operator[SEP] operator[:] identifier[DENY_AUTHZ_FAILED] operator[SEP] Keyword[if] operator[SEP] identifier[isAuthorized] operator[SEP] {
identifier[AuditAuthenticationResult] identifier[auditAuthResult] operator[=] Keyword[new] identifier[AuditAuthenticationResult] operator[SEP] identifier[AuditAuthResult] operator[SEP] identifier[SUCCESS] , identifier[authResult] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] , identifier[AuditEvent] operator[SEP] identifier[CRED_TYPE_BASIC] , Other[null] , identifier[AuditEvent] operator[SEP] identifier[OUTCOME_SUCCESS] operator[SEP] operator[SEP] identifier[Audit] operator[SEP] identifier[audit] operator[SEP] identifier[Audit] operator[SEP] identifier[EventID] operator[SEP] identifier[SECURITY_AUTHZ_02] , identifier[webRequest] , identifier[authResult] , identifier[uriName] , identifier[AuditConstants] operator[SEP] identifier[WEB_CONTAINER] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[reply] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[AuditAuthenticationResult] identifier[auditAuthResult] operator[=] Keyword[new] identifier[AuditAuthenticationResult] operator[SEP] identifier[AuditAuthResult] operator[SEP] identifier[FAILURE] , identifier[authResult] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] , identifier[AuditEvent] operator[SEP] identifier[CRED_TYPE_BASIC] , Other[null] , identifier[AuditEvent] operator[SEP] identifier[OUTCOME_FAILURE] operator[SEP] operator[SEP] identifier[Audit] operator[SEP] identifier[audit] operator[SEP] identifier[Audit] operator[SEP] identifier[EventID] operator[SEP] identifier[SECURITY_AUTHZ_02] , identifier[webRequest] , identifier[authResult] , identifier[uriName] , identifier[AuditConstants] operator[SEP] identifier[WEB_CONTAINER] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[reply] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[isAuthorized] operator[SEP] {
identifier[String] identifier[authUserName] operator[=] identifier[authResult] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[authRealm] operator[=] identifier[authResult] operator[SEP] identifier[getRealm] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[appName] operator[=] identifier[webRequest] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[authRealm] operator[!=] Other[null] operator[&&] identifier[authUserName] operator[!=] Other[null] operator[SEP] {
identifier[Tr] operator[SEP] identifier[audit] operator[SEP] identifier[tc] , literal[String] , identifier[authUserName] operator[SEP] identifier[concat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[concat] operator[SEP] identifier[authRealm] operator[SEP] , identifier[appName] , identifier[uriName] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[authUserName] operator[=] identifier[authResult] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] operator[SEP] identifier[getPrincipals] operator[SEP] identifier[WSPrincipal] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[audit] operator[SEP] identifier[tc] , literal[String] , identifier[authUserName] , identifier[appName] , identifier[uriName] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[isAuthorized] operator[SEP]
}
|
public static PolygonSymbolizerInfo createPolygonSymbolizer(FillInfo fillInfo, StrokeInfo strokeInfo) {
PolygonSymbolizerInfo symbolizerInfo = new PolygonSymbolizerInfo();
symbolizerInfo.setFill(fillInfo);
symbolizerInfo.setStroke(strokeInfo);
return symbolizerInfo;
}
|
class class_name[name] begin[{]
method[createPolygonSymbolizer, return_type[type[PolygonSymbolizerInfo]], modifier[public static], parameter[fillInfo, strokeInfo]] begin[{]
local_variable[type[PolygonSymbolizerInfo], symbolizerInfo]
call[symbolizerInfo.setFill, parameter[member[.fillInfo]]]
call[symbolizerInfo.setStroke, parameter[member[.strokeInfo]]]
return[member[.symbolizerInfo]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[PolygonSymbolizerInfo] identifier[createPolygonSymbolizer] operator[SEP] identifier[FillInfo] identifier[fillInfo] , identifier[StrokeInfo] identifier[strokeInfo] operator[SEP] {
identifier[PolygonSymbolizerInfo] identifier[symbolizerInfo] operator[=] Keyword[new] identifier[PolygonSymbolizerInfo] operator[SEP] operator[SEP] operator[SEP] identifier[symbolizerInfo] operator[SEP] identifier[setFill] operator[SEP] identifier[fillInfo] operator[SEP] operator[SEP] identifier[symbolizerInfo] operator[SEP] identifier[setStroke] operator[SEP] identifier[strokeInfo] operator[SEP] operator[SEP] Keyword[return] identifier[symbolizerInfo] operator[SEP]
}
|
public void marshall(AutoScalingTargetTrackingScalingPolicyConfigurationUpdate autoScalingTargetTrackingScalingPolicyConfigurationUpdate,
ProtocolMarshaller protocolMarshaller) {
if (autoScalingTargetTrackingScalingPolicyConfigurationUpdate == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(autoScalingTargetTrackingScalingPolicyConfigurationUpdate.getDisableScaleIn(), DISABLESCALEIN_BINDING);
protocolMarshaller.marshall(autoScalingTargetTrackingScalingPolicyConfigurationUpdate.getScaleInCooldown(), SCALEINCOOLDOWN_BINDING);
protocolMarshaller.marshall(autoScalingTargetTrackingScalingPolicyConfigurationUpdate.getScaleOutCooldown(), SCALEOUTCOOLDOWN_BINDING);
protocolMarshaller.marshall(autoScalingTargetTrackingScalingPolicyConfigurationUpdate.getTargetValue(), TARGETVALUE_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[autoScalingTargetTrackingScalingPolicyConfigurationUpdate, protocolMarshaller]] begin[{]
if[binary_operation[member[.autoScalingTargetTrackingScalingPolicyConfigurationUpdate], ==, 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=getDisableScaleIn, postfix_operators=[], prefix_operators=[], qualifier=autoScalingTargetTrackingScalingPolicyConfigurationUpdate, selectors=[], type_arguments=None), MemberReference(member=DISABLESCALEIN_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=getScaleInCooldown, postfix_operators=[], prefix_operators=[], qualifier=autoScalingTargetTrackingScalingPolicyConfigurationUpdate, selectors=[], type_arguments=None), MemberReference(member=SCALEINCOOLDOWN_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=getScaleOutCooldown, postfix_operators=[], prefix_operators=[], qualifier=autoScalingTargetTrackingScalingPolicyConfigurationUpdate, selectors=[], type_arguments=None), MemberReference(member=SCALEOUTCOOLDOWN_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=getTargetValue, postfix_operators=[], prefix_operators=[], qualifier=autoScalingTargetTrackingScalingPolicyConfigurationUpdate, selectors=[], type_arguments=None), MemberReference(member=TARGETVALUE_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[AutoScalingTargetTrackingScalingPolicyConfigurationUpdate] identifier[autoScalingTargetTrackingScalingPolicyConfigurationUpdate] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[autoScalingTargetTrackingScalingPolicyConfigurationUpdate] 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[autoScalingTargetTrackingScalingPolicyConfigurationUpdate] operator[SEP] identifier[getDisableScaleIn] operator[SEP] operator[SEP] , identifier[DISABLESCALEIN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingTargetTrackingScalingPolicyConfigurationUpdate] operator[SEP] identifier[getScaleInCooldown] operator[SEP] operator[SEP] , identifier[SCALEINCOOLDOWN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingTargetTrackingScalingPolicyConfigurationUpdate] operator[SEP] identifier[getScaleOutCooldown] operator[SEP] operator[SEP] , identifier[SCALEOUTCOOLDOWN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingTargetTrackingScalingPolicyConfigurationUpdate] operator[SEP] identifier[getTargetValue] operator[SEP] operator[SEP] , identifier[TARGETVALUE_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 SequenceGenerator<Id<T>> getOrCreateSequenceGenerator()
{
Node node = childNode.getOrCreate("sequence-generator");
SequenceGenerator<Id<T>> sequenceGenerator = new SequenceGeneratorImpl<Id<T>>(this, "sequence-generator", childNode, node);
return sequenceGenerator;
}
|
class class_name[name] begin[{]
method[getOrCreateSequenceGenerator, return_type[type[SequenceGenerator]], modifier[public], parameter[]] begin[{]
local_variable[type[Node], node]
local_variable[type[SequenceGenerator], sequenceGenerator]
return[member[.sequenceGenerator]]
end[}]
END[}]
|
Keyword[public] identifier[SequenceGenerator] operator[<] identifier[Id] operator[<] identifier[T] operator[>] operator[>] identifier[getOrCreateSequenceGenerator] operator[SEP] operator[SEP] {
identifier[Node] identifier[node] operator[=] identifier[childNode] operator[SEP] identifier[getOrCreate] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[SequenceGenerator] operator[<] identifier[Id] operator[<] identifier[T] operator[>] operator[>] identifier[sequenceGenerator] operator[=] Keyword[new] identifier[SequenceGeneratorImpl] operator[<] identifier[Id] operator[<] identifier[T] operator[>] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[childNode] , identifier[node] operator[SEP] operator[SEP] Keyword[return] identifier[sequenceGenerator] operator[SEP]
}
|
@Override
public void init() {
if (!getProcessContext().inheritsIO()) {
newThread(String.format("Process [%d] Standard Out Reader", safeGetId()),
newProcessStreamReader(getProcess().getInputStream())).start();
if (!getProcessContext().isRedirectingErrorStream()) {
newThread(String.format("Process [%d] Standard Error Reader", safeGetId()),
newProcessStreamReader(getProcess().getErrorStream())).start();
}
}
initialized.set(true);
}
|
class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[]] begin[{]
if[call[.getProcessContext, parameter[]]] begin[{]
call[.newThread, parameter[call[String.format, parameter[literal["Process [%d] Standard Out Reader"], call[.safeGetId, parameter[]]]], call[.newProcessStreamReader, parameter[call[.getProcess, parameter[]]]]]]
if[call[.getProcessContext, parameter[]]] begin[{]
call[.newThread, parameter[call[String.format, parameter[literal["Process [%d] Standard Error Reader"], call[.safeGetId, parameter[]]]], call[.newProcessStreamReader, parameter[call[.getProcess, parameter[]]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[initialized.set, parameter[literal[true]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[getProcessContext] operator[SEP] operator[SEP] operator[SEP] identifier[inheritsIO] operator[SEP] operator[SEP] operator[SEP] {
identifier[newThread] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[safeGetId] operator[SEP] operator[SEP] operator[SEP] , identifier[newProcessStreamReader] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[getProcessContext] operator[SEP] operator[SEP] operator[SEP] identifier[isRedirectingErrorStream] operator[SEP] operator[SEP] operator[SEP] {
identifier[newThread] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[safeGetId] operator[SEP] operator[SEP] operator[SEP] , identifier[newProcessStreamReader] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP] identifier[getErrorStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[initialized] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
|
private Set<String> extract(int comp, String segment, int segmentPos, StringBuffer buf) {
if (PROGRESS) System.out.println(" extract: " + Utility.hex(UTF16.valueOf(comp))
+ ", " + Utility.hex(segment.substring(segmentPos)));
String decomp = nfcImpl.getDecomposition(comp);
if (decomp == null) {
decomp = UTF16.valueOf(comp);
}
// See if it matches the start of segment (at segmentPos)
boolean ok = false;
int cp;
int decompPos = 0;
int decompCp = UTF16.charAt(decomp,0);
decompPos += UTF16.getCharCount(decompCp); // adjust position to skip first char
//int decompClass = getClass(decompCp);
buf.setLength(0); // initialize working buffer, shared among callees
for (int i = segmentPos; i < segment.length(); i += UTF16.getCharCount(cp)) {
cp = UTF16.charAt(segment, i);
if (cp == decompCp) { // if equal, eat another cp from decomp
if (PROGRESS) System.out.println(" matches: " + Utility.hex(UTF16.valueOf(cp)));
if (decompPos == decomp.length()) { // done, have all decomp characters!
buf.append(segment.substring(i + UTF16.getCharCount(cp))); // add remaining segment chars
ok = true;
break;
}
decompCp = UTF16.charAt(decomp, decompPos);
decompPos += UTF16.getCharCount(decompCp);
//decompClass = getClass(decompCp);
} else {
if (PROGRESS) System.out.println(" buffer: " + Utility.hex(UTF16.valueOf(cp)));
// brute force approach
UTF16.append(buf, cp);
/* TODO: optimize
// since we know that the classes are monotonically increasing, after zero
// e.g. 0 5 7 9 0 3
// we can do an optimization
// there are only a few cases that work: zero, less, same, greater
// if both classes are the same, we fail
// if the decomp class < the segment class, we fail
segClass = getClass(cp);
if (decompClass <= segClass) return null;
*/
}
}
if (!ok) return null; // we failed, characters left over
if (PROGRESS) System.out.println("Matches");
if (buf.length() == 0) return SET_WITH_NULL_STRING; // succeed, but no remainder
String remainder = buf.toString();
// brute force approach
// to check to make sure result is canonically equivalent
/*
String trial = Normalizer.normalize(UTF16.valueOf(comp) + remainder, Normalizer.DECOMP, 0);
if (!segment.regionMatches(segmentPos, trial, 0, segment.length() - segmentPos)) return null;
*/
if (0!=Normalizer.compare(UTF16.valueOf(comp) + remainder, segment.substring(segmentPos), 0)) return null;
// get the remaining combinations
return getEquivalents2(remainder);
}
|
class class_name[name] begin[{]
method[extract, return_type[type[Set]], modifier[private], parameter[comp, segment, segmentPos, buf]] begin[{]
if[member[.PROGRESS]] begin[{]
call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal[" extract: "], +, call[Utility.hex, parameter[call[UTF16.valueOf, parameter[member[.comp]]]]]], +, literal[", "]], +, call[Utility.hex, parameter[call[segment.substring, parameter[member[.segmentPos]]]]]]]]
else begin[{]
None
end[}]
local_variable[type[String], decomp]
if[binary_operation[member[.decomp], ==, literal[null]]] begin[{]
assign[member[.decomp], call[UTF16.valueOf, parameter[member[.comp]]]]
else begin[{]
None
end[}]
local_variable[type[boolean], ok]
local_variable[type[int], cp]
local_variable[type[int], decompPos]
local_variable[type[int], decompCp]
assign[member[.decompPos], call[UTF16.getCharCount, parameter[member[.decompCp]]]]
call[buf.setLength, parameter[literal[0]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=decompCp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=PROGRESS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" buffer: "), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None)], member=hex, postfix_operators=[], prefix_operators=[], qualifier=Utility, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=PROGRESS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" matches: "), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None)], member=hex, postfix_operators=[], prefix_operators=[], qualifier=Utility, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=decompPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=decomp, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCharCount, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=segment, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=decompCp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=decomp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=decompPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=decompPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=decompCp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCharCount, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=segment, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=segmentPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCharCount, postfix_operators=[], prefix_operators=[], qualifier=UTF16, selectors=[], type_arguments=None))]), label=None)
if[member[.ok]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[member[.PROGRESS]] begin[{]
call[System.out.println, parameter[literal["Matches"]]]
else begin[{]
None
end[}]
if[binary_operation[call[buf.length, parameter[]], ==, literal[0]]] begin[{]
return[member[.SET_WITH_NULL_STRING]]
else begin[{]
None
end[}]
local_variable[type[String], remainder]
if[binary_operation[literal[0], !=, call[Normalizer.compare, parameter[binary_operation[call[UTF16.valueOf, parameter[member[.comp]]], +, member[.remainder]], call[segment.substring, parameter[member[.segmentPos]]], literal[0]]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[.getEquivalents2, parameter[member[.remainder]]]]
end[}]
END[}]
|
Keyword[private] identifier[Set] operator[<] identifier[String] operator[>] identifier[extract] operator[SEP] Keyword[int] identifier[comp] , identifier[String] identifier[segment] , Keyword[int] identifier[segmentPos] , identifier[StringBuffer] identifier[buf] operator[SEP] {
Keyword[if] operator[SEP] identifier[PROGRESS] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[Utility] operator[SEP] identifier[hex] operator[SEP] identifier[UTF16] operator[SEP] identifier[valueOf] operator[SEP] identifier[comp] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[Utility] operator[SEP] identifier[hex] operator[SEP] identifier[segment] operator[SEP] identifier[substring] operator[SEP] identifier[segmentPos] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[decomp] operator[=] identifier[nfcImpl] operator[SEP] identifier[getDecomposition] operator[SEP] identifier[comp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[decomp] operator[==] Other[null] operator[SEP] {
identifier[decomp] operator[=] identifier[UTF16] operator[SEP] identifier[valueOf] operator[SEP] identifier[comp] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[ok] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[cp] operator[SEP] Keyword[int] identifier[decompPos] operator[=] Other[0] operator[SEP] Keyword[int] identifier[decompCp] operator[=] identifier[UTF16] operator[SEP] identifier[charAt] operator[SEP] identifier[decomp] , Other[0] operator[SEP] operator[SEP] identifier[decompPos] operator[+=] identifier[UTF16] operator[SEP] identifier[getCharCount] operator[SEP] identifier[decompCp] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[segmentPos] operator[SEP] identifier[i] operator[<] identifier[segment] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[+=] identifier[UTF16] operator[SEP] identifier[getCharCount] operator[SEP] identifier[cp] operator[SEP] operator[SEP] {
identifier[cp] operator[=] identifier[UTF16] operator[SEP] identifier[charAt] operator[SEP] identifier[segment] , identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cp] operator[==] identifier[decompCp] operator[SEP] {
Keyword[if] operator[SEP] identifier[PROGRESS] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[Utility] operator[SEP] identifier[hex] operator[SEP] identifier[UTF16] operator[SEP] identifier[valueOf] operator[SEP] identifier[cp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[decompPos] operator[==] identifier[decomp] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[segment] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[+] identifier[UTF16] operator[SEP] identifier[getCharCount] operator[SEP] identifier[cp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ok] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
identifier[decompCp] operator[=] identifier[UTF16] operator[SEP] identifier[charAt] operator[SEP] identifier[decomp] , identifier[decompPos] operator[SEP] operator[SEP] identifier[decompPos] operator[+=] identifier[UTF16] operator[SEP] identifier[getCharCount] operator[SEP] identifier[decompCp] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[PROGRESS] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[Utility] operator[SEP] identifier[hex] operator[SEP] identifier[UTF16] operator[SEP] identifier[valueOf] operator[SEP] identifier[cp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[UTF16] operator[SEP] identifier[append] operator[SEP] identifier[buf] , identifier[cp] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[ok] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[PROGRESS] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buf] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] identifier[SET_WITH_NULL_STRING] operator[SEP] identifier[String] identifier[remainder] operator[=] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[0] operator[!=] identifier[Normalizer] operator[SEP] identifier[compare] operator[SEP] identifier[UTF16] operator[SEP] identifier[valueOf] operator[SEP] identifier[comp] operator[SEP] operator[+] identifier[remainder] , identifier[segment] operator[SEP] identifier[substring] operator[SEP] identifier[segmentPos] operator[SEP] , Other[0] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[getEquivalents2] operator[SEP] identifier[remainder] operator[SEP] operator[SEP]
}
|
public Document readDocumentFromFile(String filename) {
ProvFormat format = getTypeForFile(filename);
if (format == null) {
throw new InteropException("Unknown output file format: "
+ filename);
}
return readDocumentFromFile(filename, format);
}
|
class class_name[name] begin[{]
method[readDocumentFromFile, return_type[type[Document]], modifier[public], parameter[filename]] begin[{]
local_variable[type[ProvFormat], format]
if[binary_operation[member[.format], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown output file format: "), operandr=MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InteropException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[.readDocumentFromFile, parameter[member[.filename], member[.format]]]]
end[}]
END[}]
|
Keyword[public] identifier[Document] identifier[readDocumentFromFile] operator[SEP] identifier[String] identifier[filename] operator[SEP] {
identifier[ProvFormat] identifier[format] operator[=] identifier[getTypeForFile] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[format] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InteropException] operator[SEP] literal[String] operator[+] identifier[filename] operator[SEP] operator[SEP]
}
Keyword[return] identifier[readDocumentFromFile] operator[SEP] identifier[filename] , identifier[format] operator[SEP] operator[SEP]
}
|
public void marshall(ActivityFailedEventDetails activityFailedEventDetails, ProtocolMarshaller protocolMarshaller) {
if (activityFailedEventDetails == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(activityFailedEventDetails.getError(), ERROR_BINDING);
protocolMarshaller.marshall(activityFailedEventDetails.getCause(), CAUSE_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[activityFailedEventDetails, protocolMarshaller]] begin[{]
if[binary_operation[member[.activityFailedEventDetails], ==, 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=getError, postfix_operators=[], prefix_operators=[], qualifier=activityFailedEventDetails, selectors=[], type_arguments=None), MemberReference(member=ERROR_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=getCause, postfix_operators=[], prefix_operators=[], qualifier=activityFailedEventDetails, selectors=[], type_arguments=None), MemberReference(member=CAUSE_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[ActivityFailedEventDetails] identifier[activityFailedEventDetails] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[activityFailedEventDetails] 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[activityFailedEventDetails] operator[SEP] identifier[getError] operator[SEP] operator[SEP] , identifier[ERROR_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[activityFailedEventDetails] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] , identifier[CAUSE_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 static audit_log[] get(nitro_service client) throws Exception
{
audit_log resource = new audit_log();
resource.validate("get");
return (audit_log[]) resource.get_resources(client);
}
|
class class_name[name] begin[{]
method[get, return_type[type[audit_log]], modifier[public static], parameter[client]] begin[{]
local_variable[type[audit_log], resource]
call[resource.validate, parameter[literal["get"]]]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_resources, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=audit_log, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[audit_log] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[audit_log] identifier[resource] operator[=] Keyword[new] identifier[audit_log] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[audit_log] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[get_resources] operator[SEP] identifier[client] operator[SEP] operator[SEP]
}
|
@Override
protected void horizontal() {
float[] dataX = derivX.data;
float[] dataY = derivY.data;
float[] hXX = horizXX.data;
float[] hXY = horizXY.data;
float[] hYY = horizYY.data;
final int imgHeight = derivX.getHeight();
final int imgWidth = derivX.getWidth();
int windowWidth = radius * 2 + 1;
int radp1 = radius + 1;
BoofConcurrency.loopFor(0,imgHeight,row->{
int pix = row * imgWidth;
int end = pix + windowWidth;
float totalXX = 0;
float totalXY = 0;
float totalYY = 0;
int indexX = derivX.startIndex + row * derivX.stride;
int indexY = derivY.startIndex + row * derivY.stride;
for (; pix < end; pix++) {
float dx = dataX[indexX++];
float dy = dataY[indexY++];
totalXX += dx * dx;
totalXY += dx * dy;
totalYY += dy * dy;
}
hXX[pix - radp1] = totalXX;
hXY[pix - radp1] = totalXY;
hYY[pix - radp1] = totalYY;
end = row * imgWidth + imgWidth;
for (; pix < end; pix++, indexX++, indexY++) {
float dx = dataX[indexX - windowWidth];
float dy = dataY[indexY - windowWidth];
// saving these multiplications in an array to avoid recalculating them made
// the algorithm about 50% slower
totalXX -= dx * dx;
totalXY -= dx * dy;
totalYY -= dy * dy;
dx = dataX[indexX];
dy = dataY[indexY];
totalXX += dx * dx;
totalXY += dx * dy;
totalYY += dy * dy;
hXX[pix - radius] = totalXX;
hXY[pix - radius] = totalXY;
hYY[pix - radius] = totalYY;
}
});
}
|
class class_name[name] begin[{]
method[horizontal, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[float], dataX]
local_variable[type[float], dataY]
local_variable[type[float], hXX]
local_variable[type[float], hXY]
local_variable[type[float], hYY]
local_variable[type[int], imgHeight]
local_variable[type[int], imgWidth]
local_variable[type[int], windowWidth]
local_variable[type[int], radp1]
call[BoofConcurrency.loopFor, parameter[literal[0], member[.imgHeight], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=imgWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), name=pix)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=windowWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=totalXX)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=totalXY)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=totalYY)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=derivX, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=derivX, selectors=[]), operator=*), operator=+), name=indexX)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=derivY, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=derivY, selectors=[]), operator=*), operator=+), name=indexY)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dataX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexX, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), name=dx)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dataY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexY, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), name=dy)], modifiers=set(), type=BasicType(dimensions=[], name=float)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalXX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalYY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[MemberReference(member=pix, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hXX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=radp1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MemberReference(member=totalXX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=radp1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MemberReference(member=totalXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hYY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=radp1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MemberReference(member=totalYY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=imgWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=imgWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dataX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=indexX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=windowWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), name=dx)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dataY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=indexY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=windowWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), name=dy)], modifiers=set(), type=BasicType(dimensions=[], name=float)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalXX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=BinaryOperation(operandl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=BinaryOperation(operandl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalYY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=BinaryOperation(operandl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=dataX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=dataY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalXX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalYY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hXX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=radius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MemberReference(member=totalXX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=radius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MemberReference(member=totalXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hYY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=radius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MemberReference(member=totalYY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=pix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[MemberReference(member=pix, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexX, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexY, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], parameters=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[horizontal] operator[SEP] operator[SEP] {
Keyword[float] operator[SEP] operator[SEP] identifier[dataX] operator[=] identifier[derivX] operator[SEP] identifier[data] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[dataY] operator[=] identifier[derivY] operator[SEP] identifier[data] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[hXX] operator[=] identifier[horizXX] operator[SEP] identifier[data] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[hXY] operator[=] identifier[horizXY] operator[SEP] identifier[data] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[hYY] operator[=] identifier[horizYY] operator[SEP] identifier[data] operator[SEP] Keyword[final] Keyword[int] identifier[imgHeight] operator[=] identifier[derivX] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[imgWidth] operator[=] identifier[derivX] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[windowWidth] operator[=] identifier[radius] operator[*] Other[2] operator[+] Other[1] operator[SEP] Keyword[int] identifier[radp1] operator[=] identifier[radius] operator[+] Other[1] operator[SEP] identifier[BoofConcurrency] operator[SEP] identifier[loopFor] operator[SEP] Other[0] , identifier[imgHeight] , identifier[row] operator[->] {
Keyword[int] identifier[pix] operator[=] identifier[row] operator[*] identifier[imgWidth] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[pix] operator[+] identifier[windowWidth] operator[SEP] Keyword[float] identifier[totalXX] operator[=] Other[0] operator[SEP] Keyword[float] identifier[totalXY] operator[=] Other[0] operator[SEP] Keyword[float] identifier[totalYY] operator[=] Other[0] operator[SEP] Keyword[int] identifier[indexX] operator[=] identifier[derivX] operator[SEP] identifier[startIndex] operator[+] identifier[row] operator[*] identifier[derivX] operator[SEP] identifier[stride] operator[SEP] Keyword[int] identifier[indexY] operator[=] identifier[derivY] operator[SEP] identifier[startIndex] operator[+] identifier[row] operator[*] identifier[derivY] operator[SEP] identifier[stride] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[pix] operator[<] identifier[end] operator[SEP] identifier[pix] operator[++] operator[SEP] {
Keyword[float] identifier[dx] operator[=] identifier[dataX] operator[SEP] identifier[indexX] operator[++] operator[SEP] operator[SEP] Keyword[float] identifier[dy] operator[=] identifier[dataY] operator[SEP] identifier[indexY] operator[++] operator[SEP] operator[SEP] identifier[totalXX] operator[+=] identifier[dx] operator[*] identifier[dx] operator[SEP] identifier[totalXY] operator[+=] identifier[dx] operator[*] identifier[dy] operator[SEP] identifier[totalYY] operator[+=] identifier[dy] operator[*] identifier[dy] operator[SEP]
}
identifier[hXX] operator[SEP] identifier[pix] operator[-] identifier[radp1] operator[SEP] operator[=] identifier[totalXX] operator[SEP] identifier[hXY] operator[SEP] identifier[pix] operator[-] identifier[radp1] operator[SEP] operator[=] identifier[totalXY] operator[SEP] identifier[hYY] operator[SEP] identifier[pix] operator[-] identifier[radp1] operator[SEP] operator[=] identifier[totalYY] operator[SEP] identifier[end] operator[=] identifier[row] operator[*] identifier[imgWidth] operator[+] identifier[imgWidth] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[pix] operator[<] identifier[end] operator[SEP] identifier[pix] operator[++] , identifier[indexX] operator[++] , identifier[indexY] operator[++] operator[SEP] {
Keyword[float] identifier[dx] operator[=] identifier[dataX] operator[SEP] identifier[indexX] operator[-] identifier[windowWidth] operator[SEP] operator[SEP] Keyword[float] identifier[dy] operator[=] identifier[dataY] operator[SEP] identifier[indexY] operator[-] identifier[windowWidth] operator[SEP] operator[SEP] identifier[totalXX] operator[-=] identifier[dx] operator[*] identifier[dx] operator[SEP] identifier[totalXY] operator[-=] identifier[dx] operator[*] identifier[dy] operator[SEP] identifier[totalYY] operator[-=] identifier[dy] operator[*] identifier[dy] operator[SEP] identifier[dx] operator[=] identifier[dataX] operator[SEP] identifier[indexX] operator[SEP] operator[SEP] identifier[dy] operator[=] identifier[dataY] operator[SEP] identifier[indexY] operator[SEP] operator[SEP] identifier[totalXX] operator[+=] identifier[dx] operator[*] identifier[dx] operator[SEP] identifier[totalXY] operator[+=] identifier[dx] operator[*] identifier[dy] operator[SEP] identifier[totalYY] operator[+=] identifier[dy] operator[*] identifier[dy] operator[SEP] identifier[hXX] operator[SEP] identifier[pix] operator[-] identifier[radius] operator[SEP] operator[=] identifier[totalXX] operator[SEP] identifier[hXY] operator[SEP] identifier[pix] operator[-] identifier[radius] operator[SEP] operator[=] identifier[totalXY] operator[SEP] identifier[hYY] operator[SEP] identifier[pix] operator[-] identifier[radius] operator[SEP] operator[=] identifier[totalYY] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static IndexedContainer getPrincipalContainer(
CmsObject cms,
List<? extends I_CmsPrincipal> list,
String captionID,
String descID,
String iconID,
String ouID,
String icon,
List<FontIcon> iconList) {
IndexedContainer res = new IndexedContainer();
res.addContainerProperty(captionID, String.class, "");
res.addContainerProperty(ouID, String.class, "");
res.addContainerProperty(iconID, FontIcon.class, new CmsCssIcon(icon));
if (descID != null) {
res.addContainerProperty(descID, String.class, "");
}
for (I_CmsPrincipal group : list) {
Item item = res.addItem(group);
item.getItemProperty(captionID).setValue(group.getSimpleName());
item.getItemProperty(ouID).setValue(group.getOuFqn());
if (descID != null) {
item.getItemProperty(descID).setValue(group.getDescription(A_CmsUI.get().getLocale()));
}
}
for (int i = 0; i < iconList.size(); i++) {
res.getItem(res.getIdByIndex(i)).getItemProperty(iconID).setValue(iconList.get(i));
}
return res;
}
|
class class_name[name] begin[{]
method[getPrincipalContainer, return_type[type[IndexedContainer]], modifier[public static], parameter[cms, list, captionID, descID, iconID, ouID, icon, iconList]] begin[{]
local_variable[type[IndexedContainer], res]
call[res.addContainerProperty, parameter[member[.captionID], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), literal[""]]]
call[res.addContainerProperty, parameter[member[.ouID], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), literal[""]]]
call[res.addContainerProperty, parameter[member[.iconID], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FontIcon, sub_type=None)), ClassCreator(arguments=[MemberReference(member=icon, 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=CmsCssIcon, sub_type=None))]]
if[binary_operation[member[.descID], !=, literal[null]]] begin[{]
call[res.addContainerProperty, parameter[member[.descID], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), literal[""]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addItem, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Item, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=captionID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getItemProperty, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[], type_arguments=None)], member=setValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ouID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getItemProperty, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOuFqn, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[], type_arguments=None)], member=setValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=descID, 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=descID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getItemProperty, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUI, selectors=[MethodInvocation(arguments=[], member=getLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[], type_arguments=None)], member=setValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=group)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsPrincipal, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIdByIndex, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None)], member=getItem, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[MethodInvocation(arguments=[MemberReference(member=iconID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getItemProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=iconList, selectors=[], type_arguments=None)], member=setValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=iconList, 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)
return[member[.res]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[IndexedContainer] identifier[getPrincipalContainer] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[List] operator[<] operator[?] Keyword[extends] identifier[I_CmsPrincipal] operator[>] identifier[list] , identifier[String] identifier[captionID] , identifier[String] identifier[descID] , identifier[String] identifier[iconID] , identifier[String] identifier[ouID] , identifier[String] identifier[icon] , identifier[List] operator[<] identifier[FontIcon] operator[>] identifier[iconList] operator[SEP] {
identifier[IndexedContainer] identifier[res] operator[=] Keyword[new] identifier[IndexedContainer] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addContainerProperty] operator[SEP] identifier[captionID] , identifier[String] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addContainerProperty] operator[SEP] identifier[ouID] , identifier[String] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addContainerProperty] operator[SEP] identifier[iconID] , identifier[FontIcon] operator[SEP] Keyword[class] , Keyword[new] identifier[CmsCssIcon] operator[SEP] identifier[icon] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[descID] operator[!=] Other[null] operator[SEP] {
identifier[res] operator[SEP] identifier[addContainerProperty] operator[SEP] identifier[descID] , identifier[String] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[I_CmsPrincipal] identifier[group] operator[:] identifier[list] operator[SEP] {
identifier[Item] identifier[item] operator[=] identifier[res] operator[SEP] identifier[addItem] operator[SEP] identifier[group] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[getItemProperty] operator[SEP] identifier[captionID] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[group] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[getItemProperty] operator[SEP] identifier[ouID] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[group] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[descID] operator[!=] Other[null] operator[SEP] {
identifier[item] operator[SEP] identifier[getItemProperty] operator[SEP] identifier[descID] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[group] operator[SEP] identifier[getDescription] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[iconList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[res] operator[SEP] identifier[getItem] operator[SEP] identifier[res] operator[SEP] identifier[getIdByIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[getItemProperty] operator[SEP] identifier[iconID] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[iconList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[res] operator[SEP]
}
|
public static List primitiveArrayToList(Object array) {
int size = Array.getLength(array);
List list = new ArrayList(size);
for (int i = 0; i < size; i++) {
Object item = Array.get(array, i);
if (item != null && item.getClass().isArray() && item.getClass().getComponentType().isPrimitive()) {
item = primitiveArrayToList(item);
}
list.add(item);
}
return list;
}
|
class class_name[name] begin[{]
method[primitiveArrayToList, return_type[type[List]], modifier[public static], parameter[array]] begin[{]
local_variable[type[int], size]
local_variable[type[List], list]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=Array, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[], member=isArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[], member=getComponentType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=isPrimitive, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=primitiveArrayToList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.list]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[List] identifier[primitiveArrayToList] operator[SEP] identifier[Object] identifier[array] operator[SEP] {
Keyword[int] identifier[size] operator[=] identifier[Array] operator[SEP] identifier[getLength] operator[SEP] identifier[array] operator[SEP] operator[SEP] identifier[List] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Object] identifier[item] operator[=] identifier[Array] operator[SEP] identifier[get] operator[SEP] identifier[array] , identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[!=] Other[null] operator[&&] identifier[item] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[&&] identifier[item] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] {
identifier[item] operator[=] identifier[primitiveArrayToList] operator[SEP] identifier[item] operator[SEP] operator[SEP]
}
identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[item] operator[SEP] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP]
}
|
public static void splitShortToBuffers(final ByteBuffer buffer, final ByteBuffer buffer1, final short iValue) {
buffer.put((byte) (MASK & (iValue >>> SIZE_OF_BYTE_IN_BITS)));
buffer1.put((byte) (MASK & iValue));
}
|
class class_name[name] begin[{]
method[splitShortToBuffers, return_type[void], modifier[public static], parameter[buffer, buffer1, iValue]] begin[{]
call[buffer.put, parameter[Cast(expression=BinaryOperation(operandl=MemberReference(member=MASK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=iValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SIZE_OF_BYTE_IN_BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>>>), operator=&), type=BasicType(dimensions=[], name=byte))]]
call[buffer1.put, parameter[Cast(expression=BinaryOperation(operandl=MemberReference(member=MASK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=iValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), type=BasicType(dimensions=[], name=byte))]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[splitShortToBuffers] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[buffer] , Keyword[final] identifier[ByteBuffer] identifier[buffer1] , Keyword[final] Keyword[short] identifier[iValue] operator[SEP] {
identifier[buffer] operator[SEP] identifier[put] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[MASK] operator[&] operator[SEP] identifier[iValue] operator[>] operator[>] operator[>] identifier[SIZE_OF_BYTE_IN_BITS] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffer1] operator[SEP] identifier[put] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[MASK] operator[&] identifier[iValue] operator[SEP] operator[SEP] operator[SEP]
}
|
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
StringSelection ss = new StringSelection(jTextArea5.getText());
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
}
|
class class_name[name] begin[{]
method[jButton5ActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{]
local_variable[type[StringSelection], ss]
call[Toolkit.getDefaultToolkit, parameter[]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[jButton5ActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] {
identifier[StringSelection] identifier[ss] operator[=] Keyword[new] identifier[StringSelection] operator[SEP] identifier[jTextArea5] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Toolkit] operator[SEP] identifier[getDefaultToolkit] operator[SEP] operator[SEP] operator[SEP] identifier[getSystemClipboard] operator[SEP] operator[SEP] operator[SEP] identifier[setContents] operator[SEP] identifier[ss] , Other[null] operator[SEP] operator[SEP]
}
|
public ServiceFuture<AdvisorInner> updateAsync(String resourceGroupName, String serverName, String advisorName, AutoExecuteStatus autoExecuteStatus, final ServiceCallback<AdvisorInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serverName, advisorName, autoExecuteStatus), serviceCallback);
}
|
class class_name[name] begin[{]
method[updateAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, advisorName, autoExecuteStatus, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.advisorName], member[.autoExecuteStatus]]], member[.serviceCallback]]]]
end[}]
END[}]
|
Keyword[public] identifier[ServiceFuture] operator[<] identifier[AdvisorInner] operator[>] identifier[updateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[advisorName] , identifier[AutoExecuteStatus] identifier[autoExecuteStatus] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[AdvisorInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[advisorName] , identifier[autoExecuteStatus] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
private boolean exposesNoInterfaceView(Class<?> beanClass) {
Class<?>[] interfaces = beanClass.getInterfaces();
if (interfaces.length == 0) {
return true;
}
// As per section 4.9.8 (bullet 1.3) of EJB3.1 spec
// java.io.Serializable; java.io.Externalizable; any of the interfaces defined by the javax.ejb
// are excluded from interface check
List<Class<?>> implementedInterfaces = new ArrayList<Class<?>>(Arrays.asList(interfaces));
List<Class<?>> filteredInterfaces = this.filterInterfaces(implementedInterfaces);
// Now that we have removed the interfaces that should be excluded from the check,
// if the filtered interfaces collection is empty then this bean can be considered for no-interface view
return filteredInterfaces.isEmpty();
}
|
class class_name[name] begin[{]
method[exposesNoInterfaceView, return_type[type[boolean]], modifier[private], parameter[beanClass]] begin[{]
local_variable[type[Class], interfaces]
if[binary_operation[member[interfaces.length], ==, literal[0]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[List], implementedInterfaces]
local_variable[type[List], filteredInterfaces]
return[call[filteredInterfaces.isEmpty, parameter[]]]
end[}]
END[}]
|
Keyword[private] Keyword[boolean] identifier[exposesNoInterfaceView] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[beanClass] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[interfaces] operator[=] identifier[beanClass] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interfaces] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[implementedInterfaces] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[interfaces] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[filteredInterfaces] operator[=] Keyword[this] operator[SEP] identifier[filterInterfaces] operator[SEP] identifier[implementedInterfaces] operator[SEP] operator[SEP] Keyword[return] identifier[filteredInterfaces] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP]
}
|
protected <T extends SAMLObject> void prepareSecurityParametersContext(final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
final MessageContext<T> outboundContext,
final SamlRegisteredService service) {
val secParametersContext = outboundContext.getSubcontext(SecurityParametersContext.class, true);
val roleDesc = adaptor.getSsoDescriptor();
val signingParameters = buildSignatureSigningParameters(roleDesc, service);
secParametersContext.setSignatureSigningParameters(signingParameters);
}
|
class class_name[name] begin[{]
method[prepareSecurityParametersContext, return_type[void], modifier[protected], parameter[adaptor, outboundContext, service]] begin[{]
local_variable[type[val], secParametersContext]
local_variable[type[val], roleDesc]
local_variable[type[val], signingParameters]
call[secParametersContext.setSignatureSigningParameters, parameter[member[.signingParameters]]]
end[}]
END[}]
|
Keyword[protected] operator[<] identifier[T] Keyword[extends] identifier[SAMLObject] operator[>] Keyword[void] identifier[prepareSecurityParametersContext] operator[SEP] Keyword[final] identifier[SamlRegisteredServiceServiceProviderMetadataFacade] identifier[adaptor] , Keyword[final] identifier[MessageContext] operator[<] identifier[T] operator[>] identifier[outboundContext] , Keyword[final] identifier[SamlRegisteredService] identifier[service] operator[SEP] {
identifier[val] identifier[secParametersContext] operator[=] identifier[outboundContext] operator[SEP] identifier[getSubcontext] operator[SEP] identifier[SecurityParametersContext] operator[SEP] Keyword[class] , literal[boolean] operator[SEP] operator[SEP] identifier[val] identifier[roleDesc] operator[=] identifier[adaptor] operator[SEP] identifier[getSsoDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[signingParameters] operator[=] identifier[buildSignatureSigningParameters] operator[SEP] identifier[roleDesc] , identifier[service] operator[SEP] operator[SEP] identifier[secParametersContext] operator[SEP] identifier[setSignatureSigningParameters] operator[SEP] identifier[signingParameters] operator[SEP] operator[SEP]
}
|
protected void setError(int newPosition, String error,
boolean currentExisting) {
if (!currentExisting) {
newBasicValueSumList[newPosition] = operations.getZero1();
newBasicValueNList[newPosition] = 0;
}
newErrorNumber[newPosition]++;
if (newErrorList[newPosition].containsKey(error)) {
newErrorList[newPosition].put(error,
newErrorList[newPosition].get(error) + 1);
} else {
newErrorList[newPosition].put(error, 1);
}
}
|
class class_name[name] begin[{]
method[setError, return_type[void], modifier[protected], parameter[newPosition, error, currentExisting]] begin[{]
if[member[.currentExisting]] begin[{]
assign[member[.newBasicValueSumList], call[operations.getZero1, parameter[]]]
assign[member[.newBasicValueNList], literal[0]]
else begin[{]
None
end[}]
member[.newErrorNumber]
if[member[.newErrorList]] begin[{]
member[.newErrorList]
else begin[{]
member[.newErrorList]
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[setError] operator[SEP] Keyword[int] identifier[newPosition] , identifier[String] identifier[error] , Keyword[boolean] identifier[currentExisting] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[currentExisting] operator[SEP] {
identifier[newBasicValueSumList] operator[SEP] identifier[newPosition] operator[SEP] operator[=] identifier[operations] operator[SEP] identifier[getZero1] operator[SEP] operator[SEP] operator[SEP] identifier[newBasicValueNList] operator[SEP] identifier[newPosition] operator[SEP] operator[=] Other[0] operator[SEP]
}
identifier[newErrorNumber] operator[SEP] identifier[newPosition] operator[SEP] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[newErrorList] operator[SEP] identifier[newPosition] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[error] operator[SEP] operator[SEP] {
identifier[newErrorList] operator[SEP] identifier[newPosition] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[error] , identifier[newErrorList] operator[SEP] identifier[newPosition] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[error] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[newErrorList] operator[SEP] identifier[newPosition] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[error] , Other[1] operator[SEP] operator[SEP]
}
}
|
@Override
public void close()
{
if ( treeState.compareAndSet(TreeState.STARTED, TreeState.CLOSED) )
{
client.getConnectionStateListenable().removeListener(connectionStateListener);
listeners.clear();
executorService.shutdown();
try
{
root.wasDeleted();
}
catch ( Exception e )
{
ThreadUtils.checkInterrupted(e);
handleException(e);
}
}
}
|
class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
if[call[treeState.compareAndSet, parameter[member[TreeState.STARTED], member[TreeState.CLOSED]]]] begin[{]
call[client.getConnectionStateListenable, parameter[]]
call[listeners.clear, parameter[]]
call[executorService.shutdown, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=wasDeleted, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkInterrupted, postfix_operators=[], prefix_operators=[], qualifier=ThreadUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[treeState] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[TreeState] operator[SEP] identifier[STARTED] , identifier[TreeState] operator[SEP] identifier[CLOSED] operator[SEP] operator[SEP] {
identifier[client] operator[SEP] identifier[getConnectionStateListenable] operator[SEP] operator[SEP] operator[SEP] identifier[removeListener] operator[SEP] identifier[connectionStateListener] operator[SEP] operator[SEP] identifier[listeners] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[executorService] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[root] operator[SEP] identifier[wasDeleted] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[ThreadUtils] operator[SEP] identifier[checkInterrupted] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[handleException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public String getShortString()
{
String value = Wire.getShortString(needle, needle.position());
forward(value.length() + 1);
return value;
}
|
class class_name[name] begin[{]
method[getShortString, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[String], value]
call[.forward, parameter[binary_operation[call[value.length, parameter[]], +, literal[1]]]]
return[member[.value]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[getShortString] operator[SEP] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[Wire] operator[SEP] identifier[getShortString] operator[SEP] identifier[needle] , identifier[needle] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[forward] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP]
}
|
public void marshall(DeleteApiKeyRequest deleteApiKeyRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteApiKeyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteApiKeyRequest.getApiKey(), APIKEY_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[deleteApiKeyRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deleteApiKeyRequest], ==, 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=getApiKey, postfix_operators=[], prefix_operators=[], qualifier=deleteApiKeyRequest, selectors=[], type_arguments=None), MemberReference(member=APIKEY_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[DeleteApiKeyRequest] identifier[deleteApiKeyRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteApiKeyRequest] 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[deleteApiKeyRequest] operator[SEP] identifier[getApiKey] operator[SEP] operator[SEP] , identifier[APIKEY_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 <T> void put(Key<T> key, T data) {
if (data instanceof Factory<?>)
throw new AssertionError("T extends Context.Factory");
checkState(ht);
Object old = ht.put(key, data);
if (old != null && !(old instanceof Factory<?>) && old != data && data != null)
throw new AssertionError("duplicate context value");
}
|
class class_name[name] begin[{]
method[put, return_type[void], modifier[public], parameter[key, data]] begin[{]
if[binary_operation[member[.data], instanceof, type[Factory]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="T extends Context.Factory")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.checkState, parameter[member[.ht]]]
local_variable[type[Object], old]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.old], !=, literal[null]], &&, binary_operation[member[.old], instanceof, type[Factory]]], &&, binary_operation[member[.old], !=, member[.data]]], &&, binary_operation[member[.data], !=, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="duplicate context value")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[put] operator[SEP] identifier[Key] operator[<] identifier[T] operator[>] identifier[key] , identifier[T] identifier[data] operator[SEP] {
Keyword[if] operator[SEP] identifier[data] Keyword[instanceof] identifier[Factory] operator[<] operator[?] operator[>] operator[SEP] Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[checkState] operator[SEP] identifier[ht] operator[SEP] operator[SEP] identifier[Object] identifier[old] operator[=] identifier[ht] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[data] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[old] operator[!=] Other[null] operator[&&] operator[!] operator[SEP] identifier[old] Keyword[instanceof] identifier[Factory] operator[<] operator[?] operator[>] operator[SEP] operator[&&] identifier[old] operator[!=] identifier[data] operator[&&] identifier[data] operator[!=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
protected List<String> getClassKeyword(TypeElement typeElement) {
ArrayList<String> metakeywords = new ArrayList<>(1);
String cltypelower = config.utils.isInterface(typeElement) ? "interface" : "class";
metakeywords.add(config.utils.getFullyQualifiedName(typeElement) + " " + cltypelower);
return metakeywords;
}
|
class class_name[name] begin[{]
method[getClassKeyword, return_type[type[List]], modifier[protected], parameter[typeElement]] begin[{]
local_variable[type[ArrayList], metakeywords]
local_variable[type[String], cltypelower]
call[metakeywords.add, parameter[binary_operation[binary_operation[call[config.utils.getFullyQualifiedName, parameter[member[.typeElement]]], +, literal[" "]], +, member[.cltypelower]]]]
return[member[.metakeywords]]
end[}]
END[}]
|
Keyword[protected] identifier[List] operator[<] identifier[String] operator[>] identifier[getClassKeyword] operator[SEP] identifier[TypeElement] identifier[typeElement] operator[SEP] {
identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[metakeywords] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[cltypelower] operator[=] identifier[config] operator[SEP] identifier[utils] operator[SEP] identifier[isInterface] operator[SEP] identifier[typeElement] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] identifier[metakeywords] operator[SEP] identifier[add] operator[SEP] identifier[config] operator[SEP] identifier[utils] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] identifier[typeElement] operator[SEP] operator[+] literal[String] operator[+] identifier[cltypelower] operator[SEP] operator[SEP] Keyword[return] identifier[metakeywords] operator[SEP]
}
|
public File getFinalCopy(String requestId) throws HelloSignException {
String url = BASE_URI + SIGNATURE_REQUEST_FINAL_COPY_URI + "/" + requestId;
String filename = FINAL_COPY_FILE_NAME + "." + FINAL_COPY_FILE_EXT;
return httpClient.withAuth(auth).get(url).asFile(filename);
}
|
class class_name[name] begin[{]
method[getFinalCopy, return_type[type[File]], modifier[public], parameter[requestId]] begin[{]
local_variable[type[String], url]
local_variable[type[String], filename]
return[call[httpClient.withAuth, parameter[member[.auth]]]]
end[}]
END[}]
|
Keyword[public] identifier[File] identifier[getFinalCopy] operator[SEP] identifier[String] identifier[requestId] operator[SEP] Keyword[throws] identifier[HelloSignException] {
identifier[String] identifier[url] operator[=] identifier[BASE_URI] operator[+] identifier[SIGNATURE_REQUEST_FINAL_COPY_URI] operator[+] literal[String] operator[+] identifier[requestId] operator[SEP] identifier[String] identifier[filename] operator[=] identifier[FINAL_COPY_FILE_NAME] operator[+] literal[String] operator[+] identifier[FINAL_COPY_FILE_EXT] operator[SEP] Keyword[return] identifier[httpClient] operator[SEP] identifier[withAuth] operator[SEP] identifier[auth] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[asFile] operator[SEP] identifier[filename] operator[SEP] operator[SEP]
}
|
@Override
public GetCheckerIpRangesResult getCheckerIpRanges(GetCheckerIpRangesRequest request) {
request = beforeClientExecution(request);
return executeGetCheckerIpRanges(request);
}
|
class class_name[name] begin[{]
method[getCheckerIpRanges, return_type[type[GetCheckerIpRangesResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeGetCheckerIpRanges, parameter[member[.request]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[GetCheckerIpRangesResult] identifier[getCheckerIpRanges] operator[SEP] identifier[GetCheckerIpRangesRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetCheckerIpRanges] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
@Override
public void stop(final Runnable callback) {
if (state.stop()){
serviceThreadPool.execute(new Runnable(){
@Override
public void run() {
try{
doStop();
state.finishStopping();
callback.run();
}catch(Exception e){
state.failStopping();
logger.warn("Failed to stop {}", this.getClass().getName(), e);
}
}
});
}
}
|
class class_name[name] begin[{]
method[stop, return_type[void], modifier[public], parameter[callback]] begin[{]
if[call[state.stop, parameter[]]] begin[{]
call[serviceThreadPool.execute, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=doStop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=finishStopping, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=failStopping, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to stop {}"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, 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=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[stop] operator[SEP] Keyword[final] identifier[Runnable] identifier[callback] operator[SEP] {
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] {
identifier[serviceThreadPool] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[doStop] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[finishStopping] operator[SEP] operator[SEP] operator[SEP] identifier[callback] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[state] operator[SEP] identifier[failStopping] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
}
|
public static <T> List<LocalProperty<T>> normalizeAndPrune(List<? extends LocalProperty<T>> localProperties)
{
return normalize(localProperties).stream()
.filter(Optional::isPresent)
.map(Optional::get)
.collect(Collectors.toList());
}
|
class class_name[name] begin[{]
method[normalizeAndPrune, return_type[type[List]], modifier[public static], parameter[localProperties]] begin[{]
return[call[.normalize, parameter[member[.localProperties]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[LocalProperty] operator[<] identifier[T] operator[>] operator[>] identifier[normalizeAndPrune] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[LocalProperty] operator[<] identifier[T] operator[>] operator[>] identifier[localProperties] operator[SEP] {
Keyword[return] identifier[normalize] operator[SEP] identifier[localProperties] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[Optional] operator[::] identifier[isPresent] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Optional] operator[::] identifier[get] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public final void connect(String address, int port, long timeout, TimeUnit unit, Runnable onTimeout) {
Objects.requireNonNull(address);
if (port < 0 || port > 65535) {
throw new IllegalArgumentException("The specified port must be between 0 and 65535!");
}
executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(), runnable -> {
Thread thread = new Thread(runnable);
thread.setDaemon(false);
thread.setName(thread.getName().replace("Thread", "SimpleNet"));
thread.setUncaughtExceptionHandler(($, throwable) -> throwable.printStackTrace());
return thread;
});
executor.prestartAllCoreThreads();
try {
this.channel = AsynchronousSocketChannel.open(AsynchronousChannelGroup.withThreadPool(executor));
this.channel.setOption(StandardSocketOptions.SO_RCVBUF, bufferSize);
this.channel.setOption(StandardSocketOptions.SO_SNDBUF, bufferSize);
this.channel.setOption(StandardSocketOptions.SO_KEEPALIVE, false);
this.channel.setOption(StandardSocketOptions.TCP_NODELAY, true);
} catch (IOException e) {
throw new IllegalStateException("Unable to open the channel:", e);
}
try {
channel.connect(new InetSocketAddress(address, port)).get(timeout, unit);
} catch (AlreadyConnectedException e) {
throw new IllegalStateException("This client is already connected to a server:", e);
} catch (Exception e) {
onTimeout.run();
close();
return;
}
try {
channel.read(buffer, this, Listener.CLIENT_INSTANCE);
} catch (ShutdownChannelGroupException e) {
// This exception is caught whenever a client closes their connection to the server. In that case, do
// nothing.
}
ForkJoinPool.commonPool().execute(() -> connectListeners.forEach(Runnable::run));
}
|
class class_name[name] begin[{]
method[connect, return_type[void], modifier[final public], parameter[address, port, timeout, unit, onTimeout]] begin[{]
call[Objects.requireNonNull, parameter[member[.address]]]
if[binary_operation[binary_operation[member[.port], <, literal[0]], ||, binary_operation[member[.port], >, literal[65535]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The specified port must be between 0 and 65535!")], 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[.executor], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), MemberReference(member=MILLISECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedBlockingQueue, sub_type=None)), LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=runnable, 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=Thread, sub_type=None)), name=thread)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setDaemon, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Thread"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SimpleNet")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=throwable, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=$), InferredFormalParameter(name=throwable)])], member=setUncaughtExceptionHandler, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=thread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[MemberReference(member=runnable, 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=ThreadPoolExecutor, sub_type=None))]
call[executor.prestartAllCoreThreads, parameter[]]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=channel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=executor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withThreadPool, postfix_operators=[], prefix_operators=[], qualifier=AsynchronousChannelGroup, selectors=[], type_arguments=None)], member=open, postfix_operators=[], prefix_operators=[], qualifier=AsynchronousSocketChannel, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=channel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=SO_RCVBUF, postfix_operators=[], prefix_operators=[], qualifier=StandardSocketOptions, selectors=[]), MemberReference(member=bufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOption, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=channel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=SO_SNDBUF, postfix_operators=[], prefix_operators=[], qualifier=StandardSocketOptions, selectors=[]), MemberReference(member=bufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOption, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=channel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=SO_KEEPALIVE, postfix_operators=[], prefix_operators=[], qualifier=StandardSocketOptions, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setOption, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=channel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=TCP_NODELAY, postfix_operators=[], prefix_operators=[], qualifier=StandardSocketOptions, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setOption, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to open the channel:"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, 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=InetSocketAddress, sub_type=None))], member=connect, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[MethodInvocation(arguments=[MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This client is already connected to a server:"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AlreadyConnectedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=onTimeout, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=CLIENT_INSTANCE, postfix_operators=[], prefix_operators=[], qualifier=Listener, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ShutdownChannelGroupException']))], finally_block=None, label=None, resources=None)
call[ForkJoinPool.commonPool, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[final] Keyword[void] identifier[connect] operator[SEP] identifier[String] identifier[address] , Keyword[int] identifier[port] , Keyword[long] identifier[timeout] , identifier[TimeUnit] identifier[unit] , identifier[Runnable] identifier[onTimeout] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[address] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[port] operator[<] Other[0] operator[||] identifier[port] operator[>] Other[65535] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[executor] operator[=] Keyword[new] identifier[ThreadPoolExecutor] operator[SEP] Other[1] , Other[1] , Other[0L] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] , Keyword[new] identifier[LinkedBlockingQueue] operator[<] operator[>] operator[SEP] operator[SEP] , identifier[runnable] operator[->] {
identifier[Thread] identifier[thread] operator[=] Keyword[new] identifier[Thread] operator[SEP] identifier[runnable] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[setDaemon] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[setName] operator[SEP] identifier[thread] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[setUncaughtExceptionHandler] operator[SEP] operator[SEP] identifier[$] , identifier[throwable] operator[SEP] operator[->] identifier[throwable] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[thread] operator[SEP]
} operator[SEP] operator[SEP] identifier[executor] operator[SEP] identifier[prestartAllCoreThreads] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[this] operator[SEP] identifier[channel] operator[=] identifier[AsynchronousSocketChannel] operator[SEP] identifier[open] operator[SEP] identifier[AsynchronousChannelGroup] operator[SEP] identifier[withThreadPool] operator[SEP] identifier[executor] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[channel] operator[SEP] identifier[setOption] operator[SEP] identifier[StandardSocketOptions] operator[SEP] identifier[SO_RCVBUF] , identifier[bufferSize] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[channel] operator[SEP] identifier[setOption] operator[SEP] identifier[StandardSocketOptions] operator[SEP] identifier[SO_SNDBUF] , identifier[bufferSize] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[channel] operator[SEP] identifier[setOption] operator[SEP] identifier[StandardSocketOptions] operator[SEP] identifier[SO_KEEPALIVE] , literal[boolean] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[channel] operator[SEP] identifier[setOption] operator[SEP] identifier[StandardSocketOptions] operator[SEP] identifier[TCP_NODELAY] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[channel] operator[SEP] identifier[connect] operator[SEP] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[address] , identifier[port] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[timeout] , identifier[unit] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[AlreadyConnectedException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[onTimeout] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[try] {
identifier[channel] operator[SEP] identifier[read] operator[SEP] identifier[buffer] , Keyword[this] , identifier[Listener] operator[SEP] identifier[CLIENT_INSTANCE] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ShutdownChannelGroupException] identifier[e] operator[SEP] {
}
identifier[ForkJoinPool] operator[SEP] identifier[commonPool] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[connectListeners] operator[SEP] identifier[forEach] operator[SEP] identifier[Runnable] operator[::] identifier[run] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String decryptByPrivateKey(String data, String privateKey) throws Exception {
return decryptByPrivateKey(data, privateKey, "RSA/ECB/PKCS1Padding");
}
|
class class_name[name] begin[{]
method[decryptByPrivateKey, return_type[type[String]], modifier[public static], parameter[data, privateKey]] begin[{]
return[call[.decryptByPrivateKey, parameter[member[.data], member[.privateKey], literal["RSA/ECB/PKCS1Padding"]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[decryptByPrivateKey] operator[SEP] identifier[String] identifier[data] , identifier[String] identifier[privateKey] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[return] identifier[decryptByPrivateKey] operator[SEP] identifier[data] , identifier[privateKey] , literal[String] operator[SEP] operator[SEP]
}
|
void removeProducer(JmsMsgProducerImpl producer) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "removeProducer", producer);
producers.remove(producer);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "removeProducer");
}
|
class class_name[name] begin[{]
method[removeProducer, return_type[void], modifier[default], parameter[producer]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["removeProducer"], member[.producer]]]
else begin[{]
None
end[}]
call[producers.remove, parameter[member[.producer]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["removeProducer"]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[void] identifier[removeProducer] operator[SEP] identifier[JmsMsgProducerImpl] identifier[producer] 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[producer] operator[SEP] operator[SEP] identifier[producers] operator[SEP] identifier[remove] operator[SEP] identifier[producer] 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] operator[SEP] operator[SEP]
}
|
protected IntermediateQuery buildQuery(DBMetadata metadata,
DistinctVariableOnlyDataAtom projectionAtom,
QueryTreeComponent treeComponent) {
return new IntermediateQueryImpl(metadata, projectionAtom, treeComponent, executorRegistry, validator,
settings, iqFactory);
}
|
class class_name[name] begin[{]
method[buildQuery, return_type[type[IntermediateQuery]], modifier[protected], parameter[metadata, projectionAtom, treeComponent]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=projectionAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=treeComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=executorRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=validator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=settings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iqFactory, 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=IntermediateQueryImpl, sub_type=None))]
end[}]
END[}]
|
Keyword[protected] identifier[IntermediateQuery] identifier[buildQuery] operator[SEP] identifier[DBMetadata] identifier[metadata] , identifier[DistinctVariableOnlyDataAtom] identifier[projectionAtom] , identifier[QueryTreeComponent] identifier[treeComponent] operator[SEP] {
Keyword[return] Keyword[new] identifier[IntermediateQueryImpl] operator[SEP] identifier[metadata] , identifier[projectionAtom] , identifier[treeComponent] , identifier[executorRegistry] , identifier[validator] , identifier[settings] , identifier[iqFactory] operator[SEP] operator[SEP]
}
|
public static void transfer(InputStream in, OutputStream out, TransferCallback cb) throws IOException
{
byte[] bytes = new byte[TRANSFER_BUFFER];
int count;
while ((count = in.read(bytes)) != -1)
{
out.write(bytes, 0, count);
if (cb != null)
{
cb.bytesTransferred(bytes, count);
if (cb.isCancelled())
{
break;
}
}
}
}
|
class class_name[name] begin[{]
method[transfer, return_type[void], modifier[public static], parameter[in, out, cb]] begin[{]
local_variable[type[byte], bytes]
local_variable[type[int], count]
while[binary_operation[assign[member[.count], call[in.read, parameter[member[.bytes]]]], !=, literal[1]]] begin[{]
call[out.write, parameter[member[.bytes], literal[0], member[.count]]]
if[binary_operation[member[.cb], !=, literal[null]]] begin[{]
call[cb.bytesTransferred, parameter[member[.bytes], member[.count]]]
if[call[cb.isCancelled, parameter[]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[transfer] operator[SEP] identifier[InputStream] identifier[in] , identifier[OutputStream] identifier[out] , identifier[TransferCallback] identifier[cb] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[TRANSFER_BUFFER] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[count] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[bytes] , Other[0] , identifier[count] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cb] operator[!=] Other[null] operator[SEP] {
identifier[cb] operator[SEP] identifier[bytesTransferred] operator[SEP] identifier[bytes] , identifier[count] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cb] operator[SEP] identifier[isCancelled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
}
}
}
|
protected static Implementation.Target of(TypeDescription instrumentedType,
MethodGraph.Linked methodGraph,
ClassFileVersion classFileVersion,
MethodRebaseResolver methodRebaseResolver) {
return new RebaseImplementationTarget(instrumentedType, methodGraph, DefaultMethodInvocation.of(classFileVersion), methodRebaseResolver.asTokenMap());
}
|
class class_name[name] begin[{]
method[of, return_type[type[Implementation]], modifier[static protected], parameter[instrumentedType, methodGraph, classFileVersion, methodRebaseResolver]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=instrumentedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodGraph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=classFileVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=DefaultMethodInvocation, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=asTokenMap, postfix_operators=[], prefix_operators=[], qualifier=methodRebaseResolver, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RebaseImplementationTarget, sub_type=None))]
end[}]
END[}]
|
Keyword[protected] Keyword[static] identifier[Implementation] operator[SEP] identifier[Target] identifier[of] operator[SEP] identifier[TypeDescription] identifier[instrumentedType] , identifier[MethodGraph] operator[SEP] identifier[Linked] identifier[methodGraph] , identifier[ClassFileVersion] identifier[classFileVersion] , identifier[MethodRebaseResolver] identifier[methodRebaseResolver] operator[SEP] {
Keyword[return] Keyword[new] identifier[RebaseImplementationTarget] operator[SEP] identifier[instrumentedType] , identifier[methodGraph] , identifier[DefaultMethodInvocation] operator[SEP] identifier[of] operator[SEP] identifier[classFileVersion] operator[SEP] , identifier[methodRebaseResolver] operator[SEP] identifier[asTokenMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private CmsProject createTempProject(CmsObject adminCms, List<CmsResource> resources, Date date)
throws CmsException {
CmsProject tmpProject;
String rootPath = resources.get(0).getRootPath();
if (resources.size() > 1) {
rootPath = CmsResource.getParentFolder(rootPath);
}
String projectName = computeProjectName(rootPath, date);
try {
// create the project
tmpProject = adminCms.createProject(
projectName,
"",
CmsRole.WORKPLACE_USER.getGroupName(),
CmsRole.PROJECT_MANAGER.getGroupName(),
CmsProject.PROJECT_TYPE_TEMPORARY);
} catch (CmsException e) {
String resName = CmsResource.getName(rootPath);
if (resName.length() > 64) {
resName = resName.substring(0, 64) + "...";
}
// use UUID to make sure the project name is still unique
projectName = computeProjectName(resName, date) + " [" + new CmsUUID() + "]";
// create the project
tmpProject = adminCms.createProject(
projectName,
"",
CmsRole.WORKPLACE_USER.getGroupName(),
CmsRole.PROJECT_MANAGER.getGroupName(),
CmsProject.PROJECT_TYPE_TEMPORARY);
}
// make the project invisible for all users
tmpProject.setHidden(true);
// write the project to the database
adminCms.writeProject(tmpProject);
return tmpProject;
}
|
class class_name[name] begin[{]
method[createTempProject, return_type[type[CmsProject]], modifier[private], parameter[adminCms, resources, date]] begin[{]
local_variable[type[CmsProject], tmpProject]
local_variable[type[String], rootPath]
if[binary_operation[call[resources.size, parameter[]], >, literal[1]]] begin[{]
assign[member[.rootPath], call[CmsResource.getParentFolder, parameter[member[.rootPath]]]]
else begin[{]
None
end[}]
local_variable[type[String], projectName]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmpProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MethodInvocation(arguments=[], member=getGroupName, postfix_operators=[], prefix_operators=[], qualifier=CmsRole.WORKPLACE_USER, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getGroupName, postfix_operators=[], prefix_operators=[], qualifier=CmsRole.PROJECT_MANAGER, selectors=[], type_arguments=None), MemberReference(member=PROJECT_TYPE_TEMPORARY, postfix_operators=[], prefix_operators=[], qualifier=CmsProject, selectors=[])], member=createProject, postfix_operators=[], prefix_operators=[], qualifier=adminCms, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getName, postfix_operators=[], prefix_operators=[], qualifier=CmsResource, selectors=[], type_arguments=None), name=resName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=resName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=resName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="..."), operator=+)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeProjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ["), operator=+), operandr=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsUUID, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmpProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MethodInvocation(arguments=[], member=getGroupName, postfix_operators=[], prefix_operators=[], qualifier=CmsRole.WORKPLACE_USER, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getGroupName, postfix_operators=[], prefix_operators=[], qualifier=CmsRole.PROJECT_MANAGER, selectors=[], type_arguments=None), MemberReference(member=PROJECT_TYPE_TEMPORARY, postfix_operators=[], prefix_operators=[], qualifier=CmsProject, selectors=[])], member=createProject, postfix_operators=[], prefix_operators=[], qualifier=adminCms, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
call[tmpProject.setHidden, parameter[literal[true]]]
call[adminCms.writeProject, parameter[member[.tmpProject]]]
return[member[.tmpProject]]
end[}]
END[}]
|
Keyword[private] identifier[CmsProject] identifier[createTempProject] operator[SEP] identifier[CmsObject] identifier[adminCms] , identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[resources] , identifier[Date] identifier[date] operator[SEP] Keyword[throws] identifier[CmsException] {
identifier[CmsProject] identifier[tmpProject] operator[SEP] identifier[String] identifier[rootPath] operator[=] identifier[resources] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[rootPath] operator[=] identifier[CmsResource] operator[SEP] identifier[getParentFolder] operator[SEP] identifier[rootPath] operator[SEP] operator[SEP]
}
identifier[String] identifier[projectName] operator[=] identifier[computeProjectName] operator[SEP] identifier[rootPath] , identifier[date] operator[SEP] operator[SEP] Keyword[try] {
identifier[tmpProject] operator[=] identifier[adminCms] operator[SEP] identifier[createProject] operator[SEP] identifier[projectName] , literal[String] , identifier[CmsRole] operator[SEP] identifier[WORKPLACE_USER] operator[SEP] identifier[getGroupName] operator[SEP] operator[SEP] , identifier[CmsRole] operator[SEP] identifier[PROJECT_MANAGER] operator[SEP] identifier[getGroupName] operator[SEP] operator[SEP] , identifier[CmsProject] operator[SEP] identifier[PROJECT_TYPE_TEMPORARY] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[String] identifier[resName] operator[=] identifier[CmsResource] operator[SEP] identifier[getName] operator[SEP] identifier[rootPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[64] operator[SEP] {
identifier[resName] operator[=] identifier[resName] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[64] operator[SEP] operator[+] literal[String] operator[SEP]
}
identifier[projectName] operator[=] identifier[computeProjectName] operator[SEP] identifier[resName] , identifier[date] operator[SEP] operator[+] literal[String] operator[+] Keyword[new] identifier[CmsUUID] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[tmpProject] operator[=] identifier[adminCms] operator[SEP] identifier[createProject] operator[SEP] identifier[projectName] , literal[String] , identifier[CmsRole] operator[SEP] identifier[WORKPLACE_USER] operator[SEP] identifier[getGroupName] operator[SEP] operator[SEP] , identifier[CmsRole] operator[SEP] identifier[PROJECT_MANAGER] operator[SEP] identifier[getGroupName] operator[SEP] operator[SEP] , identifier[CmsProject] operator[SEP] identifier[PROJECT_TYPE_TEMPORARY] operator[SEP] operator[SEP]
}
identifier[tmpProject] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[adminCms] operator[SEP] identifier[writeProject] operator[SEP] identifier[tmpProject] operator[SEP] operator[SEP] Keyword[return] identifier[tmpProject] operator[SEP]
}
|
public boolean isSupportedPropertyType(int sqlTypeId, String sqlTypeName) throws SQLException {
switch (sqlTypeId) {
case Types.BOOLEAN:
case Types.DOUBLE:
case Types.FLOAT:
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
case Types.DATE:
case Types.VARCHAR:
case Types.NCHAR:
case Types.CHAR:
case Types.ARRAY:
case Types.OTHER:
case Types.DECIMAL:
case Types.REAL:
case Types.TINYINT:
case Types.NUMERIC:
case Types.NULL:
return true;
default:
throw new SQLException("Field type not supported by GeoJSON driver: " + sqlTypeName);
}
}
|
class class_name[name] begin[{]
method[isSupportedPropertyType, return_type[type[boolean]], modifier[public], parameter[sqlTypeId, sqlTypeName]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=FLOAT, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=INTEGER, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=BIGINT, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=SMALLINT, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=VARCHAR, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=NCHAR, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=CHAR, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=ARRAY, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=OTHER, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=DECIMAL, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=REAL, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=TINYINT, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=NUMERIC, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[]), MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=Types, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Field type not supported by GeoJSON driver: "), operandr=MemberReference(member=sqlTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None)])], expression=MemberReference(member=sqlTypeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[isSupportedPropertyType] operator[SEP] Keyword[int] identifier[sqlTypeId] , identifier[String] identifier[sqlTypeName] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[switch] operator[SEP] identifier[sqlTypeId] operator[SEP] {
Keyword[case] identifier[Types] operator[SEP] identifier[BOOLEAN] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[DOUBLE] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[FLOAT] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[INTEGER] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[BIGINT] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[SMALLINT] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[DATE] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[VARCHAR] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[NCHAR] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[CHAR] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[ARRAY] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[OTHER] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[DECIMAL] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[REAL] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[TINYINT] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[NUMERIC] operator[:] Keyword[case] identifier[Types] operator[SEP] identifier[NULL] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[+] identifier[sqlTypeName] operator[SEP] operator[SEP]
}
}
|
public JFreeChart createAreaChart(final ChartData chartData) {
PlotOrientation orientation = PlotOrientation.VERTICAL;
// create the chart...
final JFreeChart chart = ChartFactory.createAreaChart(
chartData.getTitle(), // chart title
chartData.getCatAx().getTitle(), // x axis label
chartData.getValAx().getTitle(), // y axis label
createDataset(chartData), // data
orientation, true, // include legend
false, // tooltips
false // urls
);
setupStyle(chart, chartData);
return chart;
}
|
class class_name[name] begin[{]
method[createAreaChart, return_type[type[JFreeChart]], modifier[public], parameter[chartData]] begin[{]
local_variable[type[PlotOrientation], orientation]
local_variable[type[JFreeChart], chart]
call[.setupStyle, parameter[member[.chart], member[.chartData]]]
return[member[.chart]]
end[}]
END[}]
|
Keyword[public] identifier[JFreeChart] identifier[createAreaChart] operator[SEP] Keyword[final] identifier[ChartData] identifier[chartData] operator[SEP] {
identifier[PlotOrientation] identifier[orientation] operator[=] identifier[PlotOrientation] operator[SEP] identifier[VERTICAL] operator[SEP] Keyword[final] identifier[JFreeChart] identifier[chart] operator[=] identifier[ChartFactory] operator[SEP] identifier[createAreaChart] operator[SEP] identifier[chartData] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] , identifier[chartData] operator[SEP] identifier[getCatAx] operator[SEP] operator[SEP] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] , identifier[chartData] operator[SEP] identifier[getValAx] operator[SEP] operator[SEP] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] , identifier[createDataset] operator[SEP] identifier[chartData] operator[SEP] , identifier[orientation] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[setupStyle] operator[SEP] identifier[chart] , identifier[chartData] operator[SEP] operator[SEP] Keyword[return] identifier[chart] operator[SEP]
}
|
public <RET extends List<?>> RET query(final OQuery<?> iCommand, final Object... iArgs) {
checkIfActive();
iCommand.reset();
return (RET) iCommand.execute(iArgs);
}
|
class class_name[name] begin[{]
method[query, return_type[type[RET]], modifier[public], parameter[iCommand, iArgs]] begin[{]
call[.checkIfActive, parameter[]]
call[iCommand.reset, parameter[]]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=iArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=iCommand, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=RET, sub_type=None))]
end[}]
END[}]
|
Keyword[public] operator[<] identifier[RET] Keyword[extends] identifier[List] operator[<] operator[?] operator[>] operator[>] identifier[RET] identifier[query] operator[SEP] Keyword[final] identifier[OQuery] operator[<] operator[?] operator[>] identifier[iCommand] , Keyword[final] identifier[Object] operator[...] identifier[iArgs] operator[SEP] {
identifier[checkIfActive] operator[SEP] operator[SEP] operator[SEP] identifier[iCommand] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[RET] operator[SEP] identifier[iCommand] operator[SEP] identifier[execute] operator[SEP] identifier[iArgs] operator[SEP] operator[SEP]
}
|
public static PublicKey readPublicKey(String pemResName) throws Exception {
InputStream contentIS = TokenUtils.class.getResourceAsStream(pemResName);
byte[] tmp = new byte[4096];
int length = contentIS.read(tmp);
PublicKey publicKey = decodePublicKey(new String(tmp, 0, length));
return publicKey;
}
|
class class_name[name] begin[{]
method[readPublicKey, return_type[type[PublicKey]], modifier[public static], parameter[pemResName]] begin[{]
local_variable[type[InputStream], contentIS]
local_variable[type[byte], tmp]
local_variable[type[int], length]
local_variable[type[PublicKey], publicKey]
return[member[.publicKey]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[PublicKey] identifier[readPublicKey] operator[SEP] identifier[String] identifier[pemResName] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[InputStream] identifier[contentIS] operator[=] identifier[TokenUtils] operator[SEP] Keyword[class] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[pemResName] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[4096] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[contentIS] operator[SEP] identifier[read] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] identifier[PublicKey] identifier[publicKey] operator[=] identifier[decodePublicKey] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[tmp] , Other[0] , identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[publicKey] operator[SEP]
}
|
public void validate(String resourceGroupName, String location, String workflowName, WorkflowInner workflow) {
validateWithServiceResponseAsync(resourceGroupName, location, workflowName, workflow).toBlocking().single().body();
}
|
class class_name[name] begin[{]
method[validate, return_type[void], modifier[public], parameter[resourceGroupName, location, workflowName, workflow]] begin[{]
call[.validateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.location], member[.workflowName], member[.workflow]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[validate] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[location] , identifier[String] identifier[workflowName] , identifier[WorkflowInner] identifier[workflow] operator[SEP] {
identifier[validateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[location] , identifier[workflowName] , identifier[workflow] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public Matrix4f setPerspective(float fovy, float aspect, float zNear, float zFar) {
return setPerspective(fovy, aspect, zNear, zFar, false);
}
|
class class_name[name] begin[{]
method[setPerspective, return_type[type[Matrix4f]], modifier[public], parameter[fovy, aspect, zNear, zFar]] begin[{]
return[call[.setPerspective, parameter[member[.fovy], member[.aspect], member[.zNear], member[.zFar], literal[false]]]]
end[}]
END[}]
|
Keyword[public] identifier[Matrix4f] identifier[setPerspective] operator[SEP] Keyword[float] identifier[fovy] , Keyword[float] identifier[aspect] , Keyword[float] identifier[zNear] , Keyword[float] identifier[zFar] operator[SEP] {
Keyword[return] identifier[setPerspective] operator[SEP] identifier[fovy] , identifier[aspect] , identifier[zNear] , identifier[zFar] , literal[boolean] operator[SEP] operator[SEP]
}
|
public static <A> Maybe<A> just(A a) {
if (a == null)
throw new NullPointerException();
return new Just<>(a);
}
|
class class_name[name] begin[{]
method[just, return_type[type[Maybe]], modifier[public static], parameter[a]] begin[{]
if[binary_operation[member[.a], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Just, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[A] operator[>] identifier[Maybe] operator[<] identifier[A] operator[>] identifier[just] operator[SEP] identifier[A] identifier[a] operator[SEP] {
Keyword[if] operator[SEP] identifier[a] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Just] operator[<] operator[>] operator[SEP] identifier[a] operator[SEP] operator[SEP]
}
|
public Object getLocal(Object key) {
return data != null ? data.get(key) : null;
}
|
class class_name[name] begin[{]
method[getLocal, return_type[type[Object]], modifier[public], parameter[key]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None))]
end[}]
END[}]
|
Keyword[public] identifier[Object] identifier[getLocal] operator[SEP] identifier[Object] identifier[key] operator[SEP] {
Keyword[return] identifier[data] operator[!=] Other[null] operator[?] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[:] Other[null] operator[SEP]
}
|
public static long lastModifiedAsLong(String strTime) throws IOException {
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(TIME_PATTERN,
Locale.US);
try {
long lastModified = simpleDateFormat.parse(strTime).getTime();
if (lastModified == 0) {
lastModified = System.currentTimeMillis();
}
return lastModified;
} catch (ParseException e) {
throw new IOException("Failed to parse " + strTime, e);
}
}
|
class class_name[name] begin[{]
method[lastModifiedAsLong, return_type[type[long]], modifier[public static], parameter[strTime]] begin[{]
local_variable[type[SimpleDateFormat], simpleDateFormat]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=strTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=simpleDateFormat, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=lastModified)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lastModified, 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=Assignment(expressionl=MemberReference(member=lastModified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=MemberReference(member=lastModified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to parse "), operandr=MemberReference(member=strTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[long] identifier[lastModifiedAsLong] operator[SEP] identifier[String] identifier[strTime] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[SimpleDateFormat] identifier[simpleDateFormat] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] identifier[TIME_PATTERN] , identifier[Locale] operator[SEP] identifier[US] operator[SEP] operator[SEP] Keyword[try] {
Keyword[long] identifier[lastModified] operator[=] identifier[simpleDateFormat] operator[SEP] identifier[parse] operator[SEP] identifier[strTime] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastModified] operator[==] Other[0] operator[SEP] {
identifier[lastModified] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[lastModified] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[strTime] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public Expression invoke(MethodRef method, Expression... args) {
return method.invoke(ImmutableList.<Expression>builder().add(this).add(args).build());
}
|
class class_name[name] begin[{]
method[invoke, return_type[type[Expression]], modifier[public], parameter[method, args]] begin[{]
return[call[method.invoke, parameter[call[.ImmutableList, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] identifier[Expression] identifier[invoke] operator[SEP] identifier[MethodRef] identifier[method] , identifier[Expression] operator[...] identifier[args] operator[SEP] {
Keyword[return] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[ImmutableList] operator[SEP] operator[<] identifier[Expression] operator[>] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void mergeDocs(Hints hints) {
if (docs != null) {
if (hints.getDocs() != null && !docs.equals(hints.getDocs())) {
throw SeedException.createNew(RestErrorCode.CANNOT_MERGE_RESOURCES_WITH_DIFFERENT_DOC)
.put("oldDoc", docs).put("newDoc", hints.getDocs());
}
} else {
this.docs = hints.getDocs();
}
}
|
class class_name[name] begin[{]
method[mergeDocs, return_type[void], modifier[private], parameter[hints]] begin[{]
if[binary_operation[member[.docs], !=, literal[null]]] begin[{]
if[binary_operation[binary_operation[call[hints.getDocs, parameter[]], !=, literal[null]], &&, call[docs.equals, parameter[call[hints.getDocs, parameter[]]]]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=CANNOT_MERGE_RESOURCES_WITH_DIFFERENT_DOC, postfix_operators=[], prefix_operators=[], qualifier=RestErrorCode, selectors=[])], member=createNew, postfix_operators=[], prefix_operators=[], qualifier=SeedException, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="oldDoc"), MemberReference(member=docs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="newDoc"), MethodInvocation(arguments=[], member=getDocs, postfix_operators=[], prefix_operators=[], qualifier=hints, selectors=[], type_arguments=None)], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)
else begin[{]
None
end[}]
else begin[{]
assign[THIS[member[None.docs]], call[hints.getDocs, parameter[]]]
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[mergeDocs] operator[SEP] identifier[Hints] identifier[hints] operator[SEP] {
Keyword[if] operator[SEP] identifier[docs] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[hints] operator[SEP] identifier[getDocs] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[docs] operator[SEP] identifier[equals] operator[SEP] identifier[hints] operator[SEP] identifier[getDocs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] identifier[SeedException] operator[SEP] identifier[createNew] operator[SEP] identifier[RestErrorCode] operator[SEP] identifier[CANNOT_MERGE_RESOURCES_WITH_DIFFERENT_DOC] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[docs] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[hints] operator[SEP] identifier[getDocs] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[docs] operator[=] identifier[hints] operator[SEP] identifier[getDocs] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void endCompose(StylesheetRoot sroot) throws TransformerException
{
int length = getParamElemCount();
for (int i = 0; i < length; i++)
{
ElemWithParam ewp = getParamElem(i);
ewp.endCompose(sroot);
}
super.endCompose(sroot);
}
|
class class_name[name] begin[{]
method[endCompose, return_type[void], modifier[public], parameter[sroot]] begin[{]
local_variable[type[int], length]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParamElem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=ewp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ElemWithParam, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sroot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endCompose, postfix_operators=[], prefix_operators=[], qualifier=ewp, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
SuperMethodInvocation(arguments=[MemberReference(member=sroot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endCompose, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[endCompose] operator[SEP] identifier[StylesheetRoot] identifier[sroot] operator[SEP] Keyword[throws] identifier[TransformerException] {
Keyword[int] identifier[length] operator[=] identifier[getParamElemCount] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[ElemWithParam] identifier[ewp] operator[=] identifier[getParamElem] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ewp] operator[SEP] identifier[endCompose] operator[SEP] identifier[sroot] operator[SEP] operator[SEP]
}
Keyword[super] operator[SEP] identifier[endCompose] operator[SEP] identifier[sroot] operator[SEP] operator[SEP]
}
|
public VerificationResponse verify(String otp) throws YubicoVerificationException, YubicoValidationFailure {
if (!isValidOTPFormat(otp)) {
throw new IllegalArgumentException("The OTP is not a valid format");
}
Map<String, String> requestMap = new TreeMap<String, String>();
String nonce = UUID.randomUUID().toString().replaceAll("-", "");
requestMap.put("nonce", nonce);
requestMap.put("id", clientId.toString());
requestMap.put("otp", otp);
requestMap.put("timestamp", "1");
if (sync != null) {
requestMap.put("sl", sync.toString());
}
String queryString;
try {
queryString = toQueryString(requestMap);
} catch (UnsupportedEncodingException e) {
throw new YubicoVerificationException("Failed to encode parameter.", e);
}
if (key != null) {
queryString = sign(queryString);
}
String[] wsapiUrls = this.getWsapiUrls();
List<String> validationUrls = new ArrayList<String>();
for (String wsapiUrl : wsapiUrls) {
warnIfDeprecatedUrl(wsapiUrl);
validationUrls.add(wsapiUrl + "?" + queryString);
}
VerificationResponse response = validationService.fetch(validationUrls, userAgent);
if (key != null) {
verifySignature(response);
}
// NONCE/OTP fields are not returned to the client when sending error codes.
// If there is an error response, don't need to check them.
if (!response.getStatus().isError()) {
if (response.getOtp() == null || !otp.equals(response.getOtp())) {
throw new YubicoValidationFailure("OTP mismatch in response, is there a man-in-the-middle?");
}
if (response.getNonce() == null || !nonce.equals(response.getNonce())) {
throw new YubicoValidationFailure("Nonce mismatch in response, is there a man-in-the-middle?");
}
}
return response;
}
|
class class_name[name] begin[{]
method[verify, return_type[type[VerificationResponse]], modifier[public], parameter[otp]] begin[{]
if[call[.isValidOTPFormat, parameter[member[.otp]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The OTP is not a valid format")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Map], requestMap]
local_variable[type[String], nonce]
call[requestMap.put, parameter[literal["nonce"], member[.nonce]]]
call[requestMap.put, parameter[literal["id"], call[clientId.toString, parameter[]]]]
call[requestMap.put, parameter[literal["otp"], member[.otp]]]
call[requestMap.put, parameter[literal["timestamp"], literal["1"]]]
if[binary_operation[member[.sync], !=, literal[null]]] begin[{]
call[requestMap.put, parameter[literal["sl"], call[sync.toString, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[String], queryString]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=queryString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=requestMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toQueryString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to encode parameter."), 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=YubicoVerificationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.key], !=, literal[null]]] begin[{]
assign[member[.queryString], call[.sign, parameter[member[.queryString]]]]
else begin[{]
None
end[}]
local_variable[type[String], wsapiUrls]
local_variable[type[List], validationUrls]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=wsapiUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warnIfDeprecatedUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=wsapiUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="?"), operator=+), operandr=MemberReference(member=queryString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=add, postfix_operators=[], prefix_operators=[], qualifier=validationUrls, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=wsapiUrls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=wsapiUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
local_variable[type[VerificationResponse], response]
if[binary_operation[member[.key], !=, literal[null]]] begin[{]
call[.verifySignature, parameter[member[.response]]]
else begin[{]
None
end[}]
if[call[response.getStatus, parameter[]]] begin[{]
if[binary_operation[binary_operation[call[response.getOtp, parameter[]], ==, literal[null]], ||, call[otp.equals, parameter[call[response.getOtp, parameter[]]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="OTP mismatch in response, is there a man-in-the-middle?")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=YubicoValidationFailure, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[response.getNonce, parameter[]], ==, literal[null]], ||, call[nonce.equals, parameter[call[response.getNonce, parameter[]]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Nonce mismatch in response, is there a man-in-the-middle?")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=YubicoValidationFailure, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.response]]
end[}]
END[}]
|
Keyword[public] identifier[VerificationResponse] identifier[verify] operator[SEP] identifier[String] identifier[otp] operator[SEP] Keyword[throws] identifier[YubicoVerificationException] , identifier[YubicoValidationFailure] {
Keyword[if] operator[SEP] operator[!] identifier[isValidOTPFormat] operator[SEP] identifier[otp] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[requestMap] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[nonce] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[requestMap] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[nonce] operator[SEP] operator[SEP] identifier[requestMap] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[clientId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[requestMap] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[otp] operator[SEP] operator[SEP] identifier[requestMap] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sync] operator[!=] Other[null] operator[SEP] {
identifier[requestMap] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[sync] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[queryString] operator[SEP] Keyword[try] {
identifier[queryString] operator[=] identifier[toQueryString] operator[SEP] identifier[requestMap] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[YubicoVerificationException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[!=] Other[null] operator[SEP] {
identifier[queryString] operator[=] identifier[sign] operator[SEP] identifier[queryString] operator[SEP] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[wsapiUrls] operator[=] Keyword[this] operator[SEP] identifier[getWsapiUrls] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[validationUrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[wsapiUrl] operator[:] identifier[wsapiUrls] operator[SEP] {
identifier[warnIfDeprecatedUrl] operator[SEP] identifier[wsapiUrl] operator[SEP] operator[SEP] identifier[validationUrls] operator[SEP] identifier[add] operator[SEP] identifier[wsapiUrl] operator[+] literal[String] operator[+] identifier[queryString] operator[SEP] operator[SEP]
}
identifier[VerificationResponse] identifier[response] operator[=] identifier[validationService] operator[SEP] identifier[fetch] operator[SEP] identifier[validationUrls] , identifier[userAgent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[!=] Other[null] operator[SEP] {
identifier[verifySignature] operator[SEP] identifier[response] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[response] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[getOtp] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] operator[!] identifier[otp] operator[SEP] identifier[equals] operator[SEP] identifier[response] operator[SEP] identifier[getOtp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[YubicoValidationFailure] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[getNonce] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] operator[!] identifier[nonce] operator[SEP] identifier[equals] operator[SEP] identifier[response] operator[SEP] identifier[getNonce] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[YubicoValidationFailure] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[response] operator[SEP]
}
|
public Map<String, Object> toMap() {
if (size() == 0) {
return Collections.emptyMap();
}
return Collections.unmodifiableMap(new LinkedHashMap<>(data));
}
|
class class_name[name] begin[{]
method[toMap, return_type[type[Map]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[.size, parameter[]], ==, literal[0]]] begin[{]
return[call[Collections.emptyMap, parameter[]]]
else begin[{]
None
end[}]
return[call[Collections.unmodifiableMap, parameter[ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashMap, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[toMap] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP]
}
|
static <Entry> CacheConfiguration<Long, Entry> getDefaultCacheConfiguration(Class<Entry> entityClass) {
return getDefaultCacheConfiguration(getCacheName(entityClass));
}
|
class class_name[name] begin[{]
method[getDefaultCacheConfiguration, return_type[type[CacheConfiguration]], modifier[static], parameter[entityClass]] begin[{]
return[call[.getDefaultCacheConfiguration, parameter[call[.getCacheName, parameter[member[.entityClass]]]]]]
end[}]
END[}]
|
Keyword[static] operator[<] identifier[Entry] operator[>] identifier[CacheConfiguration] operator[<] identifier[Long] , identifier[Entry] operator[>] identifier[getDefaultCacheConfiguration] operator[SEP] identifier[Class] operator[<] identifier[Entry] operator[>] identifier[entityClass] operator[SEP] {
Keyword[return] identifier[getDefaultCacheConfiguration] operator[SEP] identifier[getCacheName] operator[SEP] identifier[entityClass] operator[SEP] operator[SEP] operator[SEP]
}
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
public static CharSequence optCharSequence(@Nullable Bundle bundle, @Nullable String key, @Nullable CharSequence fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getCharSequence(key, fallback);
}
|
class class_name[name] begin[{]
method[optCharSequence, return_type[type[CharSequence]], modifier[public static], parameter[bundle, key, fallback]] begin[{]
if[binary_operation[member[.bundle], ==, literal[null]]] begin[{]
return[member[.fallback]]
else begin[{]
None
end[}]
return[call[bundle.getCharSequence, parameter[member[.key], member[.fallback]]]]
end[}]
END[}]
|
annotation[@] identifier[TargetApi] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[HONEYCOMB_MR1] operator[SEP] Keyword[public] Keyword[static] identifier[CharSequence] identifier[optCharSequence] operator[SEP] annotation[@] identifier[Nullable] identifier[Bundle] identifier[bundle] , annotation[@] identifier[Nullable] identifier[String] identifier[key] , annotation[@] identifier[Nullable] identifier[CharSequence] identifier[fallback] operator[SEP] {
Keyword[if] operator[SEP] identifier[bundle] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[fallback] operator[SEP]
}
Keyword[return] identifier[bundle] operator[SEP] identifier[getCharSequence] operator[SEP] identifier[key] , identifier[fallback] operator[SEP] operator[SEP]
}
|
public double getBucketMaximum(int i) {
if (i < bucketLimits.length) {
return bucketLimits[i];
} else if (getBucketCount(i) == 0) {
// last bucket, but empty
return Double.MAX_VALUE;
} else {
return getMaximum();
}
}
|
class class_name[name] begin[{]
method[getBucketMaximum, return_type[type[double]], modifier[public], parameter[i]] begin[{]
if[binary_operation[member[.i], <, member[bucketLimits.length]]] begin[{]
return[member[.bucketLimits]]
else begin[{]
if[binary_operation[call[.getBucketCount, parameter[member[.i]]], ==, literal[0]]] begin[{]
return[member[Double.MAX_VALUE]]
else begin[{]
return[call[.getMaximum, parameter[]]]
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[double] identifier[getBucketMaximum] operator[SEP] Keyword[int] identifier[i] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[<] identifier[bucketLimits] operator[SEP] identifier[length] operator[SEP] {
Keyword[return] identifier[bucketLimits] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[getBucketCount] operator[SEP] identifier[i] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[MAX_VALUE] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[getMaximum] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Nullable
public static long[] optLongArray(@Nullable Bundle bundle, @Nullable String key, @Nullable long[] fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getLongArray(key);
}
|
class class_name[name] begin[{]
method[optLongArray, return_type[type[long]], modifier[public static], parameter[bundle, key, fallback]] begin[{]
if[binary_operation[member[.bundle], ==, literal[null]]] begin[{]
return[member[.fallback]]
else begin[{]
None
end[}]
return[call[bundle.getLongArray, parameter[member[.key]]]]
end[}]
END[}]
|
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] Keyword[long] operator[SEP] operator[SEP] identifier[optLongArray] operator[SEP] annotation[@] identifier[Nullable] identifier[Bundle] identifier[bundle] , annotation[@] identifier[Nullable] identifier[String] identifier[key] , annotation[@] identifier[Nullable] Keyword[long] operator[SEP] operator[SEP] identifier[fallback] operator[SEP] {
Keyword[if] operator[SEP] identifier[bundle] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[fallback] operator[SEP]
}
Keyword[return] identifier[bundle] operator[SEP] identifier[getLongArray] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
|
public HtmlEmailImpl setHtmlMsg(String aHtml) throws EmailException {
if (StringUtil.isEmpty(aHtml)) {
throw new EmailException("Invalid message supplied");
}
this.html = aHtml;
return this;
}
|
class class_name[name] begin[{]
method[setHtmlMsg, return_type[type[HtmlEmailImpl]], modifier[public], parameter[aHtml]] begin[{]
if[call[StringUtil.isEmpty, parameter[member[.aHtml]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid message supplied")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EmailException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.html]], member[.aHtml]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[HtmlEmailImpl] identifier[setHtmlMsg] operator[SEP] identifier[String] identifier[aHtml] operator[SEP] Keyword[throws] identifier[EmailException] {
Keyword[if] operator[SEP] identifier[StringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[aHtml] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[EmailException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[html] operator[=] identifier[aHtml] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private long getMax(Object sourceAttribute)
{
int size = primaryKeyAttributes.size();
long maxFromAllTables = Long.MIN_VALUE;
Long maxFromTable;
Attribute primaryKeyAttribute;
for(int i = 0; i < size; i++)
{
primaryKeyAttribute = (Attribute)primaryKeyAttributes.get(i);
maxFromTable = this.getValidIdForPrimaryKey(primaryKeyAttribute, sourceAttribute, true);
if((maxFromTable != null) && (maxFromTable > maxFromAllTables))
{
maxFromAllTables = maxFromTable;
}
}
return maxFromAllTables;
}
|
class class_name[name] begin[{]
method[getMax, return_type[type[long]], modifier[private], parameter[sourceAttribute]] begin[{]
local_variable[type[int], size]
local_variable[type[long], maxFromAllTables]
local_variable[type[Long], maxFromTable]
local_variable[type[Attribute], primaryKeyAttribute]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=primaryKeyAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=primaryKeyAttributes, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxFromTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=primaryKeyAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sourceAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getValidIdForPrimaryKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=maxFromTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=maxFromTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxFromAllTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxFromAllTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=maxFromTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.maxFromAllTables]]
end[}]
END[}]
|
Keyword[private] Keyword[long] identifier[getMax] operator[SEP] identifier[Object] identifier[sourceAttribute] operator[SEP] {
Keyword[int] identifier[size] operator[=] identifier[primaryKeyAttributes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[maxFromAllTables] operator[=] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[SEP] identifier[Long] identifier[maxFromTable] operator[SEP] identifier[Attribute] identifier[primaryKeyAttribute] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[primaryKeyAttribute] operator[=] operator[SEP] identifier[Attribute] operator[SEP] identifier[primaryKeyAttributes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[maxFromTable] operator[=] Keyword[this] operator[SEP] identifier[getValidIdForPrimaryKey] operator[SEP] identifier[primaryKeyAttribute] , identifier[sourceAttribute] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[maxFromTable] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[maxFromTable] operator[>] identifier[maxFromAllTables] operator[SEP] operator[SEP] {
identifier[maxFromAllTables] operator[=] identifier[maxFromTable] operator[SEP]
}
}
Keyword[return] identifier[maxFromAllTables] operator[SEP]
}
|
public void render(Map<?, ?> data, Writer writer) {
CharWriter charWriter = env.engineConfig.writerBuffer.getCharWriter(writer);
try {
ast.exec(env, new Scope(data, env.engineConfig.sharedObjectMap), charWriter);
} finally {
charWriter.close();
}
}
|
class class_name[name] begin[{]
method[render, return_type[void], modifier[public], parameter[data, writer]] begin[{]
local_variable[type[CharWriter], charWriter]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=env, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sharedObjectMap, postfix_operators=[], prefix_operators=[], qualifier=env.engineConfig, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Scope, sub_type=None)), MemberReference(member=charWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exec, postfix_operators=[], prefix_operators=[], qualifier=ast, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=charWriter, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[render] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[data] , identifier[Writer] identifier[writer] operator[SEP] {
identifier[CharWriter] identifier[charWriter] operator[=] identifier[env] operator[SEP] identifier[engineConfig] operator[SEP] identifier[writerBuffer] operator[SEP] identifier[getCharWriter] operator[SEP] identifier[writer] operator[SEP] operator[SEP] Keyword[try] {
identifier[ast] operator[SEP] identifier[exec] operator[SEP] identifier[env] , Keyword[new] identifier[Scope] operator[SEP] identifier[data] , identifier[env] operator[SEP] identifier[engineConfig] operator[SEP] identifier[sharedObjectMap] operator[SEP] , identifier[charWriter] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[charWriter] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected int computeAdornmentFlags(Object obj)
{
// try
// {
if (obj instanceof IVdmElement)
{
IVdmElement element = (IVdmElement) obj;
int type = element.getElementType();
switch (type)
{
case IVdmElement.VDM_MODEL:
case IVdmElement.VDM_PROJECT:
// case IVdmElement.PACKAGE_FRAGMENT_ROOT:
// return getErrorTicksFromMarkers(element.getResource(), IResource.DEPTH_INFINITE, null);
// case IVdmElement.PACKAGE_FRAGMENT:
case IVdmElement.COMPILATION_UNIT:
// case IVdmElement.CLASS_FILE:
// return getErrorTicksFromMarkers(element.getResource(), IResource.DEPTH_ONE, null);
// case IVdmElement.PACKAGE_DECLARATION:
// case IVdmElement.IMPORT_DECLARATION:
// case IVdmElement.IMPORT_CONTAINER:
case IVdmElement.TYPE:
case IVdmElement.INITIALIZER:
case IVdmElement.METHOD:
case IVdmElement.FIELD:
// case IVdmElement.LOCAL_VARIABLE:
// ICompilationUnit cu= (ICompilationUnit)
// element.getAncestor(IVdmElement.COMPILATION_UNIT);
// if (cu != null) {
// ISourceReference ref= (type == IVdmElement.COMPILATION_UNIT) ? null :
// (ISourceReference) element;
// // The assumption is that only source elements in compilation unit can have markers
// IAnnotationModel model= isInJavaAnnotationModel(cu);
// int result= 0;
// if (model != null) {
// // open in Java editor: look at annotation model
// result= getErrorTicksFromAnnotationModel(model, ref);
// } else {
// result= getErrorTicksFromMarkers(cu.getResource(), IResource.DEPTH_ONE, ref);
// }
// fCachedRange= null;
// return result;
// }
break;
default:
}
}
// else if (obj instanceof IResource)
// {
// return getErrorTicksFromMarkers((IResource) obj,
// IResource.DEPTH_INFINITE,
// null);
// }
// } catch (CoreException e)
// {
// if (e instanceof VdmModelException)
// {
// if (((VdmModelException) e).isDoesNotExist())
// {
// return 0;
// }
// }
// if (e.getStatus().getCode() == IResourceStatus.MARKER_NOT_FOUND)
// {
// return 0;
// }
//
// VdmUIPlugin.log(e);
// }
return 0;
}
|
class class_name[name] begin[{]
method[computeAdornmentFlags, return_type[type[int]], modifier[protected], parameter[obj]] begin[{]
if[binary_operation[member[.obj], instanceof, type[IVdmElement]]] begin[{]
local_variable[type[IVdmElement], element]
local_variable[type[int], type]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=VDM_MODEL, postfix_operators=[], prefix_operators=[], qualifier=IVdmElement, selectors=[]), MemberReference(member=VDM_PROJECT, postfix_operators=[], prefix_operators=[], qualifier=IVdmElement, selectors=[]), MemberReference(member=COMPILATION_UNIT, postfix_operators=[], prefix_operators=[], qualifier=IVdmElement, selectors=[]), MemberReference(member=TYPE, postfix_operators=[], prefix_operators=[], qualifier=IVdmElement, selectors=[]), MemberReference(member=INITIALIZER, postfix_operators=[], prefix_operators=[], qualifier=IVdmElement, selectors=[]), MemberReference(member=METHOD, postfix_operators=[], prefix_operators=[], qualifier=IVdmElement, selectors=[]), MemberReference(member=FIELD, postfix_operators=[], prefix_operators=[], qualifier=IVdmElement, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
return[literal[0]]
end[}]
END[}]
|
Keyword[protected] Keyword[int] identifier[computeAdornmentFlags] operator[SEP] identifier[Object] identifier[obj] operator[SEP] {
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[IVdmElement] operator[SEP] {
identifier[IVdmElement] identifier[element] operator[=] operator[SEP] identifier[IVdmElement] operator[SEP] identifier[obj] operator[SEP] Keyword[int] identifier[type] operator[=] identifier[element] operator[SEP] identifier[getElementType] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] identifier[IVdmElement] operator[SEP] identifier[VDM_MODEL] operator[:] Keyword[case] identifier[IVdmElement] operator[SEP] identifier[VDM_PROJECT] operator[:] Keyword[case] identifier[IVdmElement] operator[SEP] identifier[COMPILATION_UNIT] operator[:] Keyword[case] identifier[IVdmElement] operator[SEP] identifier[TYPE] operator[:] Keyword[case] identifier[IVdmElement] operator[SEP] identifier[INITIALIZER] operator[:] Keyword[case] identifier[IVdmElement] operator[SEP] identifier[METHOD] operator[:] Keyword[case] identifier[IVdmElement] operator[SEP] identifier[FIELD] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:]
}
}
Keyword[return] Other[0] operator[SEP]
}
|
public UserAgentInfo parse(String useragent) throws IOException {
UserAgentInfo retObj = new UserAgentInfo();
if (useragent == null) {
return retObj;
}
useragent = useragent.trim();
// check that the data maps are up-to-date
checkDataMaps();
// first check if it's a robot
if (!processRobot(useragent, retObj)) {
// search for a browser on the browser regex patterns
boolean osFound = processBrowserRegex(useragent, retObj);
if (!osFound) {
// search the OS regex patterns for the used OS
processOsRegex(useragent, retObj);
}
}
return retObj;
}
|
class class_name[name] begin[{]
method[parse, return_type[type[UserAgentInfo]], modifier[public], parameter[useragent]] begin[{]
local_variable[type[UserAgentInfo], retObj]
if[binary_operation[member[.useragent], ==, literal[null]]] begin[{]
return[member[.retObj]]
else begin[{]
None
end[}]
assign[member[.useragent], call[useragent.trim, parameter[]]]
call[.checkDataMaps, parameter[]]
if[call[.processRobot, parameter[member[.useragent], member[.retObj]]]] begin[{]
local_variable[type[boolean], osFound]
if[member[.osFound]] begin[{]
call[.processOsRegex, parameter[member[.useragent], member[.retObj]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.retObj]]
end[}]
END[}]
|
Keyword[public] identifier[UserAgentInfo] identifier[parse] operator[SEP] identifier[String] identifier[useragent] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[UserAgentInfo] identifier[retObj] operator[=] Keyword[new] identifier[UserAgentInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useragent] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[retObj] operator[SEP]
}
identifier[useragent] operator[=] identifier[useragent] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[checkDataMaps] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[processRobot] operator[SEP] identifier[useragent] , identifier[retObj] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[osFound] operator[=] identifier[processBrowserRegex] operator[SEP] identifier[useragent] , identifier[retObj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[osFound] operator[SEP] {
identifier[processOsRegex] operator[SEP] identifier[useragent] , identifier[retObj] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[retObj] operator[SEP]
}
|
protected void checkHealth(long threshold, NodeHealthChecker healthChecker) {
final int state = this.state;
if (anyAreSet(state, REMOVED | ACTIVE_PING)) {
return;
}
healthCheckPing(threshold, healthChecker);
}
|
class class_name[name] begin[{]
method[checkHealth, return_type[void], modifier[protected], parameter[threshold, healthChecker]] begin[{]
local_variable[type[int], state]
if[call[.anyAreSet, parameter[member[.state], binary_operation[member[.REMOVED], |, member[.ACTIVE_PING]]]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[.healthCheckPing, parameter[member[.threshold], member[.healthChecker]]]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[checkHealth] operator[SEP] Keyword[long] identifier[threshold] , identifier[NodeHealthChecker] identifier[healthChecker] operator[SEP] {
Keyword[final] Keyword[int] identifier[state] operator[=] Keyword[this] operator[SEP] identifier[state] operator[SEP] Keyword[if] operator[SEP] identifier[anyAreSet] operator[SEP] identifier[state] , identifier[REMOVED] operator[|] identifier[ACTIVE_PING] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[healthCheckPing] operator[SEP] identifier[threshold] , identifier[healthChecker] operator[SEP] operator[SEP]
}
|
private Map<String, Map<String, Integer>> getLinkTargetShardNumbers(DBObjectBatch dbObjBatch) {
Map<String, Map<String, Integer>> result = new HashMap<>();
Map<String, Set<String>> tableTargetObjIDMap = getAllLinkTargetObjIDs(dbObjBatch);
for (String targetTableName : tableTargetObjIDMap.keySet()) {
Map<String, Integer> shardNoMap =
getShardNumbers(targetTableName, tableTargetObjIDMap.get(targetTableName));
if (shardNoMap.size() > 0) {
Map<String, Integer> tableShardNoMap = result.get(targetTableName);
if (tableShardNoMap == null) {
tableShardNoMap = new HashMap<>();
result.put(targetTableName, tableShardNoMap);
}
tableShardNoMap.putAll(shardNoMap);
}
}
return result;
}
|
class class_name[name] begin[{]
method[getLinkTargetShardNumbers, return_type[type[Map]], modifier[private], parameter[dbObjBatch]] begin[{]
local_variable[type[Map], result]
local_variable[type[Map], tableTargetObjIDMap]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=targetTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=targetTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tableTargetObjIDMap, selectors=[], type_arguments=None)], member=getShardNumbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=shardNoMap)], 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=Integer, sub_type=None))], dimensions=[], name=Map, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=shardNoMap, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=targetTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=tableShardNoMap)], 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=Integer, sub_type=None))], dimensions=[], name=Map, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tableShardNoMap, 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=tableShardNoMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=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))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=targetTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tableShardNoMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shardNoMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=tableShardNoMap, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=tableTargetObjIDMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=targetTableName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}]
|
Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] operator[>] identifier[getLinkTargetShardNumbers] operator[SEP] identifier[DBObjectBatch] identifier[dbObjBatch] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[tableTargetObjIDMap] operator[=] identifier[getAllLinkTargetObjIDs] operator[SEP] identifier[dbObjBatch] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[targetTableName] operator[:] identifier[tableTargetObjIDMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[shardNoMap] operator[=] identifier[getShardNumbers] operator[SEP] identifier[targetTableName] , identifier[tableTargetObjIDMap] operator[SEP] identifier[get] operator[SEP] identifier[targetTableName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shardNoMap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[tableShardNoMap] operator[=] identifier[result] operator[SEP] identifier[get] operator[SEP] identifier[targetTableName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tableShardNoMap] operator[==] Other[null] operator[SEP] {
identifier[tableShardNoMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[targetTableName] , identifier[tableShardNoMap] operator[SEP] operator[SEP]
}
identifier[tableShardNoMap] operator[SEP] identifier[putAll] operator[SEP] identifier[shardNoMap] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void run() {
long purged_columns;
try {
purged_columns = purgeUIDMeta().joinUninterruptibly();
LOG.info("Thread [" + thread_id + "] finished. Purged [" +
purged_columns + "] UIDMeta columns from storage");
purged_columns = purgeTSMeta().joinUninterruptibly();
LOG.info("Thread [" + thread_id + "] finished. Purged [" +
purged_columns + "] TSMeta columns from storage");
} catch (Exception e) {
LOG.error("Unexpected exception", e);
}
}
|
class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[long], purged_columns]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=purged_columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=purgeUIDMeta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=joinUninterruptibly, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Thread ["), operandr=MemberReference(member=thread_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] finished. Purged ["), operator=+), operandr=MemberReference(member=purged_columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] UIDMeta columns from storage"), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=purged_columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=purgeTSMeta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=joinUninterruptibly, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Thread ["), operandr=MemberReference(member=thread_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] finished. Purged ["), operator=+), operandr=MemberReference(member=purged_columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] TSMeta columns from storage"), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected exception"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[long] identifier[purged_columns] operator[SEP] Keyword[try] {
identifier[purged_columns] operator[=] identifier[purgeUIDMeta] operator[SEP] operator[SEP] operator[SEP] identifier[joinUninterruptibly] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[thread_id] operator[+] literal[String] operator[+] identifier[purged_columns] operator[+] literal[String] operator[SEP] operator[SEP] identifier[purged_columns] operator[=] identifier[purgeTSMeta] operator[SEP] operator[SEP] operator[SEP] identifier[joinUninterruptibly] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[thread_id] operator[+] literal[String] operator[+] identifier[purged_columns] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private CmsWorkplaceEditorConfiguration filterPreferredEditor(String preferredEditor) {
if (m_preferredEditors.size() == 0) {
Iterator<CmsWorkplaceEditorConfiguration> i = m_editorConfigurations.iterator();
while (i.hasNext()) {
CmsWorkplaceEditorConfiguration currentConfig = i.next();
m_preferredEditors.put(currentConfig.getEditorUri(), currentConfig);
}
}
return m_preferredEditors.get(preferredEditor);
}
|
class class_name[name] begin[{]
method[filterPreferredEditor, return_type[type[CmsWorkplaceEditorConfiguration]], modifier[private], parameter[preferredEditor]] begin[{]
if[binary_operation[call[m_preferredEditors.size, parameter[]], ==, literal[0]]] begin[{]
local_variable[type[Iterator], i]
while[call[i.hasNext, parameter[]]] begin[{]
local_variable[type[CmsWorkplaceEditorConfiguration], currentConfig]
call[m_preferredEditors.put, parameter[call[currentConfig.getEditorUri, parameter[]], member[.currentConfig]]]
end[}]
else begin[{]
None
end[}]
return[call[m_preferredEditors.get, parameter[member[.preferredEditor]]]]
end[}]
END[}]
|
Keyword[private] identifier[CmsWorkplaceEditorConfiguration] identifier[filterPreferredEditor] operator[SEP] identifier[String] identifier[preferredEditor] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_preferredEditors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[Iterator] operator[<] identifier[CmsWorkplaceEditorConfiguration] operator[>] identifier[i] operator[=] identifier[m_editorConfigurations] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsWorkplaceEditorConfiguration] identifier[currentConfig] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[m_preferredEditors] operator[SEP] identifier[put] operator[SEP] identifier[currentConfig] operator[SEP] identifier[getEditorUri] operator[SEP] operator[SEP] , identifier[currentConfig] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[m_preferredEditors] operator[SEP] identifier[get] operator[SEP] identifier[preferredEditor] operator[SEP] operator[SEP]
}
|
protected PropertyData removeChildProperty(final String parentIdentifier, final String childIdentifier)
{
final List<PropertyData> childProperties = propertiesCache.get(parentIdentifier);
if (childProperties != null)
{
synchronized (childProperties)
{ // [PN] 17.01.07
for (Iterator<PropertyData> i = childProperties.iterator(); i.hasNext();)
{
PropertyData cn = i.next();
if (cn.getIdentifier().equals(childIdentifier))
{
i.remove();
if (childProperties.size() <= 0)
{
propertiesCache.remove(parentIdentifier);
}
return cn;
}
}
}
}
return null;
}
|
class class_name[name] begin[{]
method[removeChildProperty, return_type[type[PropertyData]], modifier[protected], parameter[parentIdentifier, childIdentifier]] begin[{]
local_variable[type[List], childProperties]
if[binary_operation[member[.childProperties], !=, literal[null]]] begin[{]
SYNCHRONIZED[member[.childProperties]] BEGIN[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), name=cn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyData, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=cn, selectors=[MethodInvocation(arguments=[MemberReference(member=childIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=childProperties, 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=parentIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=propertiesCache, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=cn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=childProperties, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PropertyData, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
END[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[protected] identifier[PropertyData] identifier[removeChildProperty] operator[SEP] Keyword[final] identifier[String] identifier[parentIdentifier] , Keyword[final] identifier[String] identifier[childIdentifier] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[PropertyData] operator[>] identifier[childProperties] operator[=] identifier[propertiesCache] operator[SEP] identifier[get] operator[SEP] identifier[parentIdentifier] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childProperties] operator[!=] Other[null] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[childProperties] operator[SEP] {
Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[PropertyData] operator[>] identifier[i] operator[=] identifier[childProperties] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[PropertyData] identifier[cn] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cn] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[childIdentifier] operator[SEP] operator[SEP] {
identifier[i] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childProperties] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] {
identifier[propertiesCache] operator[SEP] identifier[remove] operator[SEP] identifier[parentIdentifier] operator[SEP] operator[SEP]
}
Keyword[return] identifier[cn] operator[SEP]
}
}
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static Duration from(TemporalAmount amount) {
Jdk8Methods.requireNonNull(amount, "amount");
Duration duration = ZERO;
for (TemporalUnit unit : amount.getUnits()) {
duration = duration.plus(amount.get(unit), unit);
}
return duration;
}
|
class class_name[name] begin[{]
method[from, return_type[type[Duration]], modifier[public static], parameter[amount]] begin[{]
call[Jdk8Methods.requireNonNull, parameter[member[.amount], literal["amount"]]]
local_variable[type[Duration], duration]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=duration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=amount, selectors=[], type_arguments=None), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=plus, postfix_operators=[], prefix_operators=[], qualifier=duration, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getUnits, postfix_operators=[], prefix_operators=[], qualifier=amount, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=unit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TemporalUnit, sub_type=None))), label=None)
return[member[.duration]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Duration] identifier[from] operator[SEP] identifier[TemporalAmount] identifier[amount] operator[SEP] {
identifier[Jdk8Methods] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[amount] , literal[String] operator[SEP] operator[SEP] identifier[Duration] identifier[duration] operator[=] identifier[ZERO] operator[SEP] Keyword[for] operator[SEP] identifier[TemporalUnit] identifier[unit] operator[:] identifier[amount] operator[SEP] identifier[getUnits] operator[SEP] operator[SEP] operator[SEP] {
identifier[duration] operator[=] identifier[duration] operator[SEP] identifier[plus] operator[SEP] identifier[amount] operator[SEP] identifier[get] operator[SEP] identifier[unit] operator[SEP] , identifier[unit] operator[SEP] operator[SEP]
}
Keyword[return] identifier[duration] operator[SEP]
}
|
@Override
public void propagate(int evtmask) throws ContradictionException {
for (int i = 0; i < n; i++) {
g.enforceNode(i, this);
if (succs[i].isInstantiated()) {
g.enforceArc(i, succs[i].getValue(), this);
}
ISet tmp = g.getPotSuccOrNeighOf(i);
for (int j : tmp) {
if (!succs[i].contains(j) && (dir || !succs[j].contains(i))) {
g.removeArc(i, j, this);
}
}
}
for (int i = 0; i < n; i++) {
idm[i].unfreeze();
}
}
|
class class_name[name] begin[{]
method[propagate, return_type[void], modifier[public], parameter[evtmask]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=enforceNode, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=succs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=isInstantiated, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=succs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=enforceArc, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPotSuccOrNeighOf, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), name=tmp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ISet, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=succs, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=BinaryOperation(operandl=MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=succs, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=removeArc, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=idm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=unfreeze, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[propagate] operator[SEP] Keyword[int] identifier[evtmask] operator[SEP] Keyword[throws] identifier[ContradictionException] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[g] operator[SEP] identifier[enforceNode] operator[SEP] identifier[i] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[succs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isInstantiated] operator[SEP] operator[SEP] operator[SEP] {
identifier[g] operator[SEP] identifier[enforceArc] operator[SEP] identifier[i] , identifier[succs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] operator[SEP]
}
identifier[ISet] identifier[tmp] operator[=] identifier[g] operator[SEP] identifier[getPotSuccOrNeighOf] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[:] identifier[tmp] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[succs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[j] operator[SEP] operator[&&] operator[SEP] identifier[dir] operator[||] operator[!] identifier[succs] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] {
identifier[g] operator[SEP] identifier[removeArc] operator[SEP] identifier[i] , identifier[j] , Keyword[this] operator[SEP] operator[SEP]
}
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[idm] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[unfreeze] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private Icons getIcons(long featureId, StyleMappingDao mappingDao) {
Icons icons = null;
if (mappingDao != null) {
IconDao iconDao = getIconDao();
if (iconDao != null) {
List<StyleMappingRow> styleMappingRows = mappingDao
.queryByBaseFeatureId(featureId);
if (!styleMappingRows.isEmpty()) {
for (StyleMappingRow styleMappingRow : styleMappingRows) {
IconRow iconRow = iconDao.queryForRow(styleMappingRow);
if (iconRow != null) {
if (icons == null) {
icons = new Icons();
}
icons.setIcon(iconRow,
styleMappingRow.getGeometryType());
}
}
}
}
}
return icons;
}
|
class class_name[name] begin[{]
method[getIcons, return_type[type[Icons]], modifier[private], parameter[featureId, mappingDao]] begin[{]
local_variable[type[Icons], icons]
if[binary_operation[member[.mappingDao], !=, literal[null]]] begin[{]
local_variable[type[IconDao], iconDao]
if[binary_operation[member[.iconDao], !=, literal[null]]] begin[{]
local_variable[type[List], styleMappingRows]
if[call[styleMappingRows.isEmpty, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=styleMappingRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=queryForRow, postfix_operators=[], prefix_operators=[], qualifier=iconDao, selectors=[], type_arguments=None), name=iconRow)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IconRow, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=iconRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=icons, 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=icons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Icons, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iconRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getGeometryType, postfix_operators=[], prefix_operators=[], qualifier=styleMappingRow, selectors=[], type_arguments=None)], member=setIcon, postfix_operators=[], prefix_operators=[], qualifier=icons, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=styleMappingRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=styleMappingRow)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StyleMappingRow, sub_type=None))), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.icons]]
end[}]
END[}]
|
Keyword[private] identifier[Icons] identifier[getIcons] operator[SEP] Keyword[long] identifier[featureId] , identifier[StyleMappingDao] identifier[mappingDao] operator[SEP] {
identifier[Icons] identifier[icons] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[mappingDao] operator[!=] Other[null] operator[SEP] {
identifier[IconDao] identifier[iconDao] operator[=] identifier[getIconDao] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iconDao] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] identifier[StyleMappingRow] operator[>] identifier[styleMappingRows] operator[=] identifier[mappingDao] operator[SEP] identifier[queryByBaseFeatureId] operator[SEP] identifier[featureId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[styleMappingRows] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[StyleMappingRow] identifier[styleMappingRow] operator[:] identifier[styleMappingRows] operator[SEP] {
identifier[IconRow] identifier[iconRow] operator[=] identifier[iconDao] operator[SEP] identifier[queryForRow] operator[SEP] identifier[styleMappingRow] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iconRow] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[icons] operator[==] Other[null] operator[SEP] {
identifier[icons] operator[=] Keyword[new] identifier[Icons] operator[SEP] operator[SEP] operator[SEP]
}
identifier[icons] operator[SEP] identifier[setIcon] operator[SEP] identifier[iconRow] , identifier[styleMappingRow] operator[SEP] identifier[getGeometryType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
}
Keyword[return] identifier[icons] operator[SEP]
}
|
public Order resume(String orderId) {
HistoryOrder historyOrder = access().getHistOrder(orderId);
Order order = historyOrder.undo();
access().saveOrder(order);
historyOrder.setOrderState(STATE_ACTIVE);
access().updateHistory(historyOrder);
SnakerEngine engine = ServiceContext.getEngine();
List<HistoryTask> histTasks = access().getHistoryTasks(null,
new QueryFilter().setOrderId(orderId));
if(histTasks != null && !histTasks.isEmpty()) {
HistoryTask histTask = histTasks.get(0);
engine.task().resume(histTask.getId(), histTask.getOperator());
}
return order;
}
|
class class_name[name] begin[{]
method[resume, return_type[type[Order]], modifier[public], parameter[orderId]] begin[{]
local_variable[type[HistoryOrder], historyOrder]
local_variable[type[Order], order]
call[.access, parameter[]]
call[historyOrder.setOrderState, parameter[member[.STATE_ACTIVE]]]
call[.access, parameter[]]
local_variable[type[SnakerEngine], engine]
local_variable[type[List], histTasks]
if[binary_operation[binary_operation[member[.histTasks], !=, literal[null]], &&, call[histTasks.isEmpty, parameter[]]]] begin[{]
local_variable[type[HistoryTask], histTask]
call[engine.task, parameter[]]
else begin[{]
None
end[}]
return[member[.order]]
end[}]
END[}]
|
Keyword[public] identifier[Order] identifier[resume] operator[SEP] identifier[String] identifier[orderId] operator[SEP] {
identifier[HistoryOrder] identifier[historyOrder] operator[=] identifier[access] operator[SEP] operator[SEP] operator[SEP] identifier[getHistOrder] operator[SEP] identifier[orderId] operator[SEP] operator[SEP] identifier[Order] identifier[order] operator[=] identifier[historyOrder] operator[SEP] identifier[undo] operator[SEP] operator[SEP] operator[SEP] identifier[access] operator[SEP] operator[SEP] operator[SEP] identifier[saveOrder] operator[SEP] identifier[order] operator[SEP] operator[SEP] identifier[historyOrder] operator[SEP] identifier[setOrderState] operator[SEP] identifier[STATE_ACTIVE] operator[SEP] operator[SEP] identifier[access] operator[SEP] operator[SEP] operator[SEP] identifier[updateHistory] operator[SEP] identifier[historyOrder] operator[SEP] operator[SEP] identifier[SnakerEngine] identifier[engine] operator[=] identifier[ServiceContext] operator[SEP] identifier[getEngine] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[HistoryTask] operator[>] identifier[histTasks] operator[=] identifier[access] operator[SEP] operator[SEP] operator[SEP] identifier[getHistoryTasks] operator[SEP] Other[null] , Keyword[new] identifier[QueryFilter] operator[SEP] operator[SEP] operator[SEP] identifier[setOrderId] operator[SEP] identifier[orderId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[histTasks] operator[!=] Other[null] operator[&&] operator[!] identifier[histTasks] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[HistoryTask] identifier[histTask] operator[=] identifier[histTasks] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[engine] operator[SEP] identifier[task] operator[SEP] operator[SEP] operator[SEP] identifier[resume] operator[SEP] identifier[histTask] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[histTask] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[order] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "divide")
public JAXBElement<ArithType> createDivide(ArithType value) {
return new JAXBElement<ArithType>(_Divide_QNAME, ArithType.class, null, value);
}
|
class class_name[name] begin[{]
method[createDivide, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_Divide_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArithType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ArithType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[ArithType] operator[>] identifier[createDivide] operator[SEP] identifier[ArithType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[ArithType] operator[>] operator[SEP] identifier[_Divide_QNAME] , identifier[ArithType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
public List<FieldValuesView> getItemValues(int itemId) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/value/").get(
new GenericType<List<FieldValuesView>>() {
});
}
|
class class_name[name] begin[{]
method[getItemValues, return_type[type[List]], modifier[public], parameter[itemId]] begin[{]
return[call[.getResourceFactory, parameter[]]]
end[}]
END[}]
|
Keyword[public] identifier[List] operator[<] identifier[FieldValuesView] operator[>] identifier[getItemValues] operator[SEP] Keyword[int] identifier[itemId] operator[SEP] {
Keyword[return] identifier[getResourceFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getApiResource] operator[SEP] literal[String] operator[+] identifier[itemId] operator[+] literal[String] operator[SEP] operator[SEP] identifier[get] operator[SEP] Keyword[new] identifier[GenericType] operator[<] identifier[List] operator[<] identifier[FieldValuesView] operator[>] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] operator[SEP]
}
|
@BetaApi
public final Operation attachNetworkEndpointsNetworkEndpointGroup(
ProjectZoneNetworkEndpointGroupName networkEndpointGroup,
NetworkEndpointGroupsAttachEndpointsRequest
networkEndpointGroupsAttachEndpointsRequestResource) {
AttachNetworkEndpointsNetworkEndpointGroupHttpRequest request =
AttachNetworkEndpointsNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(
networkEndpointGroup == null ? null : networkEndpointGroup.toString())
.setNetworkEndpointGroupsAttachEndpointsRequestResource(
networkEndpointGroupsAttachEndpointsRequestResource)
.build();
return attachNetworkEndpointsNetworkEndpointGroup(request);
}
|
class class_name[name] begin[{]
method[attachNetworkEndpointsNetworkEndpointGroup, return_type[type[Operation]], modifier[final public], parameter[networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource]] begin[{]
local_variable[type[AttachNetworkEndpointsNetworkEndpointGroupHttpRequest], request]
return[call[.attachNetworkEndpointsNetworkEndpointGroup, parameter[member[.request]]]]
end[}]
END[}]
|
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[attachNetworkEndpointsNetworkEndpointGroup] operator[SEP] identifier[ProjectZoneNetworkEndpointGroupName] identifier[networkEndpointGroup] , identifier[NetworkEndpointGroupsAttachEndpointsRequest] identifier[networkEndpointGroupsAttachEndpointsRequestResource] operator[SEP] {
identifier[AttachNetworkEndpointsNetworkEndpointGroupHttpRequest] identifier[request] operator[=] identifier[AttachNetworkEndpointsNetworkEndpointGroupHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setNetworkEndpointGroup] operator[SEP] identifier[networkEndpointGroup] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[networkEndpointGroup] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setNetworkEndpointGroupsAttachEndpointsRequestResource] operator[SEP] identifier[networkEndpointGroupsAttachEndpointsRequestResource] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attachNetworkEndpointsNetworkEndpointGroup] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static void write2File(final String inputFile, final Writer writer)
throws FileNotFoundException, IOException
{
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(inputFile));)
{
write2File(bufferedReader, writer);
}
}
|
class class_name[name] begin[{]
method[write2File, return_type[void], modifier[public static], parameter[inputFile, writer]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bufferedReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write2File, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=bufferedReader, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=inputFile, 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=FileReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)))])
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[write2File] operator[SEP] Keyword[final] identifier[String] identifier[inputFile] , Keyword[final] identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[FileNotFoundException] , identifier[IOException] {
Keyword[try] operator[SEP] identifier[BufferedReader] identifier[bufferedReader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[FileReader] operator[SEP] identifier[inputFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[write2File] operator[SEP] identifier[bufferedReader] , identifier[writer] operator[SEP] operator[SEP]
}
}
|
public ListDocumentsResponse listDocuments() {
ListDocumentsRequest request = new ListDocumentsRequest();
InternalRequest internalRequest = this.createRequest(HttpMethodName.GET, request, DOC);
ListDocumentsResponse response;
try {
response = this.invokeHttpClient(internalRequest, ListDocumentsResponse.class);
} finally {
try {
internalRequest.getContent().close();
} catch (Exception e) {
// ignore exception
}
}
return response;
}
|
class class_name[name] begin[{]
method[listDocuments, return_type[type[ListDocumentsResponse]], modifier[public], parameter[]] begin[{]
local_variable[type[ListDocumentsRequest], request]
local_variable[type[InternalRequest], internalRequest]
local_variable[type[ListDocumentsResponse], response]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=internalRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ListDocumentsResponse, sub_type=None))], member=invokeHttpClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)], catches=None, finally_block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getContent, postfix_operators=[], prefix_operators=[], qualifier=internalRequest, selectors=[MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)], label=None, resources=None)
return[member[.response]]
end[}]
END[}]
|
Keyword[public] identifier[ListDocumentsResponse] identifier[listDocuments] operator[SEP] operator[SEP] {
identifier[ListDocumentsRequest] identifier[request] operator[=] Keyword[new] identifier[ListDocumentsRequest] operator[SEP] operator[SEP] operator[SEP] identifier[InternalRequest] identifier[internalRequest] operator[=] Keyword[this] operator[SEP] identifier[createRequest] operator[SEP] identifier[HttpMethodName] operator[SEP] identifier[GET] , identifier[request] , identifier[DOC] operator[SEP] operator[SEP] identifier[ListDocumentsResponse] identifier[response] operator[SEP] Keyword[try] {
identifier[response] operator[=] Keyword[this] operator[SEP] identifier[invokeHttpClient] operator[SEP] identifier[internalRequest] , identifier[ListDocumentsResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
identifier[internalRequest] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
}
}
Keyword[return] identifier[response] operator[SEP]
}
|
private synchronized void open() throws DatabaseException {
try {
if (!isOpen()) {
connection = connectionFactory.getConnection();
final String databaseProductName = determineDatabaseProductName(this.connection);
statementBundle = databaseProductName != null
? ResourceBundle.getBundle("data/dbStatements", new Locale(databaseProductName))
: ResourceBundle.getBundle("data/dbStatements");
prepareStatements();
databaseProperties = new DatabaseProperties(this);
}
} catch (DatabaseException e) {
releaseResources();
throw e;
}
}
|
class class_name[name] begin[{]
method[open, return_type[void], modifier[synchronized private], parameter[]] begin[{]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isOpen, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=connectionFactory, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=connection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=determineDatabaseProductName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=databaseProductName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=statementBundle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=databaseProductName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data/dbStatements")], member=getBundle, postfix_operators=[], prefix_operators=[], qualifier=ResourceBundle, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data/dbStatements"), ClassCreator(arguments=[MemberReference(member=databaseProductName, 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=Locale, sub_type=None))], member=getBundle, postfix_operators=[], prefix_operators=[], qualifier=ResourceBundle, selectors=[], type_arguments=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=prepareStatements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=databaseProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseProperties, sub_type=None))), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=releaseResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DatabaseException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[private] Keyword[synchronized] Keyword[void] identifier[open] operator[SEP] operator[SEP] Keyword[throws] identifier[DatabaseException] {
Keyword[try] {
Keyword[if] operator[SEP] operator[!] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] {
identifier[connection] operator[=] identifier[connectionFactory] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[databaseProductName] operator[=] identifier[determineDatabaseProductName] operator[SEP] Keyword[this] operator[SEP] identifier[connection] operator[SEP] operator[SEP] identifier[statementBundle] operator[=] identifier[databaseProductName] operator[!=] Other[null] operator[?] identifier[ResourceBundle] operator[SEP] identifier[getBundle] operator[SEP] literal[String] , Keyword[new] identifier[Locale] operator[SEP] identifier[databaseProductName] operator[SEP] operator[SEP] operator[:] identifier[ResourceBundle] operator[SEP] identifier[getBundle] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[prepareStatements] operator[SEP] operator[SEP] operator[SEP] identifier[databaseProperties] operator[=] Keyword[new] identifier[DatabaseProperties] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[DatabaseException] identifier[e] operator[SEP] {
identifier[releaseResources] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.