code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public ProcessInstance readProcessInstance(MarshallerReaderContext context) throws IOException {
InternalKnowledgeBase ruleBase = context.kBase;
InternalWorkingMemory wm = context.wm;
JBPMMessages.ProcessInstance _instance = (org.jbpm.marshalling.impl.JBPMMessages.ProcessInstance) context.parameterObject;
if( _instance == null ) {
// try to parse from the stream
ExtensionRegistry registry = PersisterHelper.buildRegistry( context, null );
Header _header;
try {
_header = PersisterHelper.readFromStreamWithHeaderPreloaded(context, registry);
} catch ( ClassNotFoundException e ) {
// Java 5 does not accept [new IOException(String, Throwable)]
IOException ioe = new IOException( "Error deserializing process instance." );
ioe.initCause(e);
throw ioe;
}
_instance = JBPMMessages.ProcessInstance.parseFrom( _header.getPayload(), registry );
}
WorkflowProcessInstanceImpl processInstance = createProcessInstance();
processInstance.setId( _instance.getId() );
String processId = _instance.getProcessId();
processInstance.setProcessId( processId );
String processXml = _instance.getProcessXml();
Process process = null;
if (processXml != null && processXml.trim().length() > 0) {
processInstance.setProcessXml( processXml );
process = processInstance.getProcess();
} else {
process = ruleBase.getProcess( processId );
if (process == null) {
throw new RuntimeException("Could not find process " + processId + " when restoring process instance " + processInstance.getId());
}
processInstance.setProcess( process );
}
processInstance.setDescription(_instance.getDescription());
processInstance.setState( _instance.getState() );
processInstance.setParentProcessInstanceId(_instance.getParentProcessInstanceId());
processInstance.setSignalCompletion(_instance.getSignalCompletion());
processInstance.setDeploymentId(_instance.getDeploymentId());
processInstance.setCorrelationKey(_instance.getCorrelationKey());
processInstance.internalSetSlaCompliance(_instance.getSlaCompliance());
if (_instance.getSlaDueDate() > 0) {
processInstance.internalSetSlaDueDate(new Date(_instance.getSlaDueDate()));
}
processInstance.internalSetSlaTimerId(_instance.getSlaTimerId());
long nodeInstanceCounter = _instance.getNodeInstanceCounter();
processInstance.setKnowledgeRuntime( wm.getKnowledgeRuntime() );
processInstance.internalSetNodeInstanceCounter( nodeInstanceCounter );
for( String completedNodeId : _instance.getCompletedNodeIdsList() ) {
processInstance.addCompletedNodeId(completedNodeId);
}
if ( _instance.getSwimlaneContextCount() > 0 ) {
Context swimlaneContext = ((org.jbpm.process.core.Process) process).getDefaultContext( SwimlaneContext.SWIMLANE_SCOPE );
SwimlaneContextInstance swimlaneContextInstance = (SwimlaneContextInstance) processInstance.getContextInstance( swimlaneContext );
for ( JBPMMessages.ProcessInstance.SwimlaneContextInstance _swimlane : _instance.getSwimlaneContextList() ) {
swimlaneContextInstance.setActorId( _swimlane.getSwimlane(), _swimlane.getActorId() );
}
}
for ( JBPMMessages.ProcessInstance.NodeInstance _node : _instance.getNodeInstanceList() ) {
context.parameterObject = _node;
readNodeInstance( context,
processInstance,
processInstance );
}
for ( JBPMMessages.ProcessInstance.ExclusiveGroupInstance _excl : _instance.getExclusiveGroupList() ) {
ExclusiveGroupInstance exclusiveGroupInstance = new ExclusiveGroupInstance();
processInstance.addContextInstance( ExclusiveGroup.EXCLUSIVE_GROUP, exclusiveGroupInstance );
for ( Long nodeInstanceId : _excl.getGroupNodeInstanceIdList() ) {
NodeInstance nodeInstance = ((org.jbpm.workflow.instance.NodeInstanceContainer)processInstance).getNodeInstance( nodeInstanceId, true );
if ( nodeInstance == null ) {
throw new IllegalArgumentException( "Could not find node instance when deserializing exclusive group instance: " + nodeInstanceId );
}
exclusiveGroupInstance.addNodeInstance( nodeInstance );
}
}
if ( _instance.getVariableCount() > 0 ) {
Context variableScope = ((org.jbpm.process.core.Process) process)
.getDefaultContext( VariableScope.VARIABLE_SCOPE );
VariableScopeInstance variableScopeInstance = (VariableScopeInstance) processInstance
.getContextInstance( variableScope );
for ( JBPMMessages.Variable _variable : _instance.getVariableList() ) {
try {
Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable );
variableScopeInstance.internalSetVariable( _variable.getName(),
_value );
} catch ( ClassNotFoundException e ) {
throw new IllegalArgumentException( "Could not reload variable " + _variable.getName() );
}
}
}
if ( _instance.getIterationLevelsCount() > 0 ) {
for ( JBPMMessages.IterationLevel _level : _instance.getIterationLevelsList()) {
processInstance.getIterationLevels().put(_level.getId(), _level.getLevel());
}
}
processInstance.reconnect();
return processInstance;
} | class class_name[name] begin[{]
method[readProcessInstance, return_type[type[ProcessInstance]], modifier[public], parameter[context]] begin[{]
local_variable[type[InternalKnowledgeBase], ruleBase]
local_variable[type[InternalWorkingMemory], wm]
local_variable[type[JBPMMessages], _instance]
if[binary_operation[member[._instance], ==, literal[null]]] begin[{]
local_variable[type[ExtensionRegistry], registry]
local_variable[type[Header], _header]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFromStreamWithHeaderPreloaded, postfix_operators=[], prefix_operators=[], qualifier=PersisterHelper, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error deserializing process instance.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), name=ioe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=ioe, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)
assign[member[._instance], call[JBPMMessages.ProcessInstance.parseFrom, parameter[call[_header.getPayload, parameter[]], member[.registry]]]]
else begin[{]
None
end[}]
local_variable[type[WorkflowProcessInstanceImpl], processInstance]
call[processInstance.setId, parameter[call[_instance.getId, parameter[]]]]
local_variable[type[String], processId]
call[processInstance.setProcessId, parameter[member[.processId]]]
local_variable[type[String], processXml]
local_variable[type[Process], process]
if[binary_operation[binary_operation[member[.processXml], !=, literal[null]], &&, binary_operation[call[processXml.trim, parameter[]], >, literal[0]]]] begin[{]
call[processInstance.setProcessXml, parameter[member[.processXml]]]
assign[member[.process], call[processInstance.getProcess, parameter[]]]
else begin[{]
assign[member[.process], call[ruleBase.getProcess, parameter[member[.processId]]]]
if[binary_operation[member[.process], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not find process "), operandr=MemberReference(member=processId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" when restoring process instance "), operator=+), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=processInstance, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[processInstance.setProcess, parameter[member[.process]]]
end[}]
call[processInstance.setDescription, parameter[call[_instance.getDescription, parameter[]]]]
call[processInstance.setState, parameter[call[_instance.getState, parameter[]]]]
call[processInstance.setParentProcessInstanceId, parameter[call[_instance.getParentProcessInstanceId, parameter[]]]]
call[processInstance.setSignalCompletion, parameter[call[_instance.getSignalCompletion, parameter[]]]]
call[processInstance.setDeploymentId, parameter[call[_instance.getDeploymentId, parameter[]]]]
call[processInstance.setCorrelationKey, parameter[call[_instance.getCorrelationKey, parameter[]]]]
call[processInstance.internalSetSlaCompliance, parameter[call[_instance.getSlaCompliance, parameter[]]]]
if[binary_operation[call[_instance.getSlaDueDate, parameter[]], >, literal[0]]] begin[{]
call[processInstance.internalSetSlaDueDate, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getSlaDueDate, postfix_operators=[], prefix_operators=[], qualifier=_instance, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
else begin[{]
None
end[}]
call[processInstance.internalSetSlaTimerId, parameter[call[_instance.getSlaTimerId, parameter[]]]]
local_variable[type[long], nodeInstanceCounter]
call[processInstance.setKnowledgeRuntime, parameter[call[wm.getKnowledgeRuntime, parameter[]]]]
call[processInstance.internalSetNodeInstanceCounter, parameter[member[.nodeInstanceCounter]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=completedNodeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addCompletedNodeId, postfix_operators=[], prefix_operators=[], qualifier=processInstance, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCompletedNodeIdsList, postfix_operators=[], prefix_operators=[], qualifier=_instance, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=completedNodeId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
if[binary_operation[call[_instance.getSwimlaneContextCount, parameter[]], >, literal[0]]] begin[{]
local_variable[type[Context], swimlaneContext]
local_variable[type[SwimlaneContextInstance], swimlaneContextInstance]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSwimlane, postfix_operators=[], prefix_operators=[], qualifier=_swimlane, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getActorId, postfix_operators=[], prefix_operators=[], qualifier=_swimlane, selectors=[], type_arguments=None)], member=setActorId, postfix_operators=[], prefix_operators=[], qualifier=swimlaneContextInstance, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSwimlaneContextList, postfix_operators=[], prefix_operators=[], qualifier=_instance, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=_swimlane)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JBPMMessages, sub_type=ReferenceType(arguments=None, dimensions=None, name=ProcessInstance, sub_type=ReferenceType(arguments=None, dimensions=None, name=SwimlaneContextInstance, sub_type=None))))), label=None)
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parameterObject, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[]), type==, value=MemberReference(member=_node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=processInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=processInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readNodeInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getNodeInstanceList, postfix_operators=[], prefix_operators=[], qualifier=_instance, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=_node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JBPMMessages, sub_type=ReferenceType(arguments=None, dimensions=None, name=ProcessInstance, sub_type=ReferenceType(arguments=None, dimensions=None, name=NodeInstance, sub_type=None))))), label=None)
ForStatement(body=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=ExclusiveGroupInstance, sub_type=None)), name=exclusiveGroupInstance)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExclusiveGroupInstance, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EXCLUSIVE_GROUP, postfix_operators=[], prefix_operators=[], qualifier=ExclusiveGroup, selectors=[]), MemberReference(member=exclusiveGroupInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addContextInstance, postfix_operators=[], prefix_operators=[], qualifier=processInstance, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=processInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=jbpm, sub_type=ReferenceType(arguments=None, dimensions=None, name=workflow, sub_type=ReferenceType(arguments=None, dimensions=None, name=instance, sub_type=ReferenceType(arguments=None, dimensions=None, name=NodeInstanceContainer, sub_type=None)))))), name=nodeInstance)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeInstance, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nodeInstance, 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="Could not find node instance when deserializing exclusive group instance: "), operandr=MemberReference(member=nodeInstanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addNodeInstance, postfix_operators=[], prefix_operators=[], qualifier=exclusiveGroupInstance, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getGroupNodeInstanceIdList, postfix_operators=[], prefix_operators=[], qualifier=_excl, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nodeInstanceId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getExclusiveGroupList, postfix_operators=[], prefix_operators=[], qualifier=_instance, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=_excl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JBPMMessages, sub_type=ReferenceType(arguments=None, dimensions=None, name=ProcessInstance, sub_type=ReferenceType(arguments=None, dimensions=None, name=ExclusiveGroupInstance, sub_type=None))))), label=None)
if[binary_operation[call[_instance.getVariableCount, parameter[]], >, literal[0]]] begin[{]
local_variable[type[Context], variableScope]
local_variable[type[VariableScopeInstance], variableScopeInstance]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_variable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmarshallVariableValue, postfix_operators=[], prefix_operators=[], qualifier=ProtobufProcessMarshaller, selectors=[], type_arguments=None), name=_value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=_variable, selectors=[], type_arguments=None), MemberReference(member=_value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=internalSetVariable, postfix_operators=[], prefix_operators=[], qualifier=variableScopeInstance, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not reload variable "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=_variable, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getVariableList, postfix_operators=[], prefix_operators=[], qualifier=_instance, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=_variable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JBPMMessages, sub_type=ReferenceType(arguments=None, dimensions=None, name=Variable, sub_type=None)))), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[_instance.getIterationLevelsCount, parameter[]], >, literal[0]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getIterationLevels, postfix_operators=[], prefix_operators=[], qualifier=processInstance, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=_level, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLevel, postfix_operators=[], prefix_operators=[], qualifier=_level, selectors=[], type_arguments=None)], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getIterationLevelsList, postfix_operators=[], prefix_operators=[], qualifier=_instance, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=_level)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JBPMMessages, sub_type=ReferenceType(arguments=None, dimensions=None, name=IterationLevel, sub_type=None)))), label=None)
else begin[{]
None
end[}]
call[processInstance.reconnect, parameter[]]
return[member[.processInstance]]
end[}]
END[}] | Keyword[public] identifier[ProcessInstance] identifier[readProcessInstance] operator[SEP] identifier[MarshallerReaderContext] identifier[context] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[InternalKnowledgeBase] identifier[ruleBase] operator[=] identifier[context] operator[SEP] identifier[kBase] operator[SEP] identifier[InternalWorkingMemory] identifier[wm] operator[=] identifier[context] operator[SEP] identifier[wm] operator[SEP] identifier[JBPMMessages] operator[SEP] identifier[ProcessInstance] identifier[_instance] operator[=] operator[SEP] identifier[org] operator[SEP] identifier[jbpm] operator[SEP] identifier[marshalling] operator[SEP] identifier[impl] operator[SEP] identifier[JBPMMessages] operator[SEP] identifier[ProcessInstance] operator[SEP] identifier[context] operator[SEP] identifier[parameterObject] operator[SEP] Keyword[if] operator[SEP] identifier[_instance] operator[==] Other[null] operator[SEP] {
identifier[ExtensionRegistry] identifier[registry] operator[=] identifier[PersisterHelper] operator[SEP] identifier[buildRegistry] operator[SEP] identifier[context] , Other[null] operator[SEP] operator[SEP] identifier[Header] identifier[_header] operator[SEP] Keyword[try] {
identifier[_header] operator[=] identifier[PersisterHelper] operator[SEP] identifier[readFromStreamWithHeaderPreloaded] operator[SEP] identifier[context] , identifier[registry] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
identifier[IOException] identifier[ioe] operator[=] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ioe] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[ioe] operator[SEP]
}
identifier[_instance] operator[=] identifier[JBPMMessages] operator[SEP] identifier[ProcessInstance] operator[SEP] identifier[parseFrom] operator[SEP] identifier[_header] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] , identifier[registry] operator[SEP] operator[SEP]
}
identifier[WorkflowProcessInstanceImpl] identifier[processInstance] operator[=] identifier[createProcessInstance] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setId] operator[SEP] identifier[_instance] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[processId] operator[=] identifier[_instance] operator[SEP] identifier[getProcessId] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setProcessId] operator[SEP] identifier[processId] operator[SEP] operator[SEP] identifier[String] identifier[processXml] operator[=] identifier[_instance] operator[SEP] identifier[getProcessXml] operator[SEP] operator[SEP] operator[SEP] identifier[Process] identifier[process] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[processXml] operator[!=] Other[null] operator[&&] identifier[processXml] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[processInstance] operator[SEP] identifier[setProcessXml] operator[SEP] identifier[processXml] operator[SEP] operator[SEP] identifier[process] operator[=] identifier[processInstance] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[process] operator[=] identifier[ruleBase] operator[SEP] identifier[getProcess] operator[SEP] identifier[processId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[process] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[processId] operator[+] literal[String] operator[+] identifier[processInstance] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[processInstance] operator[SEP] identifier[setProcess] operator[SEP] identifier[process] operator[SEP] operator[SEP]
}
identifier[processInstance] operator[SEP] identifier[setDescription] operator[SEP] identifier[_instance] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setState] operator[SEP] identifier[_instance] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setParentProcessInstanceId] operator[SEP] identifier[_instance] operator[SEP] identifier[getParentProcessInstanceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setSignalCompletion] operator[SEP] identifier[_instance] operator[SEP] identifier[getSignalCompletion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setDeploymentId] operator[SEP] identifier[_instance] operator[SEP] identifier[getDeploymentId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setCorrelationKey] operator[SEP] identifier[_instance] operator[SEP] identifier[getCorrelationKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[internalSetSlaCompliance] operator[SEP] identifier[_instance] operator[SEP] identifier[getSlaCompliance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_instance] operator[SEP] identifier[getSlaDueDate] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[processInstance] operator[SEP] identifier[internalSetSlaDueDate] operator[SEP] Keyword[new] identifier[Date] operator[SEP] identifier[_instance] operator[SEP] identifier[getSlaDueDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[processInstance] operator[SEP] identifier[internalSetSlaTimerId] operator[SEP] identifier[_instance] operator[SEP] identifier[getSlaTimerId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[nodeInstanceCounter] operator[=] identifier[_instance] operator[SEP] identifier[getNodeInstanceCounter] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[setKnowledgeRuntime] operator[SEP] identifier[wm] operator[SEP] identifier[getKnowledgeRuntime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[internalSetNodeInstanceCounter] operator[SEP] identifier[nodeInstanceCounter] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[completedNodeId] operator[:] identifier[_instance] operator[SEP] identifier[getCompletedNodeIdsList] operator[SEP] operator[SEP] operator[SEP] {
identifier[processInstance] operator[SEP] identifier[addCompletedNodeId] operator[SEP] identifier[completedNodeId] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_instance] operator[SEP] identifier[getSwimlaneContextCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[Context] identifier[swimlaneContext] operator[=] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[jbpm] operator[SEP] identifier[process] operator[SEP] identifier[core] operator[SEP] identifier[Process] operator[SEP] identifier[process] operator[SEP] operator[SEP] identifier[getDefaultContext] operator[SEP] identifier[SwimlaneContext] operator[SEP] identifier[SWIMLANE_SCOPE] operator[SEP] operator[SEP] identifier[SwimlaneContextInstance] identifier[swimlaneContextInstance] operator[=] operator[SEP] identifier[SwimlaneContextInstance] operator[SEP] identifier[processInstance] operator[SEP] identifier[getContextInstance] operator[SEP] identifier[swimlaneContext] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[JBPMMessages] operator[SEP] identifier[ProcessInstance] operator[SEP] identifier[SwimlaneContextInstance] identifier[_swimlane] operator[:] identifier[_instance] operator[SEP] identifier[getSwimlaneContextList] operator[SEP] operator[SEP] operator[SEP] {
identifier[swimlaneContextInstance] operator[SEP] identifier[setActorId] operator[SEP] identifier[_swimlane] operator[SEP] identifier[getSwimlane] operator[SEP] operator[SEP] , identifier[_swimlane] operator[SEP] identifier[getActorId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[JBPMMessages] operator[SEP] identifier[ProcessInstance] operator[SEP] identifier[NodeInstance] identifier[_node] operator[:] identifier[_instance] operator[SEP] identifier[getNodeInstanceList] operator[SEP] operator[SEP] operator[SEP] {
identifier[context] operator[SEP] identifier[parameterObject] operator[=] identifier[_node] operator[SEP] identifier[readNodeInstance] operator[SEP] identifier[context] , identifier[processInstance] , identifier[processInstance] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[JBPMMessages] operator[SEP] identifier[ProcessInstance] operator[SEP] identifier[ExclusiveGroupInstance] identifier[_excl] operator[:] identifier[_instance] operator[SEP] identifier[getExclusiveGroupList] operator[SEP] operator[SEP] operator[SEP] {
identifier[ExclusiveGroupInstance] identifier[exclusiveGroupInstance] operator[=] Keyword[new] identifier[ExclusiveGroupInstance] operator[SEP] operator[SEP] operator[SEP] identifier[processInstance] operator[SEP] identifier[addContextInstance] operator[SEP] identifier[ExclusiveGroup] operator[SEP] identifier[EXCLUSIVE_GROUP] , identifier[exclusiveGroupInstance] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Long] identifier[nodeInstanceId] operator[:] identifier[_excl] operator[SEP] identifier[getGroupNodeInstanceIdList] operator[SEP] operator[SEP] operator[SEP] {
identifier[NodeInstance] identifier[nodeInstance] operator[=] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[jbpm] operator[SEP] identifier[workflow] operator[SEP] identifier[instance] operator[SEP] identifier[NodeInstanceContainer] operator[SEP] identifier[processInstance] operator[SEP] operator[SEP] identifier[getNodeInstance] operator[SEP] identifier[nodeInstanceId] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeInstance] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[nodeInstanceId] operator[SEP] operator[SEP]
}
identifier[exclusiveGroupInstance] operator[SEP] identifier[addNodeInstance] operator[SEP] identifier[nodeInstance] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[_instance] operator[SEP] identifier[getVariableCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[Context] identifier[variableScope] operator[=] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[jbpm] operator[SEP] identifier[process] operator[SEP] identifier[core] operator[SEP] identifier[Process] operator[SEP] identifier[process] operator[SEP] operator[SEP] identifier[getDefaultContext] operator[SEP] identifier[VariableScope] operator[SEP] identifier[VARIABLE_SCOPE] operator[SEP] operator[SEP] identifier[VariableScopeInstance] identifier[variableScopeInstance] operator[=] operator[SEP] identifier[VariableScopeInstance] operator[SEP] identifier[processInstance] operator[SEP] identifier[getContextInstance] operator[SEP] identifier[variableScope] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[JBPMMessages] operator[SEP] identifier[Variable] identifier[_variable] operator[:] identifier[_instance] operator[SEP] identifier[getVariableList] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[Object] identifier[_value] operator[=] identifier[ProtobufProcessMarshaller] operator[SEP] identifier[unmarshallVariableValue] operator[SEP] identifier[context] , identifier[_variable] operator[SEP] operator[SEP] identifier[variableScopeInstance] operator[SEP] identifier[internalSetVariable] operator[SEP] identifier[_variable] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[_value] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[_variable] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[_instance] operator[SEP] identifier[getIterationLevelsCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] identifier[JBPMMessages] operator[SEP] identifier[IterationLevel] identifier[_level] operator[:] identifier[_instance] operator[SEP] identifier[getIterationLevelsList] operator[SEP] operator[SEP] operator[SEP] {
identifier[processInstance] operator[SEP] identifier[getIterationLevels] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[_level] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[_level] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[processInstance] operator[SEP] identifier[reconnect] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[processInstance] operator[SEP]
}
|
@Override
public DescribeTableRestoreStatusResult describeTableRestoreStatus(DescribeTableRestoreStatusRequest request) {
request = beforeClientExecution(request);
return executeDescribeTableRestoreStatus(request);
} | class class_name[name] begin[{]
method[describeTableRestoreStatus, return_type[type[DescribeTableRestoreStatusResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeDescribeTableRestoreStatus, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DescribeTableRestoreStatusResult] identifier[describeTableRestoreStatus] operator[SEP] identifier[DescribeTableRestoreStatusRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeTableRestoreStatus] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static double getLatitudeFromPixel(long height,
BoundingBox boundingBox, float pixel) {
return getLatitudeFromPixel(height, boundingBox, boundingBox, pixel);
} | class class_name[name] begin[{]
method[getLatitudeFromPixel, return_type[type[double]], modifier[public static], parameter[height, boundingBox, pixel]] begin[{]
return[call[.getLatitudeFromPixel, parameter[member[.height], member[.boundingBox], member[.boundingBox], member[.pixel]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[getLatitudeFromPixel] operator[SEP] Keyword[long] identifier[height] , identifier[BoundingBox] identifier[boundingBox] , Keyword[float] identifier[pixel] operator[SEP] {
Keyword[return] identifier[getLatitudeFromPixel] operator[SEP] identifier[height] , identifier[boundingBox] , identifier[boundingBox] , identifier[pixel] operator[SEP] operator[SEP]
}
|
public static OutputStreamWriter getWriter(OutputStream out, Charset charset) {
if (null == out) {
return null;
}
if (null == charset) {
return new OutputStreamWriter(out);
} else {
return new OutputStreamWriter(out, charset);
}
} | class class_name[name] begin[{]
method[getWriter, return_type[type[OutputStreamWriter]], modifier[public static], parameter[out, charset]] begin[{]
if[binary_operation[literal[null], ==, member[.out]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[literal[null], ==, member[.charset]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=out, 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=OutputStreamWriter, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charset, 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=OutputStreamWriter, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[OutputStreamWriter] identifier[getWriter] operator[SEP] identifier[OutputStream] identifier[out] , identifier[Charset] identifier[charset] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[out] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[==] identifier[charset] operator[SEP] {
Keyword[return] Keyword[new] identifier[OutputStreamWriter] operator[SEP] identifier[out] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[OutputStreamWriter] operator[SEP] identifier[out] , identifier[charset] operator[SEP] operator[SEP]
}
}
|
public void generate(GenRepoInfoFileConfiguration configuration) throws AppEngineException {
List<String> arguments = new ArrayList<>();
arguments.add("beta");
arguments.add("debug");
arguments.add("source");
arguments.add("gen-repo-info-file");
arguments.addAll(GcloudArgs.get("output-directory", configuration.getOutputDirectory()));
arguments.addAll(GcloudArgs.get("source-directory", configuration.getSourceDirectory()));
try {
runner.run(arguments, null);
} catch (ProcessHandlerException | IOException ex) {
throw new AppEngineException(ex);
}
} | class class_name[name] begin[{]
method[generate, return_type[void], modifier[public], parameter[configuration]] begin[{]
local_variable[type[List], arguments]
call[arguments.add, parameter[literal["beta"]]]
call[arguments.add, parameter[literal["debug"]]]
call[arguments.add, parameter[literal["source"]]]
call[arguments.add, parameter[literal["gen-repo-info-file"]]]
call[arguments.addAll, parameter[call[GcloudArgs.get, parameter[literal["output-directory"], call[configuration.getOutputDirectory, parameter[]]]]]]
call[arguments.addAll, parameter[call[GcloudArgs.get, parameter[literal["source-directory"], call[configuration.getSourceDirectory, parameter[]]]]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=run, postfix_operators=[], prefix_operators=[], qualifier=runner, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, 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=AppEngineException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['ProcessHandlerException', 'IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[generate] operator[SEP] identifier[GenRepoInfoFileConfiguration] identifier[configuration] operator[SEP] Keyword[throws] identifier[AppEngineException] {
identifier[List] operator[<] identifier[String] operator[>] identifier[arguments] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[addAll] operator[SEP] identifier[GcloudArgs] operator[SEP] identifier[get] operator[SEP] literal[String] , identifier[configuration] operator[SEP] identifier[getOutputDirectory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[addAll] operator[SEP] identifier[GcloudArgs] operator[SEP] identifier[get] operator[SEP] literal[String] , identifier[configuration] operator[SEP] identifier[getSourceDirectory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[runner] operator[SEP] identifier[run] operator[SEP] identifier[arguments] , Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ProcessHandlerException] operator[|] identifier[IOException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AppEngineException] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
}
|
public BatchGetTriggersResult withTriggers(Trigger... triggers) {
if (this.triggers == null) {
setTriggers(new java.util.ArrayList<Trigger>(triggers.length));
}
for (Trigger ele : triggers) {
this.triggers.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withTriggers, return_type[type[BatchGetTriggersResult]], modifier[public], parameter[triggers]] begin[{]
if[binary_operation[THIS[member[None.triggers]], ==, literal[null]]] begin[{]
call[.setTriggers, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=triggers, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Trigger, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=triggers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=triggers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Trigger, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[BatchGetTriggersResult] identifier[withTriggers] operator[SEP] identifier[Trigger] operator[...] identifier[triggers] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[triggers] operator[==] Other[null] operator[SEP] {
identifier[setTriggers] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[Trigger] operator[>] operator[SEP] identifier[triggers] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Trigger] identifier[ele] operator[:] identifier[triggers] operator[SEP] {
Keyword[this] operator[SEP] identifier[triggers] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
boolean checkCross(Lexeme lexeme){
return (lexeme.getBegin() >= this.pathBegin && lexeme.getBegin() < this.pathEnd)
|| (this.pathBegin >= lexeme.getBegin() && this.pathBegin < lexeme.getBegin()+ lexeme.getLength());
} | class class_name[name] begin[{]
method[checkCross, return_type[type[boolean]], modifier[default], parameter[lexeme]] begin[{]
return[binary_operation[binary_operation[binary_operation[call[lexeme.getBegin, parameter[]], >=, THIS[member[None.pathBegin]]], &&, binary_operation[call[lexeme.getBegin, parameter[]], <, THIS[member[None.pathEnd]]]], ||, binary_operation[binary_operation[THIS[member[None.pathBegin]], >=, call[lexeme.getBegin, parameter[]]], &&, binary_operation[THIS[member[None.pathBegin]], <, binary_operation[call[lexeme.getBegin, parameter[]], +, call[lexeme.getLength, parameter[]]]]]]]
end[}]
END[}] | Keyword[boolean] identifier[checkCross] operator[SEP] identifier[Lexeme] identifier[lexeme] operator[SEP] {
Keyword[return] operator[SEP] identifier[lexeme] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[>=] Keyword[this] operator[SEP] identifier[pathBegin] operator[&&] identifier[lexeme] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[<] Keyword[this] operator[SEP] identifier[pathEnd] operator[SEP] operator[||] operator[SEP] Keyword[this] operator[SEP] identifier[pathBegin] operator[>=] identifier[lexeme] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[&&] Keyword[this] operator[SEP] identifier[pathBegin] operator[<] identifier[lexeme] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[+] identifier[lexeme] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public List<PropertyData> getReferencesData(String nodeIdentifier) throws RepositoryException,
IllegalStateException, UnsupportedOperationException
{
Statistics s = ALL_STATISTICS.get(GET_REFERENCES_DATA_DESCR);
try
{
s.begin();
return wcs.getReferencesData(nodeIdentifier);
}
finally
{
s.end();
}
} | class class_name[name] begin[{]
method[getReferencesData, return_type[type[List]], modifier[public], parameter[nodeIdentifier]] begin[{]
local_variable[type[Statistics], s]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=begin, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nodeIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getReferencesData, postfix_operators=[], prefix_operators=[], qualifier=wcs, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=end, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[PropertyData] operator[>] identifier[getReferencesData] operator[SEP] identifier[String] identifier[nodeIdentifier] operator[SEP] Keyword[throws] identifier[RepositoryException] , identifier[IllegalStateException] , identifier[UnsupportedOperationException] {
identifier[Statistics] identifier[s] operator[=] identifier[ALL_STATISTICS] operator[SEP] identifier[get] operator[SEP] identifier[GET_REFERENCES_DATA_DESCR] operator[SEP] operator[SEP] Keyword[try] {
identifier[s] operator[SEP] identifier[begin] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[wcs] operator[SEP] identifier[getReferencesData] operator[SEP] identifier[nodeIdentifier] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[s] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static DataBinding map( Object source, Object destination )
{
return bindObject( source ).mapTo( destination );
} | class class_name[name] begin[{]
method[map, return_type[type[DataBinding]], modifier[public static], parameter[source, destination]] begin[{]
return[call[.bindObject, parameter[member[.source]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[DataBinding] identifier[map] operator[SEP] identifier[Object] identifier[source] , identifier[Object] identifier[destination] operator[SEP] {
Keyword[return] identifier[bindObject] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[mapTo] operator[SEP] identifier[destination] operator[SEP] operator[SEP]
}
|
public static int[] sliceByTime(CSTable table, int timeCol, Date start, Date end) {
if (end.before(start)) {
throw new IllegalArgumentException("end<start");
}
if (timeCol < 0) {
throw new IllegalArgumentException("timeCol :" + timeCol);
}
int s = -1;
int e = -1;
int i = -1;
for (String[] col : table.rows()) {
i++;
Date d = Conversions.convert(col[timeCol], Date.class);
if (s == -1 && (start.before(d) || start.equals(d))) {
s = i;
}
if (e == -1 && (end.before(d) || end.equals(d))) {
e = i;
break;
}
}
return new int[]{s, e};
} | class class_name[name] begin[{]
method[sliceByTime, return_type[type[int]], modifier[public static], parameter[table, timeCol, start, end]] begin[{]
if[call[end.before, parameter[member[.start]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="end<start")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.timeCol], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="timeCol :"), operandr=MemberReference(member=timeCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], s]
local_variable[type[int], e]
local_variable[type[int], i]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=timeCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=Conversions, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=before, postfix_operators=[], prefix_operators=[], qualifier=start, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=start, selectors=[], type_arguments=None), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=before, postfix_operators=[], prefix_operators=[], qualifier=end, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=end, selectors=[], type_arguments=None), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=rows, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=col)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None))), label=None)
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[sliceByTime] operator[SEP] identifier[CSTable] identifier[table] , Keyword[int] identifier[timeCol] , identifier[Date] identifier[start] , identifier[Date] identifier[end] operator[SEP] {
Keyword[if] operator[SEP] identifier[end] operator[SEP] identifier[before] operator[SEP] identifier[start] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[timeCol] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[timeCol] operator[SEP] operator[SEP]
}
Keyword[int] identifier[s] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[e] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[i] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[col] operator[:] identifier[table] operator[SEP] identifier[rows] operator[SEP] operator[SEP] operator[SEP] {
identifier[i] operator[++] operator[SEP] identifier[Date] identifier[d] operator[=] identifier[Conversions] operator[SEP] identifier[convert] operator[SEP] identifier[col] operator[SEP] identifier[timeCol] operator[SEP] , identifier[Date] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[==] operator[-] Other[1] operator[&&] operator[SEP] identifier[start] operator[SEP] identifier[before] operator[SEP] identifier[d] operator[SEP] operator[||] identifier[start] operator[SEP] identifier[equals] operator[SEP] identifier[d] operator[SEP] operator[SEP] operator[SEP] {
identifier[s] operator[=] identifier[i] operator[SEP]
}
Keyword[if] operator[SEP] identifier[e] operator[==] operator[-] Other[1] operator[&&] operator[SEP] identifier[end] operator[SEP] identifier[before] operator[SEP] identifier[d] operator[SEP] operator[||] identifier[end] operator[SEP] identifier[equals] operator[SEP] identifier[d] operator[SEP] operator[SEP] operator[SEP] {
identifier[e] operator[=] identifier[i] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] Keyword[new] Keyword[int] operator[SEP] operator[SEP] {
identifier[s] , identifier[e]
} operator[SEP]
}
|
public static String getSourceName(Type type) throws NoSourceNameException {
if (type instanceof Class<?>) {
Class<?> clazz = (Class<?>) type;
if (clazz.isPrimitive()) {
return clazz.getName(); // Returns "int" for integer etc.
}
String name = clazz.getCanonicalName();
// We get a null for anonymous inner classes or other types that don't
// have source names.
if (name == null) {
throw new NoSourceNameException(type);
}
return name;
}
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
Type[] arguments = parameterizedType.getActualTypeArguments();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(getSourceName(parameterizedType.getRawType()));
if (arguments.length == 0) {
return stringBuilder.toString();
}
stringBuilder.append("<").append(getSourceName(arguments[0]));
for (int i = 1; i < arguments.length; i++) {
stringBuilder.append(", ").append(getSourceName(arguments[i]));
}
return stringBuilder.append(">").toString();
}
if (type instanceof GenericArrayType) {
return getSourceName(((GenericArrayType) type).getGenericComponentType()) + "[]";
}
if (type instanceof WildcardType) {
Type[] lowerBounds = ((WildcardType) type).getLowerBounds();
Type[] upperBounds = ((WildcardType) type).getUpperBounds();
if (lowerBounds.length > 0 && upperBounds.length > 0
&& lowerBounds.length != 1 && lowerBounds[0] != Object.class) {
throw new NoSourceNameException(type);
}
if (lowerBounds.length > 0) {
return getBoundedSourceName("?", lowerBounds, "super");
} else if (upperBounds.length == 1 && upperBounds[0] == Object.class) {
return "?";
} else {
return getBoundedSourceName("?", upperBounds, "extends");
}
}
// This returns the name of a reference to a type variable, not the
// definition thereof. For the latter see #getTypeVariableDefinition(..).
if (type instanceof TypeVariable) {
return ((TypeVariable) type).getName();
}
throw new NoSourceNameException(type);
} | class class_name[name] begin[{]
method[getSourceName, return_type[type[String]], modifier[public static], parameter[type]] begin[{]
if[binary_operation[member[.type], instanceof, type[Class]]] begin[{]
local_variable[type[Class], clazz]
if[call[clazz.isPrimitive, parameter[]]] begin[{]
return[call[clazz.getName, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[String], name]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, 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=NoSourceNameException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.name]]
else begin[{]
None
end[}]
if[binary_operation[member[.type], instanceof, type[ParameterizedType]]] begin[{]
local_variable[type[ParameterizedType], parameterizedType]
local_variable[type[Type], arguments]
local_variable[type[StringBuilder], stringBuilder]
call[stringBuilder.append, parameter[call[.getSourceName, parameter[call[parameterizedType.getRawType, parameter[]]]]]]
if[binary_operation[member[arguments.length], ==, literal[0]]] begin[{]
return[call[stringBuilder.toString, parameter[]]]
else begin[{]
None
end[}]
call[stringBuilder.append, parameter[literal["<"]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=stringBuilder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getSourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, 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=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=arguments, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[stringBuilder.append, parameter[literal[">"]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.type], instanceof, type[GenericArrayType]]] begin[{]
return[binary_operation[call[.getSourceName, parameter[Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=GenericArrayType, sub_type=None))]], +, literal["[]"]]]
else begin[{]
None
end[}]
if[binary_operation[member[.type], instanceof, type[WildcardType]]] begin[{]
local_variable[type[Type], lowerBounds]
local_variable[type[Type], upperBounds]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[lowerBounds.length], >, literal[0]], &&, binary_operation[member[upperBounds.length], >, literal[0]]], &&, binary_operation[member[lowerBounds.length], !=, literal[1]]], &&, binary_operation[member[.lowerBounds], !=, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, 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=NoSourceNameException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[lowerBounds.length], >, literal[0]]] begin[{]
return[call[.getBoundedSourceName, parameter[literal["?"], member[.lowerBounds], literal["super"]]]]
else begin[{]
if[binary_operation[binary_operation[member[upperBounds.length], ==, literal[1]], &&, binary_operation[member[.upperBounds], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] begin[{]
return[literal["?"]]
else begin[{]
return[call[.getBoundedSourceName, parameter[literal["?"], member[.upperBounds], literal["extends"]]]]
end[}]
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.type], instanceof, type[TypeVariable]]] begin[{]
return[Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TypeVariable, sub_type=None))]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, 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=NoSourceNameException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getSourceName] operator[SEP] identifier[Type] identifier[type] operator[SEP] Keyword[throws] identifier[NoSourceNameException] {
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[name] operator[=] identifier[clazz] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NoSourceNameException] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
Keyword[return] identifier[name] operator[SEP]
}
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] {
identifier[ParameterizedType] identifier[parameterizedType] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[type] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[arguments] operator[=] identifier[parameterizedType] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[stringBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[getSourceName] operator[SEP] identifier[parameterizedType] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[arguments] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[stringBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getSourceName] operator[SEP] identifier[arguments] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[arguments] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getSourceName] operator[SEP] identifier[arguments] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[GenericArrayType] operator[SEP] {
Keyword[return] identifier[getSourceName] operator[SEP] operator[SEP] operator[SEP] identifier[GenericArrayType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getGenericComponentType] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP]
}
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[WildcardType] operator[SEP] {
identifier[Type] operator[SEP] operator[SEP] identifier[lowerBounds] operator[=] operator[SEP] operator[SEP] identifier[WildcardType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getLowerBounds] operator[SEP] operator[SEP] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[upperBounds] operator[=] operator[SEP] operator[SEP] identifier[WildcardType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getUpperBounds] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lowerBounds] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[upperBounds] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[lowerBounds] operator[SEP] identifier[length] operator[!=] Other[1] operator[&&] identifier[lowerBounds] operator[SEP] Other[0] operator[SEP] operator[!=] identifier[Object] operator[SEP] Keyword[class] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NoSourceNameException] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[lowerBounds] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
Keyword[return] identifier[getBoundedSourceName] operator[SEP] literal[String] , identifier[lowerBounds] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[upperBounds] operator[SEP] identifier[length] operator[==] Other[1] operator[&&] identifier[upperBounds] operator[SEP] Other[0] operator[SEP] operator[==] identifier[Object] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[getBoundedSourceName] operator[SEP] literal[String] , identifier[upperBounds] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[TypeVariable] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[TypeVariable] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[NoSourceNameException] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
|
public synchronized void flush() throws IOException {
if (sink != null) {
if (sink.closedByReader || closed) {
throw new IOException("Pipe closed");
}
synchronized (sink) {
sink.notifyAll();
}
}
} | class class_name[name] begin[{]
method[flush, return_type[void], modifier[synchronized public], parameter[]] begin[{]
if[binary_operation[member[.sink], !=, literal[null]]] begin[{]
if[binary_operation[member[sink.closedByReader], ||, member[.closed]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Pipe closed")], 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[}]
SYNCHRONIZED[member[.sink]] BEGIN[{]
call[sink.notifyAll, parameter[]]
END[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[flush] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[sink] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[sink] operator[SEP] identifier[closedByReader] operator[||] identifier[closed] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[sink] operator[SEP] {
identifier[sink] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Override
public CauseOfBlockage getCauseOfBlockage() {
// Block builds until they are done with post-production
if (!isConcurrentBuild() && isLogUpdated()) {
final R lastBuild = getLastBuild();
if (lastBuild != null) {
return new BlockedBecauseOfBuildInProgress(lastBuild);
} else {
// The build has been likely deleted after the isLogUpdated() call.
// Another cause may be an API implementation glitсh in the implementation for AbstractProject.
// Anyway, we should let the code go then.
LOGGER.log(Level.FINE, "The last build has been deleted during the non-concurrent cause creation. The build is not blocked anymore");
}
}
if (blockBuildWhenDownstreamBuilding()) {
AbstractProject<?,?> bup = getBuildingDownstream();
if (bup!=null)
return new BecauseOfDownstreamBuildInProgress(bup);
}
if (blockBuildWhenUpstreamBuilding()) {
AbstractProject<?,?> bup = getBuildingUpstream();
if (bup!=null)
return new BecauseOfUpstreamBuildInProgress(bup);
}
return null;
} | class class_name[name] begin[{]
method[getCauseOfBlockage, return_type[type[CauseOfBlockage]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[.isConcurrentBuild, parameter[]], &&, call[.isLogUpdated, parameter[]]]] begin[{]
local_variable[type[R], lastBuild]
if[binary_operation[member[.lastBuild], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=lastBuild, 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=BlockedBecauseOfBuildInProgress, sub_type=None))]
else begin[{]
call[LOGGER.log, parameter[member[Level.FINE], literal["The last build has been deleted during the non-concurrent cause creation. The build is not blocked anymore"]]]
end[}]
else begin[{]
None
end[}]
if[call[.blockBuildWhenDownstreamBuilding, parameter[]]] begin[{]
local_variable[type[AbstractProject], bup]
if[binary_operation[member[.bup], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=bup, 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=BecauseOfDownstreamBuildInProgress, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[call[.blockBuildWhenUpstreamBuilding, parameter[]]] begin[{]
local_variable[type[AbstractProject], bup]
if[binary_operation[member[.bup], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=bup, 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=BecauseOfUpstreamBuildInProgress, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CauseOfBlockage] identifier[getCauseOfBlockage] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isConcurrentBuild] operator[SEP] operator[SEP] operator[&&] identifier[isLogUpdated] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[R] identifier[lastBuild] operator[=] identifier[getLastBuild] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastBuild] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[BlockedBecauseOfBuildInProgress] operator[SEP] identifier[lastBuild] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[blockBuildWhenDownstreamBuilding] operator[SEP] operator[SEP] operator[SEP] {
identifier[AbstractProject] operator[<] operator[?] , operator[?] operator[>] identifier[bup] operator[=] identifier[getBuildingDownstream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bup] operator[!=] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[BecauseOfDownstreamBuildInProgress] operator[SEP] identifier[bup] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[blockBuildWhenUpstreamBuilding] operator[SEP] operator[SEP] operator[SEP] {
identifier[AbstractProject] operator[<] operator[?] , operator[?] operator[>] identifier[bup] operator[=] identifier[getBuildingUpstream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bup] operator[!=] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[BecauseOfUpstreamBuildInProgress] operator[SEP] identifier[bup] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets(String resourceGroupName, String accountName, String contentKeyPolicyName) {
return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body();
} | class class_name[name] begin[{]
method[getPolicyPropertiesWithSecrets, return_type[type[ContentKeyPolicyPropertiesInner]], modifier[public], parameter[resourceGroupName, accountName, contentKeyPolicyName]] begin[{]
return[call[.getPolicyPropertiesWithSecretsWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.contentKeyPolicyName]]]]
end[}]
END[}] | Keyword[public] identifier[ContentKeyPolicyPropertiesInner] identifier[getPolicyPropertiesWithSecrets] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[contentKeyPolicyName] operator[SEP] {
Keyword[return] identifier[getPolicyPropertiesWithSecretsWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[contentKeyPolicyName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Context begin(final String _userName,
final Inheritance _inheritance)
throws EFapsException
{
return Context.begin(_userName, null, null, null, null, _inheritance);
} | class class_name[name] begin[{]
method[begin, return_type[type[Context]], modifier[public static], parameter[_userName, _inheritance]] begin[{]
return[call[Context.begin, parameter[member[._userName], literal[null], literal[null], literal[null], literal[null], member[._inheritance]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Context] identifier[begin] operator[SEP] Keyword[final] identifier[String] identifier[_userName] , Keyword[final] identifier[Inheritance] identifier[_inheritance] operator[SEP] Keyword[throws] identifier[EFapsException] {
Keyword[return] identifier[Context] operator[SEP] identifier[begin] operator[SEP] identifier[_userName] , Other[null] , Other[null] , Other[null] , Other[null] , identifier[_inheritance] operator[SEP] operator[SEP]
}
|
private Class<? extends Field> getClassObject(final Element element) {
String className = element.getAttributeValue(XMLTags.CLASS);
Class<? extends Field> classObject = null;
try {
className = className.indexOf('.') > 0 ? className : getClass().getPackage().getName() + '.' + className;
classObject = Class.forName(className).asSubclass(Field.class);
} catch (ClassNotFoundException e) {
throw new IllegalStateException("could not get class " + className, e);
}
return classObject;
} | class class_name[name] begin[{]
method[getClassObject, return_type[type[Class]], modifier[private], parameter[element]] begin[{]
local_variable[type[String], className]
local_variable[type[Class], classObject]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=className, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getPackage, 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)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator=+), operandr=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), if_true=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=classObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Field, sub_type=None))], member=asSubclass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not get class "), operandr=MemberReference(member=className, 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=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)
return[member[.classObject]]
end[}]
END[}] | Keyword[private] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Field] operator[>] identifier[getClassObject] operator[SEP] Keyword[final] identifier[Element] identifier[element] operator[SEP] {
identifier[String] identifier[className] operator[=] identifier[element] operator[SEP] identifier[getAttributeValue] operator[SEP] identifier[XMLTags] operator[SEP] identifier[CLASS] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Field] operator[>] identifier[classObject] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[className] operator[=] identifier[className] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] Other[0] operator[?] identifier[className] operator[:] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[className] operator[SEP] identifier[classObject] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[className] operator[SEP] operator[SEP] identifier[asSubclass] operator[SEP] identifier[Field] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[className] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[classObject] operator[SEP]
}
|
public RefundQuery refundQueryByTransactionId(String transactionId) {
RefundQueryRequestWrapper refundQueryRequestWrapper = new RefundQueryRequestWrapper();
refundQueryRequestWrapper.setTransactionId(transactionId);
return refundQuery(refundQueryRequestWrapper);
} | class class_name[name] begin[{]
method[refundQueryByTransactionId, return_type[type[RefundQuery]], modifier[public], parameter[transactionId]] begin[{]
local_variable[type[RefundQueryRequestWrapper], refundQueryRequestWrapper]
call[refundQueryRequestWrapper.setTransactionId, parameter[member[.transactionId]]]
return[call[.refundQuery, parameter[member[.refundQueryRequestWrapper]]]]
end[}]
END[}] | Keyword[public] identifier[RefundQuery] identifier[refundQueryByTransactionId] operator[SEP] identifier[String] identifier[transactionId] operator[SEP] {
identifier[RefundQueryRequestWrapper] identifier[refundQueryRequestWrapper] operator[=] Keyword[new] identifier[RefundQueryRequestWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[refundQueryRequestWrapper] operator[SEP] identifier[setTransactionId] operator[SEP] identifier[transactionId] operator[SEP] operator[SEP] Keyword[return] identifier[refundQuery] operator[SEP] identifier[refundQueryRequestWrapper] operator[SEP] operator[SEP]
}
|
public Piece getPiece(int index) {
if (this.pieces == null) {
throw new IllegalStateException("Torrent not initialized yet.");
}
if (index >= this.pieces.length) {
throw new IllegalArgumentException("Invalid piece index!");
}
return this.pieces[index];
} | class class_name[name] begin[{]
method[getPiece, return_type[type[Piece]], modifier[public], parameter[index]] begin[{]
if[binary_operation[THIS[member[None.pieces]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Torrent not initialized yet.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.index], >=, THIS[member[None.pieces]member[None.length]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid piece index!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[THIS[member[None.pieces]ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]]
end[}]
END[}] | Keyword[public] identifier[Piece] identifier[getPiece] operator[SEP] Keyword[int] identifier[index] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[pieces] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[index] operator[>=] Keyword[this] operator[SEP] identifier[pieces] operator[SEP] identifier[length] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP] identifier[pieces] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
|
protected static List<water.ModelMetrics>fetchAll() {
return new ArrayList<water.ModelMetrics>(H2O.KeySnapshot.globalSnapshot().fetchAll(water.ModelMetrics.class).values());
} | class class_name[name] begin[{]
method[fetchAll, return_type[type[List]], modifier[static protected], parameter[]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=globalSnapshot, postfix_operators=[], prefix_operators=[], qualifier=H2O.KeySnapshot, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=water, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelMetrics, sub_type=None))], member=fetchAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=water, sub_type=ReferenceType(arguments=None, dimensions=None, name=ModelMetrics, sub_type=None)))], dimensions=None, name=ArrayList, sub_type=None))]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[List] operator[<] identifier[water] operator[SEP] identifier[ModelMetrics] operator[>] identifier[fetchAll] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArrayList] operator[<] identifier[water] operator[SEP] identifier[ModelMetrics] operator[>] operator[SEP] identifier[H2O] operator[SEP] identifier[KeySnapshot] operator[SEP] identifier[globalSnapshot] operator[SEP] operator[SEP] operator[SEP] identifier[fetchAll] operator[SEP] identifier[water] operator[SEP] identifier[ModelMetrics] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void run(Socket socket) {
synchronized (lock) {
nextSocket = socket;
lock.notify();
}
Thread.yield();
} | class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[socket]] begin[{]
SYNCHRONIZED[member[.lock]] BEGIN[{]
assign[member[.nextSocket], member[.socket]]
call[lock.notify, parameter[]]
END[}]
call[Thread.yield, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[run] operator[SEP] identifier[Socket] identifier[socket] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] {
identifier[nextSocket] operator[=] identifier[socket] operator[SEP] identifier[lock] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Thread] operator[SEP] identifier[yield] operator[SEP] operator[SEP] operator[SEP]
}
|
protected final PrcAccEntityWithSubaccCreate<RS, IHasId<Object>, Object>
createPutPrcAccEntityWithSubaccCreate(
final Map<String, Object> pAddParam) throws Exception {
PrcAccEntityWithSubaccCreate<RS, IHasId<Object>, Object> proc =
new PrcAccEntityWithSubaccCreate<RS, IHasId<Object>, Object>();
@SuppressWarnings("unchecked")
PrcEntityCreate<RS, IHasId<Object>, Object> procDlg =
(PrcEntityCreate<RS, IHasId<Object>, Object>)
this.fctBnEntitiesProcessors
.lazyGet(pAddParam, PrcEntityCreate.class.getSimpleName());
proc.setPrcAccEntityCreate(procDlg);
proc.setSrvTypeCode(getSrvTypeCode());
//assigning fully initialized object:
this.processorsMap
.put(PrcAccEntityWithSubaccCreate.class.getSimpleName(), proc);
return proc;
} | class class_name[name] begin[{]
method[createPutPrcAccEntityWithSubaccCreate, return_type[type[PrcAccEntityWithSubaccCreate]], modifier[final protected], parameter[pAddParam]] begin[{]
local_variable[type[PrcAccEntityWithSubaccCreate], proc]
local_variable[type[PrcEntityCreate], procDlg]
call[proc.setPrcAccEntityCreate, parameter[member[.procDlg]]]
call[proc.setSrvTypeCode, parameter[call[.getSrvTypeCode, parameter[]]]]
THIS[member[None.processorsMap]call[None.put, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcAccEntityWithSubaccCreate, sub_type=None)), member[.proc]]]]
return[member[.proc]]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[PrcAccEntityWithSubaccCreate] operator[<] identifier[RS] , identifier[IHasId] operator[<] identifier[Object] operator[>] , identifier[Object] operator[>] identifier[createPutPrcAccEntityWithSubaccCreate] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pAddParam] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[PrcAccEntityWithSubaccCreate] operator[<] identifier[RS] , identifier[IHasId] operator[<] identifier[Object] operator[>] , identifier[Object] operator[>] identifier[proc] operator[=] Keyword[new] identifier[PrcAccEntityWithSubaccCreate] operator[<] identifier[RS] , identifier[IHasId] operator[<] identifier[Object] operator[>] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[PrcEntityCreate] operator[<] identifier[RS] , identifier[IHasId] operator[<] identifier[Object] operator[>] , identifier[Object] operator[>] identifier[procDlg] operator[=] operator[SEP] identifier[PrcEntityCreate] operator[<] identifier[RS] , identifier[IHasId] operator[<] identifier[Object] operator[>] , identifier[Object] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[fctBnEntitiesProcessors] operator[SEP] identifier[lazyGet] operator[SEP] identifier[pAddParam] , identifier[PrcEntityCreate] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setPrcAccEntityCreate] operator[SEP] identifier[procDlg] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvTypeCode] operator[SEP] identifier[getSrvTypeCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[put] operator[SEP] identifier[PrcAccEntityWithSubaccCreate] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[proc] operator[SEP] operator[SEP] Keyword[return] identifier[proc] operator[SEP]
}
|
private Page<CollectorItem> removeJobUrlAndInstanceUrl(Page<CollectorItem> collectorItems) {
for (CollectorItem cItem : collectorItems) {
if(cItem.getOptions().containsKey("jobUrl")) cItem.getOptions().remove("jobUrl");
if(cItem.getOptions().containsKey("instanceUrl")) cItem.getOptions().remove("instanceUrl");
}
return collectorItems;
} | class class_name[name] begin[{]
method[removeJobUrlAndInstanceUrl, return_type[type[Page]], modifier[private], parameter[collectorItems]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getOptions, postfix_operators=[], prefix_operators=[], qualifier=cItem, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="jobUrl")], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=getOptions, postfix_operators=[], prefix_operators=[], qualifier=cItem, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="jobUrl")], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getOptions, postfix_operators=[], prefix_operators=[], qualifier=cItem, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="instanceUrl")], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=getOptions, postfix_operators=[], prefix_operators=[], qualifier=cItem, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="instanceUrl")], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=collectorItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CollectorItem, sub_type=None))), label=None)
return[member[.collectorItems]]
end[}]
END[}] | Keyword[private] identifier[Page] operator[<] identifier[CollectorItem] operator[>] identifier[removeJobUrlAndInstanceUrl] operator[SEP] identifier[Page] operator[<] identifier[CollectorItem] operator[>] identifier[collectorItems] operator[SEP] {
Keyword[for] operator[SEP] identifier[CollectorItem] identifier[cItem] operator[:] identifier[collectorItems] operator[SEP] {
Keyword[if] operator[SEP] identifier[cItem] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cItem] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cItem] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cItem] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[collectorItems] operator[SEP]
}
|
public long getTimeRangeEndingTimeInMillis (final long timeInMillis)
{
final Calendar rangeEndingTime = createJavaCalendar (timeInMillis);
rangeEndingTime.set (Calendar.HOUR_OF_DAY, m_nRangeEndingHourOfDay);
rangeEndingTime.set (Calendar.MINUTE, m_nRangeEndingMinute);
rangeEndingTime.set (Calendar.SECOND, m_nRangeEndingSecond);
rangeEndingTime.set (Calendar.MILLISECOND, m_nRangeEndingMillis);
return rangeEndingTime.getTime ().getTime ();
} | class class_name[name] begin[{]
method[getTimeRangeEndingTimeInMillis, return_type[type[long]], modifier[public], parameter[timeInMillis]] begin[{]
local_variable[type[Calendar], rangeEndingTime]
call[rangeEndingTime.set, parameter[member[Calendar.HOUR_OF_DAY], member[.m_nRangeEndingHourOfDay]]]
call[rangeEndingTime.set, parameter[member[Calendar.MINUTE], member[.m_nRangeEndingMinute]]]
call[rangeEndingTime.set, parameter[member[Calendar.SECOND], member[.m_nRangeEndingSecond]]]
call[rangeEndingTime.set, parameter[member[Calendar.MILLISECOND], member[.m_nRangeEndingMillis]]]
return[call[rangeEndingTime.getTime, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[getTimeRangeEndingTimeInMillis] operator[SEP] Keyword[final] Keyword[long] identifier[timeInMillis] operator[SEP] {
Keyword[final] identifier[Calendar] identifier[rangeEndingTime] operator[=] identifier[createJavaCalendar] operator[SEP] identifier[timeInMillis] operator[SEP] operator[SEP] identifier[rangeEndingTime] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] , identifier[m_nRangeEndingHourOfDay] operator[SEP] operator[SEP] identifier[rangeEndingTime] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] , identifier[m_nRangeEndingMinute] operator[SEP] operator[SEP] identifier[rangeEndingTime] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] , identifier[m_nRangeEndingSecond] operator[SEP] operator[SEP] identifier[rangeEndingTime] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] , identifier[m_nRangeEndingMillis] operator[SEP] operator[SEP] Keyword[return] identifier[rangeEndingTime] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void addToJson(JSONObject jsonObject, String key, Object value) throws JSONException {
if (jsonObject == null) {
throw new JSONException("Can't add key '" + key + "' to a null object.");
}
if (key == null) {
throw new JSONException("Can't add null key.");
}
JSONValue jsonValue = null;
if (value != null) {
if (value instanceof Date) {
jsonValue = new JSONString(JsonService.format((Date) value));
} else if (value instanceof JSONValue) {
jsonValue = (JSONValue) value;
} else {
jsonValue = new JSONString(value.toString());
}
}
jsonObject.put(key, jsonValue);
} | class class_name[name] begin[{]
method[addToJson, return_type[void], modifier[public static], parameter[jsonObject, key, value]] begin[{]
if[binary_operation[member[.jsonObject], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't add key '"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' to a null object."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't add null key.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[JSONValue], jsonValue]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
if[binary_operation[member[.value], instanceof, type[Date]]] begin[{]
assign[member[.jsonValue], ClassCreator(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None))], member=format, postfix_operators=[], prefix_operators=[], qualifier=JsonService, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONString, sub_type=None))]
else begin[{]
if[binary_operation[member[.value], instanceof, type[JSONValue]]] begin[{]
assign[member[.jsonValue], Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONValue, sub_type=None))]
else begin[{]
assign[member[.jsonValue], ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONString, sub_type=None))]
end[}]
end[}]
else begin[{]
None
end[}]
call[jsonObject.put, parameter[member[.key], member[.jsonValue]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[addToJson] operator[SEP] identifier[JSONObject] identifier[jsonObject] , identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] Keyword[throws] identifier[JSONException] {
Keyword[if] operator[SEP] identifier[jsonObject] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JSONException] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JSONException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[JSONValue] identifier[jsonValue] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Date] operator[SEP] {
identifier[jsonValue] operator[=] Keyword[new] identifier[JSONString] operator[SEP] identifier[JsonService] operator[SEP] identifier[format] operator[SEP] operator[SEP] identifier[Date] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[JSONValue] operator[SEP] {
identifier[jsonValue] operator[=] operator[SEP] identifier[JSONValue] operator[SEP] identifier[value] operator[SEP]
}
Keyword[else] {
identifier[jsonValue] operator[=] Keyword[new] identifier[JSONString] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[jsonObject] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[jsonValue] operator[SEP] operator[SEP]
}
|
public SeriesColorMarkerLineStyle getNextSeriesColorMarkerLineStyle() {
// 1. Color - cycle through colors one by one
if (colorCounter >= seriesColorList.length) {
colorCounter = 0;
strokeCounter++;
}
Color seriesColor = seriesColorList[colorCounter++];
// 2. Stroke - cycle through strokes one by one but only after a color cycle
if (strokeCounter >= seriesLineStyleList.length) {
strokeCounter = 0;
}
BasicStroke seriesLineStyle = seriesLineStyleList[strokeCounter];
// 3. Marker - cycle through markers one by one
if (markerCounter >= seriesMarkerList.length) {
markerCounter = 0;
}
Marker marker = seriesMarkerList[markerCounter++];
return new SeriesColorMarkerLineStyle(seriesColor, marker, seriesLineStyle);
} | class class_name[name] begin[{]
method[getNextSeriesColorMarkerLineStyle, return_type[type[SeriesColorMarkerLineStyle]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.colorCounter], >=, member[seriesColorList.length]]] begin[{]
assign[member[.colorCounter], literal[0]]
member[.strokeCounter]
else begin[{]
None
end[}]
local_variable[type[Color], seriesColor]
if[binary_operation[member[.strokeCounter], >=, member[seriesLineStyleList.length]]] begin[{]
assign[member[.strokeCounter], literal[0]]
else begin[{]
None
end[}]
local_variable[type[BasicStroke], seriesLineStyle]
if[binary_operation[member[.markerCounter], >=, member[seriesMarkerList.length]]] begin[{]
assign[member[.markerCounter], literal[0]]
else begin[{]
None
end[}]
local_variable[type[Marker], marker]
return[ClassCreator(arguments=[MemberReference(member=seriesColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=marker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seriesLineStyle, 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=SeriesColorMarkerLineStyle, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[SeriesColorMarkerLineStyle] identifier[getNextSeriesColorMarkerLineStyle] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[colorCounter] operator[>=] identifier[seriesColorList] operator[SEP] identifier[length] operator[SEP] {
identifier[colorCounter] operator[=] Other[0] operator[SEP] identifier[strokeCounter] operator[++] operator[SEP]
}
identifier[Color] identifier[seriesColor] operator[=] identifier[seriesColorList] operator[SEP] identifier[colorCounter] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strokeCounter] operator[>=] identifier[seriesLineStyleList] operator[SEP] identifier[length] operator[SEP] {
identifier[strokeCounter] operator[=] Other[0] operator[SEP]
}
identifier[BasicStroke] identifier[seriesLineStyle] operator[=] identifier[seriesLineStyleList] operator[SEP] identifier[strokeCounter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[markerCounter] operator[>=] identifier[seriesMarkerList] operator[SEP] identifier[length] operator[SEP] {
identifier[markerCounter] operator[=] Other[0] operator[SEP]
}
identifier[Marker] identifier[marker] operator[=] identifier[seriesMarkerList] operator[SEP] identifier[markerCounter] operator[++] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SeriesColorMarkerLineStyle] operator[SEP] identifier[seriesColor] , identifier[marker] , identifier[seriesLineStyle] operator[SEP] operator[SEP]
}
|
public static ShearCaptcha createShearCaptcha(int width, int height, int codeCount, int thickness) {
return new ShearCaptcha(width, height, codeCount, thickness);
} | class class_name[name] begin[{]
method[createShearCaptcha, return_type[type[ShearCaptcha]], modifier[public static], parameter[width, height, codeCount, thickness]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=codeCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thickness, 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=ShearCaptcha, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ShearCaptcha] identifier[createShearCaptcha] operator[SEP] Keyword[int] identifier[width] , Keyword[int] identifier[height] , Keyword[int] identifier[codeCount] , Keyword[int] identifier[thickness] operator[SEP] {
Keyword[return] Keyword[new] identifier[ShearCaptcha] operator[SEP] identifier[width] , identifier[height] , identifier[codeCount] , identifier[thickness] operator[SEP] operator[SEP]
}
|
private static double[][] quantile(double[] x, Distribution d) {
Arrays.sort(x);
int n = x.length;
double[][] q = new double[n][2];
for (int i = 0; i < n; i++) {
double p = (i + 1) / (n + 1.0);
q[i][0] = x[(int) Math.round(p * x.length)];
q[i][1] = d.quantile(p);
}
return q;
} | class class_name[name] begin[{]
method[quantile, return_type[type[double]], modifier[private static], parameter[x, d]] begin[{]
call[Arrays.sort, parameter[member[.x]]]
local_variable[type[int], n]
local_variable[type[double], q]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operator=+), operator=/), name=p)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[]), operator=*)], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=quantile, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], 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)
return[member[.q]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[quantile] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[x] , identifier[Distribution] identifier[d] operator[SEP] {
identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[x] operator[SEP] identifier[length] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[n] operator[SEP] operator[SEP] Other[2] 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] {
Keyword[double] identifier[p] operator[=] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[/] operator[SEP] identifier[n] operator[+] literal[Float] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[=] identifier[x] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[p] operator[*] identifier[x] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[=] identifier[d] operator[SEP] identifier[quantile] operator[SEP] identifier[p] operator[SEP] operator[SEP]
}
Keyword[return] identifier[q] operator[SEP]
}
|
public ListenableFuture<?> reserve(QueryId queryId, String allocationTag, long bytes)
{
checkArgument(bytes >= 0, "bytes is negative");
ListenableFuture<?> result;
synchronized (this) {
if (bytes != 0) {
queryMemoryReservations.merge(queryId, bytes, Long::sum);
updateTaggedMemoryAllocations(queryId, allocationTag, bytes);
}
reservedBytes += bytes;
if (getFreeBytes() <= 0) {
if (future == null) {
future = NonCancellableMemoryFuture.create();
}
checkState(!future.isDone(), "future is already completed");
result = future;
}
else {
result = NOT_BLOCKED;
}
}
onMemoryReserved();
return result;
} | class class_name[name] begin[{]
method[reserve, return_type[type[ListenableFuture]], modifier[public], parameter[queryId, allocationTag, bytes]] begin[{]
call[.checkArgument, parameter[binary_operation[member[.bytes], >=, literal[0]], literal["bytes is negative"]]]
local_variable[type[ListenableFuture], result]
SYNCHRONIZED[THIS[]] BEGIN[{]
if[binary_operation[member[.bytes], !=, literal[0]]] begin[{]
call[queryMemoryReservations.merge, parameter[member[.queryId], member[.bytes], MethodReference(expression=MemberReference(member=Long, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]
call[.updateTaggedMemoryAllocations, parameter[member[.queryId], member[.allocationTag], member[.bytes]]]
else begin[{]
None
end[}]
assign[member[.reservedBytes], member[.bytes]]
if[binary_operation[call[.getFreeBytes, parameter[]], <=, literal[0]]] begin[{]
if[binary_operation[member[.future], ==, literal[null]]] begin[{]
assign[member[.future], call[NonCancellableMemoryFuture.create, parameter[]]]
else begin[{]
None
end[}]
call[.checkState, parameter[call[future.isDone, parameter[]], literal["future is already completed"]]]
assign[member[.result], member[.future]]
else begin[{]
assign[member[.result], member[.NOT_BLOCKED]]
end[}]
END[}]
call[.onMemoryReserved, parameter[]]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[ListenableFuture] operator[<] operator[?] operator[>] identifier[reserve] operator[SEP] identifier[QueryId] identifier[queryId] , identifier[String] identifier[allocationTag] , Keyword[long] identifier[bytes] operator[SEP] {
identifier[checkArgument] operator[SEP] identifier[bytes] operator[>=] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[ListenableFuture] operator[<] operator[?] operator[>] identifier[result] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
Keyword[if] operator[SEP] identifier[bytes] operator[!=] Other[0] operator[SEP] {
identifier[queryMemoryReservations] operator[SEP] identifier[merge] operator[SEP] identifier[queryId] , identifier[bytes] , identifier[Long] operator[::] identifier[sum] operator[SEP] operator[SEP] identifier[updateTaggedMemoryAllocations] operator[SEP] identifier[queryId] , identifier[allocationTag] , identifier[bytes] operator[SEP] operator[SEP]
}
identifier[reservedBytes] operator[+=] identifier[bytes] operator[SEP] Keyword[if] operator[SEP] identifier[getFreeBytes] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[future] operator[==] Other[null] operator[SEP] {
identifier[future] operator[=] identifier[NonCancellableMemoryFuture] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP]
}
identifier[checkState] operator[SEP] operator[!] identifier[future] operator[SEP] identifier[isDone] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[future] operator[SEP]
}
Keyword[else] {
identifier[result] operator[=] identifier[NOT_BLOCKED] operator[SEP]
}
}
identifier[onMemoryReserved] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public boolean
removeRecord(Record r, int section) {
if (sections[section] != null && sections[section].remove(r)) {
header.decCount(section);
return true;
}
else
return false;
} | class class_name[name] begin[{]
method[removeRecord, return_type[type[boolean]], modifier[public], parameter[r, section]] begin[{]
if[binary_operation[binary_operation[member[.sections], !=, literal[null]], &&, member[.sections]]] begin[{]
call[header.decCount, parameter[member[.section]]]
return[literal[true]]
else begin[{]
return[literal[false]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[removeRecord] operator[SEP] identifier[Record] identifier[r] , Keyword[int] identifier[section] operator[SEP] {
Keyword[if] operator[SEP] identifier[sections] operator[SEP] identifier[section] operator[SEP] operator[!=] Other[null] operator[&&] identifier[sections] operator[SEP] identifier[section] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[r] operator[SEP] operator[SEP] {
identifier[header] operator[SEP] identifier[decCount] operator[SEP] identifier[section] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[return] literal[boolean] operator[SEP]
}
|
public Type getTypeOfArrayItems()
throws DataConversionException {
JsonSchema arrayValues = getItemsWithinDataType();
if (arrayValues == null) {
throw new DataConversionException("Array types only allow values as primitive, null or JsonObject");
}
return arrayValues.getType();
} | class class_name[name] begin[{]
method[getTypeOfArrayItems, return_type[type[Type]], modifier[public], parameter[]] begin[{]
local_variable[type[JsonSchema], arrayValues]
if[binary_operation[member[.arrayValues], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Array types only allow values as primitive, null or JsonObject")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataConversionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[arrayValues.getType, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Type] identifier[getTypeOfArrayItems] operator[SEP] operator[SEP] Keyword[throws] identifier[DataConversionException] {
identifier[JsonSchema] identifier[arrayValues] operator[=] identifier[getItemsWithinDataType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[arrayValues] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DataConversionException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[arrayValues] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public CompletableFuture<LogicalSlot> allocateSlot(
SlotRequestId slotRequestId,
ScheduledUnit scheduledUnit,
SlotProfile slotProfile,
boolean allowQueuedScheduling,
Time allocationTimeout) {
log.debug("Received slot request [{}] for task: {}", slotRequestId, scheduledUnit.getTaskToExecute());
componentMainThreadExecutor.assertRunningInMainThread();
final CompletableFuture<LogicalSlot> allocationResultFuture = new CompletableFuture<>();
CompletableFuture<LogicalSlot> allocationFuture = scheduledUnit.getSlotSharingGroupId() == null ?
allocateSingleSlot(slotRequestId, slotProfile, allowQueuedScheduling, allocationTimeout) :
allocateSharedSlot(slotRequestId, scheduledUnit, slotProfile, allowQueuedScheduling, allocationTimeout);
allocationFuture.whenComplete((LogicalSlot slot, Throwable failure) -> {
if (failure != null) {
cancelSlotRequest(
slotRequestId,
scheduledUnit.getSlotSharingGroupId(),
failure);
allocationResultFuture.completeExceptionally(failure);
} else {
allocationResultFuture.complete(slot);
}
});
return allocationResultFuture;
} | class class_name[name] begin[{]
method[allocateSlot, return_type[type[CompletableFuture]], modifier[public], parameter[slotRequestId, scheduledUnit, slotProfile, allowQueuedScheduling, allocationTimeout]] begin[{]
call[log.debug, parameter[literal["Received slot request [{}] for task: {}"], member[.slotRequestId], call[scheduledUnit.getTaskToExecute, parameter[]]]]
call[componentMainThreadExecutor.assertRunningInMainThread, parameter[]]
local_variable[type[CompletableFuture], allocationResultFuture]
local_variable[type[CompletableFuture], allocationFuture]
call[allocationFuture.whenComplete, parameter[LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=failure, 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=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=complete, postfix_operators=[], prefix_operators=[], qualifier=allocationResultFuture, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=slotRequestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSlotSharingGroupId, postfix_operators=[], prefix_operators=[], qualifier=scheduledUnit, selectors=[], type_arguments=None), MemberReference(member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cancelSlotRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=completeExceptionally, postfix_operators=[], prefix_operators=[], qualifier=allocationResultFuture, selectors=[], type_arguments=None), label=None)]))], parameters=[FormalParameter(annotations=[], modifiers=set(), name=slot, type=ReferenceType(arguments=None, dimensions=[], name=LogicalSlot, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=failure, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)])]]
return[member[.allocationResultFuture]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CompletableFuture] operator[<] identifier[LogicalSlot] operator[>] identifier[allocateSlot] operator[SEP] identifier[SlotRequestId] identifier[slotRequestId] , identifier[ScheduledUnit] identifier[scheduledUnit] , identifier[SlotProfile] identifier[slotProfile] , Keyword[boolean] identifier[allowQueuedScheduling] , identifier[Time] identifier[allocationTimeout] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[slotRequestId] , identifier[scheduledUnit] operator[SEP] identifier[getTaskToExecute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[componentMainThreadExecutor] operator[SEP] identifier[assertRunningInMainThread] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[CompletableFuture] operator[<] identifier[LogicalSlot] operator[>] identifier[allocationResultFuture] operator[=] Keyword[new] identifier[CompletableFuture] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[CompletableFuture] operator[<] identifier[LogicalSlot] operator[>] identifier[allocationFuture] operator[=] identifier[scheduledUnit] operator[SEP] identifier[getSlotSharingGroupId] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] identifier[allocateSingleSlot] operator[SEP] identifier[slotRequestId] , identifier[slotProfile] , identifier[allowQueuedScheduling] , identifier[allocationTimeout] operator[SEP] operator[:] identifier[allocateSharedSlot] operator[SEP] identifier[slotRequestId] , identifier[scheduledUnit] , identifier[slotProfile] , identifier[allowQueuedScheduling] , identifier[allocationTimeout] operator[SEP] operator[SEP] identifier[allocationFuture] operator[SEP] identifier[whenComplete] operator[SEP] operator[SEP] identifier[LogicalSlot] identifier[slot] , identifier[Throwable] identifier[failure] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[failure] operator[!=] Other[null] operator[SEP] {
identifier[cancelSlotRequest] operator[SEP] identifier[slotRequestId] , identifier[scheduledUnit] operator[SEP] identifier[getSlotSharingGroupId] operator[SEP] operator[SEP] , identifier[failure] operator[SEP] operator[SEP] identifier[allocationResultFuture] operator[SEP] identifier[completeExceptionally] operator[SEP] identifier[failure] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[allocationResultFuture] operator[SEP] identifier[complete] operator[SEP] identifier[slot] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[return] identifier[allocationResultFuture] operator[SEP]
}
|
public TaskGetOptions withOcpDate(DateTime ocpDate) {
if (ocpDate == null) {
this.ocpDate = null;
} else {
this.ocpDate = new DateTimeRfc1123(ocpDate);
}
return this;
} | class class_name[name] begin[{]
method[withOcpDate, return_type[type[TaskGetOptions]], modifier[public], parameter[ocpDate]] begin[{]
if[binary_operation[member[.ocpDate], ==, literal[null]]] begin[{]
assign[THIS[member[None.ocpDate]], literal[null]]
else begin[{]
assign[THIS[member[None.ocpDate]], ClassCreator(arguments=[MemberReference(member=ocpDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRfc1123, sub_type=None))]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[TaskGetOptions] identifier[withOcpDate] operator[SEP] identifier[DateTime] identifier[ocpDate] operator[SEP] {
Keyword[if] operator[SEP] identifier[ocpDate] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public Multimap<Id, Revision> publish() {
Multimap<Id, Revision> result = options.transactions.writeNewRequired(this::doPublish);
if (this.cache != null) {
result.keySet().forEach(this.cache::refresh);
}
return result;
} | class class_name[name] begin[{]
method[publish, return_type[type[Multimap]], modifier[public], parameter[]] begin[{]
local_variable[type[Multimap], result]
if[binary_operation[THIS[member[None.cache]], !=, literal[null]]] begin[{]
call[result.keySet, parameter[]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Multimap] operator[<] identifier[Id] , identifier[Revision] operator[>] identifier[publish] operator[SEP] operator[SEP] {
identifier[Multimap] operator[<] identifier[Id] , identifier[Revision] operator[>] identifier[result] operator[=] identifier[options] operator[SEP] identifier[transactions] operator[SEP] identifier[writeNewRequired] operator[SEP] Keyword[this] operator[::] identifier[doPublish] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[cache] operator[!=] Other[null] operator[SEP] {
identifier[result] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] Keyword[this] operator[SEP] identifier[cache] operator[::] identifier[refresh] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void deleteMessages() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
OfflineMessageRequest request = new OfflineMessageRequest();
request.setType(IQ.Type.set);
request.setPurge(true);
connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
} | class class_name[name] begin[{]
method[deleteMessages, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[OfflineMessageRequest], request]
call[request.setType, parameter[member[IQ.Type.set]]]
call[request.setPurge, parameter[literal[true]]]
call[connection.createStanzaCollectorAndSend, parameter[member[.request]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[deleteMessages] operator[SEP] operator[SEP] Keyword[throws] identifier[NoResponseException] , identifier[XMPPErrorException] , identifier[NotConnectedException] , identifier[InterruptedException] {
identifier[OfflineMessageRequest] identifier[request] operator[=] Keyword[new] identifier[OfflineMessageRequest] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setType] operator[SEP] identifier[IQ] operator[SEP] identifier[Type] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setPurge] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[createStanzaCollectorAndSend] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[nextResultOrThrow] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
@CallerSideMethod public void subscribe(Subscriber subs) {
// need callerside to transform to Callback
Callback callback = (r, e) -> {
if (Actors.isResult(e))
subs.getReceiver().receive((ChangeMessage) r);
};
_subscribe(subs.getFilter(), callback, subs.getId());
} | class class_name[name] begin[{]
method[subscribe, return_type[void], modifier[public], parameter[subs]] begin[{]
local_variable[type[Callback], callback]
call[._subscribe, parameter[call[subs.getFilter, parameter[]], member[.callback], call[subs.getId, parameter[]]]]
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[CallerSideMethod] Keyword[public] Keyword[void] identifier[subscribe] operator[SEP] identifier[Subscriber] identifier[subs] operator[SEP] {
identifier[Callback] identifier[callback] operator[=] operator[SEP] identifier[r] , identifier[e] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[Actors] operator[SEP] identifier[isResult] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[subs] operator[SEP] identifier[getReceiver] operator[SEP] operator[SEP] operator[SEP] identifier[receive] operator[SEP] operator[SEP] identifier[ChangeMessage] operator[SEP] identifier[r] operator[SEP] operator[SEP]
} operator[SEP] identifier[_subscribe] operator[SEP] identifier[subs] operator[SEP] identifier[getFilter] operator[SEP] operator[SEP] , identifier[callback] , identifier[subs] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
void addShifted(MutableBigInteger addend, int n) {
if (addend.isZero()) {
return;
}
int x = intLen;
int y = addend.intLen + n;
int resultLen = (intLen > y ? intLen : y);
int[] result = (value.length < resultLen ? new int[resultLen] : value);
int rstart = result.length-1;
long sum;
long carry = 0;
// Add common parts of both numbers
while (x > 0 && y > 0) {
x--; y--;
int bval = y+addend.offset < addend.value.length ? addend.value[y+addend.offset] : 0;
sum = (value[x+offset] & LONG_MASK) +
(bval & LONG_MASK) + carry;
result[rstart--] = (int)sum;
carry = sum >>> 32;
}
// Add remainder of the longer number
while (x > 0) {
x--;
if (carry == 0 && result == value && rstart == (x + offset)) {
return;
}
sum = (value[x+offset] & LONG_MASK) + carry;
result[rstart--] = (int)sum;
carry = sum >>> 32;
}
while (y > 0) {
y--;
int bval = y+addend.offset < addend.value.length ? addend.value[y+addend.offset] : 0;
sum = (bval & LONG_MASK) + carry;
result[rstart--] = (int)sum;
carry = sum >>> 32;
}
if (carry > 0) { // Result must grow in length
resultLen++;
if (result.length < resultLen) {
int temp[] = new int[resultLen];
// Result one word longer from carry-out; copy low-order
// bits into new result.
System.arraycopy(result, 0, temp, 1, result.length);
temp[0] = 1;
result = temp;
} else {
result[rstart--] = 1;
}
}
value = result;
intLen = resultLen;
offset = result.length - resultLen;
} | class class_name[name] begin[{]
method[addShifted, return_type[void], modifier[default], parameter[addend, n]] begin[{]
if[call[addend.isZero, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[int], x]
local_variable[type[int], y]
local_variable[type[int], resultLen]
local_variable[type[int], result]
local_variable[type[int], rstart]
local_variable[type[long], sum]
local_variable[type[long], carry]
while[binary_operation[binary_operation[member[.x], >, literal[0]], &&, binary_operation[member[.y], >, literal[0]]]] begin[{]
member[.x]
member[.y]
local_variable[type[int], bval]
assign[member[.sum], binary_operation[binary_operation[binary_operation[member[.value], &, member[.LONG_MASK]], +, binary_operation[member[.bval], &, member[.LONG_MASK]]], +, member[.carry]]]
assign[member[.result], Cast(expression=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]
assign[member[.carry], binary_operation[member[.sum], >>>, literal[32]]]
end[}]
while[binary_operation[member[.x], >, literal[0]]] begin[{]
member[.x]
if[binary_operation[binary_operation[binary_operation[member[.carry], ==, literal[0]], &&, binary_operation[member[.result], ==, member[.value]]], &&, binary_operation[member[.rstart], ==, binary_operation[member[.x], +, member[.offset]]]]] begin[{]
return[None]
else begin[{]
None
end[}]
assign[member[.sum], binary_operation[binary_operation[member[.value], &, member[.LONG_MASK]], +, member[.carry]]]
assign[member[.result], Cast(expression=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]
assign[member[.carry], binary_operation[member[.sum], >>>, literal[32]]]
end[}]
while[binary_operation[member[.y], >, literal[0]]] begin[{]
member[.y]
local_variable[type[int], bval]
assign[member[.sum], binary_operation[binary_operation[member[.bval], &, member[.LONG_MASK]], +, member[.carry]]]
assign[member[.result], Cast(expression=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]
assign[member[.carry], binary_operation[member[.sum], >>>, literal[32]]]
end[}]
if[binary_operation[member[.carry], >, literal[0]]] begin[{]
member[.resultLen]
if[binary_operation[member[result.length], <, member[.resultLen]]] begin[{]
local_variable[type[int], temp]
call[System.arraycopy, parameter[member[.result], literal[0], member[.temp], literal[1], member[result.length]]]
assign[member[.temp], literal[1]]
assign[member[.result], member[.temp]]
else begin[{]
assign[member[.result], literal[1]]
end[}]
else begin[{]
None
end[}]
assign[member[.value], member[.result]]
assign[member[.intLen], member[.resultLen]]
assign[member[.offset], binary_operation[member[result.length], -, member[.resultLen]]]
end[}]
END[}] | Keyword[void] identifier[addShifted] operator[SEP] identifier[MutableBigInteger] identifier[addend] , Keyword[int] identifier[n] operator[SEP] {
Keyword[if] operator[SEP] identifier[addend] operator[SEP] identifier[isZero] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[int] identifier[x] operator[=] identifier[intLen] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[addend] operator[SEP] identifier[intLen] operator[+] identifier[n] operator[SEP] Keyword[int] identifier[resultLen] operator[=] operator[SEP] identifier[intLen] operator[>] identifier[y] operator[?] identifier[intLen] operator[:] identifier[y] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[result] operator[=] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[<] identifier[resultLen] operator[?] Keyword[new] Keyword[int] operator[SEP] identifier[resultLen] operator[SEP] operator[:] identifier[value] operator[SEP] operator[SEP] Keyword[int] identifier[rstart] operator[=] identifier[result] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[long] identifier[sum] operator[SEP] Keyword[long] identifier[carry] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[x] operator[>] Other[0] operator[&&] identifier[y] operator[>] Other[0] operator[SEP] {
identifier[x] operator[--] operator[SEP] identifier[y] operator[--] operator[SEP] Keyword[int] identifier[bval] operator[=] identifier[y] operator[+] identifier[addend] operator[SEP] identifier[offset] operator[<] identifier[addend] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[?] identifier[addend] operator[SEP] identifier[value] operator[SEP] identifier[y] operator[+] identifier[addend] operator[SEP] identifier[offset] operator[SEP] operator[:] Other[0] operator[SEP] identifier[sum] operator[=] operator[SEP] identifier[value] operator[SEP] identifier[x] operator[+] identifier[offset] operator[SEP] operator[&] identifier[LONG_MASK] operator[SEP] operator[+] operator[SEP] identifier[bval] operator[&] identifier[LONG_MASK] operator[SEP] operator[+] identifier[carry] operator[SEP] identifier[result] operator[SEP] identifier[rstart] operator[--] operator[SEP] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[sum] operator[SEP] identifier[carry] operator[=] identifier[sum] operator[>] operator[>] operator[>] Other[32] operator[SEP]
}
Keyword[while] operator[SEP] identifier[x] operator[>] Other[0] operator[SEP] {
identifier[x] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[carry] operator[==] Other[0] operator[&&] identifier[result] operator[==] identifier[value] operator[&&] identifier[rstart] operator[==] operator[SEP] identifier[x] operator[+] identifier[offset] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[sum] operator[=] operator[SEP] identifier[value] operator[SEP] identifier[x] operator[+] identifier[offset] operator[SEP] operator[&] identifier[LONG_MASK] operator[SEP] operator[+] identifier[carry] operator[SEP] identifier[result] operator[SEP] identifier[rstart] operator[--] operator[SEP] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[sum] operator[SEP] identifier[carry] operator[=] identifier[sum] operator[>] operator[>] operator[>] Other[32] operator[SEP]
}
Keyword[while] operator[SEP] identifier[y] operator[>] Other[0] operator[SEP] {
identifier[y] operator[--] operator[SEP] Keyword[int] identifier[bval] operator[=] identifier[y] operator[+] identifier[addend] operator[SEP] identifier[offset] operator[<] identifier[addend] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[?] identifier[addend] operator[SEP] identifier[value] operator[SEP] identifier[y] operator[+] identifier[addend] operator[SEP] identifier[offset] operator[SEP] operator[:] Other[0] operator[SEP] identifier[sum] operator[=] operator[SEP] identifier[bval] operator[&] identifier[LONG_MASK] operator[SEP] operator[+] identifier[carry] operator[SEP] identifier[result] operator[SEP] identifier[rstart] operator[--] operator[SEP] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[sum] operator[SEP] identifier[carry] operator[=] identifier[sum] operator[>] operator[>] operator[>] Other[32] operator[SEP]
}
Keyword[if] operator[SEP] identifier[carry] operator[>] Other[0] operator[SEP] {
identifier[resultLen] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[length] operator[<] identifier[resultLen] operator[SEP] {
Keyword[int] identifier[temp] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[resultLen] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[result] , Other[0] , identifier[temp] , Other[1] , identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[temp] operator[SEP] Other[0] operator[SEP] operator[=] Other[1] operator[SEP] identifier[result] operator[=] identifier[temp] operator[SEP]
}
Keyword[else] {
identifier[result] operator[SEP] identifier[rstart] operator[--] operator[SEP] operator[=] Other[1] operator[SEP]
}
}
identifier[value] operator[=] identifier[result] operator[SEP] identifier[intLen] operator[=] identifier[resultLen] operator[SEP] identifier[offset] operator[=] identifier[result] operator[SEP] identifier[length] operator[-] identifier[resultLen] operator[SEP]
}
|
private void writeObject(ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
// not all values in the property bag are going to be serializable; we
// need to be careful which parts of the bag we serialize
//
Map<Object, Object> tempProperties = new HashMap<Object, Object>();
for (Object key : this.properties.keySet()) {
Object value = this.properties.get(key);
if (value instanceof Serializable || value instanceof Externalizable) {
tempProperties.put(key, value);
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "value for key \"" + key + "\" is not serializable");
}
}
}
stream.writeObject(tempProperties);
} | class class_name[name] begin[{]
method[writeObject, return_type[void], modifier[private], parameter[stream]] begin[{]
call[stream.defaultWriteObject, parameter[]]
local_variable[type[Map], tempProperties]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=properties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Serializable, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Externalizable, sub_type=None), operator=instanceof), operator=||), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value for key \""), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" is not serializable"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=tempProperties, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=properties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
call[stream.writeObject, parameter[member[.tempProperties]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[writeObject] operator[SEP] identifier[ObjectOutputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[stream] operator[SEP] identifier[defaultWriteObject] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[tempProperties] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Object] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[key] operator[:] Keyword[this] operator[SEP] identifier[properties] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Object] identifier[value] operator[=] Keyword[this] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Serializable] operator[||] identifier[value] Keyword[instanceof] identifier[Externalizable] operator[SEP] {
identifier[tempProperties] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
}
identifier[stream] operator[SEP] identifier[writeObject] operator[SEP] identifier[tempProperties] operator[SEP] operator[SEP]
}
|
public void sendMessage(BaseMessage messageOut, BaseInternalMessageProcessor messageOutProcessor)
{
int iErrorCode = this.convertToExternal(messageOut, messageOutProcessor); // Convert my standard message to the external format for this message
BaseMessage messageReplyIn = null;
if (iErrorCode != DBConstants.NORMAL_RETURN)
{
String strMessageDescription = this.getTask().getLastError(iErrorCode);
if ((strMessageDescription == null) || (strMessageDescription.length() == 0))
strMessageDescription = "Error converting to external format";
iErrorCode = this.getTask().setLastError(strMessageDescription);
messageReplyIn = BaseMessageProcessor.processErrorMessage(this, messageOut, strMessageDescription);
}
else
{
Utility.getLogger().info("sendMessage externalTrxMessage = " + messageOut);
messageReplyIn = this.sendMessageRequest(messageOut);
}
if (messageReplyIn != null) // No reply if null.
{
this.setupReplyMessage(messageReplyIn, messageOut, MessageInfoTypeModel.REPLY, MessageTypeModel.MESSAGE_IN);
Utility.getLogger().info("externalMessageReply: " + messageReplyIn);
this.processIncomingMessage(messageReplyIn, messageOut);
}
} | class class_name[name] begin[{]
method[sendMessage, return_type[void], modifier[public], parameter[messageOut, messageOutProcessor]] begin[{]
local_variable[type[int], iErrorCode]
local_variable[type[BaseMessage], messageReplyIn]
if[binary_operation[member[.iErrorCode], !=, member[DBConstants.NORMAL_RETURN]]] begin[{]
local_variable[type[String], strMessageDescription]
if[binary_operation[binary_operation[member[.strMessageDescription], ==, literal[null]], ||, binary_operation[call[strMessageDescription.length, parameter[]], ==, literal[0]]]] begin[{]
assign[member[.strMessageDescription], literal["Error converting to external format"]]
else begin[{]
None
end[}]
assign[member[.iErrorCode], THIS[call[None.getTask, parameter[]]call[None.setLastError, parameter[member[.strMessageDescription]]]]]
assign[member[.messageReplyIn], call[BaseMessageProcessor.processErrorMessage, parameter[THIS[], member[.messageOut], member[.strMessageDescription]]]]
else begin[{]
call[Utility.getLogger, parameter[]]
assign[member[.messageReplyIn], THIS[call[None.sendMessageRequest, parameter[member[.messageOut]]]]]
end[}]
if[binary_operation[member[.messageReplyIn], !=, literal[null]]] begin[{]
THIS[call[None.setupReplyMessage, parameter[member[.messageReplyIn], member[.messageOut], member[MessageInfoTypeModel.REPLY], member[MessageTypeModel.MESSAGE_IN]]]]
call[Utility.getLogger, parameter[]]
THIS[call[None.processIncomingMessage, parameter[member[.messageReplyIn], member[.messageOut]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[sendMessage] operator[SEP] identifier[BaseMessage] identifier[messageOut] , identifier[BaseInternalMessageProcessor] identifier[messageOutProcessor] operator[SEP] {
Keyword[int] identifier[iErrorCode] operator[=] Keyword[this] operator[SEP] identifier[convertToExternal] operator[SEP] identifier[messageOut] , identifier[messageOutProcessor] operator[SEP] operator[SEP] identifier[BaseMessage] identifier[messageReplyIn] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[iErrorCode] operator[!=] identifier[DBConstants] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] {
identifier[String] identifier[strMessageDescription] operator[=] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[getLastError] operator[SEP] identifier[iErrorCode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strMessageDescription] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[strMessageDescription] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] identifier[strMessageDescription] operator[=] literal[String] operator[SEP] identifier[iErrorCode] operator[=] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[setLastError] operator[SEP] identifier[strMessageDescription] operator[SEP] operator[SEP] identifier[messageReplyIn] operator[=] identifier[BaseMessageProcessor] operator[SEP] identifier[processErrorMessage] operator[SEP] Keyword[this] , identifier[messageOut] , identifier[strMessageDescription] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Utility] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[messageOut] operator[SEP] operator[SEP] identifier[messageReplyIn] operator[=] Keyword[this] operator[SEP] identifier[sendMessageRequest] operator[SEP] identifier[messageOut] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[messageReplyIn] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[setupReplyMessage] operator[SEP] identifier[messageReplyIn] , identifier[messageOut] , identifier[MessageInfoTypeModel] operator[SEP] identifier[REPLY] , identifier[MessageTypeModel] operator[SEP] identifier[MESSAGE_IN] operator[SEP] operator[SEP] identifier[Utility] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[messageReplyIn] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processIncomingMessage] operator[SEP] identifier[messageReplyIn] , identifier[messageOut] operator[SEP] operator[SEP]
}
}
|
static Function<String, ManagedCloudSdk> newManagedSdkFactory() {
return (version) -> {
try {
if (Strings.isNullOrEmpty(version)) {
return ManagedCloudSdk.newManagedSdk();
} else {
return ManagedCloudSdk.newManagedSdk(new Version(version));
}
} catch (UnsupportedOsException | BadCloudSdkVersionException ex) {
throw new RuntimeException(ex);
}
};
} | class class_name[name] begin[{]
method[newManagedSdkFactory, return_type[type[Function]], modifier[static], parameter[]] begin[{]
return[LambdaExpression(body=[TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNullOrEmpty, postfix_operators=[], prefix_operators=[], qualifier=Strings, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=version, 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=Version, sub_type=None))], member=newManagedSdk, postfix_operators=[], prefix_operators=[], qualifier=ManagedCloudSdk, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=newManagedSdk, postfix_operators=[], prefix_operators=[], qualifier=ManagedCloudSdk, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, 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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['UnsupportedOsException', 'BadCloudSdkVersionException']))], finally_block=None, label=None, resources=None)], parameters=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]
end[}]
END[}] | Keyword[static] identifier[Function] operator[<] identifier[String] , identifier[ManagedCloudSdk] operator[>] identifier[newManagedSdkFactory] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[version] operator[SEP] operator[->] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[version] operator[SEP] operator[SEP] {
Keyword[return] identifier[ManagedCloudSdk] operator[SEP] identifier[newManagedSdk] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[ManagedCloudSdk] operator[SEP] identifier[newManagedSdk] operator[SEP] Keyword[new] identifier[Version] operator[SEP] identifier[version] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[UnsupportedOsException] operator[|] identifier[BadCloudSdkVersionException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
Get generateContinueRequest(String cmcontinue) {
return newRequestBuilder() //
.param("cmcontinue", MediaWiki.urlEncode(cmcontinue)) //
.buildGet();
} | class class_name[name] begin[{]
method[generateContinueRequest, return_type[type[Get]], modifier[default], parameter[cmcontinue]] begin[{]
return[call[.newRequestBuilder, parameter[]]]
end[}]
END[}] | identifier[Get] identifier[generateContinueRequest] operator[SEP] identifier[String] identifier[cmcontinue] operator[SEP] {
Keyword[return] identifier[newRequestBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] literal[String] , identifier[MediaWiki] operator[SEP] identifier[urlEncode] operator[SEP] identifier[cmcontinue] operator[SEP] operator[SEP] operator[SEP] identifier[buildGet] operator[SEP] operator[SEP] operator[SEP]
}
|
public static BitfinexCandlestickSymbol fromBitfinexString(final String symbol) {
if(! symbol.startsWith("trade:")) {
throw new IllegalArgumentException("Unable to parse: " + symbol);
}
final String[] splitString = symbol.split(":");
if(splitString.length != 3) {
throw new IllegalArgumentException("Unable to parse: " + symbol);
}
final String timeframeString = splitString[1];
final String symbolString = splitString[2];
return BitfinexSymbols.candlesticks(
BitfinexCurrencyPair.fromSymbolString(symbolString),
BitfinexCandleTimeFrame.fromSymbolString(timeframeString));
} | class class_name[name] begin[{]
method[fromBitfinexString, return_type[type[BitfinexCandlestickSymbol]], modifier[public static], parameter[symbol]] begin[{]
if[call[symbol.startsWith, parameter[literal["trade:"]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to parse: "), operandr=MemberReference(member=symbol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], splitString]
if[binary_operation[member[splitString.length], !=, literal[3]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to parse: "), operandr=MemberReference(member=symbol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], timeframeString]
local_variable[type[String], symbolString]
return[call[BitfinexSymbols.candlesticks, parameter[call[BitfinexCurrencyPair.fromSymbolString, parameter[member[.symbolString]]], call[BitfinexCandleTimeFrame.fromSymbolString, parameter[member[.timeframeString]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BitfinexCandlestickSymbol] identifier[fromBitfinexString] operator[SEP] Keyword[final] identifier[String] identifier[symbol] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[symbol] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[symbol] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[splitString] operator[=] identifier[symbol] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[splitString] operator[SEP] identifier[length] operator[!=] Other[3] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[symbol] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[timeframeString] operator[=] identifier[splitString] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[symbolString] operator[=] identifier[splitString] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[return] identifier[BitfinexSymbols] operator[SEP] identifier[candlesticks] operator[SEP] identifier[BitfinexCurrencyPair] operator[SEP] identifier[fromSymbolString] operator[SEP] identifier[symbolString] operator[SEP] , identifier[BitfinexCandleTimeFrame] operator[SEP] identifier[fromSymbolString] operator[SEP] identifier[timeframeString] operator[SEP] operator[SEP] operator[SEP]
}
|
public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
if (creationalContext != null) {
T instance = contextual.create(creationalContext);
if (creationalContext instanceof WeldCreationalContext<?>) {
addDependentInstance(instance, contextual, (WeldCreationalContext<T>) creationalContext);
}
return instance;
} else {
return null;
}
} | class class_name[name] begin[{]
method[get, return_type[type[T]], modifier[public], parameter[contextual, creationalContext]] begin[{]
if[call[.isActive, parameter[]]] 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=ContextNotActiveException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.creationalContext], !=, literal[null]]] begin[{]
local_variable[type[T], instance]
if[binary_operation[member[.creationalContext], instanceof, type[WeldCreationalContext]]] begin[{]
call[.addDependentInstance, parameter[member[.instance], member[.contextual], Cast(expression=MemberReference(member=creationalContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=WeldCreationalContext, sub_type=None))]]
else begin[{]
None
end[}]
return[member[.instance]]
else begin[{]
return[literal[null]]
end[}]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[get] operator[SEP] identifier[Contextual] operator[<] identifier[T] operator[>] identifier[contextual] , identifier[CreationalContext] operator[<] identifier[T] operator[>] identifier[creationalContext] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ContextNotActiveException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[creationalContext] operator[!=] Other[null] operator[SEP] {
identifier[T] identifier[instance] operator[=] identifier[contextual] operator[SEP] identifier[create] operator[SEP] identifier[creationalContext] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[creationalContext] Keyword[instanceof] identifier[WeldCreationalContext] operator[<] operator[?] operator[>] operator[SEP] {
identifier[addDependentInstance] operator[SEP] identifier[instance] , identifier[contextual] , operator[SEP] identifier[WeldCreationalContext] operator[<] identifier[T] operator[>] operator[SEP] identifier[creationalContext] operator[SEP] operator[SEP]
}
Keyword[return] identifier[instance] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public List<List<SquareNode>> process(List<Polygon2D_F64> squares ) {
recycleData();
// set up nodes
computeNodeInfo(squares);
// Connect nodes to each other
connectNodes();
// Prune noise
disconnectSingleConnections();
// Find all valid graphs
findClusters();
return clusters.toList();
} | class class_name[name] begin[{]
method[process, return_type[type[List]], modifier[public], parameter[squares]] begin[{]
call[.recycleData, parameter[]]
call[.computeNodeInfo, parameter[member[.squares]]]
call[.connectNodes, parameter[]]
call[.disconnectSingleConnections, parameter[]]
call[.findClusters, parameter[]]
return[call[clusters.toList, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[List] operator[<] identifier[SquareNode] operator[>] operator[>] identifier[process] operator[SEP] identifier[List] operator[<] identifier[Polygon2D_F64] operator[>] identifier[squares] operator[SEP] {
identifier[recycleData] operator[SEP] operator[SEP] operator[SEP] identifier[computeNodeInfo] operator[SEP] identifier[squares] operator[SEP] operator[SEP] identifier[connectNodes] operator[SEP] operator[SEP] operator[SEP] identifier[disconnectSingleConnections] operator[SEP] operator[SEP] operator[SEP] identifier[findClusters] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[clusters] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void startFakeThread(ServerSocket server) {
Thread thread = new Thread(new FakeRunnable(server));
thread.start();
} | class class_name[name] begin[{]
method[startFakeThread, return_type[void], modifier[public static], parameter[server]] begin[{]
local_variable[type[Thread], thread]
call[thread.start, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[startFakeThread] operator[SEP] identifier[ServerSocket] identifier[server] operator[SEP] {
identifier[Thread] identifier[thread] operator[=] Keyword[new] identifier[Thread] operator[SEP] Keyword[new] identifier[FakeRunnable] operator[SEP] identifier[server] operator[SEP] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
|
private void createTables(PersistenceServiceUnit persistenceServiceUnit) throws Exception {
// Run under a new transaction and commit right away
LocalTransactionCurrent localTranCurrent = this.localTranCurrent;
LocalTransactionCoordinator suspendedLTC = localTranCurrent.suspend();
EmbeddableWebSphereTransactionManager tranMgr = this.tranMgr;
Transaction suspendedTran = suspendedLTC == null ? tranMgr.suspend() : null;
boolean psuIsPUSI = (persistenceServiceUnit instanceof PersistenceServiceUnitImpl) ? true : false;
synchronized (persistenceServiceUnit) {
try {
if (psuIsPUSI) {
((PersistenceServiceUnitImpl) persistenceServiceUnit).setTransactionManager(tranMgr);
}
persistenceServiceUnit.createTables();
} finally {
// resume
if (psuIsPUSI) {
((PersistenceServiceUnitImpl) persistenceServiceUnit).setTransactionManager(null);
}
if (suspendedTran != null)
tranMgr.resume(suspendedTran);
else if (suspendedLTC != null)
localTranCurrent.resume(suspendedLTC);
}
}
} | class class_name[name] begin[{]
method[createTables, return_type[void], modifier[private], parameter[persistenceServiceUnit]] begin[{]
local_variable[type[LocalTransactionCurrent], localTranCurrent]
local_variable[type[LocalTransactionCoordinator], suspendedLTC]
local_variable[type[EmbeddableWebSphereTransactionManager], tranMgr]
local_variable[type[Transaction], suspendedTran]
local_variable[type[boolean], psuIsPUSI]
SYNCHRONIZED[member[.persistenceServiceUnit]] BEGIN[{]
TryStatement(block=[IfStatement(condition=MemberReference(member=psuIsPUSI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=persistenceServiceUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PersistenceServiceUnitImpl, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=createTables, postfix_operators=[], prefix_operators=[], qualifier=persistenceServiceUnit, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=psuIsPUSI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=persistenceServiceUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PersistenceServiceUnitImpl, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=suspendedTran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=suspendedLTC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=suspendedLTC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resume, postfix_operators=[], prefix_operators=[], qualifier=localTranCurrent, selectors=[], type_arguments=None), label=None)), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=suspendedTran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resume, postfix_operators=[], prefix_operators=[], qualifier=tranMgr, selectors=[], type_arguments=None), label=None))], label=None, resources=None)
END[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createTables] operator[SEP] identifier[PersistenceServiceUnit] identifier[persistenceServiceUnit] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[LocalTransactionCurrent] identifier[localTranCurrent] operator[=] Keyword[this] operator[SEP] identifier[localTranCurrent] operator[SEP] identifier[LocalTransactionCoordinator] identifier[suspendedLTC] operator[=] identifier[localTranCurrent] operator[SEP] identifier[suspend] operator[SEP] operator[SEP] operator[SEP] identifier[EmbeddableWebSphereTransactionManager] identifier[tranMgr] operator[=] Keyword[this] operator[SEP] identifier[tranMgr] operator[SEP] identifier[Transaction] identifier[suspendedTran] operator[=] identifier[suspendedLTC] operator[==] Other[null] operator[?] identifier[tranMgr] operator[SEP] identifier[suspend] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[boolean] identifier[psuIsPUSI] operator[=] operator[SEP] identifier[persistenceServiceUnit] Keyword[instanceof] identifier[PersistenceServiceUnitImpl] operator[SEP] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] Keyword[synchronized] operator[SEP] identifier[persistenceServiceUnit] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[psuIsPUSI] operator[SEP] {
operator[SEP] operator[SEP] identifier[PersistenceServiceUnitImpl] operator[SEP] identifier[persistenceServiceUnit] operator[SEP] operator[SEP] identifier[setTransactionManager] operator[SEP] identifier[tranMgr] operator[SEP] operator[SEP]
}
identifier[persistenceServiceUnit] operator[SEP] identifier[createTables] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[psuIsPUSI] operator[SEP] {
operator[SEP] operator[SEP] identifier[PersistenceServiceUnitImpl] operator[SEP] identifier[persistenceServiceUnit] operator[SEP] operator[SEP] identifier[setTransactionManager] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[suspendedTran] operator[!=] Other[null] operator[SEP] identifier[tranMgr] operator[SEP] identifier[resume] operator[SEP] identifier[suspendedTran] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[suspendedLTC] operator[!=] Other[null] operator[SEP] identifier[localTranCurrent] operator[SEP] identifier[resume] operator[SEP] identifier[suspendedLTC] operator[SEP] operator[SEP]
}
}
}
|
public static void processException(Object source
,Class sourceClass
,String methodName
,Throwable throwable
,String probe
,Object[] objects
)
{
if (TraceComponent.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(cclass
,"processException"
,new Object[]{source
,sourceClass
,methodName
,throwable
,probe
,objects
}
);
if (TraceComponent.isAnyTracingEnabled() && trace.isEventEnabled())
trace.event(cclass,
"processException",
throwable);
print(source
,sourceClass
,methodName
,throwable
,probe
,objects);
com.ibm.ws.ffdc.FFDCFilter.processException(throwable
,sourceClass.getName()+":"+methodName
,probe
,source
,objects);
if (TraceComponent.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.exit(cclass,"processException");
} | class class_name[name] begin[{]
method[processException, return_type[void], modifier[public static], parameter[source, sourceClass, methodName, throwable, probe, objects]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{]
call[trace.entry, parameter[member[.cclass], literal["processException"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sourceClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=probe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=objects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[trace.isEventEnabled, parameter[]]]] begin[{]
call[trace.event, parameter[member[.cclass], literal["processException"], member[.throwable]]]
else begin[{]
None
end[}]
call[.print, parameter[member[.source], member[.sourceClass], member[.methodName], member[.throwable], member[.probe], member[.objects]]]
call[com.ibm.ws.ffdc.FFDCFilter.processException, parameter[member[.throwable], binary_operation[binary_operation[call[sourceClass.getName, parameter[]], +, literal[":"]], +, member[.methodName]], member[.probe], member[.source], member[.objects]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{]
call[trace.exit, parameter[member[.cclass], literal["processException"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[processException] operator[SEP] identifier[Object] identifier[source] , identifier[Class] identifier[sourceClass] , identifier[String] identifier[methodName] , identifier[Throwable] identifier[throwable] , identifier[String] identifier[probe] , identifier[Object] operator[SEP] operator[SEP] identifier[objects] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[entry] operator[SEP] identifier[cclass] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[source] , identifier[sourceClass] , identifier[methodName] , identifier[throwable] , identifier[probe] , identifier[objects]
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[event] operator[SEP] identifier[cclass] , literal[String] , identifier[throwable] operator[SEP] operator[SEP] identifier[print] operator[SEP] identifier[source] , identifier[sourceClass] , identifier[methodName] , identifier[throwable] , identifier[probe] , identifier[objects] operator[SEP] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[throwable] , identifier[sourceClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[methodName] , identifier[probe] , identifier[source] , identifier[objects] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[exit] operator[SEP] identifier[cclass] , literal[String] operator[SEP] operator[SEP]
}
|
@NonNull
@Card.CardBrand
public static String getPossibleCardType(@Nullable String cardNumber) {
return getPossibleCardType(cardNumber, true);
} | class class_name[name] begin[{]
method[getPossibleCardType, return_type[type[String]], modifier[public static], parameter[cardNumber]] begin[{]
return[call[.getPossibleCardType, parameter[member[.cardNumber], literal[true]]]]
end[}]
END[}] | annotation[@] identifier[NonNull] annotation[@] identifier[Card] operator[SEP] identifier[CardBrand] Keyword[public] Keyword[static] identifier[String] identifier[getPossibleCardType] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[cardNumber] operator[SEP] {
Keyword[return] identifier[getPossibleCardType] operator[SEP] identifier[cardNumber] , literal[boolean] operator[SEP] operator[SEP]
}
|
protected void doExecuteCommand() {
if(!ValkyrieRepository.getInstance().getApplicationConfig().applicationSecurityManager().isSecuritySupported()) {
return ;
}
CompositeDialogPage tabbedPage = new TabbedDialogPage( "loginForm" );
final LoginForm loginForm = createLoginForm();
tabbedPage.addForm( loginForm );
if( getDefaultUserName() != null ) {
loginForm.setUserName( getDefaultUserName() );
}
dialog = new TitledPageApplicationDialog( tabbedPage ) {
protected boolean onFinish() {
loginForm.commit();
Authentication authentication = loginForm.getAuthentication();
// Hand this token to the security manager to actually attempt the login
ApplicationSecurityManager sm = getApplicationConfig().applicationSecurityManager();
try {
sm.doLogin( authentication );
postLogin();
return true;
} finally {
if( isClearPasswordOnFailure() ) {
loginForm.setPassword("");
}
loginForm.requestFocusInWindow();
}
}
protected void onCancel() {
super.onCancel(); // Close the dialog
// Now exit if configured
if( isCloseOnCancel() ) {
ApplicationSecurityManager sm = getApplicationConfig().applicationSecurityManager();
Authentication authentication = sm.getAuthentication();
if( authentication == null ) {
LoginCommand.this.logger.info( "User canceled login; close the application." );
getApplicationConfig().application().close();
}
}
}
protected ActionCommand getCallingCommand() {
return LoginCommand.this;
}
protected void onAboutToShow() {
loginForm.requestFocusInWindow();
}
};
dialog.setDisplayFinishSuccessMessage( displaySuccessMessage );
dialog.showDialog();
} | class class_name[name] begin[{]
method[doExecuteCommand, return_type[void], modifier[protected], parameter[]] begin[{]
if[call[ValkyrieRepository.getInstance, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[CompositeDialogPage], tabbedPage]
local_variable[type[LoginForm], loginForm]
call[tabbedPage.addForm, parameter[member[.loginForm]]]
if[binary_operation[call[.getDefaultUserName, parameter[]], !=, literal[null]]] begin[{]
call[loginForm.setUserName, parameter[call[.getDefaultUserName, parameter[]]]]
else begin[{]
None
end[}]
assign[member[.dialog], ClassCreator(arguments=[MemberReference(member=tabbedPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=loginForm, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAuthentication, postfix_operators=[], prefix_operators=[], qualifier=loginForm, selectors=[], type_arguments=None), name=authentication)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Authentication, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getApplicationConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=applicationSecurityManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=sm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ApplicationSecurityManager, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=authentication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doLogin, postfix_operators=[], prefix_operators=[], qualifier=sm, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=postLogin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=None, finally_block=[IfStatement(condition=MethodInvocation(arguments=[], member=isClearPasswordOnFailure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=setPassword, postfix_operators=[], prefix_operators=[], qualifier=loginForm, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=requestFocusInWindow, postfix_operators=[], prefix_operators=[], qualifier=loginForm, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], documentation=None, modifiers={'protected'}, name=onFinish, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=SuperMethodInvocation(arguments=[], member=onCancel, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isCloseOnCancel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getApplicationConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=applicationSecurityManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=sm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ApplicationSecurityManager, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAuthentication, postfix_operators=[], prefix_operators=[], qualifier=sm, selectors=[], type_arguments=None), name=authentication)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Authentication, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=authentication, 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=This(postfix_operators=[], prefix_operators=[], qualifier=LoginCommand, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User canceled login; close the application.")], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getApplicationConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=application, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]))], documentation=None, modifiers={'protected'}, name=onCancel, parameters=[], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=LoginCommand, selectors=[]), label=None)], documentation=None, modifiers={'protected'}, name=getCallingCommand, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=ActionCommand, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=requestFocusInWindow, postfix_operators=[], prefix_operators=[], qualifier=loginForm, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=onAboutToShow, 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=TitledPageApplicationDialog, sub_type=None))]
call[dialog.setDisplayFinishSuccessMessage, parameter[member[.displaySuccessMessage]]]
call[dialog.showDialog, parameter[]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[doExecuteCommand] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[ValkyrieRepository] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getApplicationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[applicationSecurityManager] operator[SEP] operator[SEP] operator[SEP] identifier[isSecuritySupported] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[CompositeDialogPage] identifier[tabbedPage] operator[=] Keyword[new] identifier[TabbedDialogPage] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[LoginForm] identifier[loginForm] operator[=] identifier[createLoginForm] operator[SEP] operator[SEP] operator[SEP] identifier[tabbedPage] operator[SEP] identifier[addForm] operator[SEP] identifier[loginForm] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getDefaultUserName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[loginForm] operator[SEP] identifier[setUserName] operator[SEP] identifier[getDefaultUserName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[dialog] operator[=] Keyword[new] identifier[TitledPageApplicationDialog] operator[SEP] identifier[tabbedPage] operator[SEP] {
Keyword[protected] Keyword[boolean] identifier[onFinish] operator[SEP] operator[SEP] {
identifier[loginForm] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] identifier[Authentication] identifier[authentication] operator[=] identifier[loginForm] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] identifier[ApplicationSecurityManager] identifier[sm] operator[=] identifier[getApplicationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[applicationSecurityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[sm] operator[SEP] identifier[doLogin] operator[SEP] identifier[authentication] operator[SEP] operator[SEP] identifier[postLogin] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[isClearPasswordOnFailure] operator[SEP] operator[SEP] operator[SEP] {
identifier[loginForm] operator[SEP] identifier[setPassword] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[loginForm] operator[SEP] identifier[requestFocusInWindow] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[protected] Keyword[void] identifier[onCancel] operator[SEP] operator[SEP] {
Keyword[super] operator[SEP] identifier[onCancel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isCloseOnCancel] operator[SEP] operator[SEP] operator[SEP] {
identifier[ApplicationSecurityManager] identifier[sm] operator[=] identifier[getApplicationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[applicationSecurityManager] operator[SEP] operator[SEP] operator[SEP] identifier[Authentication] identifier[authentication] operator[=] identifier[sm] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[authentication] operator[==] Other[null] operator[SEP] {
identifier[LoginCommand] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getApplicationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[application] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[protected] identifier[ActionCommand] identifier[getCallingCommand] operator[SEP] operator[SEP] {
Keyword[return] identifier[LoginCommand] operator[SEP] Keyword[this] operator[SEP]
}
Keyword[protected] Keyword[void] identifier[onAboutToShow] operator[SEP] operator[SEP] {
identifier[loginForm] operator[SEP] identifier[requestFocusInWindow] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] identifier[dialog] operator[SEP] identifier[setDisplayFinishSuccessMessage] operator[SEP] identifier[displaySuccessMessage] operator[SEP] operator[SEP] identifier[dialog] operator[SEP] identifier[showDialog] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void main(String[] args) {
Test instance = JKFactory.instance(Test.class);
System.out.println(instance.hello());
System.out.println(instance.hello());
System.out.println(instance.hello());
System.out.println(instance.hello());
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[args]] begin[{]
local_variable[type[Test], instance]
call[System.out.println, parameter[call[instance.hello, parameter[]]]]
call[System.out.println, parameter[call[instance.hello, parameter[]]]]
call[System.out.println, parameter[call[instance.hello, parameter[]]]]
call[System.out.println, parameter[call[instance.hello, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] {
identifier[Test] identifier[instance] operator[=] identifier[JKFactory] operator[SEP] identifier[instance] operator[SEP] identifier[Test] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[instance] operator[SEP] identifier[hello] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[instance] operator[SEP] identifier[hello] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[instance] operator[SEP] identifier[hello] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[instance] operator[SEP] identifier[hello] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private boolean checkText(final Characters paramEvent) {
assert paramEvent != null;
final String text = paramEvent.getData().trim();
return mWtx.getNode().getKind() == IConstants.TEXT && mWtx.getValueOfCurrentNode().equals(text);
} | class class_name[name] begin[{]
method[checkText, return_type[type[boolean]], modifier[private], parameter[paramEvent]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=paramEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
local_variable[type[String], text]
return[binary_operation[binary_operation[call[mWtx.getNode, parameter[]], ==, member[IConstants.TEXT]], &&, call[mWtx.getValueOfCurrentNode, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[checkText] operator[SEP] Keyword[final] identifier[Characters] identifier[paramEvent] operator[SEP] {
Keyword[assert] identifier[paramEvent] operator[!=] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[text] operator[=] identifier[paramEvent] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[mWtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[==] identifier[IConstants] operator[SEP] identifier[TEXT] operator[&&] identifier[mWtx] operator[SEP] identifier[getValueOfCurrentNode] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
|
protected final <T> String getString(final IKey<T> key) {
final Object value = config.get(key.key());
return String.valueOf(value != null ? value : key.getDefaultValue());
} | class class_name[name] begin[{]
method[getString, return_type[type[String]], modifier[final protected], parameter[key]] begin[{]
local_variable[type[Object], value]
return[call[String.valueOf, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[], member=getDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), if_true=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]]]
end[}]
END[}] | Keyword[protected] Keyword[final] operator[<] identifier[T] operator[>] identifier[String] identifier[getString] operator[SEP] Keyword[final] identifier[IKey] operator[<] identifier[T] operator[>] identifier[key] operator[SEP] {
Keyword[final] identifier[Object] identifier[value] operator[=] identifier[config] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[!=] Other[null] operator[?] identifier[value] operator[:] identifier[key] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Indexable(type = IndexableType.REINDEX)
@Override
public CommerceNotificationAttachment updateCommerceNotificationAttachment(
CommerceNotificationAttachment commerceNotificationAttachment) {
return commerceNotificationAttachmentPersistence.update(commerceNotificationAttachment);
} | class class_name[name] begin[{]
method[updateCommerceNotificationAttachment, return_type[type[CommerceNotificationAttachment]], modifier[public], parameter[commerceNotificationAttachment]] begin[{]
return[call[commerceNotificationAttachmentPersistence.update, parameter[member[.commerceNotificationAttachment]]]]
end[}]
END[}] | annotation[@] identifier[Indexable] operator[SEP] identifier[type] operator[=] identifier[IndexableType] operator[SEP] identifier[REINDEX] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[CommerceNotificationAttachment] identifier[updateCommerceNotificationAttachment] operator[SEP] identifier[CommerceNotificationAttachment] identifier[commerceNotificationAttachment] operator[SEP] {
Keyword[return] identifier[commerceNotificationAttachmentPersistence] operator[SEP] identifier[update] operator[SEP] identifier[commerceNotificationAttachment] operator[SEP] operator[SEP]
}
|
private void downHeap() {
E elem = storage.array[0];
int currIdx = 0;
while (2 * currIdx < size) {
int leftChildIdx = 2 * currIdx;
E leftChild = storage.array[leftChildIdx];
if (comparator.compare(elem, leftChild) > 0) {
storage.array[currIdx] = leftChild;
storage.array[leftChildIdx] = elem;
currIdx = leftChildIdx;
} else if (2 * currIdx + 1 < size) {
int rightChildIdx = 2 * currIdx + 1;
E rightChild = storage.array[rightChildIdx];
if (comparator.compare(elem, rightChild) > 0) {
storage.array[currIdx] = rightChild;
storage.array[rightChildIdx] = elem;
currIdx = rightChildIdx;
} else {
return;
}
} else {
return;
}
}
} | class class_name[name] begin[{]
method[downHeap, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[E], elem]
local_variable[type[int], currIdx]
while[binary_operation[binary_operation[literal[2], *, member[.currIdx]], <, member[.size]]] begin[{]
local_variable[type[int], leftChildIdx]
local_variable[type[E], leftChild]
if[binary_operation[call[comparator.compare, parameter[member[.elem], member[.leftChild]]], >, literal[0]]] begin[{]
assign[member[storage.array], member[.leftChild]]
assign[member[storage.array], member[.elem]]
assign[member[.currIdx], member[.leftChildIdx]]
else begin[{]
if[binary_operation[binary_operation[binary_operation[literal[2], *, member[.currIdx]], +, literal[1]], <, member[.size]]] begin[{]
local_variable[type[int], rightChildIdx]
local_variable[type[E], rightChild]
if[binary_operation[call[comparator.compare, parameter[member[.elem], member[.rightChild]]], >, literal[0]]] begin[{]
assign[member[storage.array], member[.rightChild]]
assign[member[storage.array], member[.elem]]
assign[member[.currIdx], member[.rightChildIdx]]
else begin[{]
return[None]
end[}]
else begin[{]
return[None]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[downHeap] operator[SEP] operator[SEP] {
identifier[E] identifier[elem] operator[=] identifier[storage] operator[SEP] identifier[array] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[currIdx] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] Other[2] operator[*] identifier[currIdx] operator[<] identifier[size] operator[SEP] {
Keyword[int] identifier[leftChildIdx] operator[=] Other[2] operator[*] identifier[currIdx] operator[SEP] identifier[E] identifier[leftChild] operator[=] identifier[storage] operator[SEP] identifier[array] operator[SEP] identifier[leftChildIdx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comparator] operator[SEP] identifier[compare] operator[SEP] identifier[elem] , identifier[leftChild] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[storage] operator[SEP] identifier[array] operator[SEP] identifier[currIdx] operator[SEP] operator[=] identifier[leftChild] operator[SEP] identifier[storage] operator[SEP] identifier[array] operator[SEP] identifier[leftChildIdx] operator[SEP] operator[=] identifier[elem] operator[SEP] identifier[currIdx] operator[=] identifier[leftChildIdx] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Other[2] operator[*] identifier[currIdx] operator[+] Other[1] operator[<] identifier[size] operator[SEP] {
Keyword[int] identifier[rightChildIdx] operator[=] Other[2] operator[*] identifier[currIdx] operator[+] Other[1] operator[SEP] identifier[E] identifier[rightChild] operator[=] identifier[storage] operator[SEP] identifier[array] operator[SEP] identifier[rightChildIdx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comparator] operator[SEP] identifier[compare] operator[SEP] identifier[elem] , identifier[rightChild] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[storage] operator[SEP] identifier[array] operator[SEP] identifier[currIdx] operator[SEP] operator[=] identifier[rightChild] operator[SEP] identifier[storage] operator[SEP] identifier[array] operator[SEP] identifier[rightChildIdx] operator[SEP] operator[=] identifier[elem] operator[SEP] identifier[currIdx] operator[=] identifier[rightChildIdx] operator[SEP]
}
Keyword[else] {
Keyword[return] operator[SEP]
}
}
Keyword[else] {
Keyword[return] operator[SEP]
}
}
}
|
@FFDCIgnore({ IllegalStateException.class, Exception.class })
public BundleLifecycleStatus uninstallBundles(final BundleContext bundleContext,
final BundleList removeBundles,
final BundleInstallStatus installStatus,
ShutdownHookManager shutdownHook) {
final List<Bundle> bundlesToUninstall = new ArrayList<Bundle>();
removeBundles.foreach(new FeatureResourceHandler() {
@Override
@FFDCIgnore({ Exception.class })
public boolean handle(FeatureResource fr) {
try {
Bundle b = removeBundles.getBundle(bundleContext, fr);
// We found the bundle we want to uninstall
if (b != null && b.getBundleId() > 0) {
bundlesToUninstall.add(b);
}
} catch (Exception e) {
installStatus.addInstallException("UNINSTALL " + fr.getLocation(), e);
}
return true;
}
});
// sort the bundle in reverse start-level order so that
// start-phase is consistently honored
Collections.sort(bundlesToUninstall, Collections.reverseOrder(BundleInstallStatus.sortByStartLevel));
for (Bundle bundleToUninstall : bundlesToUninstall) {
try {
bundleToUninstall.uninstall();
} catch (IllegalStateException e) {
// ok: bundle already uninstalled or the framework is stopping,
// determine if we should continue on to the next:
// (if the bundle was uninstalled, but the framework is in perfect health),
// or not (if the framework is stopping and we should just get done early).
if (!!!FrameworkState.isValid()) {
break;
}
} catch (Exception e) {
installStatus.addInstallException("UNINSTALL " + bundleToUninstall.getLocation(), e);
}
}
// Refresh bundles: provide a listener for notification of when refresh is complete
RefreshBundlesListener listener = new RefreshBundlesListener(shutdownHook);
FrameworkWiring wiring = adaptSystemBundle(bundleContext, FrameworkWiring.class);
if (wiring != null) {
wiring.refreshBundles(null, listener);
// wait for refresh operation to complete
listener.waitForComplete();
}
return listener.getStatus();
} | class class_name[name] begin[{]
method[uninstallBundles, return_type[type[BundleLifecycleStatus]], modifier[public], parameter[bundleContext, removeBundles, installStatus, shutdownHook]] begin[{]
local_variable[type[List], bundlesToUninstall]
call[removeBundles.foreach, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override), Annotation(element=ElementArrayValue(values=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))]), name=FFDCIgnore)], body=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bundleContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBundle, postfix_operators=[], prefix_operators=[], qualifier=removeBundles, selectors=[], type_arguments=None), name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Bundle, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBundleId, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=bundlesToUninstall, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UNINSTALL "), operandr=MethodInvocation(arguments=[], member=getLocation, postfix_operators=[], prefix_operators=[], qualifier=fr, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addInstallException, postfix_operators=[], prefix_operators=[], qualifier=installStatus, 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), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=fr, type=ReferenceType(arguments=None, dimensions=[], name=FeatureResource, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FeatureResourceHandler, sub_type=None))]]
call[Collections.sort, parameter[member[.bundlesToUninstall], call[Collections.reverseOrder, parameter[member[BundleInstallStatus.sortByStartLevel]]]]]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=uninstall, postfix_operators=[], prefix_operators=[], qualifier=bundleToUninstall, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isValid, postfix_operators=[], prefix_operators=['!', '!', '!'], qualifier=FrameworkState, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalStateException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UNINSTALL "), operandr=MethodInvocation(arguments=[], member=getLocation, postfix_operators=[], prefix_operators=[], qualifier=bundleToUninstall, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addInstallException, postfix_operators=[], prefix_operators=[], qualifier=installStatus, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=bundlesToUninstall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bundleToUninstall)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Bundle, sub_type=None))), label=None)
local_variable[type[RefreshBundlesListener], listener]
local_variable[type[FrameworkWiring], wiring]
if[binary_operation[member[.wiring], !=, literal[null]]] begin[{]
call[wiring.refreshBundles, parameter[literal[null], member[.listener]]]
call[listener.waitForComplete, parameter[]]
else begin[{]
None
end[}]
return[call[listener.getStatus, parameter[]]]
end[}]
END[}] | annotation[@] identifier[FFDCIgnore] operator[SEP] {
identifier[IllegalStateException] operator[SEP] Keyword[class] , identifier[Exception] operator[SEP] Keyword[class]
} operator[SEP] Keyword[public] identifier[BundleLifecycleStatus] identifier[uninstallBundles] operator[SEP] Keyword[final] identifier[BundleContext] identifier[bundleContext] , Keyword[final] identifier[BundleList] identifier[removeBundles] , Keyword[final] identifier[BundleInstallStatus] identifier[installStatus] , identifier[ShutdownHookManager] identifier[shutdownHook] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[Bundle] operator[>] identifier[bundlesToUninstall] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Bundle] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[removeBundles] operator[SEP] identifier[foreach] operator[SEP] Keyword[new] identifier[FeatureResourceHandler] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] annotation[@] identifier[FFDCIgnore] operator[SEP] {
identifier[Exception] operator[SEP] Keyword[class]
} operator[SEP] Keyword[public] Keyword[boolean] identifier[handle] operator[SEP] identifier[FeatureResource] identifier[fr] operator[SEP] {
Keyword[try] {
identifier[Bundle] identifier[b] operator[=] identifier[removeBundles] operator[SEP] identifier[getBundle] operator[SEP] identifier[bundleContext] , identifier[fr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[&&] identifier[b] operator[SEP] identifier[getBundleId] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[bundlesToUninstall] operator[SEP] identifier[add] operator[SEP] identifier[b] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[installStatus] operator[SEP] identifier[addInstallException] operator[SEP] literal[String] operator[+] identifier[fr] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[bundlesToUninstall] , identifier[Collections] operator[SEP] identifier[reverseOrder] operator[SEP] identifier[BundleInstallStatus] operator[SEP] identifier[sortByStartLevel] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Bundle] identifier[bundleToUninstall] operator[:] identifier[bundlesToUninstall] operator[SEP] {
Keyword[try] {
identifier[bundleToUninstall] operator[SEP] identifier[uninstall] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[!] operator[!] identifier[FrameworkState] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[installStatus] operator[SEP] identifier[addInstallException] operator[SEP] literal[String] operator[+] identifier[bundleToUninstall] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[RefreshBundlesListener] identifier[listener] operator[=] Keyword[new] identifier[RefreshBundlesListener] operator[SEP] identifier[shutdownHook] operator[SEP] operator[SEP] identifier[FrameworkWiring] identifier[wiring] operator[=] identifier[adaptSystemBundle] operator[SEP] identifier[bundleContext] , identifier[FrameworkWiring] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wiring] operator[!=] Other[null] operator[SEP] {
identifier[wiring] operator[SEP] identifier[refreshBundles] operator[SEP] Other[null] , identifier[listener] operator[SEP] operator[SEP] identifier[listener] operator[SEP] identifier[waitForComplete] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[listener] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP]
}
|
public <T extends AmazonWebServiceRequest> T withSdkClientExecutionTimeout(int sdkClientExecutionTimeout) {
setSdkClientExecutionTimeout(sdkClientExecutionTimeout);
@SuppressWarnings("unchecked")
T t = (T) this;
return t;
} | class class_name[name] begin[{]
method[withSdkClientExecutionTimeout, return_type[type[T]], modifier[public], parameter[sdkClientExecutionTimeout]] begin[{]
call[.setSdkClientExecutionTimeout, parameter[member[.sdkClientExecutionTimeout]]]
local_variable[type[T], t]
return[member[.t]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[AmazonWebServiceRequest] operator[>] identifier[T] identifier[withSdkClientExecutionTimeout] operator[SEP] Keyword[int] identifier[sdkClientExecutionTimeout] operator[SEP] {
identifier[setSdkClientExecutionTimeout] operator[SEP] identifier[sdkClientExecutionTimeout] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[T] identifier[t] operator[=] operator[SEP] identifier[T] operator[SEP] Keyword[this] operator[SEP] Keyword[return] identifier[t] operator[SEP]
}
|
public Observable<Page<DeletedCertificateItem>> getDeletedCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final Boolean includePending) {
return getDeletedCertificatesWithServiceResponseAsync(vaultBaseUrl, maxresults, includePending)
.map(new Func1<ServiceResponse<Page<DeletedCertificateItem>>, Page<DeletedCertificateItem>>() {
@Override
public Page<DeletedCertificateItem> call(ServiceResponse<Page<DeletedCertificateItem>> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[getDeletedCertificatesAsync, return_type[type[Observable]], modifier[public], parameter[vaultBaseUrl, maxresults, includePending]] begin[{]
return[call[.getDeletedCertificatesWithServiceResponseAsync, parameter[member[.vaultBaseUrl], member[.maxresults], member[.includePending]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[DeletedCertificateItem] operator[>] operator[>] identifier[getDeletedCertificatesAsync] operator[SEP] Keyword[final] identifier[String] identifier[vaultBaseUrl] , Keyword[final] identifier[Integer] identifier[maxresults] , Keyword[final] identifier[Boolean] identifier[includePending] operator[SEP] {
Keyword[return] identifier[getDeletedCertificatesWithServiceResponseAsync] operator[SEP] identifier[vaultBaseUrl] , identifier[maxresults] , identifier[includePending] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[DeletedCertificateItem] operator[>] operator[>] , identifier[Page] operator[<] identifier[DeletedCertificateItem] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[DeletedCertificateItem] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[DeletedCertificateItem] operator[>] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public void message(SourceLocator srcLctr, String msg, boolean terminate) throws TransformerException
{
ErrorListener errHandler = m_transformer.getErrorListener();
if (null != errHandler)
{
errHandler.warning(new TransformerException(msg, srcLctr));
}
else
{
if (terminate)
throw new TransformerException(msg, srcLctr);
else
System.out.println(msg);
}
} | class class_name[name] begin[{]
method[message, return_type[void], modifier[public], parameter[srcLctr, msg, terminate]] begin[{]
local_variable[type[ErrorListener], errHandler]
if[binary_operation[literal[null], !=, member[.errHandler]]] begin[{]
call[errHandler.warning, parameter[ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=srcLctr, 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=TransformerException, sub_type=None))]]
else begin[{]
if[member[.terminate]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=srcLctr, 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=TransformerException, sub_type=None)), label=None)
else begin[{]
call[System.out.println, parameter[member[.msg]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[message] operator[SEP] identifier[SourceLocator] identifier[srcLctr] , identifier[String] identifier[msg] , Keyword[boolean] identifier[terminate] operator[SEP] Keyword[throws] identifier[TransformerException] {
identifier[ErrorListener] identifier[errHandler] operator[=] identifier[m_transformer] operator[SEP] identifier[getErrorListener] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[errHandler] operator[SEP] {
identifier[errHandler] operator[SEP] identifier[warning] operator[SEP] Keyword[new] identifier[TransformerException] operator[SEP] identifier[msg] , identifier[srcLctr] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[terminate] operator[SEP] Keyword[throw] Keyword[new] identifier[TransformerException] operator[SEP] identifier[msg] , identifier[srcLctr] operator[SEP] operator[SEP] Keyword[else] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
}
|
public static String format(final OffsetTime self, String pattern) {
return self.format(DateTimeFormatter.ofPattern(pattern));
} | class class_name[name] begin[{]
method[format, return_type[type[String]], modifier[public static], parameter[self, pattern]] begin[{]
return[call[self.format, parameter[call[DateTimeFormatter.ofPattern, parameter[member[.pattern]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[format] operator[SEP] Keyword[final] identifier[OffsetTime] identifier[self] , identifier[String] identifier[pattern] operator[SEP] {
Keyword[return] identifier[self] operator[SEP] identifier[format] operator[SEP] identifier[DateTimeFormatter] operator[SEP] identifier[ofPattern] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] operator[SEP]
}
|
boolean isProtoBufMessageObject(Object object) {
if (object == null) {
return false;
}
if (MULTIPLE_CLASSLOADER) {
return object instanceof MessageLite || isProtoBufMessageClass(object.getClass());
} else {
return object instanceof MessageLite;
}
} | class class_name[name] begin[{]
method[isProtoBufMessageObject, return_type[type[boolean]], modifier[default], parameter[object]] begin[{]
if[binary_operation[member[.object], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[member[.MULTIPLE_CLASSLOADER]] begin[{]
return[binary_operation[binary_operation[member[.object], instanceof, type[MessageLite]], ||, call[.isProtoBufMessageClass, parameter[call[object.getClass, parameter[]]]]]]
else begin[{]
return[binary_operation[member[.object], instanceof, type[MessageLite]]]
end[}]
end[}]
END[}] | Keyword[boolean] identifier[isProtoBufMessageObject] operator[SEP] identifier[Object] identifier[object] operator[SEP] {
Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[MULTIPLE_CLASSLOADER] operator[SEP] {
Keyword[return] identifier[object] Keyword[instanceof] identifier[MessageLite] operator[||] identifier[isProtoBufMessageClass] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[object] Keyword[instanceof] identifier[MessageLite] operator[SEP]
}
}
|
public LightweightTypeReference getReturnTypeOfOverriddenOperation(JvmOperation operation, ITypeReferenceOwner owner, IVisibilityHelper visibilityHelper) {
if (operation.getVisibility() == JvmVisibility.PRIVATE || !InferredTypeIndicator.isInferred(operation.getReturnType())) {
return null;
}
LightweightTypeReference declaringType = owner.newParameterizedTypeReference(operation.getDeclaringType());
TypeParameterSubstitutor<?> substitutor = createSubstitutor(owner, declaringType);
JvmOperation overriddenOperation = findOverriddenOperation(operation, declaringType, substitutor, owner, visibilityHelper);
if (overriddenOperation != null) {
return substitutor.substitute(owner.toLightweightTypeReference(overriddenOperation.getReturnType()));
}
return null;
} | class class_name[name] begin[{]
method[getReturnTypeOfOverriddenOperation, return_type[type[LightweightTypeReference]], modifier[public], parameter[operation, owner, visibilityHelper]] begin[{]
if[binary_operation[binary_operation[call[operation.getVisibility, parameter[]], ==, member[JvmVisibility.PRIVATE]], ||, call[InferredTypeIndicator.isInferred, parameter[call[operation.getReturnType, parameter[]]]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[LightweightTypeReference], declaringType]
local_variable[type[TypeParameterSubstitutor], substitutor]
local_variable[type[JvmOperation], overriddenOperation]
if[binary_operation[member[.overriddenOperation], !=, literal[null]]] begin[{]
return[call[substitutor.substitute, parameter[call[owner.toLightweightTypeReference, parameter[call[overriddenOperation.getReturnType, parameter[]]]]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[LightweightTypeReference] identifier[getReturnTypeOfOverriddenOperation] operator[SEP] identifier[JvmOperation] identifier[operation] , identifier[ITypeReferenceOwner] identifier[owner] , identifier[IVisibilityHelper] identifier[visibilityHelper] operator[SEP] {
Keyword[if] operator[SEP] identifier[operation] operator[SEP] identifier[getVisibility] operator[SEP] operator[SEP] operator[==] identifier[JvmVisibility] operator[SEP] identifier[PRIVATE] operator[||] operator[!] identifier[InferredTypeIndicator] operator[SEP] identifier[isInferred] operator[SEP] identifier[operation] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[LightweightTypeReference] identifier[declaringType] operator[=] identifier[owner] operator[SEP] identifier[newParameterizedTypeReference] operator[SEP] identifier[operation] operator[SEP] identifier[getDeclaringType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TypeParameterSubstitutor] operator[<] operator[?] operator[>] identifier[substitutor] operator[=] identifier[createSubstitutor] operator[SEP] identifier[owner] , identifier[declaringType] operator[SEP] operator[SEP] identifier[JvmOperation] identifier[overriddenOperation] operator[=] identifier[findOverriddenOperation] operator[SEP] identifier[operation] , identifier[declaringType] , identifier[substitutor] , identifier[owner] , identifier[visibilityHelper] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[overriddenOperation] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[substitutor] operator[SEP] identifier[substitute] operator[SEP] identifier[owner] operator[SEP] identifier[toLightweightTypeReference] operator[SEP] identifier[overriddenOperation] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public ValidateTemplateResult withParameters(TemplateParameter... parameters) {
if (this.parameters == null) {
setParameters(new com.amazonaws.internal.SdkInternalList<TemplateParameter>(parameters.length));
}
for (TemplateParameter ele : parameters) {
this.parameters.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withParameters, return_type[type[ValidateTemplateResult]], modifier[public], parameter[parameters]] begin[{]
if[binary_operation[THIS[member[None.parameters]], ==, literal[null]]] begin[{]
call[.setParameters, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TemplateParameter, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=parameters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TemplateParameter, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ValidateTemplateResult] identifier[withParameters] operator[SEP] identifier[TemplateParameter] operator[...] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] {
identifier[setParameters] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[TemplateParameter] operator[>] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[TemplateParameter] identifier[ele] operator[:] identifier[parameters] operator[SEP] {
Keyword[this] operator[SEP] identifier[parameters] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public final void inlineListExpression() throws RecognitionException {
try {
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:5: ( LEFT_SQUARE ( expressionList )? RIGHT_SQUARE )
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:9: LEFT_SQUARE ( expressionList )? RIGHT_SQUARE
{
match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_inlineListExpression3100); if (state.failed) return;
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:21: ( expressionList )?
int alt61=2;
int LA61_0 = input.LA(1);
if ( (LA61_0==BOOL||(LA61_0 >= DECIMAL && LA61_0 <= DECR)||LA61_0==FLOAT||LA61_0==HEX||(LA61_0 >= ID && LA61_0 <= INCR)||(LA61_0 >= LEFT_PAREN && LA61_0 <= LESS)||LA61_0==MINUS||LA61_0==NEGATION||LA61_0==NULL||LA61_0==PLUS||(LA61_0 >= STAR && LA61_0 <= TIME_INTERVAL)) ) {
alt61=1;
}
switch (alt61) {
case 1 :
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:21: expressionList
{
pushFollow(FOLLOW_expressionList_in_inlineListExpression3102);
expressionList();
state._fsp--;
if (state.failed) return;
}
break;
}
match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_inlineListExpression3105); if (state.failed) return;
}
}
catch (RecognitionException re) {
throw re;
}
finally {
// do for sure before leaving
}
} | class class_name[name] begin[{]
method[inlineListExpression, return_type[void], modifier[final public], parameter[]] begin[{]
TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LEFT_SQUARE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_LEFT_SQUARE_in_inlineListExpression3100, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt61)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA61_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BOOL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DECIMAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DECR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FLOAT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=INCR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LEFT_PAREN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LESS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MINUS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NEGATION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PLUS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA61_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TIME_INTERVAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt61, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_expressionList_in_inlineListExpression3102, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=expressionList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt61, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=RIGHT_SQUARE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_RIGHT_SQUARE_in_inlineListExpression3105, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))])], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[inlineListExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
{
identifier[match] operator[SEP] identifier[input] , identifier[LEFT_SQUARE] , identifier[FOLLOW_LEFT_SQUARE_in_inlineListExpression3100] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[alt61] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA61_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA61_0] operator[==] identifier[BOOL] operator[||] operator[SEP] identifier[LA61_0] operator[>=] identifier[DECIMAL] operator[&&] identifier[LA61_0] operator[<=] identifier[DECR] operator[SEP] operator[||] identifier[LA61_0] operator[==] identifier[FLOAT] operator[||] identifier[LA61_0] operator[==] identifier[HEX] operator[||] operator[SEP] identifier[LA61_0] operator[>=] identifier[ID] operator[&&] identifier[LA61_0] operator[<=] identifier[INCR] operator[SEP] operator[||] operator[SEP] identifier[LA61_0] operator[>=] identifier[LEFT_PAREN] operator[&&] identifier[LA61_0] operator[<=] identifier[LESS] operator[SEP] operator[||] identifier[LA61_0] operator[==] identifier[MINUS] operator[||] identifier[LA61_0] operator[==] identifier[NEGATION] operator[||] identifier[LA61_0] operator[==] identifier[NULL] operator[||] identifier[LA61_0] operator[==] identifier[PLUS] operator[||] operator[SEP] identifier[LA61_0] operator[>=] identifier[STAR] operator[&&] identifier[LA61_0] operator[<=] identifier[TIME_INTERVAL] operator[SEP] operator[SEP] operator[SEP] {
identifier[alt61] operator[=] Other[1] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt61] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[pushFollow] operator[SEP] identifier[FOLLOW_expressionList_in_inlineListExpression3102] operator[SEP] operator[SEP] identifier[expressionList] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[break] operator[SEP]
}
identifier[match] operator[SEP] identifier[input] , identifier[RIGHT_SQUARE] , identifier[FOLLOW_RIGHT_SQUARE_in_inlineListExpression3105] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
Keyword[throw] identifier[re] operator[SEP]
}
Keyword[finally] {
}
}
|
public Decorators<BeansDescriptor> getOrCreateDecorators()
{
List<Node> nodeList = model.get("decorators");
if (nodeList != null && nodeList.size() > 0)
{
return new DecoratorsImpl<BeansDescriptor>(this, "decorators", model, nodeList.get(0));
}
return createDecorators();
} | class class_name[name] begin[{]
method[getOrCreateDecorators, return_type[type[Decorators]], modifier[public], parameter[]] begin[{]
local_variable[type[List], nodeList]
if[binary_operation[binary_operation[member[.nodeList], !=, literal[null]], &&, binary_operation[call[nodeList.size, parameter[]], >, literal[0]]]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="decorators"), MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[], type_arguments=None)], 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=BeansDescriptor, sub_type=None))], dimensions=None, name=DecoratorsImpl, sub_type=None))]
else begin[{]
None
end[}]
return[call[.createDecorators, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Decorators] operator[<] identifier[BeansDescriptor] operator[>] identifier[getOrCreateDecorators] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[model] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeList] operator[!=] Other[null] operator[&&] identifier[nodeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[return] Keyword[new] identifier[DecoratorsImpl] operator[<] identifier[BeansDescriptor] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[model] , identifier[nodeList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[createDecorators] operator[SEP] operator[SEP] operator[SEP]
}
|
public T get(Object key) {
SoftReference<T> ref = cache.get(key);
T ob;
if( ref == null ) {
return null;
}
ob = ref.get();
if( ob == null ) {
release(key);
}
if( ob instanceof CachedItem ) {
if( !((CachedItem)ob).isValidForCache() ) {
release(key);
return null;
}
}
return ob;
} | class class_name[name] begin[{]
method[get, return_type[type[T]], modifier[public], parameter[key]] begin[{]
local_variable[type[SoftReference], ref]
local_variable[type[T], ob]
if[binary_operation[member[.ref], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.ob], call[ref.get, parameter[]]]
if[binary_operation[member[.ob], ==, literal[null]]] begin[{]
call[.release, parameter[member[.key]]]
else begin[{]
None
end[}]
if[binary_operation[member[.ob], instanceof, type[CachedItem]]] begin[{]
if[Cast(expression=MemberReference(member=ob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CachedItem, sub_type=None))] begin[{]
call[.release, parameter[member[.key]]]
return[literal[null]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.ob]]
end[}]
END[}] | Keyword[public] identifier[T] identifier[get] operator[SEP] identifier[Object] identifier[key] operator[SEP] {
identifier[SoftReference] operator[<] identifier[T] operator[>] identifier[ref] operator[=] identifier[cache] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[T] identifier[ob] operator[SEP] Keyword[if] operator[SEP] identifier[ref] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[ob] operator[=] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ob] operator[==] Other[null] operator[SEP] {
identifier[release] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ob] Keyword[instanceof] identifier[CachedItem] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[CachedItem] operator[SEP] identifier[ob] operator[SEP] operator[SEP] identifier[isValidForCache] operator[SEP] operator[SEP] operator[SEP] {
identifier[release] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
Keyword[return] identifier[ob] operator[SEP]
}
|
public static <MSG extends Message> void writeStream(Iterable<MSG> messages, OutputStream output) {
try {
for (Message message : messages) {
message.writeDelimitedTo(output);
}
} catch (Exception e) {
throw ContextException.of("Unable to write messages", e);
}
} | class class_name[name] begin[{]
method[writeStream, return_type[void], modifier[public static], parameter[messages, output]] begin[{]
TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeDelimitedTo, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to write messages"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=ContextException, 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[static] operator[<] identifier[MSG] Keyword[extends] identifier[Message] operator[>] Keyword[void] identifier[writeStream] operator[SEP] identifier[Iterable] operator[<] identifier[MSG] operator[>] identifier[messages] , identifier[OutputStream] identifier[output] operator[SEP] {
Keyword[try] {
Keyword[for] operator[SEP] identifier[Message] identifier[message] operator[:] identifier[messages] operator[SEP] {
identifier[message] operator[SEP] identifier[writeDelimitedTo] operator[SEP] identifier[output] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] identifier[ContextException] operator[SEP] identifier[of] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private String getServiceIdFromMavenBundlePlugin() {
Plugin bundlePlugin = project.getBuildPlugins().stream()
.filter(plugin -> StringUtils.equals(plugin.getKey(), MAVEN_BUNDLE_PLUGIN_ID))
.findFirst().orElse(null);
if (bundlePlugin != null) {
Xpp3Dom configuration = (Xpp3Dom)bundlePlugin.getConfiguration();
if (configuration != null) {
Xpp3Dom instructions = configuration.getChild("instructions");
if (instructions != null) {
Xpp3Dom applicationPath = instructions.getChild(ApplicationPath.HEADER_APPLICATON_PATH);
if (applicationPath != null) {
return applicationPath.getValue();
}
}
}
}
return null;
} | class class_name[name] begin[{]
method[getServiceIdFromMavenBundlePlugin, return_type[type[String]], modifier[private], parameter[]] begin[{]
local_variable[type[Plugin], bundlePlugin]
if[binary_operation[member[.bundlePlugin], !=, literal[null]]] begin[{]
local_variable[type[Xpp3Dom], configuration]
if[binary_operation[member[.configuration], !=, literal[null]]] begin[{]
local_variable[type[Xpp3Dom], instructions]
if[binary_operation[member[.instructions], !=, literal[null]]] begin[{]
local_variable[type[Xpp3Dom], applicationPath]
if[binary_operation[member[.applicationPath], !=, literal[null]]] begin[{]
return[call[applicationPath.getValue, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[getServiceIdFromMavenBundlePlugin] operator[SEP] operator[SEP] {
identifier[Plugin] identifier[bundlePlugin] operator[=] identifier[project] operator[SEP] identifier[getBuildPlugins] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[plugin] operator[->] identifier[StringUtils] operator[SEP] identifier[equals] operator[SEP] identifier[plugin] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[MAVEN_BUNDLE_PLUGIN_ID] operator[SEP] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bundlePlugin] operator[!=] Other[null] operator[SEP] {
identifier[Xpp3Dom] identifier[configuration] operator[=] operator[SEP] identifier[Xpp3Dom] operator[SEP] identifier[bundlePlugin] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configuration] operator[!=] Other[null] operator[SEP] {
identifier[Xpp3Dom] identifier[instructions] operator[=] identifier[configuration] operator[SEP] identifier[getChild] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instructions] operator[!=] Other[null] operator[SEP] {
identifier[Xpp3Dom] identifier[applicationPath] operator[=] identifier[instructions] operator[SEP] identifier[getChild] operator[SEP] identifier[ApplicationPath] operator[SEP] identifier[HEADER_APPLICATON_PATH] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[applicationPath] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[applicationPath] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static synchronized void resetAll(Object... additionalMocks) {
MockRepository.addObjectsToAutomaticallyReplayAndVerify(additionalMocks);
for (Object classToReplayOrVerify : MockRepository.getObjectsToAutomaticallyReplayAndVerify()) {
reset(classToReplayOrVerify);
}
} | class class_name[name] begin[{]
method[resetAll, return_type[void], modifier[synchronized public static], parameter[additionalMocks]] begin[{]
call[MockRepository.addObjectsToAutomaticallyReplayAndVerify, parameter[member[.additionalMocks]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=classToReplayOrVerify, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getObjectsToAutomaticallyReplayAndVerify, postfix_operators=[], prefix_operators=[], qualifier=MockRepository, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classToReplayOrVerify)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[synchronized] Keyword[void] identifier[resetAll] operator[SEP] identifier[Object] operator[...] identifier[additionalMocks] operator[SEP] {
identifier[MockRepository] operator[SEP] identifier[addObjectsToAutomaticallyReplayAndVerify] operator[SEP] identifier[additionalMocks] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[classToReplayOrVerify] operator[:] identifier[MockRepository] operator[SEP] identifier[getObjectsToAutomaticallyReplayAndVerify] operator[SEP] operator[SEP] operator[SEP] {
identifier[reset] operator[SEP] identifier[classToReplayOrVerify] operator[SEP] operator[SEP]
}
}
|
public static <T> List<T> page(int pageNo, int pageSize, List<T> list) {
if (isEmpty(list)) {
return new ArrayList<>(0);
}
int resultSize = list.size();
// 每页条目数大于总数直接返回所有
if (resultSize <= pageSize) {
if (pageNo <= 1) {
return Collections.unmodifiableList(list);
} else {
// 越界直接返回空
return new ArrayList<>(0);
}
}
final int[] startEnd = PageUtil.transToStartEnd(pageNo, pageSize);
if (startEnd[1] > resultSize) {
startEnd[1] = resultSize;
}
return list.subList(startEnd[0], startEnd[1]);
} | class class_name[name] begin[{]
method[page, return_type[type[List]], modifier[public static], parameter[pageNo, pageSize, list]] begin[{]
if[call[.isEmpty, parameter[member[.list]]]] begin[{]
return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[int], resultSize]
if[binary_operation[member[.resultSize], <=, member[.pageSize]]] begin[{]
if[binary_operation[member[.pageNo], <=, literal[1]]] begin[{]
return[call[Collections.unmodifiableList, parameter[member[.list]]]]
else begin[{]
return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
end[}]
else begin[{]
None
end[}]
local_variable[type[int], startEnd]
if[binary_operation[member[.startEnd], >, member[.resultSize]]] begin[{]
assign[member[.startEnd], member[.resultSize]]
else begin[{]
None
end[}]
return[call[list.subList, parameter[member[.startEnd], member[.startEnd]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[page] operator[SEP] Keyword[int] identifier[pageNo] , Keyword[int] identifier[pageSize] , identifier[List] operator[<] identifier[T] operator[>] identifier[list] operator[SEP] {
Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[list] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[int] identifier[resultSize] operator[=] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resultSize] operator[<=] identifier[pageSize] operator[SEP] {
Keyword[if] operator[SEP] identifier[pageNo] operator[<=] Other[1] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[list] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[startEnd] operator[=] identifier[PageUtil] operator[SEP] identifier[transToStartEnd] operator[SEP] identifier[pageNo] , identifier[pageSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startEnd] operator[SEP] Other[1] operator[SEP] operator[>] identifier[resultSize] operator[SEP] {
identifier[startEnd] operator[SEP] Other[1] operator[SEP] operator[=] identifier[resultSize] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP] identifier[subList] operator[SEP] identifier[startEnd] operator[SEP] Other[0] operator[SEP] , identifier[startEnd] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public List<CommerceAccount> findByCompanyId(long companyId) {
return findByCompanyId(companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null);
} | class class_name[name] begin[{]
method[findByCompanyId, return_type[type[List]], modifier[public], parameter[companyId]] begin[{]
return[call[.findByCompanyId, parameter[member[.companyId], member[QueryUtil.ALL_POS], member[QueryUtil.ALL_POS], literal[null]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceAccount] operator[>] identifier[findByCompanyId] operator[SEP] Keyword[long] identifier[companyId] operator[SEP] {
Keyword[return] identifier[findByCompanyId] operator[SEP] identifier[companyId] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP]
}
|
public void get(Object rootVal,
MatchSpaceKey msg,
EvalCache cache,
Object contextValue,
SearchResults result)
throws MatchingException,BadMessageFormatMatchingException
{
if (tc.isEntryEnabled())
tc.entry(this,cclass, "get", new Object[]{rootVal,msg,cache,result});
if (result instanceof CacheingSearchResults)
((CacheingSearchResults) result).setMatcher(vacantChild);
vacantChild.get(null, msg, cache, contextValue, result);
if (tc.isEntryEnabled())
tc.exit(this,cclass, "get");
} | class class_name[name] begin[{]
method[get, return_type[void], modifier[public], parameter[rootVal, msg, cache, contextValue, result]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[tc.entry, parameter[THIS[], member[.cclass], literal["get"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=rootVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
if[binary_operation[member[.result], instanceof, type[CacheingSearchResults]]] begin[{]
Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CacheingSearchResults, sub_type=None))
else begin[{]
None
end[}]
call[vacantChild.get, parameter[literal[null], member[.msg], member[.cache], member[.contextValue], member[.result]]]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[tc.exit, parameter[THIS[], member[.cclass], literal["get"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[get] operator[SEP] identifier[Object] identifier[rootVal] , identifier[MatchSpaceKey] identifier[msg] , identifier[EvalCache] identifier[cache] , identifier[Object] identifier[contextValue] , identifier[SearchResults] identifier[result] operator[SEP] Keyword[throws] identifier[MatchingException] , identifier[BadMessageFormatMatchingException] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[tc] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[rootVal] , identifier[msg] , identifier[cache] , identifier[result]
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] Keyword[instanceof] identifier[CacheingSearchResults] operator[SEP] operator[SEP] operator[SEP] identifier[CacheingSearchResults] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[setMatcher] operator[SEP] identifier[vacantChild] operator[SEP] operator[SEP] identifier[vacantChild] operator[SEP] identifier[get] operator[SEP] Other[null] , identifier[msg] , identifier[cache] , identifier[contextValue] , identifier[result] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[tc] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[SEP] operator[SEP]
}
|
public Subscription updateSubscription(final String uuid, final SubscriptionUpdate subscriptionUpdate) {
return doPUT(Subscriptions.SUBSCRIPTIONS_RESOURCE
+ "/" + uuid,
subscriptionUpdate,
Subscription.class);
} | class class_name[name] begin[{]
method[updateSubscription, return_type[type[Subscription]], modifier[public], parameter[uuid, subscriptionUpdate]] begin[{]
return[call[.doPUT, parameter[binary_operation[binary_operation[member[Subscriptions.SUBSCRIPTIONS_RESOURCE], +, literal["/"]], +, member[.uuid]], member[.subscriptionUpdate], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Subscription, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Subscription] identifier[updateSubscription] operator[SEP] Keyword[final] identifier[String] identifier[uuid] , Keyword[final] identifier[SubscriptionUpdate] identifier[subscriptionUpdate] operator[SEP] {
Keyword[return] identifier[doPUT] operator[SEP] identifier[Subscriptions] operator[SEP] identifier[SUBSCRIPTIONS_RESOURCE] operator[+] literal[String] operator[+] identifier[uuid] , identifier[subscriptionUpdate] , identifier[Subscription] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
@InterfaceAudience.Private
protected void checkSession() {
if (getAuthenticator() != null) {
Authorizer auth = (Authorizer) getAuthenticator();
auth.setRemoteURL(remote);
auth.setLocalUUID(db.publicUUID());
}
if (getAuthenticator() != null && getAuthenticator() instanceof SessionCookieAuthorizer) {
// Sync Gateway session API is at /db/_session; try that first
checkSessionAtPath("_session");
} else {
login();
}
} | class class_name[name] begin[{]
method[checkSession, return_type[void], modifier[protected], parameter[]] begin[{]
if[binary_operation[call[.getAuthenticator, parameter[]], !=, literal[null]]] begin[{]
local_variable[type[Authorizer], auth]
call[auth.setRemoteURL, parameter[member[.remote]]]
call[auth.setLocalUUID, parameter[call[db.publicUUID, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[.getAuthenticator, parameter[]], !=, literal[null]], &&, binary_operation[call[.getAuthenticator, parameter[]], instanceof, type[SessionCookieAuthorizer]]]] begin[{]
call[.checkSessionAtPath, parameter[literal["_session"]]]
else begin[{]
call[.login, parameter[]]
end[}]
end[}]
END[}] | annotation[@] identifier[InterfaceAudience] operator[SEP] identifier[Private] Keyword[protected] Keyword[void] identifier[checkSession] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[getAuthenticator] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[Authorizer] identifier[auth] operator[=] operator[SEP] identifier[Authorizer] operator[SEP] identifier[getAuthenticator] operator[SEP] operator[SEP] operator[SEP] identifier[auth] operator[SEP] identifier[setRemoteURL] operator[SEP] identifier[remote] operator[SEP] operator[SEP] identifier[auth] operator[SEP] identifier[setLocalUUID] operator[SEP] identifier[db] operator[SEP] identifier[publicUUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getAuthenticator] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[getAuthenticator] operator[SEP] operator[SEP] Keyword[instanceof] identifier[SessionCookieAuthorizer] operator[SEP] {
identifier[checkSessionAtPath] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[login] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public synchronized void sendResponse(BinaryResponse response) {
if (pending == null) {
pending = new LinkedList<ByteBuffer>();
}
pending.add(response.getBuffer());
} | class class_name[name] begin[{]
method[sendResponse, return_type[void], modifier[synchronized public], parameter[response]] begin[{]
if[binary_operation[member[.pending], ==, literal[null]]] begin[{]
assign[member[.pending], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ByteBuffer, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))]
else begin[{]
None
end[}]
call[pending.add, parameter[call[response.getBuffer, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[sendResponse] operator[SEP] identifier[BinaryResponse] identifier[response] operator[SEP] {
Keyword[if] operator[SEP] identifier[pending] operator[==] Other[null] operator[SEP] {
identifier[pending] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[ByteBuffer] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pending] operator[SEP] identifier[add] operator[SEP] identifier[response] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) {
return getLink(new LinkInfoImpl(configuration, context, cd)
.label(configuration.getClassName(cd)));
} | class class_name[name] begin[{]
method[getQualifiedClassLink, return_type[type[Content]], modifier[public], parameter[context, cd]] begin[{]
return[call[.getLink, parameter[ClassCreator(arguments=[MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None)], member=label, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=LinkInfoImpl, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Content] identifier[getQualifiedClassLink] operator[SEP] identifier[LinkInfoImpl] operator[SEP] identifier[Kind] identifier[context] , identifier[ClassDoc] identifier[cd] operator[SEP] {
Keyword[return] identifier[getLink] operator[SEP] Keyword[new] identifier[LinkInfoImpl] operator[SEP] identifier[configuration] , identifier[context] , identifier[cd] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[configuration] operator[SEP] identifier[getClassName] operator[SEP] identifier[cd] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public boolean checkCondition(IValue test) throws FilterException {
Iterator iter = values.iterator();
while (iter.hasNext()) {
IValue value = (IValue) iter.next();
if (value.containedBy(test)) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[checkCondition, return_type[type[boolean]], modifier[public], parameter[test]] begin[{]
local_variable[type[Iterator], iter]
while[call[iter.hasNext, parameter[]]] begin[{]
local_variable[type[IValue], value]
if[call[value.containedBy, parameter[member[.test]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
end[}]
return[literal[false]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[checkCondition] operator[SEP] identifier[IValue] identifier[test] operator[SEP] Keyword[throws] identifier[FilterException] {
identifier[Iterator] identifier[iter] operator[=] identifier[values] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[IValue] identifier[value] operator[=] operator[SEP] identifier[IValue] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[containedBy] operator[SEP] identifier[test] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@NotNull
public Candidate setDateOfBirth(@Nullable final Date dateOfBirth) {
if (dateOfBirth == null) {
this.dateOfBirth = null;
return this;
}
this.dateOfBirth = new Date(dateOfBirth.getTime());
return this;
} | class class_name[name] begin[{]
method[setDateOfBirth, return_type[type[Candidate]], modifier[public], parameter[dateOfBirth]] begin[{]
if[binary_operation[member[.dateOfBirth], ==, literal[null]]] begin[{]
assign[THIS[member[None.dateOfBirth]], literal[null]]
return[THIS[]]
else begin[{]
None
end[}]
assign[THIS[member[None.dateOfBirth]], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=dateOfBirth, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[NotNull] Keyword[public] identifier[Candidate] identifier[setDateOfBirth] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[Date] identifier[dateOfBirth] operator[SEP] {
Keyword[if] operator[SEP] identifier[dateOfBirth] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[dateOfBirth] operator[=] Other[null] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
Keyword[this] operator[SEP] identifier[dateOfBirth] operator[=] Keyword[new] identifier[Date] operator[SEP] identifier[dateOfBirth] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public int handleGetRawRecordData(Rec record)
{
int iErrorCode = Constant.NORMAL_RETURN;
iErrorCode = super.handleGetRawRecordData(record);
if (iErrorCode == Constant.NORMAL_RETURN)
{
if (m_messageDataDescChildren != null)
{
for (String strKey : m_messageDataDescChildren.keySet())
{
iErrorCode = m_messageDataDescChildren.get(strKey).handleGetRawRecordData(record);
if (iErrorCode != Constant.NORMAL_RETURN)
break;
}
}
}
return iErrorCode;
} | class class_name[name] begin[{]
method[handleGetRawRecordData, return_type[type[int]], modifier[public], parameter[record]] begin[{]
local_variable[type[int], iErrorCode]
assign[member[.iErrorCode], SuperMethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleGetRawRecordData, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
if[binary_operation[member[.iErrorCode], ==, member[Constant.NORMAL_RETURN]]] begin[{]
if[binary_operation[member[.m_messageDataDescChildren], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iErrorCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=strKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=m_messageDataDescChildren, selectors=[MethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleGetRawRecordData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=iErrorCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NORMAL_RETURN, postfix_operators=[], prefix_operators=[], qualifier=Constant, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=m_messageDataDescChildren, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=strKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.iErrorCode]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[handleGetRawRecordData] operator[SEP] identifier[Rec] identifier[record] operator[SEP] {
Keyword[int] identifier[iErrorCode] operator[=] identifier[Constant] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] identifier[iErrorCode] operator[=] Keyword[super] operator[SEP] identifier[handleGetRawRecordData] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iErrorCode] operator[==] identifier[Constant] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_messageDataDescChildren] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[strKey] operator[:] identifier[m_messageDataDescChildren] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[iErrorCode] operator[=] identifier[m_messageDataDescChildren] operator[SEP] identifier[get] operator[SEP] identifier[strKey] operator[SEP] operator[SEP] identifier[handleGetRawRecordData] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iErrorCode] operator[!=] identifier[Constant] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] Keyword[break] operator[SEP]
}
}
}
Keyword[return] identifier[iErrorCode] operator[SEP]
}
|
public void shutdownInvocations() {
logger.finest("Shutting down invocations");
invocationRegistry.shutdown();
invocationMonitor.shutdown();
inboundResponseHandlerSupplier.shutdown();
try {
invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS);
} catch (InterruptedException e) {
// TODO: we need a better mechanism for dealing with interruption and waiting for termination
Thread.currentThread().interrupt();
}
} | class class_name[name] begin[{]
method[shutdownInvocations, return_type[void], modifier[public], parameter[]] begin[{]
call[logger.finest, parameter[literal["Shutting down invocations"]]]
call[invocationRegistry.shutdown, parameter[]]
call[invocationMonitor.shutdown, parameter[]]
call[inboundResponseHandlerSupplier.shutdown, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TERMINATION_TIMEOUT_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=awaitTermination, postfix_operators=[], prefix_operators=[], qualifier=invocationMonitor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[shutdownInvocations] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[finest] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[invocationRegistry] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] identifier[invocationMonitor] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] identifier[inboundResponseHandlerSupplier] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[invocationMonitor] operator[SEP] identifier[awaitTermination] operator[SEP] identifier[TERMINATION_TIMEOUT_MILLIS] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected CompletableFuture<List<String>> remoteWebSocketAddresses(@RpcTargetAddress InetSocketAddress targetAddress, Serializable userid) {
if (remoteNode == null) return CompletableFuture.completedFuture(null);
try {
return remoteNode.getWebSocketAddresses(targetAddress, userid);
} catch (Exception e) {
logger.log(Level.WARNING, "remote " + targetAddress + " websocket getOnlineRemoteAddresses error", e);
return CompletableFuture.completedFuture(null);
}
} | class class_name[name] begin[{]
method[remoteWebSocketAddresses, return_type[type[CompletableFuture]], modifier[protected], parameter[targetAddress, userid]] begin[{]
if[binary_operation[member[.remoteNode], ==, literal[null]]] begin[{]
return[call[CompletableFuture.completedFuture, parameter[literal[null]]]]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=targetAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWebSocketAddresses, postfix_operators=[], prefix_operators=[], qualifier=remoteNode, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="remote "), operandr=MemberReference(member=targetAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" websocket getOnlineRemoteAddresses error"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=completedFuture, postfix_operators=[], prefix_operators=[], qualifier=CompletableFuture, 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[protected] identifier[CompletableFuture] operator[<] identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[remoteWebSocketAddresses] operator[SEP] annotation[@] identifier[RpcTargetAddress] identifier[InetSocketAddress] identifier[targetAddress] , identifier[Serializable] identifier[userid] operator[SEP] {
Keyword[if] operator[SEP] identifier[remoteNode] operator[==] Other[null] operator[SEP] Keyword[return] identifier[CompletableFuture] operator[SEP] identifier[completedFuture] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[remoteNode] operator[SEP] identifier[getWebSocketAddresses] operator[SEP] identifier[targetAddress] , identifier[userid] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[targetAddress] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] identifier[CompletableFuture] operator[SEP] identifier[completedFuture] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
}
|
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AfplibPackage.GCHST__XPOS:
setXPOS(XPOS_EDEFAULT);
return;
case AfplibPackage.GCHST__YPOS:
setYPOS(YPOS_EDEFAULT);
return;
case AfplibPackage.GCHST__CP:
setCP(CP_EDEFAULT);
return;
}
super.eUnset(featureID);
} | class class_name[name] begin[{]
method[eUnset, return_type[void], modifier[public], parameter[featureID]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=GCHST__XPOS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=XPOS_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setXPOS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=GCHST__YPOS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=YPOS_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setYPOS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=GCHST__CP, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CP_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eUnset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eUnset] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCHST__XPOS] operator[:] identifier[setXPOS] operator[SEP] identifier[XPOS_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCHST__YPOS] operator[:] identifier[setYPOS] operator[SEP] identifier[YPOS_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCHST__CP] operator[:] identifier[setCP] operator[SEP] identifier[CP_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[super] operator[SEP] identifier[eUnset] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
public static Type parameterizedInnerClass(Type owner, Class<?> clazz, Type... arguments) {
// never allow an owner on a class that doesn't have one
if (clazz.getDeclaringClass() == null && owner != null) {
throw new IllegalArgumentException("Cannot specify an owner type for a top level class");
}
Type realOwner = transformOwner(owner, clazz);
if (arguments == null) {
if (clazz.getTypeParameters().length == 0) {
// no arguments known, but no needed so just use an empty argument list.
// (we can still end up with a generic type if the owner is generic)
arguments = new Type[0];
} else {
// missing type arguments, return the raw type
return clazz;
}
} else {
if (arguments.length != clazz.getTypeParameters().length) {
throw new IllegalArgumentException("Incorrect number of type arguments for [" + clazz + "]: " +
"expected " + clazz.getTypeParameters().length + ", but got " + arguments.length);
}
}
// if the class and its owner simply have no parameters at all, this is not a parameterized type
if (!GenericTypeReflector.isMissingTypeParameters(clazz)) {
return clazz;
}
// if the owner type is missing type parameters and clazz is non-static, this is a raw type
if (realOwner != null && !Modifier.isStatic(clazz.getModifiers())
&& GenericTypeReflector.isMissingTypeParameters(realOwner)) {
return clazz;
}
ParameterizedType result = new ParameterizedTypeImpl(clazz, arguments, realOwner);
checkParametersWithinBound(result);
return result;
} | class class_name[name] begin[{]
method[parameterizedInnerClass, return_type[type[Type]], modifier[public static], parameter[owner, clazz, arguments]] begin[{]
if[binary_operation[binary_operation[call[clazz.getDeclaringClass, parameter[]], ==, literal[null]], &&, binary_operation[member[.owner], !=, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot specify an owner type for a top level class")], 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[Type], realOwner]
if[binary_operation[member[.arguments], ==, literal[null]]] begin[{]
if[binary_operation[call[clazz.getTypeParameters, parameter[]], ==, literal[0]]] begin[{]
assign[member[.arguments], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None))]
else begin[{]
return[member[.clazz]]
end[}]
else begin[{]
if[binary_operation[member[arguments.length], !=, call[clazz.getTypeParameters, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Incorrect number of type arguments for ["), operandr=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]: "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="expected "), operator=+), operandr=MethodInvocation(arguments=[], member=getTypeParameters, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", but got "), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=arguments, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
if[call[GenericTypeReflector.isMissingTypeParameters, parameter[member[.clazz]]]] begin[{]
return[member[.clazz]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.realOwner], !=, literal[null]], &&, call[Modifier.isStatic, parameter[call[clazz.getModifiers, parameter[]]]]], &&, call[GenericTypeReflector.isMissingTypeParameters, parameter[member[.realOwner]]]]] begin[{]
return[member[.clazz]]
else begin[{]
None
end[}]
local_variable[type[ParameterizedType], result]
call[.checkParametersWithinBound, parameter[member[.result]]]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Type] identifier[parameterizedInnerClass] operator[SEP] identifier[Type] identifier[owner] , identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Type] operator[...] identifier[arguments] operator[SEP] {
Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[==] Other[null] operator[&&] identifier[owner] operator[!=] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Type] identifier[realOwner] operator[=] identifier[transformOwner] operator[SEP] identifier[owner] , identifier[clazz] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[arguments] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[getTypeParameters] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[arguments] operator[=] Keyword[new] identifier[Type] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[clazz] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[arguments] operator[SEP] identifier[length] operator[!=] identifier[clazz] operator[SEP] identifier[getTypeParameters] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[clazz] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getTypeParameters] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[+] literal[String] operator[+] identifier[arguments] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[GenericTypeReflector] operator[SEP] identifier[isMissingTypeParameters] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] {
Keyword[return] identifier[clazz] operator[SEP]
}
Keyword[if] operator[SEP] identifier[realOwner] operator[!=] Other[null] operator[&&] operator[!] identifier[Modifier] operator[SEP] identifier[isStatic] operator[SEP] identifier[clazz] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[GenericTypeReflector] operator[SEP] identifier[isMissingTypeParameters] operator[SEP] identifier[realOwner] operator[SEP] operator[SEP] {
Keyword[return] identifier[clazz] operator[SEP]
}
identifier[ParameterizedType] identifier[result] operator[=] Keyword[new] identifier[ParameterizedTypeImpl] operator[SEP] identifier[clazz] , identifier[arguments] , identifier[realOwner] operator[SEP] operator[SEP] identifier[checkParametersWithinBound] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public static <K, V> InternalCacheEntry<K, V> immutableInternalCacheEntry(InternalCacheEntry<K, V> entry) {
return new ImmutableInternalCacheEntry<K, V>(entry);
} | class class_name[name] begin[{]
method[immutableInternalCacheEntry, return_type[type[InternalCacheEntry]], modifier[public static], parameter[entry]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=entry, 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=ImmutableInternalCacheEntry, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[InternalCacheEntry] operator[<] identifier[K] , identifier[V] operator[>] identifier[immutableInternalCacheEntry] operator[SEP] identifier[InternalCacheEntry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[SEP] {
Keyword[return] Keyword[new] identifier[ImmutableInternalCacheEntry] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[entry] operator[SEP] operator[SEP]
}
|
@Implementation
protected int getConnectionState(BluetoothDevice device) {
return connectedDevices.contains(device)
? BluetoothProfile.STATE_CONNECTED
: BluetoothProfile.STATE_DISCONNECTED;
} | class class_name[name] begin[{]
method[getConnectionState, return_type[type[int]], modifier[protected], parameter[device]] begin[{]
return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=device, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=connectedDevices, selectors=[], type_arguments=None), if_false=MemberReference(member=STATE_DISCONNECTED, postfix_operators=[], prefix_operators=[], qualifier=BluetoothProfile, selectors=[]), if_true=MemberReference(member=STATE_CONNECTED, postfix_operators=[], prefix_operators=[], qualifier=BluetoothProfile, selectors=[]))]
end[}]
END[}] | annotation[@] identifier[Implementation] Keyword[protected] Keyword[int] identifier[getConnectionState] operator[SEP] identifier[BluetoothDevice] identifier[device] operator[SEP] {
Keyword[return] identifier[connectedDevices] operator[SEP] identifier[contains] operator[SEP] identifier[device] operator[SEP] operator[?] identifier[BluetoothProfile] operator[SEP] identifier[STATE_CONNECTED] operator[:] identifier[BluetoothProfile] operator[SEP] identifier[STATE_DISCONNECTED] operator[SEP]
}
|
@SuppressWarnings("fallthrough")
public static int log2(double x, RoundingMode mode) {
N.checkArgument(x > 0.0 && isFinite(x), "x must be positive and finite");
int exponent = getExponent(x);
if (!isNormal(x)) {
return log2(x * IMPLICIT_BIT, mode) - SIGNIFICAND_BITS;
// Do the calculation on a normal value.
}
// x is positive, finite, and normal
boolean increment;
switch (mode) {
case UNNECESSARY:
checkRoundingUnnecessary(isPowerOfTwo(x));
// fall through
case FLOOR:
increment = false;
break;
case CEILING:
increment = !isPowerOfTwo(x);
break;
case DOWN:
increment = exponent < 0 & !isPowerOfTwo(x);
break;
case UP:
increment = exponent >= 0 & !isPowerOfTwo(x);
break;
case HALF_DOWN:
case HALF_EVEN:
case HALF_UP:
double xScaled = scaleNormalize(x);
// sqrt(2) is irrational, and the spec is relative to the "exact numerical result,"
// so log2(x) is never exactly exponent + 0.5.
increment = (xScaled * xScaled) > 2.0;
break;
default:
throw new AssertionError();
}
return increment ? exponent + 1 : exponent;
} | class class_name[name] begin[{]
method[log2, return_type[type[int]], modifier[public static], parameter[x, mode]] begin[{]
call[N.checkArgument, parameter[binary_operation[binary_operation[member[.x], >, literal[0.0]], &&, call[.isFinite, parameter[member[.x]]]], literal["x must be positive and finite"]]]
local_variable[type[int], exponent]
if[call[.isNormal, parameter[member[.x]]]] begin[{]
return[binary_operation[call[.log2, parameter[binary_operation[member[.x], *, member[.IMPLICIT_BIT]], member[.mode]]], -, member[.SIGNIFICAND_BITS]]]
else begin[{]
None
end[}]
local_variable[type[boolean], increment]
SwitchStatement(cases=[SwitchStatementCase(case=['UNNECESSARY'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPowerOfTwo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=checkRoundingUnnecessary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['FLOOR'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=increment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CEILING'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=increment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPowerOfTwo, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['DOWN'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=increment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=exponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operandr=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPowerOfTwo, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=&)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['UP'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=increment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=exponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPowerOfTwo, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=&)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HALF_DOWN', 'HALF_EVEN', 'HALF_UP'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scaleNormalize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=xScaled)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=increment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=xScaled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xScaled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.0), operator=>)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)])], expression=MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[TernaryExpression(condition=MemberReference(member=increment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=exponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=MemberReference(member=exponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[int] identifier[log2] operator[SEP] Keyword[double] identifier[x] , identifier[RoundingMode] identifier[mode] operator[SEP] {
identifier[N] operator[SEP] identifier[checkArgument] operator[SEP] identifier[x] operator[>] literal[Float] operator[&&] identifier[isFinite] operator[SEP] identifier[x] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[exponent] operator[=] identifier[getExponent] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNormal] operator[SEP] identifier[x] operator[SEP] operator[SEP] {
Keyword[return] identifier[log2] operator[SEP] identifier[x] operator[*] identifier[IMPLICIT_BIT] , identifier[mode] operator[SEP] operator[-] identifier[SIGNIFICAND_BITS] operator[SEP]
}
Keyword[boolean] identifier[increment] operator[SEP] Keyword[switch] operator[SEP] identifier[mode] operator[SEP] {
Keyword[case] identifier[UNNECESSARY] operator[:] identifier[checkRoundingUnnecessary] operator[SEP] identifier[isPowerOfTwo] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[FLOOR] operator[:] identifier[increment] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CEILING] operator[:] identifier[increment] operator[=] operator[!] identifier[isPowerOfTwo] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[DOWN] operator[:] identifier[increment] operator[=] identifier[exponent] operator[<] Other[0] operator[&] operator[!] identifier[isPowerOfTwo] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[UP] operator[:] identifier[increment] operator[=] identifier[exponent] operator[>=] Other[0] operator[&] operator[!] identifier[isPowerOfTwo] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HALF_DOWN] operator[:] Keyword[case] identifier[HALF_EVEN] operator[:] Keyword[case] identifier[HALF_UP] operator[:] Keyword[double] identifier[xScaled] operator[=] identifier[scaleNormalize] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[increment] operator[=] operator[SEP] identifier[xScaled] operator[*] identifier[xScaled] operator[SEP] operator[>] literal[Float] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[increment] operator[?] identifier[exponent] operator[+] Other[1] operator[:] identifier[exponent] operator[SEP]
}
|
@Override
public String concat(final String parent, final String name) {
return parent != null
? FileNameUtil.concat(FileNameUtil.getPath(parent), name)
: name;
} | class class_name[name] begin[{]
method[concat, return_type[type[String]], modifier[public], parameter[parent, name]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=FileNameUtil, selectors=[], type_arguments=None), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=concat, postfix_operators=[], prefix_operators=[], qualifier=FileNameUtil, selectors=[], type_arguments=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[concat] operator[SEP] Keyword[final] identifier[String] identifier[parent] , Keyword[final] identifier[String] identifier[name] operator[SEP] {
Keyword[return] identifier[parent] operator[!=] Other[null] operator[?] identifier[FileNameUtil] operator[SEP] identifier[concat] operator[SEP] identifier[FileNameUtil] operator[SEP] identifier[getPath] operator[SEP] identifier[parent] operator[SEP] , identifier[name] operator[SEP] operator[:] identifier[name] operator[SEP]
}
|
@Scheduled(cron = "${deployer.main.targets.scan.scheduling.cron}")
public void scanTargets() {
try {
targetService.resolveTargets();
} catch (DeployerException e) {
logger.error("Scheduled target scan failed", e);
}
} | class class_name[name] begin[{]
method[scanTargets, return_type[void], modifier[public], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=resolveTargets, postfix_operators=[], prefix_operators=[], qualifier=targetService, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Scheduled target scan failed"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DeployerException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Scheduled] operator[SEP] identifier[cron] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[scanTargets] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[targetService] operator[SEP] identifier[resolveTargets] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DeployerException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static AuthData getAuthData(String authDataAlias) throws LoginException {
readLock.lock();
try {
AuthData authDataConfig = authDataMap.getService(authDataAlias);
validateAuthDataConfig(authDataAlias, authDataConfig);
return authDataConfig;
} finally {
readLock.unlock();
}
} | class class_name[name] begin[{]
method[getAuthData, return_type[type[AuthData]], modifier[public static], parameter[authDataAlias]] begin[{]
call[readLock.lock, parameter[]]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=authDataAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getService, postfix_operators=[], prefix_operators=[], qualifier=authDataMap, selectors=[], type_arguments=None), name=authDataConfig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AuthData, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=authDataAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authDataConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateAuthDataConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=authDataConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=readLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[AuthData] identifier[getAuthData] operator[SEP] identifier[String] identifier[authDataAlias] operator[SEP] Keyword[throws] identifier[LoginException] {
identifier[readLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[AuthData] identifier[authDataConfig] operator[=] identifier[authDataMap] operator[SEP] identifier[getService] operator[SEP] identifier[authDataAlias] operator[SEP] operator[SEP] identifier[validateAuthDataConfig] operator[SEP] identifier[authDataAlias] , identifier[authDataConfig] operator[SEP] operator[SEP] Keyword[return] identifier[authDataConfig] operator[SEP]
}
Keyword[finally] {
identifier[readLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void returnSerializationObject(SerializationObject object) {
synchronized (ivListOfObjects) {
if (ivListOfObjects.size() < MAXIMUM_NUM_OF_OBJECTS) {
ivListOfObjects.add(object);
}
}
} | class class_name[name] begin[{]
method[returnSerializationObject, return_type[void], modifier[public], parameter[object]] begin[{]
SYNCHRONIZED[member[.ivListOfObjects]] BEGIN[{]
if[binary_operation[call[ivListOfObjects.size, parameter[]], <, member[.MAXIMUM_NUM_OF_OBJECTS]]] begin[{]
call[ivListOfObjects.add, parameter[member[.object]]]
else begin[{]
None
end[}]
END[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[returnSerializationObject] operator[SEP] identifier[SerializationObject] identifier[object] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[ivListOfObjects] operator[SEP] {
Keyword[if] operator[SEP] identifier[ivListOfObjects] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[MAXIMUM_NUM_OF_OBJECTS] operator[SEP] {
identifier[ivListOfObjects] operator[SEP] identifier[add] operator[SEP] identifier[object] operator[SEP] operator[SEP]
}
}
}
|
@Override
public void remove(byte []tableKey, byte []rowKey,
long version,
Result<Boolean> result)
{
_tableManager.getKelpBacking().remove(tableKey, rowKey, version, result);
} | class class_name[name] begin[{]
method[remove, return_type[void], modifier[public], parameter[tableKey, rowKey, version, result]] begin[{]
call[_tableManager.getKelpBacking, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[remove] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[tableKey] , Keyword[byte] operator[SEP] operator[SEP] identifier[rowKey] , Keyword[long] identifier[version] , identifier[Result] operator[<] identifier[Boolean] operator[>] identifier[result] operator[SEP] {
identifier[_tableManager] operator[SEP] identifier[getKelpBacking] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[tableKey] , identifier[rowKey] , identifier[version] , identifier[result] operator[SEP] operator[SEP]
}
|
public DescribeStorediSCSIVolumesResult withStorediSCSIVolumes(StorediSCSIVolume... storediSCSIVolumes) {
if (this.storediSCSIVolumes == null) {
setStorediSCSIVolumes(new com.amazonaws.internal.SdkInternalList<StorediSCSIVolume>(storediSCSIVolumes.length));
}
for (StorediSCSIVolume ele : storediSCSIVolumes) {
this.storediSCSIVolumes.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withStorediSCSIVolumes, return_type[type[DescribeStorediSCSIVolumesResult]], modifier[public], parameter[storediSCSIVolumes]] begin[{]
if[binary_operation[THIS[member[None.storediSCSIVolumes]], ==, literal[null]]] begin[{]
call[.setStorediSCSIVolumes, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=storediSCSIVolumes, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StorediSCSIVolume, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=storediSCSIVolumes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=storediSCSIVolumes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorediSCSIVolume, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DescribeStorediSCSIVolumesResult] identifier[withStorediSCSIVolumes] operator[SEP] identifier[StorediSCSIVolume] operator[...] identifier[storediSCSIVolumes] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[storediSCSIVolumes] operator[==] Other[null] operator[SEP] {
identifier[setStorediSCSIVolumes] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[StorediSCSIVolume] operator[>] operator[SEP] identifier[storediSCSIVolumes] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[StorediSCSIVolume] identifier[ele] operator[:] identifier[storediSCSIVolumes] operator[SEP] {
Keyword[this] operator[SEP] identifier[storediSCSIVolumes] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public GetCampaignActivitiesResult getCampaignActivities(GetCampaignActivitiesRequest request) {
request = beforeClientExecution(request);
return executeGetCampaignActivities(request);
} | class class_name[name] begin[{]
method[getCampaignActivities, return_type[type[GetCampaignActivitiesResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeGetCampaignActivities, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[GetCampaignActivitiesResult] identifier[getCampaignActivities] operator[SEP] identifier[GetCampaignActivitiesRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetCampaignActivities] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static CommerceWishListItem findByCW_CPI_First(
long commerceWishListId, String CPInstanceUuid,
OrderByComparator<CommerceWishListItem> orderByComparator)
throws com.liferay.commerce.wish.list.exception.NoSuchWishListItemException {
return getPersistence()
.findByCW_CPI_First(commerceWishListId, CPInstanceUuid,
orderByComparator);
} | class class_name[name] begin[{]
method[findByCW_CPI_First, return_type[type[CommerceWishListItem]], modifier[public static], parameter[commerceWishListId, CPInstanceUuid, orderByComparator]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CommerceWishListItem] identifier[findByCW_CPI_First] operator[SEP] Keyword[long] identifier[commerceWishListId] , identifier[String] identifier[CPInstanceUuid] , identifier[OrderByComparator] operator[<] identifier[CommerceWishListItem] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[wish] operator[SEP] identifier[list] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchWishListItemException] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByCW_CPI_First] operator[SEP] identifier[commerceWishListId] , identifier[CPInstanceUuid] , identifier[orderByComparator] operator[SEP] operator[SEP]
}
|
protected static TableServiceException generateTableServiceException(RequestResult res, TableOperation op,
InputStream inStream, TablePayloadFormat format) {
return new TableServiceException(res.getStatusCode(), res.getStatusMessage(), op,
new InputStreamReader(inStream), format);
} | class class_name[name] begin[{]
method[generateTableServiceException, return_type[type[TableServiceException]], modifier[static protected], parameter[res, op, inStream, format]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getStatusMessage, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=inStream, 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=InputStreamReader, sub_type=None)), MemberReference(member=format, 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=TableServiceException, sub_type=None))]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[TableServiceException] identifier[generateTableServiceException] operator[SEP] identifier[RequestResult] identifier[res] , identifier[TableOperation] identifier[op] , identifier[InputStream] identifier[inStream] , identifier[TablePayloadFormat] identifier[format] operator[SEP] {
Keyword[return] Keyword[new] identifier[TableServiceException] operator[SEP] identifier[res] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] , identifier[res] operator[SEP] identifier[getStatusMessage] operator[SEP] operator[SEP] , identifier[op] , Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[inStream] operator[SEP] , identifier[format] operator[SEP] operator[SEP]
}
|
public static void booter(String[] elasticsearchServerNames,GetProperties configContext,boolean forceBoot){
booter( elasticsearchServerNames, configContext, forceBoot,false);
} | class class_name[name] begin[{]
method[booter, return_type[void], modifier[public static], parameter[elasticsearchServerNames, configContext, forceBoot]] begin[{]
call[.booter, parameter[member[.elasticsearchServerNames], member[.configContext], member[.forceBoot], literal[false]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[booter] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[elasticsearchServerNames] , identifier[GetProperties] identifier[configContext] , Keyword[boolean] identifier[forceBoot] operator[SEP] {
identifier[booter] operator[SEP] identifier[elasticsearchServerNames] , identifier[configContext] , identifier[forceBoot] , literal[boolean] operator[SEP] operator[SEP]
}
|
public void marshall(PutEventsRequest putEventsRequest, ProtocolMarshaller protocolMarshaller) {
if (putEventsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putEventsRequest.getApplicationId(), APPLICATIONID_BINDING);
protocolMarshaller.marshall(putEventsRequest.getEventsRequest(), EVENTSREQUEST_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[putEventsRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.putEventsRequest], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getApplicationId, postfix_operators=[], prefix_operators=[], qualifier=putEventsRequest, selectors=[], type_arguments=None), MemberReference(member=APPLICATIONID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEventsRequest, postfix_operators=[], prefix_operators=[], qualifier=putEventsRequest, selectors=[], type_arguments=None), MemberReference(member=EVENTSREQUEST_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[PutEventsRequest] identifier[putEventsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[putEventsRequest] 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[putEventsRequest] operator[SEP] identifier[getApplicationId] operator[SEP] operator[SEP] , identifier[APPLICATIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putEventsRequest] operator[SEP] identifier[getEventsRequest] operator[SEP] operator[SEP] , identifier[EVENTSREQUEST_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]
}
}
|
List<Measurement> getMeasurements() {
return stream()
.filter(m -> !m.hasExpired())
.flatMap(m -> StreamSupport.stream(m.measure().spliterator(), false))
.collect(Collectors.toList());
} | class class_name[name] begin[{]
method[getMeasurements, return_type[type[List]], modifier[default], parameter[]] begin[{]
return[call[.stream, parameter[]]]
end[}]
END[}] | identifier[List] operator[<] identifier[Measurement] operator[>] identifier[getMeasurements] operator[SEP] operator[SEP] {
Keyword[return] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[m] operator[->] operator[!] identifier[m] operator[SEP] identifier[hasExpired] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[m] operator[->] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[m] operator[SEP] identifier[measure] operator[SEP] operator[SEP] operator[SEP] identifier[spliterator] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Bootstrap removeSslSupport(Bootstrap b) {
BootstrapHandlers.removeConfiguration(b, NettyPipeline.SslHandler);
return b;
} | class class_name[name] begin[{]
method[removeSslSupport, return_type[type[Bootstrap]], modifier[public static], parameter[b]] begin[{]
call[BootstrapHandlers.removeConfiguration, parameter[member[.b], member[NettyPipeline.SslHandler]]]
return[member[.b]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Bootstrap] identifier[removeSslSupport] operator[SEP] identifier[Bootstrap] identifier[b] operator[SEP] {
identifier[BootstrapHandlers] operator[SEP] identifier[removeConfiguration] operator[SEP] identifier[b] , identifier[NettyPipeline] operator[SEP] identifier[SslHandler] operator[SEP] operator[SEP] Keyword[return] identifier[b] operator[SEP]
}
|
public JComponent[] addBinding(Binding binding, JComponent wrappedComponent, String attributes,
String labelAttributes) {
Assert.notNull(binding, "binding is null");
Assert.isTrue(getFormModel() == binding.getFormModel(),
"Binding's form model must match FormBuilder's form model");
JComponent component = binding.getControl();
final JLabel label = createLabelFor(binding.getProperty(), component);
if (wrappedComponent == null) {
wrappedComponent = component;
}
TableLayoutBuilder layoutBuilder = getLayoutBuilder();
if (!layoutBuilder.hasGapToLeft()) {
layoutBuilder.gapCol();
}
layoutBuilder.cell(label, labelAttributes);
layoutBuilder.labelGapCol();
layoutBuilder.cell(wrappedComponent, attributes);
return new JComponent[] { label, component, wrappedComponent };
} | class class_name[name] begin[{]
method[addBinding, return_type[type[JComponent]], modifier[public], parameter[binding, wrappedComponent, attributes, labelAttributes]] begin[{]
call[Assert.notNull, parameter[member[.binding], literal["binding is null"]]]
call[Assert.isTrue, parameter[binary_operation[call[.getFormModel, parameter[]], ==, call[binding.getFormModel, parameter[]]], literal["Binding's form model must match FormBuilder's form model"]]]
local_variable[type[JComponent], component]
local_variable[type[JLabel], label]
if[binary_operation[member[.wrappedComponent], ==, literal[null]]] begin[{]
assign[member[.wrappedComponent], member[.component]]
else begin[{]
None
end[}]
local_variable[type[TableLayoutBuilder], layoutBuilder]
if[call[layoutBuilder.hasGapToLeft, parameter[]]] begin[{]
call[layoutBuilder.gapCol, parameter[]]
else begin[{]
None
end[}]
call[layoutBuilder.cell, parameter[member[.label], member[.labelAttributes]]]
call[layoutBuilder.labelGapCol, parameter[]]
call[layoutBuilder.cell, parameter[member[.wrappedComponent], member[.attributes]]]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wrappedComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JComponent, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[JComponent] operator[SEP] operator[SEP] identifier[addBinding] operator[SEP] identifier[Binding] identifier[binding] , identifier[JComponent] identifier[wrappedComponent] , identifier[String] identifier[attributes] , identifier[String] identifier[labelAttributes] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[binding] , literal[String] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[isTrue] operator[SEP] identifier[getFormModel] operator[SEP] operator[SEP] operator[==] identifier[binding] operator[SEP] identifier[getFormModel] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[JComponent] identifier[component] operator[=] identifier[binding] operator[SEP] identifier[getControl] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[JLabel] identifier[label] operator[=] identifier[createLabelFor] operator[SEP] identifier[binding] operator[SEP] identifier[getProperty] operator[SEP] operator[SEP] , identifier[component] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wrappedComponent] operator[==] Other[null] operator[SEP] {
identifier[wrappedComponent] operator[=] identifier[component] operator[SEP]
}
identifier[TableLayoutBuilder] identifier[layoutBuilder] operator[=] identifier[getLayoutBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[layoutBuilder] operator[SEP] identifier[hasGapToLeft] operator[SEP] operator[SEP] operator[SEP] {
identifier[layoutBuilder] operator[SEP] identifier[gapCol] operator[SEP] operator[SEP] operator[SEP]
}
identifier[layoutBuilder] operator[SEP] identifier[cell] operator[SEP] identifier[label] , identifier[labelAttributes] operator[SEP] operator[SEP] identifier[layoutBuilder] operator[SEP] identifier[labelGapCol] operator[SEP] operator[SEP] operator[SEP] identifier[layoutBuilder] operator[SEP] identifier[cell] operator[SEP] identifier[wrappedComponent] , identifier[attributes] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JComponent] operator[SEP] operator[SEP] {
identifier[label] , identifier[component] , identifier[wrappedComponent]
} operator[SEP]
}
|
private Future<M> sync() {
logger.debug("Synchronization of Remote[" + this + "] triggered...");
try {
validateInitialization();
try {
SyncTaskCallable syncCallable = new SyncTaskCallable();
final Future<M> currentSyncTask = GlobalCachedExecutorService.submit(syncCallable);
syncCallable.setRelatedFuture(currentSyncTask);
return currentSyncTask;
} catch (java.util.concurrent.RejectedExecutionException | NullPointerException ex) {
throw new CouldNotPerformException("Could not request the current status.", ex);
}
} catch (CouldNotPerformException ex) {
return FutureProcessor.canceledFuture(ex);
}
} | class class_name[name] begin[{]
method[sync, return_type[type[Future]], modifier[private], parameter[]] begin[{]
call[logger.debug, parameter[binary_operation[binary_operation[literal["Synchronization of Remote["], +, THIS[]], +, literal["] triggered..."]]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=validateInitialization, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SyncTaskCallable, sub_type=None)), name=syncCallable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SyncTaskCallable, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=syncCallable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=submit, postfix_operators=[], prefix_operators=[], qualifier=GlobalCachedExecutorService, selectors=[], type_arguments=None), name=currentSyncTask)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=M, sub_type=None))], dimensions=[], name=Future, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentSyncTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRelatedFuture, postfix_operators=[], prefix_operators=[], qualifier=syncCallable, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=currentSyncTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not request the current status."), MemberReference(member=ex, 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=CouldNotPerformException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['java.util.concurrent.RejectedExecutionException', 'NullPointerException']))], finally_block=None, label=None, resources=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=canceledFuture, postfix_operators=[], prefix_operators=[], qualifier=FutureProcessor, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CouldNotPerformException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] identifier[Future] operator[<] identifier[M] operator[>] identifier[sync] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[try] {
identifier[validateInitialization] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[SyncTaskCallable] identifier[syncCallable] operator[=] Keyword[new] identifier[SyncTaskCallable] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Future] operator[<] identifier[M] operator[>] identifier[currentSyncTask] operator[=] identifier[GlobalCachedExecutorService] operator[SEP] identifier[submit] operator[SEP] identifier[syncCallable] operator[SEP] operator[SEP] identifier[syncCallable] operator[SEP] identifier[setRelatedFuture] operator[SEP] identifier[currentSyncTask] operator[SEP] operator[SEP] Keyword[return] identifier[currentSyncTask] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[concurrent] operator[SEP] identifier[RejectedExecutionException] operator[|] identifier[NullPointerException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CouldNotPerformException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[CouldNotPerformException] identifier[ex] operator[SEP] {
Keyword[return] identifier[FutureProcessor] operator[SEP] identifier[canceledFuture] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
}
|
public static RequestBinding attribute(final String property)
{
return new RequestAttributeBinding(property) {
@Override
public String toString()
{
return "RequestBinding.attribute(\"" + property + "\")";
}
};
} | class class_name[name] begin[{]
method[attribute, return_type[type[RequestBinding]], modifier[public static], parameter[property]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="RequestBinding.attribute(\""), operandr=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\")"), operator=+), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_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=RequestAttributeBinding, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[RequestBinding] identifier[attribute] operator[SEP] Keyword[final] identifier[String] identifier[property] operator[SEP] {
Keyword[return] Keyword[new] identifier[RequestAttributeBinding] operator[SEP] identifier[property] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[+] identifier[property] operator[+] literal[String] operator[SEP]
}
} operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.