code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public CmsUUID readIdForUrlName(CmsRequestContext context, String name) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { return m_driverManager.readIdForUrlName(dbc, name); } catch (Exception e) { CmsMessageContainer message = Messages.get().container(Messages.ERR_READ_ID_FOR_URLNAME_1, name); dbc.report(null, message, e); return null; // will never be reached } finally { dbc.clear(); } }
class class_name[name] begin[{] method[readIdForUrlName, return_type[type[CmsUUID]], modifier[public], parameter[context, name]] begin[{] local_variable[type[CmsDbContext], dbc] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readIdForUrlName, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_READ_ID_FOR_URLNAME_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsMessageContainer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=report, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[CmsUUID] identifier[readIdForUrlName] operator[SEP] identifier[CmsRequestContext] identifier[context] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[CmsDbContext] identifier[dbc] operator[=] identifier[m_dbContextFactory] operator[SEP] identifier[getDbContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[m_driverManager] operator[SEP] identifier[readIdForUrlName] operator[SEP] identifier[dbc] , identifier[name] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[CmsMessageContainer] identifier[message] operator[=] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_READ_ID_FOR_URLNAME_1] , identifier[name] operator[SEP] operator[SEP] identifier[dbc] operator[SEP] identifier[report] operator[SEP] Other[null] , identifier[message] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[finally] { identifier[dbc] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } }
@Override public void run() { do { // Scan for directories: try { log.info("Scanning for directories under {}", root); Files.walkFileTree(root, new Visitor()); } catch (IOException e) { log.info("Error in scanning for directories to monitor:"); e.printStackTrace(); } // Block until notified that a new scan is needed: synchronized (Scanner.class) { try { Scanner.class.wait(); } catch (InterruptedException e) { log.info("Scanner interrupted:"); e.printStackTrace(); } } } while (true); }
class class_name[name] begin[{] method[run, return_type[void], modifier[public], parameter[]] begin[{] do[literal[true]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Scanning for directories under {}"), MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Visitor, sub_type=None))], member=walkFileTree, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error in scanning for directories to monitor:")], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Scanner, sub_type=None))] BEGIN[{] TryStatement(block=[StatementExpression(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=wait, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Scanner, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Scanner interrupted:")], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) END[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[do] { Keyword[try] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[root] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[walkFileTree] operator[SEP] identifier[root] , Keyword[new] identifier[Visitor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[synchronized] operator[SEP] identifier[Scanner] operator[SEP] Keyword[class] operator[SEP] { Keyword[try] { identifier[Scanner] operator[SEP] Keyword[class] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
void enableKeepAlive(boolean enable, long keepAliveTimeNanos, long keepAliveTimeoutNanos, boolean keepAliveWithoutCalls) { enableKeepAlive = enable; this.keepAliveTimeNanos = keepAliveTimeNanos; this.keepAliveTimeoutNanos = keepAliveTimeoutNanos; this.keepAliveWithoutCalls = keepAliveWithoutCalls; }
class class_name[name] begin[{] method[enableKeepAlive, return_type[void], modifier[default], parameter[enable, keepAliveTimeNanos, keepAliveTimeoutNanos, keepAliveWithoutCalls]] begin[{] assign[member[.enableKeepAlive], member[.enable]] assign[THIS[member[None.keepAliveTimeNanos]], member[.keepAliveTimeNanos]] assign[THIS[member[None.keepAliveTimeoutNanos]], member[.keepAliveTimeoutNanos]] assign[THIS[member[None.keepAliveWithoutCalls]], member[.keepAliveWithoutCalls]] end[}] END[}]
Keyword[void] identifier[enableKeepAlive] operator[SEP] Keyword[boolean] identifier[enable] , Keyword[long] identifier[keepAliveTimeNanos] , Keyword[long] identifier[keepAliveTimeoutNanos] , Keyword[boolean] identifier[keepAliveWithoutCalls] operator[SEP] { identifier[enableKeepAlive] operator[=] identifier[enable] operator[SEP] Keyword[this] operator[SEP] identifier[keepAliveTimeNanos] operator[=] identifier[keepAliveTimeNanos] operator[SEP] Keyword[this] operator[SEP] identifier[keepAliveTimeoutNanos] operator[=] identifier[keepAliveTimeoutNanos] operator[SEP] Keyword[this] operator[SEP] identifier[keepAliveWithoutCalls] operator[=] identifier[keepAliveWithoutCalls] operator[SEP] }
private void checkReceiveState() throws SIIncorrectCallException, SISessionUnavailableException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkReceiveState"); // Only valid if the consumer session is still open checkNotClosed(); //if there is an AsynchConsumerCallback registered, throw an exception if (_asynchConsumerRegistered) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkReceiveState", "asynchConsumerRegistered == true "); throw new SIIncorrectCallException( nls.getFormattedMessage( "RECEIVE_USAGE_ERROR_CWSIP0171", new Object[] { _consumerDispatcher.getDestination().getName(), _messageProcessor.getMessagingEngineName() }, null)); } // If we already have the waiting bit set it implies another // thread is sat waiting in a receive for this consumer (we release // the consumer lock while waiting so this is possible). else if (_waiting) { SIIncorrectCallException e = new SIIncorrectCallException( nls.getFormattedMessage( "RECEIVE_USAGE_ERROR_CWSIP0178", new Object[] { _consumerDispatcher.getDestination().getName(), _messageProcessor.getMessagingEngineName() }, null)); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkReceiveState", "receive already in progress"); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkReceiveState"); }
class class_name[name] begin[{] method[checkReceiveState, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["checkReceiveState"]]] else begin[{] None end[}] call[.checkNotClosed, parameter[]] if[member[._asynchConsumerRegistered]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["checkReceiveState"], literal["asynchConsumerRegistered == true "]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="RECEIVE_USAGE_ERROR_CWSIP0171"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getDestination, postfix_operators=[], prefix_operators=[], qualifier=_consumerDispatcher, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getMessagingEngineName, postfix_operators=[], prefix_operators=[], qualifier=_messageProcessor, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIIncorrectCallException, sub_type=None)), label=None) else begin[{] if[member[._waiting]] begin[{] local_variable[type[SIIncorrectCallException], e] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["checkReceiveState"], literal["receive already in progress"]]] else begin[{] None end[}] ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["checkReceiveState"]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkReceiveState] operator[SEP] operator[SEP] Keyword[throws] identifier[SIIncorrectCallException] , identifier[SISessionUnavailableException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[checkNotClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_asynchConsumerRegistered] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[_consumerDispatcher] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[_messageProcessor] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] } , Other[null] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[_waiting] operator[SEP] { identifier[SIIncorrectCallException] identifier[e] operator[=] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[_consumerDispatcher] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[_messageProcessor] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] } , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private void appendEncoded(StringBuilder builder, String s, Charset charset, boolean isPartiallyEncoded) { if (s == null) { throw new NullPointerException("s == null"); } int escapeStart = -1; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || isRetained(c) || (c == '%' && isPartiallyEncoded)) { if (escapeStart != -1) { appendHex(builder, s.substring(escapeStart, i), charset); escapeStart = -1; } if (c == '%' && isPartiallyEncoded) { // this is an encoded 3-character sequence like "%20" builder.append(s, i, Math.min(i + 3, s.length())); i += 2; } else if (c == ' ') { builder.append('+'); } else { builder.append(c); } } else if (escapeStart == -1) { escapeStart = i; } } if (escapeStart != -1) { appendHex(builder, s.substring(escapeStart, s.length()), charset); } }
class class_name[name] begin[{] method[appendEncoded, return_type[void], modifier[private], parameter[builder, s, charset, isPartiallyEncoded]] begin[{] if[binary_operation[member[.s], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="s == null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], escapeStart] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='z'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Z'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isRetained, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%'), operator===), operandr=MemberReference(member=isPartiallyEncoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=escapeStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=escapeStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=escapeStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=escapeStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), MemberReference(member=charset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendHex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=escapeStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%'), operator===), operandr=MemberReference(member=isPartiallyEncoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+')], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.escapeStart], !=, literal[1]]] begin[{] call[.appendHex, parameter[member[.builder], call[s.substring, parameter[member[.escapeStart], call[s.length, parameter[]]]], member[.charset]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[appendEncoded] operator[SEP] identifier[StringBuilder] identifier[builder] , identifier[String] identifier[s] , identifier[Charset] identifier[charset] , Keyword[boolean] identifier[isPartiallyEncoded] operator[SEP] { Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[escapeStart] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] operator[||] identifier[isRetained] operator[SEP] identifier[c] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[&&] identifier[isPartiallyEncoded] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[escapeStart] operator[!=] operator[-] Other[1] operator[SEP] { identifier[appendHex] operator[SEP] identifier[builder] , identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[escapeStart] , identifier[i] operator[SEP] , identifier[charset] operator[SEP] operator[SEP] identifier[escapeStart] operator[=] operator[-] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[&&] identifier[isPartiallyEncoded] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[s] , identifier[i] , identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[i] operator[+] Other[3] , identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[escapeStart] operator[==] operator[-] Other[1] operator[SEP] { identifier[escapeStart] operator[=] identifier[i] operator[SEP] } } Keyword[if] operator[SEP] identifier[escapeStart] operator[!=] operator[-] Other[1] operator[SEP] { identifier[appendHex] operator[SEP] identifier[builder] , identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[escapeStart] , identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] , identifier[charset] operator[SEP] operator[SEP] } }
private void initialize(Configuration conf) { this.nodeHealthScript = conf.get(HEALTH_CHECK_SCRIPT_PROPERTY); this.intervalTime = conf.getLong(HEALTH_CHECK_INTERVAL_PROPERTY, DEFAULT_HEALTH_CHECK_INTERVAL); this.scriptTimeout = conf.getLong(HEALTH_CHECK_FAILURE_INTERVAL_PROPERTY, DEFAULT_HEALTH_SCRIPT_FAILURE_INTERVAL); String[] args = conf.getStrings(HEALTH_CHECK_SCRIPT_ARGUMENTS_PROPERTY, new String[] {}); timer = new NodeHealthMonitorExecutor(args); }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[private], parameter[conf]] begin[{] assign[THIS[member[None.nodeHealthScript]], call[conf.get, parameter[member[.HEALTH_CHECK_SCRIPT_PROPERTY]]]] assign[THIS[member[None.intervalTime]], call[conf.getLong, parameter[member[.HEALTH_CHECK_INTERVAL_PROPERTY], member[.DEFAULT_HEALTH_CHECK_INTERVAL]]]] assign[THIS[member[None.scriptTimeout]], call[conf.getLong, parameter[member[.HEALTH_CHECK_FAILURE_INTERVAL_PROPERTY], member[.DEFAULT_HEALTH_SCRIPT_FAILURE_INTERVAL]]]] local_variable[type[String], args] assign[member[.timer], ClassCreator(arguments=[MemberReference(member=args, 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=NodeHealthMonitorExecutor, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[void] identifier[initialize] operator[SEP] identifier[Configuration] identifier[conf] operator[SEP] { Keyword[this] operator[SEP] identifier[nodeHealthScript] operator[=] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[HEALTH_CHECK_SCRIPT_PROPERTY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[intervalTime] operator[=] identifier[conf] operator[SEP] identifier[getLong] operator[SEP] identifier[HEALTH_CHECK_INTERVAL_PROPERTY] , identifier[DEFAULT_HEALTH_CHECK_INTERVAL] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[scriptTimeout] operator[=] identifier[conf] operator[SEP] identifier[getLong] operator[SEP] identifier[HEALTH_CHECK_FAILURE_INTERVAL_PROPERTY] , identifier[DEFAULT_HEALTH_SCRIPT_FAILURE_INTERVAL] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[=] identifier[conf] operator[SEP] identifier[getStrings] operator[SEP] identifier[HEALTH_CHECK_SCRIPT_ARGUMENTS_PROPERTY] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[timer] operator[=] Keyword[new] identifier[NodeHealthMonitorExecutor] operator[SEP] identifier[args] operator[SEP] operator[SEP] }
protected static String decode(String component, String charset) throws URIException { if (component == null) { throw new IllegalArgumentException("Component array of chars may not be null"); } byte[] rawdata = null; try { rawdata = URLCodec.decodeUrl(EncodingUtil.getAsciiBytes(component)); } catch (DecoderException e) { throw new URIException(e.getMessage()); } return EncodingUtil.getString(rawdata, charset); }
class class_name[name] begin[{] method[decode, return_type[type[String]], modifier[static protected], parameter[component, charset]] begin[{] if[binary_operation[member[.component], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component array of chars may not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[byte], rawdata] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rawdata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAsciiBytes, postfix_operators=[], prefix_operators=[], qualifier=EncodingUtil, selectors=[], type_arguments=None)], member=decodeUrl, postfix_operators=[], prefix_operators=[], qualifier=URLCodec, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URIException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DecoderException']))], finally_block=None, label=None, resources=None) return[call[EncodingUtil.getString, parameter[member[.rawdata], member[.charset]]]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[String] identifier[decode] operator[SEP] identifier[String] identifier[component] , identifier[String] identifier[charset] operator[SEP] Keyword[throws] identifier[URIException] { Keyword[if] operator[SEP] identifier[component] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[rawdata] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[rawdata] operator[=] identifier[URLCodec] operator[SEP] identifier[decodeUrl] operator[SEP] identifier[EncodingUtil] operator[SEP] identifier[getAsciiBytes] operator[SEP] identifier[component] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DecoderException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[URIException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[EncodingUtil] operator[SEP] identifier[getString] operator[SEP] identifier[rawdata] , identifier[charset] operator[SEP] operator[SEP] }
public static Path getRootFolderForSource(Path sourceFilePath, String packageName) { if (packageName == null || packageName.trim().isEmpty()) { return sourceFilePath.getParent(); } String[] packageNameComponents = packageName.split("\\."); Path currentPath = sourceFilePath.getParent(); for (int i = packageNameComponents.length; i > 0; i--) { String packageComponent = packageNameComponents[i - 1]; if (!StringUtils.equals(packageComponent, currentPath.getFileName().toString())) { return null; } currentPath = currentPath.getParent(); } return currentPath; }
class class_name[name] begin[{] method[getRootFolderForSource, return_type[type[Path]], modifier[public static], parameter[sourceFilePath, packageName]] begin[{] if[binary_operation[binary_operation[member[.packageName], ==, literal[null]], ||, call[packageName.trim, parameter[]]]] begin[{] return[call[sourceFilePath.getParent, parameter[]]] else begin[{] None end[}] local_variable[type[String], packageNameComponents] local_variable[type[Path], currentPath] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=packageNameComponents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), name=packageComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=packageComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=currentPath, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=currentPath, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=packageNameComponents, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.currentPath]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Path] identifier[getRootFolderForSource] operator[SEP] identifier[Path] identifier[sourceFilePath] , identifier[String] identifier[packageName] operator[SEP] { Keyword[if] operator[SEP] identifier[packageName] operator[==] Other[null] operator[||] identifier[packageName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[sourceFilePath] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[packageNameComponents] operator[=] identifier[packageName] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Path] identifier[currentPath] operator[=] identifier[sourceFilePath] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[packageNameComponents] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { identifier[String] identifier[packageComponent] operator[=] identifier[packageNameComponents] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[equals] operator[SEP] identifier[packageComponent] , identifier[currentPath] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[currentPath] operator[=] identifier[currentPath] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[currentPath] operator[SEP] }
@SuppressWarnings("rawtypes") public static Class loadClass(Class loaderClass, String name) throws ClassNotFoundException { if (loaderClass != null && loaderClass.getClassLoader() != null) return loaderClass.getClassLoader().loadClass(name); return loadClass(name); }
class class_name[name] begin[{] method[loadClass, return_type[type[Class]], modifier[public static], parameter[loaderClass, name]] begin[{] if[binary_operation[binary_operation[member[.loaderClass], !=, literal[null]], &&, binary_operation[call[loaderClass.getClassLoader, parameter[]], !=, literal[null]]]] begin[{] return[call[loaderClass.getClassLoader, parameter[]]] else begin[{] None end[}] return[call[.loadClass, parameter[member[.name]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[Class] identifier[loadClass] operator[SEP] identifier[Class] identifier[loaderClass] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] { Keyword[if] operator[SEP] identifier[loaderClass] operator[!=] Other[null] operator[&&] identifier[loaderClass] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[loaderClass] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[loadClass] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[loadClass] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
private static Map<SegmentId, DataSegment> createLazySegmentsMap(DruidServer server) { return new AbstractMap<SegmentId, DataSegment>() { @Override public Set<Entry<SegmentId, DataSegment>> entrySet() { return new AbstractSet<Entry<SegmentId, DataSegment>>() { @Override public Iterator<Entry<SegmentId, DataSegment>> iterator() { return Iterators.transform( server.iterateAllSegments().iterator(), segment -> new AbstractMap.SimpleImmutableEntry<>(segment.getId(), segment) ); } @Override public int size() { return server.getTotalSegments(); } }; } }; }
class class_name[name] begin[{] method[createLazySegmentsMap, return_type[type[Map]], modifier[private static], parameter[server]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=iterateAllSegments, postfix_operators=[], prefix_operators=[], qualifier=server, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), LambdaExpression(body=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=segment, selectors=[], type_arguments=None), MemberReference(member=segment, 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=AbstractMap, sub_type=ReferenceType(arguments=[], dimensions=None, name=SimpleImmutableEntry, sub_type=None))), parameters=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=transform, postfix_operators=[], prefix_operators=[], qualifier=Iterators, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=iterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SegmentId, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DataSegment, sub_type=None))], dimensions=[], name=Entry, sub_type=None))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTotalSegments, postfix_operators=[], prefix_operators=[], qualifier=server, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=size, parameters=[], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SegmentId, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DataSegment, sub_type=None))], dimensions=[], name=Entry, sub_type=None))], dimensions=None, name=AbstractSet, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=entrySet, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SegmentId, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DataSegment, sub_type=None))], dimensions=[], name=Entry, sub_type=None))], dimensions=[], name=Set, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SegmentId, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DataSegment, sub_type=None))], dimensions=None, name=AbstractMap, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[SegmentId] , identifier[DataSegment] operator[>] identifier[createLazySegmentsMap] operator[SEP] identifier[DruidServer] identifier[server] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractMap] operator[<] identifier[SegmentId] , identifier[DataSegment] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[Entry] operator[<] identifier[SegmentId] , identifier[DataSegment] operator[>] operator[>] identifier[entrySet] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractSet] operator[<] identifier[Entry] operator[<] identifier[SegmentId] , identifier[DataSegment] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[Entry] operator[<] identifier[SegmentId] , identifier[DataSegment] operator[>] operator[>] identifier[iterator] operator[SEP] operator[SEP] { Keyword[return] identifier[Iterators] operator[SEP] identifier[transform] operator[SEP] identifier[server] operator[SEP] identifier[iterateAllSegments] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[segment] operator[->] Keyword[new] identifier[AbstractMap] operator[SEP] identifier[SimpleImmutableEntry] operator[<] operator[>] operator[SEP] identifier[segment] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[segment] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[size] operator[SEP] operator[SEP] { Keyword[return] identifier[server] operator[SEP] identifier[getTotalSegments] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] } } operator[SEP] }
private static void verifyArguments(byte[] source, int srcOffset, byte[] destination, int destOffset) { // Lots of error checking and exception throwing if( source == null ){ throw new IllegalArgumentException( "Source array was null." ); } // end if if( destination == null ){ throw new IllegalArgumentException( "Destination array was null." ); } // end if if( srcOffset < 0 || srcOffset + 3 >= source.length ){ throw new IllegalArgumentException( String.format( "Source array with length %d cannot have offset of %d and still process four bytes.", source.length, srcOffset ) ); } // end if if( destOffset < 0 || destOffset +2 >= destination.length ){ throw new IllegalArgumentException( String.format( "Destination array with length %d cannot have offset of %d and still store three bytes.", destination.length, destOffset ) ); } // end if }
class class_name[name] begin[{] method[verifyArguments, return_type[void], modifier[private static], parameter[source, srcOffset, destination, destOffset]] begin[{] if[binary_operation[member[.source], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source array was null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.destination], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination array was null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.srcOffset], <, literal[0]], ||, binary_operation[binary_operation[member[.srcOffset], +, literal[3]], >=, member[source.length]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source array with length %d cannot have offset of %d and still process four bytes."), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[]), MemberReference(member=srcOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.destOffset], <, literal[0]], ||, binary_operation[binary_operation[member[.destOffset], +, literal[2]], >=, member[destination.length]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination array with length %d cannot have offset of %d and still store three bytes."), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=destination, selectors=[]), MemberReference(member=destOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[verifyArguments] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[source] , Keyword[int] identifier[srcOffset] , Keyword[byte] operator[SEP] operator[SEP] identifier[destination] , Keyword[int] identifier[destOffset] operator[SEP] { Keyword[if] operator[SEP] identifier[source] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[destination] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[srcOffset] operator[<] Other[0] operator[||] identifier[srcOffset] operator[+] Other[3] operator[>=] identifier[source] operator[SEP] identifier[length] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[source] operator[SEP] identifier[length] , identifier[srcOffset] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[destOffset] operator[<] Other[0] operator[||] identifier[destOffset] operator[+] Other[2] operator[>=] identifier[destination] operator[SEP] identifier[length] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[destination] operator[SEP] identifier[length] , identifier[destOffset] operator[SEP] operator[SEP] operator[SEP] } }
@CodingStyleguideUnaware public static <T extends Map <?, ?>> T notNullNoNullValue (final T aValue, final String sName) { if (isEnabled ()) return notNullNoNullValue (aValue, () -> sName); return aValue; }
class class_name[name] begin[{] method[notNullNoNullValue, return_type[type[T]], modifier[public static], parameter[aValue, sName]] begin[{] if[call[.isEnabled, parameter[]]] begin[{] return[call[.notNullNoNullValue, parameter[member[.aValue], LambdaExpression(body=MemberReference(member=sName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), parameters=[])]]] else begin[{] None end[}] return[member[.aValue]] end[}] END[}]
annotation[@] identifier[CodingStyleguideUnaware] Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Map] operator[<] operator[?] , operator[?] operator[>] operator[>] identifier[T] identifier[notNullNoNullValue] operator[SEP] Keyword[final] identifier[T] identifier[aValue] , Keyword[final] identifier[String] identifier[sName] operator[SEP] { Keyword[if] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[notNullNoNullValue] operator[SEP] identifier[aValue] , operator[SEP] operator[SEP] operator[->] identifier[sName] operator[SEP] operator[SEP] Keyword[return] identifier[aValue] operator[SEP] }
public static void eventAvailableImage(final Image image) { final Subscription subscription = image.subscription(); System.out.format( "new image on %s streamId %x sessionId %x from %s%n", subscription.channel(), subscription.streamId(), image.sessionId(), image.sourceIdentity()); }
class class_name[name] begin[{] method[eventAvailableImage, return_type[void], modifier[public static], parameter[image]] begin[{] local_variable[type[Subscription], subscription] call[System.out.format, parameter[literal["new image on %s streamId %x sessionId %x from %s%n"], call[subscription.channel, parameter[]], call[subscription.streamId, parameter[]], call[image.sessionId, parameter[]], call[image.sourceIdentity, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[eventAvailableImage] operator[SEP] Keyword[final] identifier[Image] identifier[image] operator[SEP] { Keyword[final] identifier[Subscription] identifier[subscription] operator[=] identifier[image] operator[SEP] identifier[subscription] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[subscription] operator[SEP] identifier[channel] operator[SEP] operator[SEP] , identifier[subscription] operator[SEP] identifier[streamId] operator[SEP] operator[SEP] , identifier[image] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] , identifier[image] operator[SEP] identifier[sourceIdentity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static final PolygonOptions buildClosedArc(LatLong center, LatLong start, LatLong end, ArcType arcType) { MVCArray res = buildArcPoints(center, start, end); if (ArcType.ROUND.equals(arcType)) { res.push(center); } return new PolygonOptions().paths(res); }
class class_name[name] begin[{] method[buildClosedArc, return_type[type[PolygonOptions]], modifier[final public static], parameter[center, start, end, arcType]] begin[{] local_variable[type[MVCArray], res] if[call[ArcType.ROUND.equals, parameter[member[.arcType]]]] begin[{] call[res.push, parameter[member[.center]]] else begin[{] None end[}] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=paths, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PolygonOptions, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[PolygonOptions] identifier[buildClosedArc] operator[SEP] identifier[LatLong] identifier[center] , identifier[LatLong] identifier[start] , identifier[LatLong] identifier[end] , identifier[ArcType] identifier[arcType] operator[SEP] { identifier[MVCArray] identifier[res] operator[=] identifier[buildArcPoints] operator[SEP] identifier[center] , identifier[start] , identifier[end] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ArcType] operator[SEP] identifier[ROUND] operator[SEP] identifier[equals] operator[SEP] identifier[arcType] operator[SEP] operator[SEP] { identifier[res] operator[SEP] identifier[push] operator[SEP] identifier[center] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[PolygonOptions] operator[SEP] operator[SEP] operator[SEP] identifier[paths] operator[SEP] identifier[res] operator[SEP] operator[SEP] }
public void scrollAllFilesForFileMove(DbSession session, String projectUuid, ResultHandler<FileMoveRowDto> handler) { mapper(session).scrollAllFilesForFileMove(projectUuid, handler); }
class class_name[name] begin[{] method[scrollAllFilesForFileMove, return_type[void], modifier[public], parameter[session, projectUuid, handler]] begin[{] call[.mapper, parameter[member[.session]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[scrollAllFilesForFileMove] operator[SEP] identifier[DbSession] identifier[session] , identifier[String] identifier[projectUuid] , identifier[ResultHandler] operator[<] identifier[FileMoveRowDto] operator[>] identifier[handler] operator[SEP] { identifier[mapper] operator[SEP] identifier[session] operator[SEP] operator[SEP] identifier[scrollAllFilesForFileMove] operator[SEP] identifier[projectUuid] , identifier[handler] operator[SEP] operator[SEP] }
public FeedLoadResult exportTables() { // This result object will be returned to the caller to summarize the feed and report any critical errors. // FIXME: use feed export result object? FeedLoadResult result = new FeedLoadResult(); try { zipOutputStream = new ZipOutputStream(new FileOutputStream(outFile)); long startTime = System.currentTimeMillis(); // We get a single connection object and share it across several different methods. // This ensures that actions taken in one method are visible to all subsequent SQL statements. // If we create a schema or table on one connection, then access it in a separate connection, we have no // guarantee that it exists when the accessing statement is executed. connection = dataSource.getConnection(); if (!connection.getMetaData().getDatabaseProductName().equals("PostgreSQL")) { // This code path currently requires the Postgres text "copy to" format. throw new RuntimeException("Export from SQL database not implemented for non-PostgreSQL databases."); } // Construct where clause for routes table to filter only "approved" routes (and entities related to routes) // if exporting a feed/schema that represents an editor snapshot. String whereRouteIsApproved = String.format("where %s.%s.status = 2", feedIdToExport, Table.ROUTES.name); // Export each table in turn (by placing entry in zip output stream). result.agency = export(Table.AGENCY, connection); if (fromEditor) { // only export calendar entries that have at least one day of service set // this could happen in cases where a feed was imported that only had calendar_dates.txt result.calendar = export( Table.CALENDAR, String.join( " ", Table.CALENDAR.generateSelectSql(feedIdToExport, Requirement.OPTIONAL), "WHERE monday=1 OR tuesday=1 OR wednesday=1 OR thursday=1 OR friday=1 OR saturday=1 OR sunday=1" ) ); } else { result.calendar = export(Table.CALENDAR, connection); } if (fromEditor) { // Export schedule exceptions in place of calendar dates if exporting a feed/schema that represents an editor snapshot. GTFSFeed feed = new GTFSFeed(); // FIXME: The below table readers should probably just share a connection with the exporter. JDBCTableReader<ScheduleException> exceptionsReader = new JDBCTableReader(Table.SCHEDULE_EXCEPTIONS, dataSource, feedIdToExport + ".", EntityPopulator.SCHEDULE_EXCEPTION); JDBCTableReader<Calendar> calendarsReader = new JDBCTableReader(Table.CALENDAR, dataSource, feedIdToExport + ".", EntityPopulator.CALENDAR); Iterable<Calendar> calendars = calendarsReader.getAll(); Iterable<ScheduleException> exceptionsIterator = exceptionsReader.getAll(); List<ScheduleException> exceptions = new ArrayList<>(); // FIXME: Doing this causes the connection to stay open, but it is closed in the finalizer so it should // not be a big problem. for (ScheduleException exception : exceptionsIterator) { exceptions.add(exception); } // check whether the feed is organized in a format with the calendars.txt file if (calendarsReader.getRowCount() > 0) { // feed does have calendars.txt file, continue export with strategy of matching exceptions // to calendar to output calendar_dates.txt int calendarDateCount = 0; for (Calendar cal : calendars) { Service service = new Service(cal.service_id); service.calendar = cal; for (ScheduleException ex : exceptions) { if (ex.exemplar.equals(ScheduleException.ExemplarServiceDescriptor.SWAP) && (!ex.addedService.contains(cal.service_id) && !ex.removedService.contains(cal.service_id))) { // Skip swap exception if cal is not referenced by added or removed service. // This is not technically necessary, but the output is cleaner/more intelligible. continue; } for (LocalDate date : ex.dates) { if (date.isBefore(cal.start_date) || date.isAfter(cal.end_date)) { // No need to write dates that do not apply continue; } CalendarDate calendarDate = new CalendarDate(); calendarDate.date = date; calendarDate.service_id = cal.service_id; calendarDate.exception_type = ex.serviceRunsOn(cal) ? 1 : 2; LOG.info("Adding exception {} (type={}) for calendar {} on date {}", ex.name, calendarDate.exception_type, cal.service_id, date.toString()); if (service.calendar_dates.containsKey(date)) throw new IllegalArgumentException("Duplicate schedule exceptions on " + date.toString()); service.calendar_dates.put(date, calendarDate); calendarDateCount += 1; } } feed.services.put(cal.service_id, service); } if (calendarDateCount == 0) { LOG.info("No calendar dates found. Skipping table."); } else { LOG.info("Writing {} calendar dates from schedule exceptions", calendarDateCount); new CalendarDate.Writer(feed).writeTable(zipOutputStream); } } else { // No calendar records exist, export calendar_dates as is and hope for the best. // This situation will occur in at least 2 scenarios: // 1. A GTFS has been loaded into the editor that had only the calendar_dates.txt file // and no further edits were made before exporting to a snapshot // 2. A new GTFS has been created from scratch and calendar information has yet to be added. // This will result in an invalid GTFS, but it was what the user wanted so ¯\_(ツ)_/¯ result.calendarDates = export(Table.CALENDAR_DATES, connection); } } else { // Otherwise, simply export the calendar dates as they were loaded in. result.calendarDates = export(Table.CALENDAR_DATES, connection); } result.fareAttributes = export(Table.FARE_ATTRIBUTES, connection); result.fareRules = export(Table.FARE_RULES, connection); result.feedInfo = export(Table.FEED_INFO, connection); // Only write frequencies for "approved" routes using COPY TO with results of select query if (fromEditor) { // Generate filter SQL for trips if exporting a feed/schema that represents an editor snapshot. // The filter clause for frequencies requires two joins to reach the routes table and a where filter on // route status. // FIXME Replace with string literal query instead of clause generators result.frequencies = export( Table.FREQUENCIES, String.join( " ", // Convert start_time and end_time values from seconds to time format (HH:MM:SS). Table.FREQUENCIES.generateSelectSql(feedIdToExport, Requirement.OPTIONAL), Table.FREQUENCIES.generateJoinSql(Table.TRIPS, feedIdToExport), Table.TRIPS.generateJoinSql( Table.ROUTES, feedIdToExport, "route_id", false ), whereRouteIsApproved ) ); } else { result.frequencies = export(Table.FREQUENCIES, connection); } // Only write "approved" routes using COPY TO with results of select query if (fromEditor) { // The filter clause for routes is simple. We're just checking that the route is APPROVED. result.routes = export( Table.ROUTES, String.join( " ", Table.ROUTES.generateSelectSql(feedIdToExport, Requirement.OPTIONAL), whereRouteIsApproved ) ); } else { result.routes = export(Table.ROUTES, connection); } // FIXME: Find some place to store errors encountered on export for patterns and pattern stops. // FIXME: Is there a need to export patterns or pattern stops? Should these be iterated over to ensure that // frequency-based pattern travel times match stop time arrivals/departures? // export(Table.PATTERNS); // export(Table.PATTERN_STOP); // Only write shapes for "approved" routes using COPY TO with results of select query if (fromEditor) { // Generate filter SQL for shapes if exporting a feed/schema that represents an editor snapshot. // The filter clause for shapes requires joining to trips and then to routes table and a where filter on // route status. // FIXME: I'm not sure that shape_id is indexed for the trips table. This could cause slow downs. // FIXME: this is exporting point_type, which is not a GTFS field, but its presence shouldn't hurt. String shapeFieldsToExport = Table.commaSeparatedNames( Table.SHAPES.specFields(), String.join(".", feedIdToExport, Table.SHAPES.name + "."), true ); // NOTE: The below substitution uses relative indexing. All values "%<s" reference the same arg as the // previous format specifier (i.e., feedIdToExport). result.shapes = export( Table.SHAPES, String.format( "select %s " + "from (select distinct %s.trips.shape_id " + "from %<s.trips, %<s.routes " + "where %<s.trips.route_id = %<s.routes.route_id and " + "%<s.routes.status = 2) as unique_approved_shape_ids, " + "%<s.shapes where unique_approved_shape_ids.shape_id = %<s.shapes.shape_id", shapeFieldsToExport, feedIdToExport ) ); } else { result.shapes = export(Table.SHAPES, connection); } result.stops = export(Table.STOPS, connection); // Only write stop times for "approved" routes using COPY TO with results of select query if (fromEditor) { // Generate filter SQL for trips if exporting a feed/schema that represents an editor snapshot. // The filter clause for stop times requires two joins to reach the routes table and a where filter on // route status. // FIXME Replace with string literal query instead of clause generators result.stopTimes = export( Table.STOP_TIMES, String.join(" ", Table.STOP_TIMES.generateSelectSql(feedIdToExport, Requirement.OPTIONAL), Table.STOP_TIMES.generateJoinSql(Table.TRIPS, feedIdToExport), Table.TRIPS.generateJoinSql( Table.ROUTES, feedIdToExport, "route_id", false ), whereRouteIsApproved ) ); } else { result.stopTimes = export(Table.STOP_TIMES, connection); } result.transfers = export(Table.TRANSFERS, connection); if (fromEditor) { // Generate filter SQL for trips if exporting a feed/schema that represents an editor snapshot. // The filter clause for trips requires an inner join on the routes table and the same where check on // route status. // FIXME Replace with string literal query instead of clause generators result.trips = export( Table.TRIPS, String.join(" ", Table.TRIPS.generateSelectSql(feedIdToExport, Requirement.OPTIONAL), Table.TRIPS.generateJoinSql( Table.ROUTES, feedIdToExport, "route_id", false ), whereRouteIsApproved ) ); } else { result.trips = export(Table.TRIPS, connection); } zipOutputStream.close(); // Run clean up on the resulting zip file. cleanUpZipFile(); result.completionTime = System.currentTimeMillis(); result.loadTimeMillis = result.completionTime - startTime; // Exporting primary GTFS tables for GRTA Xpress = 12 sec LOG.info("Exporting tables took {} sec", (result.loadTimeMillis) / 1000); LOG.info("Exported feed {} to zip file: {}", feedIdToExport, outFile); } catch (Exception ex) { // Note: Exceptions that occur during individual table loads are separately caught and stored in // TableLoadResult. LOG.error("Exception while creating snapshot: {}", ex.toString()); ex.printStackTrace(); result.fatalException = ex.toString(); } return result; }
class class_name[name] begin[{] method[exportTables, return_type[type[FeedLoadResult]], modifier[public], parameter[]] begin[{] local_variable[type[FeedLoadResult], result] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=zipOutputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=outFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZipOutputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=startTime)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=dataSource, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getMetaData, postfix_operators=[], prefix_operators=['!'], qualifier=connection, selectors=[MethodInvocation(arguments=[], member=getDatabaseProductName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PostgreSQL")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Export from SQL database not implemented for non-PostgreSQL databases.")], 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)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="where %s.%s.status = 2"), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=Table.ROUTES, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), name=whereRouteIsApproved)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=agency, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=AGENCY, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=fromEditor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=calendar, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=CALENDAR, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=calendar, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=CALENDAR, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), MethodInvocation(arguments=[MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OPTIONAL, postfix_operators=[], prefix_operators=[], qualifier=Requirement, selectors=[])], member=generateSelectSql, postfix_operators=[], prefix_operators=[], qualifier=Table.CALENDAR, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="WHERE monday=1 OR tuesday=1 OR wednesday=1 OR thursday=1 OR friday=1 OR saturday=1 OR sunday=1")], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MemberReference(member=fromEditor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=calendarDates, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=CALENDAR_DATES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GTFSFeed, sub_type=None)), name=feed)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GTFSFeed, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=SCHEDULE_EXCEPTIONS, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=dataSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), MemberReference(member=SCHEDULE_EXCEPTION, postfix_operators=[], prefix_operators=[], qualifier=EntityPopulator, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JDBCTableReader, sub_type=None)), name=exceptionsReader)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ScheduleException, sub_type=None))], dimensions=[], name=JDBCTableReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=CALENDAR, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=dataSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), MemberReference(member=CALENDAR, postfix_operators=[], prefix_operators=[], qualifier=EntityPopulator, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JDBCTableReader, sub_type=None)), name=calendarsReader)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Calendar, sub_type=None))], dimensions=[], name=JDBCTableReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAll, postfix_operators=[], prefix_operators=[], qualifier=calendarsReader, selectors=[], type_arguments=None), name=calendars)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Calendar, sub_type=None))], dimensions=[], name=Iterable, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAll, postfix_operators=[], prefix_operators=[], qualifier=exceptionsReader, selectors=[], type_arguments=None), name=exceptionsIterator)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ScheduleException, sub_type=None))], dimensions=[], name=Iterable, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=exceptions)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ScheduleException, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=exceptions, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=exceptionsIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=exception)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ScheduleException, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRowCount, postfix_operators=[], prefix_operators=[], qualifier=calendarsReader, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=calendarDates, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=CALENDAR_DATES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=calendarDateCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=service_id, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Service, sub_type=None)), name=service)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Service, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=calendar, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[]), type==, value=MemberReference(member=cal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SWAP, postfix_operators=[], prefix_operators=[], qualifier=ScheduleException.ExemplarServiceDescriptor, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ex.exemplar, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=service_id, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=ex.addedService, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=service_id, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=ex.removedService, selectors=[], type_arguments=None), operator=&&), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=start_date, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[])], member=isBefore, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=end_date, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[])], member=isAfter, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CalendarDate, sub_type=None)), name=calendarDate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CalendarDate, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=calendarDate, selectors=[]), type==, value=MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=service_id, postfix_operators=[], prefix_operators=[], qualifier=calendarDate, selectors=[]), type==, value=MemberReference(member=service_id, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exception_type, postfix_operators=[], prefix_operators=[], qualifier=calendarDate, selectors=[]), type==, value=TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=cal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serviceRunsOn, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding exception {} (type={}) for calendar {} on date {}"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[]), MemberReference(member=exception_type, postfix_operators=[], prefix_operators=[], qualifier=calendarDate, selectors=[]), MemberReference(member=service_id, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=service.calendar_dates, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Duplicate schedule exceptions on "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=date, 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)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=calendarDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=service.calendar_dates, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=calendarDateCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=dates, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=date)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocalDate, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=exceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ScheduleException, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=service_id, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[]), MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=feed.services, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=calendars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cal)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Calendar, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=calendarDateCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Writing {} calendar dates from schedule exceptions"), MemberReference(member=calendarDateCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=ClassCreator(arguments=[MemberReference(member=feed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=zipOutputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeTable, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CalendarDate, sub_type=ReferenceType(arguments=None, dimensions=None, name=Writer, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No calendar dates found. Skipping table.")], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fareAttributes, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=FARE_ATTRIBUTES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fareRules, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=FARE_RULES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=feedInfo, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=FEED_INFO, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=fromEditor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=frequencies, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=FREQUENCIES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=frequencies, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=FREQUENCIES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), MethodInvocation(arguments=[MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OPTIONAL, postfix_operators=[], prefix_operators=[], qualifier=Requirement, selectors=[])], member=generateSelectSql, postfix_operators=[], prefix_operators=[], qualifier=Table.FREQUENCIES, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=TRIPS, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateJoinSql, postfix_operators=[], prefix_operators=[], qualifier=Table.FREQUENCIES, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ROUTES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="route_id"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=generateJoinSql, postfix_operators=[], prefix_operators=[], qualifier=Table.TRIPS, selectors=[], type_arguments=None), MemberReference(member=whereRouteIsApproved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MemberReference(member=fromEditor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=routes, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ROUTES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=routes, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ROUTES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), MethodInvocation(arguments=[MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OPTIONAL, postfix_operators=[], prefix_operators=[], qualifier=Requirement, selectors=[])], member=generateSelectSql, postfix_operators=[], prefix_operators=[], qualifier=Table.ROUTES, selectors=[], type_arguments=None), MemberReference(member=whereRouteIsApproved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MemberReference(member=fromEditor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shapes, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=SHAPES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=specFields, postfix_operators=[], prefix_operators=[], qualifier=Table.SHAPES, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=Table.SHAPES, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=commaSeparatedNames, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[], type_arguments=None), name=shapeFieldsToExport)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=shapes, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=SHAPES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="select %s "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="from (select distinct %s.trips.shape_id "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="from %<s.trips, %<s.routes "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="where %<s.trips.route_id = %<s.routes.route_id and "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%<s.routes.status = 2) as unique_approved_shape_ids, "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%<s.shapes where unique_approved_shape_ids.shape_id = %<s.shapes.shape_id"), operator=+), MemberReference(member=shapeFieldsToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stops, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=STOPS, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=fromEditor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stopTimes, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=STOP_TIMES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stopTimes, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=STOP_TIMES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), MethodInvocation(arguments=[MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OPTIONAL, postfix_operators=[], prefix_operators=[], qualifier=Requirement, selectors=[])], member=generateSelectSql, postfix_operators=[], prefix_operators=[], qualifier=Table.STOP_TIMES, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=TRIPS, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateJoinSql, postfix_operators=[], prefix_operators=[], qualifier=Table.STOP_TIMES, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ROUTES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="route_id"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=generateJoinSql, postfix_operators=[], prefix_operators=[], qualifier=Table.TRIPS, selectors=[], type_arguments=None), MemberReference(member=whereRouteIsApproved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=transfers, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=TRANSFERS, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=fromEditor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=trips, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=TRIPS, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=trips, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=TRIPS, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), MethodInvocation(arguments=[MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OPTIONAL, postfix_operators=[], prefix_operators=[], qualifier=Requirement, selectors=[])], member=generateSelectSql, postfix_operators=[], prefix_operators=[], qualifier=Table.TRIPS, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ROUTES, postfix_operators=[], prefix_operators=[], qualifier=Table, selectors=[]), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="route_id"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=generateJoinSql, postfix_operators=[], prefix_operators=[], qualifier=Table.TRIPS, selectors=[], type_arguments=None), MemberReference(member=whereRouteIsApproved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=export, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=zipOutputStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=cleanUpZipFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=completionTime, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=loadTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=completionTime, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), operandr=MemberReference(member=startTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exporting tables took {} sec"), BinaryOperation(operandl=MemberReference(member=loadTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=/)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exported feed {} to zip file: {}"), MemberReference(member=feedIdToExport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception while creating snapshot: {}"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fatalException, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[FeedLoadResult] identifier[exportTables] operator[SEP] operator[SEP] { identifier[FeedLoadResult] identifier[result] operator[=] Keyword[new] identifier[FeedLoadResult] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[zipOutputStream] operator[=] Keyword[new] identifier[ZipOutputStream] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[outFile] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[startTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[=] identifier[dataSource] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[connection] operator[SEP] identifier[getMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[getDatabaseProductName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[whereRouteIsApproved] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[feedIdToExport] , identifier[Table] operator[SEP] identifier[ROUTES] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[agency] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[AGENCY] , identifier[connection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fromEditor] operator[SEP] { identifier[result] operator[SEP] identifier[calendar] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[CALENDAR] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[Table] operator[SEP] identifier[CALENDAR] operator[SEP] identifier[generateSelectSql] operator[SEP] identifier[feedIdToExport] , identifier[Requirement] operator[SEP] identifier[OPTIONAL] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[calendar] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[CALENDAR] , identifier[connection] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fromEditor] operator[SEP] { identifier[GTFSFeed] identifier[feed] operator[=] Keyword[new] identifier[GTFSFeed] operator[SEP] operator[SEP] operator[SEP] identifier[JDBCTableReader] operator[<] identifier[ScheduleException] operator[>] identifier[exceptionsReader] operator[=] Keyword[new] identifier[JDBCTableReader] operator[SEP] identifier[Table] operator[SEP] identifier[SCHEDULE_EXCEPTIONS] , identifier[dataSource] , identifier[feedIdToExport] operator[+] literal[String] , identifier[EntityPopulator] operator[SEP] identifier[SCHEDULE_EXCEPTION] operator[SEP] operator[SEP] identifier[JDBCTableReader] operator[<] identifier[Calendar] operator[>] identifier[calendarsReader] operator[=] Keyword[new] identifier[JDBCTableReader] operator[SEP] identifier[Table] operator[SEP] identifier[CALENDAR] , identifier[dataSource] , identifier[feedIdToExport] operator[+] literal[String] , identifier[EntityPopulator] operator[SEP] identifier[CALENDAR] operator[SEP] operator[SEP] identifier[Iterable] operator[<] identifier[Calendar] operator[>] identifier[calendars] operator[=] identifier[calendarsReader] operator[SEP] identifier[getAll] operator[SEP] operator[SEP] operator[SEP] identifier[Iterable] operator[<] identifier[ScheduleException] operator[>] identifier[exceptionsIterator] operator[=] identifier[exceptionsReader] operator[SEP] identifier[getAll] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ScheduleException] operator[>] identifier[exceptions] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ScheduleException] identifier[exception] operator[:] identifier[exceptionsIterator] operator[SEP] { identifier[exceptions] operator[SEP] identifier[add] operator[SEP] identifier[exception] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[calendarsReader] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[calendarDateCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Calendar] identifier[cal] operator[:] identifier[calendars] operator[SEP] { identifier[Service] identifier[service] operator[=] Keyword[new] identifier[Service] operator[SEP] identifier[cal] operator[SEP] identifier[service_id] operator[SEP] operator[SEP] identifier[service] operator[SEP] identifier[calendar] operator[=] identifier[cal] operator[SEP] Keyword[for] operator[SEP] identifier[ScheduleException] identifier[ex] operator[:] identifier[exceptions] operator[SEP] { Keyword[if] operator[SEP] identifier[ex] operator[SEP] identifier[exemplar] operator[SEP] identifier[equals] operator[SEP] identifier[ScheduleException] operator[SEP] identifier[ExemplarServiceDescriptor] operator[SEP] identifier[SWAP] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[ex] operator[SEP] identifier[addedService] operator[SEP] identifier[contains] operator[SEP] identifier[cal] operator[SEP] identifier[service_id] operator[SEP] operator[&&] operator[!] identifier[ex] operator[SEP] identifier[removedService] operator[SEP] identifier[contains] operator[SEP] identifier[cal] operator[SEP] identifier[service_id] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[for] operator[SEP] identifier[LocalDate] identifier[date] operator[:] identifier[ex] operator[SEP] identifier[dates] operator[SEP] { Keyword[if] operator[SEP] identifier[date] operator[SEP] identifier[isBefore] operator[SEP] identifier[cal] operator[SEP] identifier[start_date] operator[SEP] operator[||] identifier[date] operator[SEP] identifier[isAfter] operator[SEP] identifier[cal] operator[SEP] identifier[end_date] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[CalendarDate] identifier[calendarDate] operator[=] Keyword[new] identifier[CalendarDate] operator[SEP] operator[SEP] operator[SEP] identifier[calendarDate] operator[SEP] identifier[date] operator[=] identifier[date] operator[SEP] identifier[calendarDate] operator[SEP] identifier[service_id] operator[=] identifier[cal] operator[SEP] identifier[service_id] operator[SEP] identifier[calendarDate] operator[SEP] identifier[exception_type] operator[=] identifier[ex] operator[SEP] identifier[serviceRunsOn] operator[SEP] identifier[cal] operator[SEP] operator[?] Other[1] operator[:] Other[2] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[ex] operator[SEP] identifier[name] , identifier[calendarDate] operator[SEP] identifier[exception_type] , identifier[cal] operator[SEP] identifier[service_id] , identifier[date] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[service] operator[SEP] identifier[calendar_dates] operator[SEP] identifier[containsKey] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[date] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[service] operator[SEP] identifier[calendar_dates] operator[SEP] identifier[put] operator[SEP] identifier[date] , identifier[calendarDate] operator[SEP] operator[SEP] identifier[calendarDateCount] operator[+=] Other[1] operator[SEP] } } identifier[feed] operator[SEP] identifier[services] operator[SEP] identifier[put] operator[SEP] identifier[cal] operator[SEP] identifier[service_id] , identifier[service] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[calendarDateCount] operator[==] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[calendarDateCount] operator[SEP] operator[SEP] Keyword[new] identifier[CalendarDate] operator[SEP] identifier[Writer] operator[SEP] identifier[feed] operator[SEP] operator[SEP] identifier[writeTable] operator[SEP] identifier[zipOutputStream] operator[SEP] operator[SEP] } } Keyword[else] { identifier[result] operator[SEP] identifier[calendarDates] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[CALENDAR_DATES] , identifier[connection] operator[SEP] operator[SEP] } } Keyword[else] { identifier[result] operator[SEP] identifier[calendarDates] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[CALENDAR_DATES] , identifier[connection] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[fareAttributes] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[FARE_ATTRIBUTES] , identifier[connection] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[fareRules] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[FARE_RULES] , identifier[connection] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[feedInfo] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[FEED_INFO] , identifier[connection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fromEditor] operator[SEP] { identifier[result] operator[SEP] identifier[frequencies] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[FREQUENCIES] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[Table] operator[SEP] identifier[FREQUENCIES] operator[SEP] identifier[generateSelectSql] operator[SEP] identifier[feedIdToExport] , identifier[Requirement] operator[SEP] identifier[OPTIONAL] operator[SEP] , identifier[Table] operator[SEP] identifier[FREQUENCIES] operator[SEP] identifier[generateJoinSql] operator[SEP] identifier[Table] operator[SEP] identifier[TRIPS] , identifier[feedIdToExport] operator[SEP] , identifier[Table] operator[SEP] identifier[TRIPS] operator[SEP] identifier[generateJoinSql] operator[SEP] identifier[Table] operator[SEP] identifier[ROUTES] , identifier[feedIdToExport] , literal[String] , literal[boolean] operator[SEP] , identifier[whereRouteIsApproved] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[frequencies] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[FREQUENCIES] , identifier[connection] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fromEditor] operator[SEP] { identifier[result] operator[SEP] identifier[routes] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[ROUTES] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[Table] operator[SEP] identifier[ROUTES] operator[SEP] identifier[generateSelectSql] operator[SEP] identifier[feedIdToExport] , identifier[Requirement] operator[SEP] identifier[OPTIONAL] operator[SEP] , identifier[whereRouteIsApproved] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[routes] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[ROUTES] , identifier[connection] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fromEditor] operator[SEP] { identifier[String] identifier[shapeFieldsToExport] operator[=] identifier[Table] operator[SEP] identifier[commaSeparatedNames] operator[SEP] identifier[Table] operator[SEP] identifier[SHAPES] operator[SEP] identifier[specFields] operator[SEP] operator[SEP] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[feedIdToExport] , identifier[Table] operator[SEP] identifier[SHAPES] operator[SEP] identifier[name] operator[+] literal[String] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[shapes] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[SHAPES] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] , identifier[shapeFieldsToExport] , identifier[feedIdToExport] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[shapes] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[SHAPES] , identifier[connection] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[stops] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[STOPS] , identifier[connection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fromEditor] operator[SEP] { identifier[result] operator[SEP] identifier[stopTimes] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[STOP_TIMES] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[Table] operator[SEP] identifier[STOP_TIMES] operator[SEP] identifier[generateSelectSql] operator[SEP] identifier[feedIdToExport] , identifier[Requirement] operator[SEP] identifier[OPTIONAL] operator[SEP] , identifier[Table] operator[SEP] identifier[STOP_TIMES] operator[SEP] identifier[generateJoinSql] operator[SEP] identifier[Table] operator[SEP] identifier[TRIPS] , identifier[feedIdToExport] operator[SEP] , identifier[Table] operator[SEP] identifier[TRIPS] operator[SEP] identifier[generateJoinSql] operator[SEP] identifier[Table] operator[SEP] identifier[ROUTES] , identifier[feedIdToExport] , literal[String] , literal[boolean] operator[SEP] , identifier[whereRouteIsApproved] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[stopTimes] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[STOP_TIMES] , identifier[connection] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[transfers] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[TRANSFERS] , identifier[connection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fromEditor] operator[SEP] { identifier[result] operator[SEP] identifier[trips] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[TRIPS] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[Table] operator[SEP] identifier[TRIPS] operator[SEP] identifier[generateSelectSql] operator[SEP] identifier[feedIdToExport] , identifier[Requirement] operator[SEP] identifier[OPTIONAL] operator[SEP] , identifier[Table] operator[SEP] identifier[TRIPS] operator[SEP] identifier[generateJoinSql] operator[SEP] identifier[Table] operator[SEP] identifier[ROUTES] , identifier[feedIdToExport] , literal[String] , literal[boolean] operator[SEP] , identifier[whereRouteIsApproved] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[trips] operator[=] identifier[export] operator[SEP] identifier[Table] operator[SEP] identifier[TRIPS] , identifier[connection] operator[SEP] operator[SEP] } identifier[zipOutputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[cleanUpZipFile] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[completionTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[loadTimeMillis] operator[=] identifier[result] operator[SEP] identifier[completionTime] operator[-] identifier[startTime] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , operator[SEP] identifier[result] operator[SEP] identifier[loadTimeMillis] operator[SEP] operator[/] Other[1000] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[feedIdToExport] , identifier[outFile] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ex] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[fatalException] operator[=] identifier[ex] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static ScheduleExpression copyBase(ScheduleExpression schedule) // d632906 { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "copy copyBase: " + Util.identity(schedule)); // 'schedule' could be a subclass of ScheduleExpression. // Use only the base class constructor. return new ScheduleExpression() .start(schedule.getStart() == null ? null : new Date(schedule.getStart().getTime())) .end(schedule.getEnd() == null ? null : new Date(schedule.getEnd().getTime())) .timezone(schedule.getTimezone()) .second(schedule.getSecond()) .minute(schedule.getMinute()) .hour(schedule.getHour()) .dayOfMonth(schedule.getDayOfMonth()) .dayOfWeek(schedule.getDayOfWeek()) .month(schedule.getMonth()) .year(schedule.getYear()); }
class class_name[name] begin[{] method[copyBase, return_type[type[ScheduleExpression]], modifier[public static], parameter[schedule]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["copy copyBase: "], +, call[Util.identity, parameter[member[.schedule]]]]]] else begin[{] None end[}] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))], member=start, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))], member=end, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTimezone, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=timezone, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSecond, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=second, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMinute, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=minute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHour, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=hour, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDayOfMonth, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=dayOfMonth, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDayOfWeek, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=dayOfWeek, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMonth, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=month, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getYear, postfix_operators=[], prefix_operators=[], qualifier=schedule, selectors=[], type_arguments=None)], member=year, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ScheduleExpression, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ScheduleExpression] identifier[copyBase] operator[SEP] identifier[ScheduleExpression] identifier[schedule] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[Util] operator[SEP] identifier[identity] operator[SEP] identifier[schedule] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ScheduleExpression] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[SEP] identifier[schedule] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] Other[null] operator[:] Keyword[new] identifier[Date] operator[SEP] identifier[schedule] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[end] operator[SEP] identifier[schedule] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] Other[null] operator[:] Keyword[new] identifier[Date] operator[SEP] identifier[schedule] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[timezone] operator[SEP] identifier[schedule] operator[SEP] identifier[getTimezone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[second] operator[SEP] identifier[schedule] operator[SEP] identifier[getSecond] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[minute] operator[SEP] identifier[schedule] operator[SEP] identifier[getMinute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[hour] operator[SEP] identifier[schedule] operator[SEP] identifier[getHour] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dayOfMonth] operator[SEP] identifier[schedule] operator[SEP] identifier[getDayOfMonth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dayOfWeek] operator[SEP] identifier[schedule] operator[SEP] identifier[getDayOfWeek] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[month] operator[SEP] identifier[schedule] operator[SEP] identifier[getMonth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[year] operator[SEP] identifier[schedule] operator[SEP] identifier[getYear] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void acceptsJson(OptionParser parser) { parser.acceptsAll(Arrays.asList(OPT_J, OPT_JSON), "fetch key/entry by key value of json type") .withRequiredArg() .describedAs("key-list") .withValuesSeparatedBy(',') .ofType(String.class); }
class class_name[name] begin[{] method[acceptsJson, return_type[void], modifier[public static], parameter[parser]] begin[{] call[parser.acceptsAll, parameter[call[Arrays.asList, parameter[member[.OPT_J], member[.OPT_JSON]]], literal["fetch key/entry by key value of json type"]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[acceptsJson] operator[SEP] identifier[OptionParser] identifier[parser] operator[SEP] { identifier[parser] operator[SEP] identifier[acceptsAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[OPT_J] , identifier[OPT_JSON] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[withRequiredArg] operator[SEP] operator[SEP] operator[SEP] identifier[describedAs] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[withValuesSeparatedBy] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ofType] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public boolean needAuthorization(ResponseEvent event) { Response response = event.getResponse(); int status = response.getStatusCode(); if ((status == Response.UNAUTHORIZED) || (status == Response.PROXY_AUTHENTICATION_REQUIRED)) { return true; } return false; }
class class_name[name] begin[{] method[needAuthorization, return_type[type[boolean]], modifier[public], parameter[event]] begin[{] local_variable[type[Response], response] local_variable[type[int], status] if[binary_operation[binary_operation[member[.status], ==, member[Response.UNAUTHORIZED]], ||, binary_operation[member[.status], ==, member[Response.PROXY_AUTHENTICATION_REQUIRED]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[needAuthorization] operator[SEP] identifier[ResponseEvent] identifier[event] operator[SEP] { identifier[Response] identifier[response] operator[=] identifier[event] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[status] operator[=] identifier[response] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[status] operator[==] identifier[Response] operator[SEP] identifier[UNAUTHORIZED] operator[SEP] operator[||] operator[SEP] identifier[status] operator[==] identifier[Response] operator[SEP] identifier[PROXY_AUTHENTICATION_REQUIRED] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static PayContractorderResult payContractorder(PayContractorder payContractorder,String key){ Map<String,String> map = MapUtil.objectToMap(payContractorder); String sign = SignatureUtil.generateSign(map,payContractorder.getSign_type(),key); payContractorder.setSign(sign); String secapiPayRefundXML = XMLConverUtil.convertToXML( payContractorder); HttpUriRequest httpUriRequest = RequestBuilder.post() .setHeader(xmlHeader) .setUri(baseURI()+ "/pay/contractorder") .setEntity(new StringEntity(secapiPayRefundXML,Charset.forName("utf-8"))) .build(); return LocalHttpClient.executeXmlResult(httpUriRequest,PayContractorderResult.class,payContractorder.getSign_type(),key); }
class class_name[name] begin[{] method[payContractorder, return_type[type[PayContractorderResult]], modifier[public static], parameter[payContractorder, key]] begin[{] local_variable[type[Map], map] local_variable[type[String], sign] call[payContractorder.setSign, parameter[member[.sign]]] local_variable[type[String], secapiPayRefundXML] local_variable[type[HttpUriRequest], httpUriRequest] return[call[LocalHttpClient.executeXmlResult, parameter[member[.httpUriRequest], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PayContractorderResult, sub_type=None)), call[payContractorder.getSign_type, parameter[]], member[.key]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[PayContractorderResult] identifier[payContractorder] operator[SEP] identifier[PayContractorder] identifier[payContractorder] , identifier[String] identifier[key] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] identifier[MapUtil] operator[SEP] identifier[objectToMap] operator[SEP] identifier[payContractorder] operator[SEP] operator[SEP] identifier[String] identifier[sign] operator[=] identifier[SignatureUtil] operator[SEP] identifier[generateSign] operator[SEP] identifier[map] , identifier[payContractorder] operator[SEP] identifier[getSign_type] operator[SEP] operator[SEP] , identifier[key] operator[SEP] operator[SEP] identifier[payContractorder] operator[SEP] identifier[setSign] operator[SEP] identifier[sign] operator[SEP] operator[SEP] identifier[String] identifier[secapiPayRefundXML] operator[=] identifier[XMLConverUtil] operator[SEP] identifier[convertToXML] operator[SEP] identifier[payContractorder] operator[SEP] operator[SEP] identifier[HttpUriRequest] identifier[httpUriRequest] operator[=] identifier[RequestBuilder] operator[SEP] identifier[post] operator[SEP] operator[SEP] operator[SEP] identifier[setHeader] operator[SEP] identifier[xmlHeader] operator[SEP] operator[SEP] identifier[setUri] operator[SEP] identifier[baseURI] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[setEntity] operator[SEP] Keyword[new] identifier[StringEntity] operator[SEP] identifier[secapiPayRefundXML] , identifier[Charset] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[LocalHttpClient] operator[SEP] identifier[executeXmlResult] operator[SEP] identifier[httpUriRequest] , identifier[PayContractorderResult] operator[SEP] Keyword[class] , identifier[payContractorder] operator[SEP] identifier[getSign_type] operator[SEP] operator[SEP] , identifier[key] operator[SEP] operator[SEP] }
public PartnerLogData getEntry(int index) { if (tc.isEntryEnabled()) Tr.entry(tc, "getEntry", index); _pltReadLock.lock(); try { final PartnerLogData entry = _partnerLogTable.get(index - 1); if (tc.isEntryEnabled()) Tr.exit(tc, "getEntry", entry); return entry; } catch (IndexOutOfBoundsException ioobe) { // The index was invalid; return null. FFDCFilter.processException(ioobe, "com.ibm.ws.Transaction.JTA.PartnerLogTable.getEntry", "122", this); } finally { _pltReadLock.unlock(); } if (tc.isEntryEnabled()) Tr.exit(tc, "getEntry", null); return null; }
class class_name[name] begin[{] method[getEntry, return_type[type[PartnerLogData]], modifier[public], parameter[index]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["getEntry"], member[.index]]] else begin[{] None end[}] call[_pltReadLock.lock, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=_partnerLogTable, selectors=[], type_arguments=None), name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=PartnerLogData, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getEntry"), MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ioobe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.Transaction.JTA.PartnerLogTable.getEntry"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="122"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioobe, types=['IndexOutOfBoundsException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=_pltReadLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["getEntry"], literal[null]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[PartnerLogData] identifier[getEntry] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[index] operator[SEP] operator[SEP] identifier[_pltReadLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[PartnerLogData] identifier[entry] operator[=] identifier[_partnerLogTable] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[entry] operator[SEP] operator[SEP] Keyword[return] identifier[entry] operator[SEP] } Keyword[catch] operator[SEP] identifier[IndexOutOfBoundsException] identifier[ioobe] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ioobe] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] } Keyword[finally] { identifier[_pltReadLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , Other[null] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
@Override public CPDefinitionOptionValueRel[] findByGroupId_PrevAndNext( long CPDefinitionOptionValueRelId, long groupId, OrderByComparator<CPDefinitionOptionValueRel> orderByComparator) throws NoSuchCPDefinitionOptionValueRelException { CPDefinitionOptionValueRel cpDefinitionOptionValueRel = findByPrimaryKey(CPDefinitionOptionValueRelId); Session session = null; try { session = openSession(); CPDefinitionOptionValueRel[] array = new CPDefinitionOptionValueRelImpl[3]; array[0] = getByGroupId_PrevAndNext(session, cpDefinitionOptionValueRel, groupId, orderByComparator, true); array[1] = cpDefinitionOptionValueRel; array[2] = getByGroupId_PrevAndNext(session, cpDefinitionOptionValueRel, groupId, orderByComparator, false); return array; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
class class_name[name] begin[{] method[findByGroupId_PrevAndNext, return_type[type[CPDefinitionOptionValueRel]], modifier[public], parameter[CPDefinitionOptionValueRelId, groupId, orderByComparator]] begin[{] local_variable[type[CPDefinitionOptionValueRel], cpDefinitionOptionValueRel] local_variable[type[Session], session] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CPDefinitionOptionValueRelImpl, sub_type=None)), name=array)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=CPDefinitionOptionValueRel, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cpDefinitionOptionValueRel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderByComparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getByGroupId_PrevAndNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=MemberReference(member=cpDefinitionOptionValueRel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cpDefinitionOptionValueRel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderByComparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getByGroupId_PrevAndNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CPDefinitionOptionValueRel] operator[SEP] operator[SEP] identifier[findByGroupId_PrevAndNext] operator[SEP] Keyword[long] identifier[CPDefinitionOptionValueRelId] , Keyword[long] identifier[groupId] , identifier[OrderByComparator] operator[<] identifier[CPDefinitionOptionValueRel] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchCPDefinitionOptionValueRelException] { identifier[CPDefinitionOptionValueRel] identifier[cpDefinitionOptionValueRel] operator[=] identifier[findByPrimaryKey] operator[SEP] identifier[CPDefinitionOptionValueRelId] operator[SEP] operator[SEP] identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[CPDefinitionOptionValueRel] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] identifier[CPDefinitionOptionValueRelImpl] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[array] operator[SEP] Other[0] operator[SEP] operator[=] identifier[getByGroupId_PrevAndNext] operator[SEP] identifier[session] , identifier[cpDefinitionOptionValueRel] , identifier[groupId] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP] identifier[array] operator[SEP] Other[1] operator[SEP] operator[=] identifier[cpDefinitionOptionValueRel] operator[SEP] identifier[array] operator[SEP] Other[2] operator[SEP] operator[=] identifier[getByGroupId_PrevAndNext] operator[SEP] identifier[session] , identifier[cpDefinitionOptionValueRel] , identifier[groupId] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[array] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } }
private static List<List<Integer>> getUniqueBondSubgraphs(List<List<RMap>> subgraphs, IAtomContainer ac) { List<List<Integer>> bondList = new ArrayList<List<Integer>>(); for (List<RMap> subgraph : subgraphs) { List<RMap> current = subgraph; List<Integer> ids = new ArrayList<Integer>(); for (RMap aCurrent : current) { RMap rmap = (RMap) aCurrent; ids.add(rmap.getId1()); } Collections.sort(ids); bondList.add(ids); } // get the unique set of bonds HashSet<List<Integer>> hs = new HashSet<List<Integer>>(bondList); bondList = new ArrayList<List<Integer>>(hs); List<List<Integer>> paths = new ArrayList<List<Integer>>(); for (List<Integer> aBondList1 : bondList) { List<Integer> aBondList = aBondList1; List<Integer> tmp = new ArrayList<Integer>(); for (Object anABondList : aBondList) { int bondNumber = (Integer) anABondList; for (IAtom atom : ac.getBond(bondNumber).atoms()) { Integer atomInt = ac.indexOf(atom); if (!tmp.contains(atomInt)) tmp.add(atomInt); } } paths.add(tmp); } return paths; }
class class_name[name] begin[{] method[getUniqueBondSubgraphs, return_type[type[List]], modifier[private static], parameter[subgraphs, ac]] begin[{] local_variable[type[List], bondList] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=subgraph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=current)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RMap, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=ids)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=aCurrent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RMap, sub_type=None)), name=rmap)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RMap, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId1, postfix_operators=[], prefix_operators=[], qualifier=rmap, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ids, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aCurrent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RMap, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sort, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=bondList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=subgraphs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subgraph)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RMap, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) local_variable[type[HashSet], hs] assign[member[.bondList], ClassCreator(arguments=[MemberReference(member=hs, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] local_variable[type[List], paths] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=aBondList1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=aBondList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=tmp)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=anABondList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=bondNumber)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), name=atomInt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=atomInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=tmp, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=atomInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=bondNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBond, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[MethodInvocation(arguments=[], member=atoms, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=aBondList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=anABondList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paths, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=bondList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aBondList1)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) return[member[.paths]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[getUniqueBondSubgraphs] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[RMap] operator[>] operator[>] identifier[subgraphs] , identifier[IAtomContainer] identifier[ac] operator[SEP] { identifier[List] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[bondList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[RMap] operator[>] identifier[subgraph] operator[:] identifier[subgraphs] operator[SEP] { identifier[List] operator[<] identifier[RMap] operator[>] identifier[current] operator[=] identifier[subgraph] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[ids] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[RMap] identifier[aCurrent] operator[:] identifier[current] operator[SEP] { identifier[RMap] identifier[rmap] operator[=] operator[SEP] identifier[RMap] operator[SEP] identifier[aCurrent] operator[SEP] identifier[ids] operator[SEP] identifier[add] operator[SEP] identifier[rmap] operator[SEP] identifier[getId1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[ids] operator[SEP] operator[SEP] identifier[bondList] operator[SEP] identifier[add] operator[SEP] identifier[ids] operator[SEP] operator[SEP] } identifier[HashSet] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[hs] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] operator[SEP] identifier[bondList] operator[SEP] operator[SEP] identifier[bondList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] operator[SEP] identifier[hs] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[paths] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[aBondList1] operator[:] identifier[bondList] operator[SEP] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[aBondList] operator[=] identifier[aBondList1] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[tmp] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[anABondList] operator[:] identifier[aBondList] operator[SEP] { Keyword[int] identifier[bondNumber] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[anABondList] operator[SEP] Keyword[for] operator[SEP] identifier[IAtom] identifier[atom] operator[:] identifier[ac] operator[SEP] identifier[getBond] operator[SEP] identifier[bondNumber] operator[SEP] operator[SEP] identifier[atoms] operator[SEP] operator[SEP] operator[SEP] { identifier[Integer] identifier[atomInt] operator[=] identifier[ac] operator[SEP] identifier[indexOf] operator[SEP] identifier[atom] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[tmp] operator[SEP] identifier[contains] operator[SEP] identifier[atomInt] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] identifier[add] operator[SEP] identifier[atomInt] operator[SEP] operator[SEP] } } identifier[paths] operator[SEP] identifier[add] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] } Keyword[return] identifier[paths] operator[SEP] }
public void removeFileSystem(final DedicatedFileSystem pDedicatedFileSystem) { for (final Iterator<Map.Entry<FileSystem, DedicatedFileSystem>> it = children.entrySet().iterator() ; it.hasNext() ; ) { final Map.Entry<FileSystem, DedicatedFileSystem> next = it.next(); if (pDedicatedFileSystem.equals(next.getValue())) { manager.removeFileSystem(next.getKey()); it.remove(); } } }
class class_name[name] begin[{] method[removeFileSystem, return_type[void], modifier[public], parameter[pDedicatedFileSystem]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=next)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FileSystem, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DedicatedFileSystem, sub_type=None))], dimensions=None, name=Entry, sub_type=None))), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=pDedicatedFileSystem, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[], type_arguments=None)], member=removeFileSystem, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FileSystem, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DedicatedFileSystem, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[removeFileSystem] operator[SEP] Keyword[final] identifier[DedicatedFileSystem] identifier[pDedicatedFileSystem] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[FileSystem] , identifier[DedicatedFileSystem] operator[>] operator[>] identifier[it] operator[=] identifier[children] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[FileSystem] , identifier[DedicatedFileSystem] operator[>] identifier[next] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pDedicatedFileSystem] operator[SEP] identifier[equals] operator[SEP] identifier[next] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[manager] operator[SEP] identifier[removeFileSystem] operator[SEP] identifier[next] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } } }
public void closeContext() throws EFapsException { if (isLogedIn()) { try { if (!Context.isTMNoTransaction()) { if (Context.isTMActive()) { Context.commit(); } else { Context.rollback(); } } } catch (final SecurityException e) { throw new EFapsException("SecurityException", e); } catch (final IllegalStateException e) { throw new EFapsException("IllegalStateException", e); } } }
class class_name[name] begin[{] method[closeContext, return_type[void], modifier[public], parameter[]] begin[{] if[call[.isLogedIn, parameter[]]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTMNoTransaction, postfix_operators=[], prefix_operators=['!'], qualifier=Context, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isTMActive, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=rollback, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SecurityException"), 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=EFapsException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SecurityException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IllegalStateException"), 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=EFapsException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalStateException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[closeContext] operator[SEP] operator[SEP] Keyword[throws] identifier[EFapsException] { Keyword[if] operator[SEP] identifier[isLogedIn] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[Context] operator[SEP] identifier[isTMNoTransaction] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Context] operator[SEP] identifier[isTMActive] operator[SEP] operator[SEP] operator[SEP] { identifier[Context] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Context] operator[SEP] identifier[rollback] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] Keyword[final] identifier[SecurityException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[EFapsException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IllegalStateException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[EFapsException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
@Override public AttributeValue_4[] read_attributes_4(final String[] names, final DevSource source, final ClntIdent clIdent) throws DevFailed { // final Profiler profilerPeriod = new Profiler("period"); // profilerPeriod.start(Arrays.toString(names)); MDC.setContextMap(contextMap); xlogger.entry(Arrays.toString(names)); if (names.length != 1 || !names[0].equalsIgnoreCase(DeviceImpl.STATE_NAME) && !names[0].equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } deviceMonitoring.startRequest("read_attributes_4 " + Arrays.toString(names), source, clIdent); clientIdentity.set(clIdent); if (names.length == 0) { throw DevFailedUtils.newDevFailed(READ_ERROR, READ_ASKED_FOR_0_ATTRIBUTES); } if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent, names); } AttributeValue_4[] result = null; try { result = AttributeGetterSetter.getAttributesValues4(name, names, pollingManager, attributeList, aroundInvokeImpl, source, deviceLock, clIdent); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); // profilerPeriod.stop().print(); return result; }
class class_name[name] begin[{] method[read_attributes_4, return_type[type[AttributeValue_4]], modifier[public], parameter[names, source, clIdent]] begin[{] call[MDC.setContextMap, parameter[member[.contextMap]]] call[xlogger.entry, parameter[call[Arrays.toString, parameter[member[.names]]]]] if[binary_operation[binary_operation[member[names.length], !=, literal[1]], ||, binary_operation[member[.names], &&, member[.names]]]] begin[{] call[.checkInitialization, parameter[]] else begin[{] None end[}] call[deviceMonitoring.startRequest, parameter[binary_operation[literal["read_attributes_4 "], +, call[Arrays.toString, parameter[member[.names]]]], member[.source], member[.clIdent]]] call[clientIdentity.set, parameter[member[.clIdent]]] if[binary_operation[member[names.length], ==, literal[0]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=READ_ERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=READ_ASKED_FOR_0_ATTRIBUTES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newDevFailed, postfix_operators=[], prefix_operators=[], qualifier=DevFailedUtils, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[call[name.equalsIgnoreCase, parameter[call[.getAdminDeviceName, parameter[]]]]] begin[{] call[clientLocking.checkClientLocking, parameter[member[.clIdent], member[.names]]] else begin[{] None end[}] local_variable[type[AttributeValue_4], result] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pollingManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aroundInvokeImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deviceLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clIdent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributesValues4, postfix_operators=[], prefix_operators=[], qualifier=AttributeGetterSetter, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=addError, postfix_operators=[], prefix_operators=[], qualifier=deviceMonitoring, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DevFailed, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newDevFailed, postfix_operators=[], prefix_operators=[], qualifier=DevFailedUtils, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DevFailed, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[xlogger.exit, parameter[]] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[AttributeValue_4] operator[SEP] operator[SEP] identifier[read_attributes_4] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[names] , Keyword[final] identifier[DevSource] identifier[source] , Keyword[final] identifier[ClntIdent] identifier[clIdent] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[MDC] operator[SEP] identifier[setContextMap] operator[SEP] identifier[contextMap] operator[SEP] operator[SEP] identifier[xlogger] operator[SEP] identifier[entry] operator[SEP] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[names] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[names] operator[SEP] identifier[length] operator[!=] Other[1] operator[||] operator[!] identifier[names] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[DeviceImpl] operator[SEP] identifier[STATE_NAME] operator[SEP] operator[&&] operator[!] identifier[names] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[DeviceImpl] operator[SEP] identifier[STATUS_NAME] operator[SEP] operator[SEP] { identifier[checkInitialization] operator[SEP] operator[SEP] operator[SEP] } identifier[deviceMonitoring] operator[SEP] identifier[startRequest] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[names] operator[SEP] , identifier[source] , identifier[clIdent] operator[SEP] operator[SEP] identifier[clientIdentity] operator[SEP] identifier[set] operator[SEP] identifier[clIdent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[names] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[throw] identifier[DevFailedUtils] operator[SEP] identifier[newDevFailed] operator[SEP] identifier[READ_ERROR] , identifier[READ_ASKED_FOR_0_ATTRIBUTES] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[getAdminDeviceName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[clientLocking] operator[SEP] identifier[checkClientLocking] operator[SEP] identifier[clIdent] , identifier[names] operator[SEP] operator[SEP] } identifier[AttributeValue_4] operator[SEP] operator[SEP] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[result] operator[=] identifier[AttributeGetterSetter] operator[SEP] identifier[getAttributesValues4] operator[SEP] identifier[name] , identifier[names] , identifier[pollingManager] , identifier[attributeList] , identifier[aroundInvokeImpl] , identifier[source] , identifier[deviceLock] , identifier[clIdent] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[deviceMonitoring] operator[SEP] identifier[addError] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[DevFailed] operator[SEP] { Keyword[throw] operator[SEP] identifier[DevFailed] operator[SEP] identifier[e] operator[SEP] } Keyword[else] { Keyword[throw] identifier[DevFailedUtils] operator[SEP] identifier[newDevFailed] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } identifier[xlogger] operator[SEP] identifier[exit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public Matrix4x3f set3x3(Matrix4x3fc mat) { if (mat instanceof Matrix4x3f) { MemUtil.INSTANCE.copy3x3((Matrix4x3f) mat, this); } else { set3x3Matrix4x3fc(mat); } properties &= mat.properties(); return this; }
class class_name[name] begin[{] method[set3x3, return_type[type[Matrix4x3f]], modifier[public], parameter[mat]] begin[{] if[binary_operation[member[.mat], instanceof, type[Matrix4x3f]]] begin[{] call[MemUtil.INSTANCE.copy3x3, parameter[Cast(expression=MemberReference(member=mat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Matrix4x3f, sub_type=None)), THIS[]]] else begin[{] call[.set3x3Matrix4x3fc, parameter[member[.mat]]] end[}] assign[member[.properties], call[mat.properties, parameter[]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Matrix4x3f] identifier[set3x3] operator[SEP] identifier[Matrix4x3fc] identifier[mat] operator[SEP] { Keyword[if] operator[SEP] identifier[mat] Keyword[instanceof] identifier[Matrix4x3f] operator[SEP] { identifier[MemUtil] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[copy3x3] operator[SEP] operator[SEP] identifier[Matrix4x3f] operator[SEP] identifier[mat] , Keyword[this] operator[SEP] operator[SEP] } Keyword[else] { identifier[set3x3Matrix4x3fc] operator[SEP] identifier[mat] operator[SEP] operator[SEP] } identifier[properties] operator[&=] identifier[mat] operator[SEP] identifier[properties] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Nonnull public static <T> LTieDblFunction<T> tieDblFunctionFrom(Consumer<LTieDblFunctionBuilder<T>> buildingFunction) { LTieDblFunctionBuilder builder = new LTieDblFunctionBuilder(); buildingFunction.accept(builder); return builder.build(); }
class class_name[name] begin[{] method[tieDblFunctionFrom, return_type[type[LTieDblFunction]], modifier[public static], parameter[buildingFunction]] begin[{] local_variable[type[LTieDblFunctionBuilder], builder] call[buildingFunction.accept, parameter[member[.builder]]] return[call[builder.build, parameter[]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[LTieDblFunction] operator[<] identifier[T] operator[>] identifier[tieDblFunctionFrom] operator[SEP] identifier[Consumer] operator[<] identifier[LTieDblFunctionBuilder] operator[<] identifier[T] operator[>] operator[>] identifier[buildingFunction] operator[SEP] { identifier[LTieDblFunctionBuilder] identifier[builder] operator[=] Keyword[new] identifier[LTieDblFunctionBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildingFunction] operator[SEP] identifier[accept] operator[SEP] identifier[builder] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public CondItem genCond(JCTree tree, int crtFlags) { if (!genCrt) return genCond(tree, false); int startpc = code.curCP(); CondItem item = genCond(tree, (crtFlags & CRT_FLOW_CONTROLLER) != 0); code.crt.put(tree, crtFlags, startpc, code.curCP()); return item; }
class class_name[name] begin[{] method[genCond, return_type[type[CondItem]], modifier[public], parameter[tree, crtFlags]] begin[{] if[member[.genCrt]] begin[{] return[call[.genCond, parameter[member[.tree], literal[false]]]] else begin[{] None end[}] local_variable[type[int], startpc] local_variable[type[CondItem], item] call[code.crt.put, parameter[member[.tree], member[.crtFlags], member[.startpc], call[code.curCP, parameter[]]]] return[member[.item]] end[}] END[}]
Keyword[public] identifier[CondItem] identifier[genCond] operator[SEP] identifier[JCTree] identifier[tree] , Keyword[int] identifier[crtFlags] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[genCrt] operator[SEP] Keyword[return] identifier[genCond] operator[SEP] identifier[tree] , literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[startpc] operator[=] identifier[code] operator[SEP] identifier[curCP] operator[SEP] operator[SEP] operator[SEP] identifier[CondItem] identifier[item] operator[=] identifier[genCond] operator[SEP] identifier[tree] , operator[SEP] identifier[crtFlags] operator[&] identifier[CRT_FLOW_CONTROLLER] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] identifier[code] operator[SEP] identifier[crt] operator[SEP] identifier[put] operator[SEP] identifier[tree] , identifier[crtFlags] , identifier[startpc] , identifier[code] operator[SEP] identifier[curCP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[item] operator[SEP] }
private void enterDefaultValue(JCExpression defaultValue, Env<AttrContext> localEnv, MethodSymbol m) { m.defaultValue = attributeAnnotationValue(m.type.getReturnType(), defaultValue, localEnv); }
class class_name[name] begin[{] method[enterDefaultValue, return_type[void], modifier[private], parameter[defaultValue, localEnv, m]] begin[{] assign[member[m.defaultValue], call[.attributeAnnotationValue, parameter[call[m.type.getReturnType, parameter[]], member[.defaultValue], member[.localEnv]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[enterDefaultValue] operator[SEP] identifier[JCExpression] identifier[defaultValue] , identifier[Env] operator[<] identifier[AttrContext] operator[>] identifier[localEnv] , identifier[MethodSymbol] identifier[m] operator[SEP] { identifier[m] operator[SEP] identifier[defaultValue] operator[=] identifier[attributeAnnotationValue] operator[SEP] identifier[m] operator[SEP] identifier[type] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] , identifier[defaultValue] , identifier[localEnv] operator[SEP] operator[SEP] }
public void startSetup(@Nullable final OnIabSetupFinishedListener listener) { // If already set up, can't do it again. if (mSetupDone) throw new IllegalStateException("IAB helper is already set up."); // Connection to IAB service Logger.d("Starting in-app billing setup."); mServiceConn = new ServiceConnection() { @Override public void onServiceDisconnected(ComponentName name) { Logger.d("Billing service disconnected."); mService = null; } @Override public void onServiceConnected(ComponentName name, IBinder service) { Logger.d("Billing service connected."); mService = getServiceFromBinder(service); componentName = name; String packageName = mContext.getPackageName(); final Handler handler = new Handler(); flagStartAsync("startSetup"); startSetupIabAsync(packageName, new OnIabSetupFinishedListener() { @Override public void onIabSetupFinished(final IabResult result) { handler.post(new Runnable() { @Override public void run() { flagEndAsync(); listener.onIabSetupFinished(result); } }); } }); } }; Intent serviceIntent = getServiceIntent(); final List<ResolveInfo> infoList = mContext.getPackageManager().queryIntentServices(serviceIntent, 0); if (infoList != null && !infoList.isEmpty()) { // service available to handle that Intent mContext.bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); } else { // no service available to handle that Intent if (listener != null) { listener.onIabSetupFinished(new IabResult(BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE, "Billing service unavailable on device.")); Logger.d("Billing service unavailable on device."); } } }
class class_name[name] begin[{] method[startSetup, return_type[void], modifier[public], parameter[listener]] begin[{] if[member[.mSetupDone]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IAB helper is already set up.")], 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[}] call[Logger.d, parameter[literal["Starting in-app billing setup."]]] assign[member[.mServiceConn], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Billing service disconnected.")], member=d, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], documentation=None, modifiers={'public'}, name=onServiceDisconnected, parameters=[FormalParameter(annotations=[], modifiers=set(), name=name, type=ReferenceType(arguments=None, dimensions=[], name=ComponentName, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Billing service connected.")], member=d, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getServiceFromBinder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=componentName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPackageName, postfix_operators=[], prefix_operators=[], qualifier=mContext, selectors=[], type_arguments=None), name=packageName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Handler, sub_type=None)), name=handler)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Handler, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="startSetup")], member=flagStartAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=flagEndAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onIabSetupFinished, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], member=post, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onIabSetupFinished, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=result, type=ReferenceType(arguments=None, dimensions=[], name=IabResult, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OnIabSetupFinishedListener, sub_type=None))], member=startSetupIabAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onServiceConnected, parameters=[FormalParameter(annotations=[], modifiers=set(), name=name, type=ReferenceType(arguments=None, dimensions=[], name=ComponentName, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=IBinder, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceConnection, sub_type=None))] local_variable[type[Intent], serviceIntent] local_variable[type[List], infoList] if[binary_operation[binary_operation[member[.infoList], !=, literal[null]], &&, call[infoList.isEmpty, parameter[]]]] begin[{] call[mContext.bindService, parameter[member[.serviceIntent], member[.mServiceConn], member[Context.BIND_AUTO_CREATE]]] else begin[{] if[binary_operation[member[.listener], !=, literal[null]]] begin[{] call[listener.onIabSetupFinished, parameter[ClassCreator(arguments=[MemberReference(member=BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Billing service unavailable on device.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IabResult, sub_type=None))]] call[Logger.d, parameter[literal["Billing service unavailable on device."]]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[startSetup] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[OnIabSetupFinishedListener] identifier[listener] operator[SEP] { Keyword[if] operator[SEP] identifier[mSetupDone] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Logger] operator[SEP] identifier[d] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mServiceConn] operator[=] Keyword[new] identifier[ServiceConnection] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onServiceDisconnected] operator[SEP] identifier[ComponentName] identifier[name] operator[SEP] { identifier[Logger] operator[SEP] identifier[d] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mService] operator[=] Other[null] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onServiceConnected] operator[SEP] identifier[ComponentName] identifier[name] , identifier[IBinder] identifier[service] operator[SEP] { identifier[Logger] operator[SEP] identifier[d] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mService] operator[=] identifier[getServiceFromBinder] operator[SEP] identifier[service] operator[SEP] operator[SEP] identifier[componentName] operator[=] identifier[name] operator[SEP] identifier[String] identifier[packageName] operator[=] identifier[mContext] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Handler] identifier[handler] operator[=] Keyword[new] identifier[Handler] operator[SEP] operator[SEP] operator[SEP] identifier[flagStartAsync] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[startSetupIabAsync] operator[SEP] identifier[packageName] , Keyword[new] identifier[OnIabSetupFinishedListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onIabSetupFinished] operator[SEP] Keyword[final] identifier[IabResult] identifier[result] operator[SEP] { identifier[handler] operator[SEP] identifier[post] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[flagEndAsync] operator[SEP] operator[SEP] operator[SEP] identifier[listener] operator[SEP] identifier[onIabSetupFinished] operator[SEP] identifier[result] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } } operator[SEP] identifier[Intent] identifier[serviceIntent] operator[=] identifier[getServiceIntent] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ResolveInfo] operator[>] identifier[infoList] operator[=] identifier[mContext] operator[SEP] identifier[getPackageManager] operator[SEP] operator[SEP] operator[SEP] identifier[queryIntentServices] operator[SEP] identifier[serviceIntent] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[infoList] operator[!=] Other[null] operator[&&] operator[!] identifier[infoList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[mContext] operator[SEP] identifier[bindService] operator[SEP] identifier[serviceIntent] , identifier[mServiceConn] , identifier[Context] operator[SEP] identifier[BIND_AUTO_CREATE] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[listener] operator[!=] Other[null] operator[SEP] { identifier[listener] operator[SEP] identifier[onIabSetupFinished] operator[SEP] Keyword[new] identifier[IabResult] operator[SEP] identifier[BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[Logger] operator[SEP] identifier[d] operator[SEP] literal[String] operator[SEP] operator[SEP] } } }
public QueryRule createShouldQueryRule(String multiOntologyTermIri) { QueryRule shouldQueryRule = new QueryRule(new ArrayList<>()); shouldQueryRule.setOperator(Operator.SHOULD); for (String ontologyTermIri : multiOntologyTermIri.split(COMMA_CHAR)) { OntologyTerm ontologyTerm = ontologyService.getOntologyTerm(ontologyTermIri); List<String> queryTerms = parseOntologyTermQueries(ontologyTerm); Double termFrequency = getBestInverseDocumentFrequency(queryTerms); shouldQueryRule .getNestedRules() .add(createBoostedDisMaxQueryRuleForTerms(queryTerms, termFrequency)); } return shouldQueryRule; }
class class_name[name] begin[{] method[createShouldQueryRule, return_type[type[QueryRule]], modifier[public], parameter[multiOntologyTermIri]] begin[{] local_variable[type[QueryRule], shouldQueryRule] call[shouldQueryRule.setOperator, parameter[member[Operator.SHOULD]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ontologyTermIri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOntologyTerm, postfix_operators=[], prefix_operators=[], qualifier=ontologyService, selectors=[], type_arguments=None), name=ontologyTerm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OntologyTerm, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ontologyTerm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseOntologyTermQueries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=queryTerms)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=queryTerms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBestInverseDocumentFrequency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=termFrequency)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getNestedRules, postfix_operators=[], prefix_operators=[], qualifier=shouldQueryRule, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=queryTerms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=termFrequency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createBoostedDisMaxQueryRuleForTerms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=COMMA_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=multiOntologyTermIri, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ontologyTermIri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.shouldQueryRule]] end[}] END[}]
Keyword[public] identifier[QueryRule] identifier[createShouldQueryRule] operator[SEP] identifier[String] identifier[multiOntologyTermIri] operator[SEP] { identifier[QueryRule] identifier[shouldQueryRule] operator[=] Keyword[new] identifier[QueryRule] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[shouldQueryRule] operator[SEP] identifier[setOperator] operator[SEP] identifier[Operator] operator[SEP] identifier[SHOULD] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[ontologyTermIri] operator[:] identifier[multiOntologyTermIri] operator[SEP] identifier[split] operator[SEP] identifier[COMMA_CHAR] operator[SEP] operator[SEP] { identifier[OntologyTerm] identifier[ontologyTerm] operator[=] identifier[ontologyService] operator[SEP] identifier[getOntologyTerm] operator[SEP] identifier[ontologyTermIri] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[queryTerms] operator[=] identifier[parseOntologyTermQueries] operator[SEP] identifier[ontologyTerm] operator[SEP] operator[SEP] identifier[Double] identifier[termFrequency] operator[=] identifier[getBestInverseDocumentFrequency] operator[SEP] identifier[queryTerms] operator[SEP] operator[SEP] identifier[shouldQueryRule] operator[SEP] identifier[getNestedRules] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[createBoostedDisMaxQueryRuleForTerms] operator[SEP] identifier[queryTerms] , identifier[termFrequency] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[shouldQueryRule] operator[SEP] }
public static double[][] Kernel2D(int size, double wavelength, double orientation, double phaseOffset, double gaussVariance, double aspectRatio, Config config) { double sigmaX = gaussVariance; double sigmaY = gaussVariance / aspectRatio; int xMax = (int) Math.ceil(Math.max(1, Math.max(Math.abs(size * sigmaX * Math.cos(orientation)), Math.abs(size * sigmaY * Math.sin(orientation))))); int yMax = (int) Math.ceil(Math.max(1, Math.max(Math.abs(size * sigmaX * Math.sin(orientation)), Math.abs(size * sigmaY * Math.cos(orientation))))); double[][] kernel = new double[2 * xMax + 1][2 * yMax + 1]; double sum = 0; switch (config) { case Real: for (int x = -xMax; x <= xMax; x++) { for (int y = -yMax; y <= yMax; y++) { kernel[x + xMax][y + yMax] = Gabor.RealFunction2D(x, y, wavelength, orientation, phaseOffset, gaussVariance, aspectRatio); sum += kernel[x + xMax][y + yMax]; } } break; case Imaginary: for (int x = -xMax; x <= xMax; x++) { for (int y = -yMax; y <= yMax; y++) { kernel[x + xMax][y + yMax] = Gabor.ImaginaryFunction2D(x, y, wavelength, orientation, phaseOffset, gaussVariance, aspectRatio); sum += kernel[x + xMax][y + yMax]; } } break; case Magnitude: for (int x = -xMax; x <= xMax; x++) { for (int y = -yMax; y <= yMax; y++) { ComplexNumber c = Gabor.Function2D(x, y, wavelength, orientation, phaseOffset, gaussVariance, aspectRatio); kernel[x + xMax][y + yMax] = c.getMagnitude(); sum += kernel[x + xMax][y + yMax]; } } break; case SquaredMagnitude: for (int x = -xMax; x <= xMax; x++) { for (int y = -yMax; y <= yMax; y++) { ComplexNumber c = Gabor.Function2D(x, y, wavelength, orientation, phaseOffset, gaussVariance, aspectRatio); kernel[x + xMax][y + yMax] = c.getSquaredMagnitude(); sum += kernel[x + xMax][y + yMax]; } } break; } for (int x = -xMax; x <= xMax; x++) { for (int y = -yMax; y <= yMax; y++) { kernel[x + xMax][y + yMax] /= sum; } } return kernel; }
class class_name[name] begin[{] method[Kernel2D, return_type[type[double]], modifier[public static], parameter[size, wavelength, orientation, phaseOffset, gaussVariance, aspectRatio, config]] begin[{] local_variable[type[double], sigmaX] local_variable[type[double], sigmaY] local_variable[type[int], xMax] local_variable[type[int], yMax] local_variable[type[double], kernel] local_variable[type[double], sum] SwitchStatement(cases=[SwitchStatementCase(case=['Real'], statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wavelength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orientation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=phaseOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gaussVariance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aspectRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=RealFunction2D, postfix_operators=[], prefix_operators=[], qualifier=Gabor, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=yMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=xMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['Imaginary'], statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wavelength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orientation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=phaseOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gaussVariance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aspectRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ImaginaryFunction2D, postfix_operators=[], prefix_operators=[], qualifier=Gabor, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=yMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=xMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['Magnitude'], statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wavelength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orientation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=phaseOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gaussVariance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aspectRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=Function2D, postfix_operators=[], prefix_operators=[], qualifier=Gabor, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ComplexNumber, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MethodInvocation(arguments=[], member=getMagnitude, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=yMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=xMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SquaredMagnitude'], statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wavelength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orientation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=phaseOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gaussVariance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aspectRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=Function2D, postfix_operators=[], prefix_operators=[], qualifier=Gabor, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ComplexNumber, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MethodInvocation(arguments=[], member=getSquaredMagnitude, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=yMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=xMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type=/=, value=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=yMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=yMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=xMax, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.kernel]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Kernel2D] operator[SEP] Keyword[int] identifier[size] , Keyword[double] identifier[wavelength] , Keyword[double] identifier[orientation] , Keyword[double] identifier[phaseOffset] , Keyword[double] identifier[gaussVariance] , Keyword[double] identifier[aspectRatio] , identifier[Config] identifier[config] operator[SEP] { Keyword[double] identifier[sigmaX] operator[=] identifier[gaussVariance] operator[SEP] Keyword[double] identifier[sigmaY] operator[=] identifier[gaussVariance] operator[/] identifier[aspectRatio] operator[SEP] Keyword[int] identifier[xMax] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[ceil] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[1] , identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[size] operator[*] identifier[sigmaX] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[orientation] operator[SEP] operator[SEP] , identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[size] operator[*] identifier[sigmaY] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[orientation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[yMax] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[ceil] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[1] , identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[size] operator[*] identifier[sigmaX] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[orientation] operator[SEP] operator[SEP] , identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[size] operator[*] identifier[sigmaY] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[orientation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[kernel] operator[=] Keyword[new] Keyword[double] operator[SEP] Other[2] operator[*] identifier[xMax] operator[+] Other[1] operator[SEP] operator[SEP] Other[2] operator[*] identifier[yMax] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] identifier[sum] operator[=] Other[0] operator[SEP] Keyword[switch] operator[SEP] identifier[config] operator[SEP] { Keyword[case] identifier[Real] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] operator[-] identifier[xMax] operator[SEP] identifier[x] operator[<=] identifier[xMax] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] operator[-] identifier[yMax] operator[SEP] identifier[y] operator[<=] identifier[yMax] operator[SEP] identifier[y] operator[++] operator[SEP] { identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[=] identifier[Gabor] operator[SEP] identifier[RealFunction2D] operator[SEP] identifier[x] , identifier[y] , identifier[wavelength] , identifier[orientation] , identifier[phaseOffset] , identifier[gaussVariance] , identifier[aspectRatio] operator[SEP] operator[SEP] identifier[sum] operator[+=] identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[Imaginary] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] operator[-] identifier[xMax] operator[SEP] identifier[x] operator[<=] identifier[xMax] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] operator[-] identifier[yMax] operator[SEP] identifier[y] operator[<=] identifier[yMax] operator[SEP] identifier[y] operator[++] operator[SEP] { identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[=] identifier[Gabor] operator[SEP] identifier[ImaginaryFunction2D] operator[SEP] identifier[x] , identifier[y] , identifier[wavelength] , identifier[orientation] , identifier[phaseOffset] , identifier[gaussVariance] , identifier[aspectRatio] operator[SEP] operator[SEP] identifier[sum] operator[+=] identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[Magnitude] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] operator[-] identifier[xMax] operator[SEP] identifier[x] operator[<=] identifier[xMax] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] operator[-] identifier[yMax] operator[SEP] identifier[y] operator[<=] identifier[yMax] operator[SEP] identifier[y] operator[++] operator[SEP] { identifier[ComplexNumber] identifier[c] operator[=] identifier[Gabor] operator[SEP] identifier[Function2D] operator[SEP] identifier[x] , identifier[y] , identifier[wavelength] , identifier[orientation] , identifier[phaseOffset] , identifier[gaussVariance] , identifier[aspectRatio] operator[SEP] operator[SEP] identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[=] identifier[c] operator[SEP] identifier[getMagnitude] operator[SEP] operator[SEP] operator[SEP] identifier[sum] operator[+=] identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[SquaredMagnitude] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] operator[-] identifier[xMax] operator[SEP] identifier[x] operator[<=] identifier[xMax] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] operator[-] identifier[yMax] operator[SEP] identifier[y] operator[<=] identifier[yMax] operator[SEP] identifier[y] operator[++] operator[SEP] { identifier[ComplexNumber] identifier[c] operator[=] identifier[Gabor] operator[SEP] identifier[Function2D] operator[SEP] identifier[x] , identifier[y] , identifier[wavelength] , identifier[orientation] , identifier[phaseOffset] , identifier[gaussVariance] , identifier[aspectRatio] operator[SEP] operator[SEP] identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[=] identifier[c] operator[SEP] identifier[getSquaredMagnitude] operator[SEP] operator[SEP] operator[SEP] identifier[sum] operator[+=] identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] operator[-] identifier[xMax] operator[SEP] identifier[x] operator[<=] identifier[xMax] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] operator[-] identifier[yMax] operator[SEP] identifier[y] operator[<=] identifier[yMax] operator[SEP] identifier[y] operator[++] operator[SEP] { identifier[kernel] operator[SEP] identifier[x] operator[+] identifier[xMax] operator[SEP] operator[SEP] identifier[y] operator[+] identifier[yMax] operator[SEP] operator[/=] identifier[sum] operator[SEP] } } Keyword[return] identifier[kernel] operator[SEP] }
public int getAllContentWidth() { float width = getAllContentWidthBase(mTimeTextWidth); if (!isConvertDaysToHours && isShowDay) { if (isDayLargeNinetyNine) { Rect rect = new Rect(); String tempDay = String.valueOf(mDay); mTimeTextPaint.getTextBounds(tempDay, 0, tempDay.length(), rect); mDayTimeTextWidth = rect.width(); width += mDayTimeTextWidth; } else { mDayTimeTextWidth = mTimeTextWidth; width += mTimeTextWidth; } } return (int) Math.ceil(width); }
class class_name[name] begin[{] method[getAllContentWidth, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[float], width] if[binary_operation[member[.isConvertDaysToHours], &&, member[.isShowDay]]] begin[{] if[member[.isDayLargeNinetyNine]] begin[{] local_variable[type[Rect], rect] local_variable[type[String], tempDay] call[mTimeTextPaint.getTextBounds, parameter[member[.tempDay], literal[0], call[tempDay.length, parameter[]], member[.rect]]] assign[member[.mDayTimeTextWidth], call[rect.width, parameter[]]] assign[member[.width], member[.mDayTimeTextWidth]] else begin[{] assign[member[.mDayTimeTextWidth], member[.mTimeTextWidth]] assign[member[.width], member[.mTimeTextWidth]] end[}] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ceil, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] end[}] END[}]
Keyword[public] Keyword[int] identifier[getAllContentWidth] operator[SEP] operator[SEP] { Keyword[float] identifier[width] operator[=] identifier[getAllContentWidthBase] operator[SEP] identifier[mTimeTextWidth] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isConvertDaysToHours] operator[&&] identifier[isShowDay] operator[SEP] { Keyword[if] operator[SEP] identifier[isDayLargeNinetyNine] operator[SEP] { identifier[Rect] identifier[rect] operator[=] Keyword[new] identifier[Rect] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[tempDay] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[mDay] operator[SEP] operator[SEP] identifier[mTimeTextPaint] operator[SEP] identifier[getTextBounds] operator[SEP] identifier[tempDay] , Other[0] , identifier[tempDay] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[rect] operator[SEP] operator[SEP] identifier[mDayTimeTextWidth] operator[=] identifier[rect] operator[SEP] identifier[width] operator[SEP] operator[SEP] operator[SEP] identifier[width] operator[+=] identifier[mDayTimeTextWidth] operator[SEP] } Keyword[else] { identifier[mDayTimeTextWidth] operator[=] identifier[mTimeTextWidth] operator[SEP] identifier[width] operator[+=] identifier[mTimeTextWidth] operator[SEP] } } Keyword[return] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[ceil] operator[SEP] identifier[width] operator[SEP] operator[SEP] }
public static HealthReport max(HealthReport a, HealthReport b) { if (a == null && b == null) return null; if (a == null) return b; if (b == null) return a; if (a.compareTo(b) >= 0) return a; return b; }
class class_name[name] begin[{] method[max, return_type[type[HealthReport]], modifier[public static], parameter[a, b]] begin[{] if[binary_operation[binary_operation[member[.a], ==, literal[null]], &&, binary_operation[member[.b], ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.a], ==, literal[null]]] begin[{] return[member[.b]] else begin[{] None end[}] if[binary_operation[member[.b], ==, literal[null]]] begin[{] return[member[.a]] else begin[{] None end[}] if[binary_operation[call[a.compareTo, parameter[member[.b]]], >=, literal[0]]] begin[{] return[member[.a]] else begin[{] None end[}] return[member[.b]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HealthReport] identifier[max] operator[SEP] identifier[HealthReport] identifier[a] , identifier[HealthReport] identifier[b] operator[SEP] { Keyword[if] operator[SEP] identifier[a] operator[==] Other[null] operator[&&] identifier[b] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[==] Other[null] operator[SEP] Keyword[return] identifier[b] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[==] Other[null] operator[SEP] Keyword[return] identifier[a] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[compareTo] operator[SEP] identifier[b] operator[SEP] operator[>=] Other[0] operator[SEP] Keyword[return] identifier[a] operator[SEP] Keyword[return] identifier[b] operator[SEP] }
public void setPublishHistorySize(String publishHistorySize) { if (m_frozen) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONFIG_FROZEN_0)); } m_publishHistorySize = Integer.parseInt(publishHistorySize); }
class class_name[name] begin[{] method[setPublishHistorySize, return_type[void], modifier[public], parameter[publishHistorySize]] begin[{] if[member[.m_frozen]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_CONFIG_FROZEN_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsRuntimeException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.m_publishHistorySize], call[Integer.parseInt, parameter[member[.publishHistorySize]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPublishHistorySize] operator[SEP] identifier[String] identifier[publishHistorySize] operator[SEP] { Keyword[if] operator[SEP] identifier[m_frozen] operator[SEP] { Keyword[throw] Keyword[new] identifier[CmsRuntimeException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_CONFIG_FROZEN_0] operator[SEP] operator[SEP] operator[SEP] } identifier[m_publishHistorySize] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[publishHistorySize] operator[SEP] operator[SEP] }
public String convertFNDFtDsFlagsToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertFNDFtDsFlagsToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertFNDFtDsFlagsToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
void releaseBlock(BlockId blockId) throws IOException { synchronized (m_accessLock) { if (! m_blockPathMap.containsKey(blockId)) { throw new IllegalArgumentException("Request to release block that is not stored: " + blockId); } Path blockPath = m_blockPathMap.get(blockId); Files.delete(blockPath); m_blockPathMap.remove(blockId); } }
class class_name[name] begin[{] method[releaseBlock, return_type[void], modifier[default], parameter[blockId]] begin[{] SYNCHRONIZED[member[.m_accessLock]] BEGIN[{] if[call[m_blockPathMap.containsKey, parameter[member[.blockId]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request to release block that is not stored: "), operandr=MemberReference(member=blockId, 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[Path], blockPath] call[Files.delete, parameter[member[.blockPath]]] call[m_blockPathMap.remove, parameter[member[.blockId]]] END[}] end[}] END[}]
Keyword[void] identifier[releaseBlock] operator[SEP] identifier[BlockId] identifier[blockId] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[synchronized] operator[SEP] identifier[m_accessLock] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[m_blockPathMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[blockId] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[blockId] operator[SEP] operator[SEP] } identifier[Path] identifier[blockPath] operator[=] identifier[m_blockPathMap] operator[SEP] identifier[get] operator[SEP] identifier[blockId] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[delete] operator[SEP] identifier[blockPath] operator[SEP] operator[SEP] identifier[m_blockPathMap] operator[SEP] identifier[remove] operator[SEP] identifier[blockId] operator[SEP] operator[SEP] } }
public JDABuilder setStatus(OnlineStatus status) { if (status == null || status == OnlineStatus.UNKNOWN) throw new IllegalArgumentException("OnlineStatus cannot be null or unknown!"); this.status = status; return this; }
class class_name[name] begin[{] method[setStatus, return_type[type[JDABuilder]], modifier[public], parameter[status]] begin[{] if[binary_operation[binary_operation[member[.status], ==, literal[null]], ||, binary_operation[member[.status], ==, member[OnlineStatus.UNKNOWN]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="OnlineStatus cannot be null or unknown!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.status]], member[.status]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JDABuilder] identifier[setStatus] operator[SEP] identifier[OnlineStatus] identifier[status] operator[SEP] { Keyword[if] operator[SEP] identifier[status] operator[==] Other[null] operator[||] identifier[status] operator[==] identifier[OnlineStatus] operator[SEP] identifier[UNKNOWN] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[status] operator[=] identifier[status] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public <N> CompletableFutureQueue<T, N> thenCombineAsyncFromArray(Function<R, N>[] nextTransformations) { CompletableFutureQueue cfq = this; for (Function<R, N> nextTransformation : nextTransformations) { cfq = cfq.thenCombineAsync(nextTransformation); } return cfq; }
class class_name[name] begin[{] method[thenCombineAsyncFromArray, return_type[type[CompletableFutureQueue]], modifier[public], parameter[nextTransformations]] begin[{] local_variable[type[CompletableFutureQueue], cfq] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cfq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=nextTransformation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=thenCombineAsync, postfix_operators=[], prefix_operators=[], qualifier=cfq, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nextTransformations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nextTransformation)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=N, sub_type=None))], dimensions=[], name=Function, sub_type=None))), label=None) return[member[.cfq]] end[}] END[}]
Keyword[public] operator[<] identifier[N] operator[>] identifier[CompletableFutureQueue] operator[<] identifier[T] , identifier[N] operator[>] identifier[thenCombineAsyncFromArray] operator[SEP] identifier[Function] operator[<] identifier[R] , identifier[N] operator[>] operator[SEP] operator[SEP] identifier[nextTransformations] operator[SEP] { identifier[CompletableFutureQueue] identifier[cfq] operator[=] Keyword[this] operator[SEP] Keyword[for] operator[SEP] identifier[Function] operator[<] identifier[R] , identifier[N] operator[>] identifier[nextTransformation] operator[:] identifier[nextTransformations] operator[SEP] { identifier[cfq] operator[=] identifier[cfq] operator[SEP] identifier[thenCombineAsync] operator[SEP] identifier[nextTransformation] operator[SEP] operator[SEP] } Keyword[return] identifier[cfq] operator[SEP] }
@XmlTransient public String getFieldValueAsString() { Object returnObj = this.getFieldValue(); return (returnObj == null) ? null : returnObj.toString(); }
class class_name[name] begin[{] method[getFieldValueAsString, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[Object], returnObj] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=returnObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=returnObj, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
annotation[@] identifier[XmlTransient] Keyword[public] identifier[String] identifier[getFieldValueAsString] operator[SEP] operator[SEP] { identifier[Object] identifier[returnObj] operator[=] Keyword[this] operator[SEP] identifier[getFieldValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[returnObj] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[returnObj] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static <K, V> CompletableFuture<StatefulRedisMasterSlaveConnection<K, V>> connectAsync(RedisClient redisClient, RedisCodec<K, V> codec, Iterable<RedisURI> redisURIs) { return transformAsyncConnectionException(connectAsyncSentinelOrStaticSetup(redisClient, codec, redisURIs), redisURIs); }
class class_name[name] begin[{] method[connectAsync, return_type[type[CompletableFuture]], modifier[public static], parameter[redisClient, codec, redisURIs]] begin[{] return[call[.transformAsyncConnectionException, parameter[call[.connectAsyncSentinelOrStaticSetup, parameter[member[.redisClient], member[.codec], member[.redisURIs]]], member[.redisURIs]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[CompletableFuture] operator[<] identifier[StatefulRedisMasterSlaveConnection] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[connectAsync] operator[SEP] identifier[RedisClient] identifier[redisClient] , identifier[RedisCodec] operator[<] identifier[K] , identifier[V] operator[>] identifier[codec] , identifier[Iterable] operator[<] identifier[RedisURI] operator[>] identifier[redisURIs] operator[SEP] { Keyword[return] identifier[transformAsyncConnectionException] operator[SEP] identifier[connectAsyncSentinelOrStaticSetup] operator[SEP] identifier[redisClient] , identifier[codec] , identifier[redisURIs] operator[SEP] , identifier[redisURIs] operator[SEP] operator[SEP] }
private boolean hasCustomReadObject(Method m, ClassContext classContext,List<String> classesToIgnore) throws CFGBuilderException, DataflowAnalysisException { ConstantPoolGen cpg = classContext.getConstantPoolGen(); CFG cfg = classContext.getCFG(m); int count = 0; for (Iterator<Location> i = cfg.locationIterator(); i.hasNext(); ) { Location location = i.next(); Instruction inst = location.getHandle().getInstruction(); //ByteCode.printOpCode(inst,cpg); if(inst instanceof InvokeInstruction) { InvokeInstruction invoke = (InvokeInstruction) inst; if (!READ_DESERIALIZATION_METHODS.contains(invoke.getMethodName(cpg)) && !classesToIgnore.contains(invoke.getClassName(cpg))) { count +=1; } } } return count > 3; }
class class_name[name] begin[{] method[hasCustomReadObject, return_type[type[boolean]], modifier[private], parameter[m, classContext, classesToIgnore]] begin[{] local_variable[type[ConstantPoolGen], cpg] local_variable[type[CFG], cfg] local_variable[type[int], count] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), name=location)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Location, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHandle, postfix_operators=[], prefix_operators=[], qualifier=location, selectors=[MethodInvocation(arguments=[], member=getInstruction, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=inst)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Instruction, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=InvokeInstruction, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=InvokeInstruction, sub_type=None)), name=invoke)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InvokeInstruction, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cpg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethodName, postfix_operators=[], prefix_operators=[], qualifier=invoke, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=READ_DESERIALIZATION_METHODS, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cpg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=invoke, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=classesToIgnore, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]))]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=locationIterator, postfix_operators=[], prefix_operators=[], qualifier=cfg, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Location, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) return[binary_operation[member[.count], >, literal[3]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[hasCustomReadObject] operator[SEP] identifier[Method] identifier[m] , identifier[ClassContext] identifier[classContext] , identifier[List] operator[<] identifier[String] operator[>] identifier[classesToIgnore] operator[SEP] Keyword[throws] identifier[CFGBuilderException] , identifier[DataflowAnalysisException] { identifier[ConstantPoolGen] identifier[cpg] operator[=] identifier[classContext] operator[SEP] identifier[getConstantPoolGen] operator[SEP] operator[SEP] operator[SEP] identifier[CFG] identifier[cfg] operator[=] identifier[classContext] operator[SEP] identifier[getCFG] operator[SEP] identifier[m] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Location] operator[>] identifier[i] operator[=] identifier[cfg] operator[SEP] identifier[locationIterator] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Location] identifier[location] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Instruction] identifier[inst] operator[=] identifier[location] operator[SEP] identifier[getHandle] operator[SEP] operator[SEP] operator[SEP] identifier[getInstruction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inst] Keyword[instanceof] identifier[InvokeInstruction] operator[SEP] { identifier[InvokeInstruction] identifier[invoke] operator[=] operator[SEP] identifier[InvokeInstruction] operator[SEP] identifier[inst] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[READ_DESERIALIZATION_METHODS] operator[SEP] identifier[contains] operator[SEP] identifier[invoke] operator[SEP] identifier[getMethodName] operator[SEP] identifier[cpg] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[classesToIgnore] operator[SEP] identifier[contains] operator[SEP] identifier[invoke] operator[SEP] identifier[getClassName] operator[SEP] identifier[cpg] operator[SEP] operator[SEP] operator[SEP] { identifier[count] operator[+=] Other[1] operator[SEP] } } } Keyword[return] identifier[count] operator[>] Other[3] operator[SEP] }
private static boolean isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod) { return (!candidateMethod.isBridge() && !candidateMethod.equals(bridgeMethod) && candidateMethod.getName().equals(bridgeMethod.getName()) && candidateMethod.getParameterTypes().length == bridgeMethod.getParameterTypes().length); }
class class_name[name] begin[{] method[isBridgedCandidateFor, return_type[type[boolean]], modifier[private static], parameter[candidateMethod, bridgeMethod]] begin[{] return[binary_operation[binary_operation[binary_operation[call[candidateMethod.isBridge, parameter[]], &&, call[candidateMethod.equals, parameter[member[.bridgeMethod]]]], &&, call[candidateMethod.getName, parameter[]]], &&, binary_operation[call[candidateMethod.getParameterTypes, parameter[]], ==, call[bridgeMethod.getParameterTypes, parameter[]]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isBridgedCandidateFor] operator[SEP] identifier[Method] identifier[candidateMethod] , identifier[Method] identifier[bridgeMethod] operator[SEP] { Keyword[return] operator[SEP] operator[!] identifier[candidateMethod] operator[SEP] identifier[isBridge] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[candidateMethod] operator[SEP] identifier[equals] operator[SEP] identifier[bridgeMethod] operator[SEP] operator[&&] identifier[candidateMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[bridgeMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[candidateMethod] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] identifier[bridgeMethod] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
public <T> Attribute<T> attribute(AttributeDefinition<T> def) { Attribute<T> attribute = attribute(def.name()); if (attribute != null) return attribute; else throw log.noSuchAttribute(def.name(), name); }
class class_name[name] begin[{] method[attribute, return_type[type[Attribute]], modifier[public], parameter[def]] begin[{] local_variable[type[Attribute], attribute] if[binary_operation[member[.attribute], !=, literal[null]]] begin[{] return[member[.attribute]] else begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=noSuchAttribute, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None) end[}] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Attribute] operator[<] identifier[T] operator[>] identifier[attribute] operator[SEP] identifier[AttributeDefinition] operator[<] identifier[T] operator[>] identifier[def] operator[SEP] { identifier[Attribute] operator[<] identifier[T] operator[>] identifier[attribute] operator[=] identifier[attribute] operator[SEP] identifier[def] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attribute] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[attribute] operator[SEP] Keyword[else] Keyword[throw] identifier[log] operator[SEP] identifier[noSuchAttribute] operator[SEP] identifier[def] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[name] operator[SEP] operator[SEP] }
@SuppressWarnings("restriction") public final void putLong(int index, long value) { if (CHECKED) { if (index >= 0 && index <= this.memory.length - 8) { UNSAFE.putLong(this.memory, BASE_OFFSET + index, value); } else { throw new IndexOutOfBoundsException(); } } else { UNSAFE.putLong(this.memory, BASE_OFFSET + index, value); } }
class class_name[name] begin[{] method[putLong, return_type[void], modifier[final public], parameter[index, value]] begin[{] if[member[.CHECKED]] begin[{] if[binary_operation[binary_operation[member[.index], >=, literal[0]], &&, binary_operation[member[.index], <=, binary_operation[THIS[member[None.memory]member[None.length]], -, literal[8]]]]] begin[{] call[UNSAFE.putLong, parameter[THIS[member[None.memory]], binary_operation[member[.BASE_OFFSET], +, member[.index]], member[.value]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) end[}] else begin[{] call[UNSAFE.putLong, parameter[THIS[member[None.memory]], binary_operation[member[.BASE_OFFSET], +, member[.index]], member[.value]]] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[final] Keyword[void] identifier[putLong] operator[SEP] Keyword[int] identifier[index] , Keyword[long] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[CHECKED] operator[SEP] { Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[&&] identifier[index] operator[<=] Keyword[this] operator[SEP] identifier[memory] operator[SEP] identifier[length] operator[-] Other[8] operator[SEP] { identifier[UNSAFE] operator[SEP] identifier[putLong] operator[SEP] Keyword[this] operator[SEP] identifier[memory] , identifier[BASE_OFFSET] operator[+] identifier[index] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[UNSAFE] operator[SEP] identifier[putLong] operator[SEP] Keyword[this] operator[SEP] identifier[memory] , identifier[BASE_OFFSET] operator[+] identifier[index] , identifier[value] operator[SEP] operator[SEP] } }
void initializeListeners(NavigationViewOptions navigationViewOptions, NavigationViewModel navigationViewModel) { assignFeedbackListener(navigationViewOptions.feedbackListener()); assignNavigationListener(navigationViewOptions.navigationListener(), navigationViewModel); assignRouteListener(navigationViewOptions.routeListener()); assignBottomSheetCallback(navigationViewOptions.bottomSheetCallback()); MapboxNavigation navigation = navigationViewModel.retrieveNavigation(); assignProgressChangeListener(navigationViewOptions, navigation); assignMilestoneEventListener(navigationViewOptions, navigation); assignInstructionListListener(navigationViewOptions.instructionListListener()); assignSpeechAnnouncementListener(navigationViewOptions.speechAnnouncementListener()); assignBannerInstructionsListener(navigationViewOptions.bannerInstructionsListener()); }
class class_name[name] begin[{] method[initializeListeners, return_type[void], modifier[default], parameter[navigationViewOptions, navigationViewModel]] begin[{] call[.assignFeedbackListener, parameter[call[navigationViewOptions.feedbackListener, parameter[]]]] call[.assignNavigationListener, parameter[call[navigationViewOptions.navigationListener, parameter[]], member[.navigationViewModel]]] call[.assignRouteListener, parameter[call[navigationViewOptions.routeListener, parameter[]]]] call[.assignBottomSheetCallback, parameter[call[navigationViewOptions.bottomSheetCallback, parameter[]]]] local_variable[type[MapboxNavigation], navigation] call[.assignProgressChangeListener, parameter[member[.navigationViewOptions], member[.navigation]]] call[.assignMilestoneEventListener, parameter[member[.navigationViewOptions], member[.navigation]]] call[.assignInstructionListListener, parameter[call[navigationViewOptions.instructionListListener, parameter[]]]] call[.assignSpeechAnnouncementListener, parameter[call[navigationViewOptions.speechAnnouncementListener, parameter[]]]] call[.assignBannerInstructionsListener, parameter[call[navigationViewOptions.bannerInstructionsListener, parameter[]]]] end[}] END[}]
Keyword[void] identifier[initializeListeners] operator[SEP] identifier[NavigationViewOptions] identifier[navigationViewOptions] , identifier[NavigationViewModel] identifier[navigationViewModel] operator[SEP] { identifier[assignFeedbackListener] operator[SEP] identifier[navigationViewOptions] operator[SEP] identifier[feedbackListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[assignNavigationListener] operator[SEP] identifier[navigationViewOptions] operator[SEP] identifier[navigationListener] operator[SEP] operator[SEP] , identifier[navigationViewModel] operator[SEP] operator[SEP] identifier[assignRouteListener] operator[SEP] identifier[navigationViewOptions] operator[SEP] identifier[routeListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[assignBottomSheetCallback] operator[SEP] identifier[navigationViewOptions] operator[SEP] identifier[bottomSheetCallback] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[MapboxNavigation] identifier[navigation] operator[=] identifier[navigationViewModel] operator[SEP] identifier[retrieveNavigation] operator[SEP] operator[SEP] operator[SEP] identifier[assignProgressChangeListener] operator[SEP] identifier[navigationViewOptions] , identifier[navigation] operator[SEP] operator[SEP] identifier[assignMilestoneEventListener] operator[SEP] identifier[navigationViewOptions] , identifier[navigation] operator[SEP] operator[SEP] identifier[assignInstructionListListener] operator[SEP] identifier[navigationViewOptions] operator[SEP] identifier[instructionListListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[assignSpeechAnnouncementListener] operator[SEP] identifier[navigationViewOptions] operator[SEP] identifier[speechAnnouncementListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[assignBannerInstructionsListener] operator[SEP] identifier[navigationViewOptions] operator[SEP] identifier[bannerInstructionsListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void readHierarchy(Object object, ObjectStreamClass classDesc) throws IOException, ClassNotFoundException, NotActiveException { if (object == null && mustResolve) { throw new NotActiveException(); } List<ObjectStreamClass> streamClassList = classDesc.getHierarchy(); if (object == null) { for (ObjectStreamClass objectStreamClass : streamClassList) { readObjectForClass(null, objectStreamClass); } } else { List<Class<?>> superclasses = cachedSuperclasses.get(object.getClass()); if (superclasses == null) { superclasses = cacheSuperclassesFor(object.getClass()); } int lastIndex = 0; for (int i = 0, end = superclasses.size(); i < end; ++i) { Class<?> superclass = superclasses.get(i); int index = findStreamSuperclass(superclass, streamClassList, lastIndex); if (index == -1) { readObjectNoData(object, superclass, ObjectStreamClass.lookupStreamClass(superclass)); } else { for (int j = lastIndex; j <= index; j++) { readObjectForClass(object, streamClassList.get(j)); } lastIndex = index + 1; } } } }
class class_name[name] begin[{] method[readHierarchy, return_type[void], modifier[private], parameter[object, classDesc]] begin[{] if[binary_operation[binary_operation[member[.object], ==, literal[null]], &&, member[.mustResolve]]] 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=NotActiveException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[List], streamClassList] if[binary_operation[member[.object], ==, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=objectStreamClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readObjectForClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=streamClassList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=objectStreamClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectStreamClass, sub_type=None))), label=None) else begin[{] local_variable[type[List], superclasses] if[binary_operation[member[.superclasses], ==, literal[null]]] begin[{] assign[member[.superclasses], call[.cacheSuperclassesFor, parameter[call[object.getClass, parameter[]]]]] else begin[{] None end[}] local_variable[type[int], lastIndex] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=superclasses, selectors=[], type_arguments=None), name=superclass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=superclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=streamClassList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lastIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findStreamSuperclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=streamClassList, selectors=[], type_arguments=None)], member=readObjectForClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=lastIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=superclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=superclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lookupStreamClass, postfix_operators=[], prefix_operators=[], qualifier=ObjectStreamClass, selectors=[], type_arguments=None)], member=readObjectNoData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=superclasses, selectors=[], type_arguments=None), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[readHierarchy] operator[SEP] identifier[Object] identifier[object] , identifier[ObjectStreamClass] identifier[classDesc] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] , identifier[NotActiveException] { Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[&&] identifier[mustResolve] operator[SEP] { Keyword[throw] Keyword[new] identifier[NotActiveException] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[ObjectStreamClass] operator[>] identifier[streamClassList] operator[=] identifier[classDesc] operator[SEP] identifier[getHierarchy] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[ObjectStreamClass] identifier[objectStreamClass] operator[:] identifier[streamClassList] operator[SEP] { identifier[readObjectForClass] operator[SEP] Other[null] , identifier[objectStreamClass] operator[SEP] operator[SEP] } } Keyword[else] { identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[superclasses] operator[=] identifier[cachedSuperclasses] operator[SEP] identifier[get] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[superclasses] operator[==] Other[null] operator[SEP] { identifier[superclasses] operator[=] identifier[cacheSuperclassesFor] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[lastIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[end] operator[=] identifier[superclasses] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[end] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[superclass] operator[=] identifier[superclasses] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[findStreamSuperclass] operator[SEP] identifier[superclass] , identifier[streamClassList] , identifier[lastIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { identifier[readObjectNoData] operator[SEP] identifier[object] , identifier[superclass] , identifier[ObjectStreamClass] operator[SEP] identifier[lookupStreamClass] operator[SEP] identifier[superclass] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[lastIndex] operator[SEP] identifier[j] operator[<=] identifier[index] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[readObjectForClass] operator[SEP] identifier[object] , identifier[streamClassList] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] } identifier[lastIndex] operator[=] identifier[index] operator[+] Other[1] operator[SEP] } } } }
public Module getPlumbingModules(final Config config) { return new Module() { @Override public void configure(final Binder binder) { binder.install(new ConfigModule(config)); binder.install(new JmxModule()); binder.install(new JmxLoggingModule("server")); binder.install(getLifecycleModule()); binder.bind(GuiceFilter.class).in(Scopes.SINGLETON); // There must be at least one ServletModule bound somewhere in the module // hierarchy or FilterPipeline is never bound and Guice cannot create the Injector. binder.install(new ServletModule()); } }; }
class class_name[name] begin[{] method[getPlumbingModules, return_type[type[Module]], modifier[public], parameter[config]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigModule, sub_type=None))], member=install, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JmxModule, sub_type=None))], member=install, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="server")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JmxLoggingModule, sub_type=None))], member=install, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLifecycleModule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=install, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GuiceFilter, sub_type=None))], member=bind, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[MethodInvocation(arguments=[MemberReference(member=SINGLETON, postfix_operators=[], prefix_operators=[], qualifier=Scopes, selectors=[])], member=in, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServletModule, sub_type=None))], member=install, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=configure, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=binder, type=ReferenceType(arguments=None, dimensions=[], name=Binder, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Module, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Module] identifier[getPlumbingModules] operator[SEP] Keyword[final] identifier[Config] identifier[config] operator[SEP] { Keyword[return] Keyword[new] identifier[Module] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[configure] operator[SEP] Keyword[final] identifier[Binder] identifier[binder] operator[SEP] { identifier[binder] operator[SEP] identifier[install] operator[SEP] Keyword[new] identifier[ConfigModule] operator[SEP] identifier[config] operator[SEP] operator[SEP] operator[SEP] identifier[binder] operator[SEP] identifier[install] operator[SEP] Keyword[new] identifier[JmxModule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[binder] operator[SEP] identifier[install] operator[SEP] Keyword[new] identifier[JmxLoggingModule] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[binder] operator[SEP] identifier[install] operator[SEP] identifier[getLifecycleModule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[binder] operator[SEP] identifier[bind] operator[SEP] identifier[GuiceFilter] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[Scopes] operator[SEP] identifier[SINGLETON] operator[SEP] operator[SEP] identifier[binder] operator[SEP] identifier[install] operator[SEP] Keyword[new] identifier[ServletModule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public void marshall(DescribeGameSessionPlacementRequest describeGameSessionPlacementRequest, ProtocolMarshaller protocolMarshaller) { if (describeGameSessionPlacementRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeGameSessionPlacementRequest.getPlacementId(), PLACEMENTID_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[describeGameSessionPlacementRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeGameSessionPlacementRequest], ==, 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=getPlacementId, postfix_operators=[], prefix_operators=[], qualifier=describeGameSessionPlacementRequest, selectors=[], type_arguments=None), MemberReference(member=PLACEMENTID_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[DescribeGameSessionPlacementRequest] identifier[describeGameSessionPlacementRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeGameSessionPlacementRequest] 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[describeGameSessionPlacementRequest] operator[SEP] identifier[getPlacementId] operator[SEP] operator[SEP] , identifier[PLACEMENTID_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static String keyVersionToString(ByteArray key, Map<Value, Set<ClusterNode>> versionMap, String storeName, Integer partitionId) { StringBuilder record = new StringBuilder(); for (Map.Entry<Value, Set<ClusterNode>> versionSet : versionMap.entrySet()) { Value value = versionSet.getKey(); Set<ClusterNode> nodeSet = versionSet.getValue(); record.append("BAD_KEY,"); record.append(storeName + ","); record.append(partitionId + ","); record.append(ByteUtils.toHexString(key.get()) + ","); record.append(nodeSet.toString().replace(", ", ";") + ","); record.append(value.toString()); } return record.toString(); }
class class_name[name] begin[{] method[keyVersionToString, return_type[type[String]], modifier[public static], parameter[key, versionMap, storeName, partitionId]] begin[{] local_variable[type[StringBuilder], record] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=versionSet, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Value, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=versionSet, selectors=[], type_arguments=None), name=nodeSet)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClusterNode, sub_type=None))], dimensions=[], name=Set, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BAD_KEY,")], member=append, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=storeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=partitionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=ByteUtils, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=nodeSet, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";")], member=replace, 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=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=versionMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=versionSet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Value, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClusterNode, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[call[record.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[keyVersionToString] operator[SEP] identifier[ByteArray] identifier[key] , identifier[Map] operator[<] identifier[Value] , identifier[Set] operator[<] identifier[ClusterNode] operator[>] operator[>] identifier[versionMap] , identifier[String] identifier[storeName] , identifier[Integer] identifier[partitionId] operator[SEP] { identifier[StringBuilder] identifier[record] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Value] , identifier[Set] operator[<] identifier[ClusterNode] operator[>] operator[>] identifier[versionSet] operator[:] identifier[versionMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Value] identifier[value] operator[=] identifier[versionSet] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ClusterNode] operator[>] identifier[nodeSet] operator[=] identifier[versionSet] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[append] operator[SEP] identifier[storeName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[append] operator[SEP] identifier[partitionId] operator[+] literal[String] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[append] operator[SEP] identifier[ByteUtils] operator[SEP] identifier[toHexString] operator[SEP] identifier[key] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[append] operator[SEP] identifier[nodeSet] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[append] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[record] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private void loadMorphoTaggerDicts(final Properties props) { final String resourcesDirectory = props.getProperty("resourcesDirectory"); final Resources resources = new Resources(); final URL binDictMorphoTaggerURL = resources.getBinaryTaggerDict(this.lang, resourcesDirectory); if (binDictMorphoTaggerURL == null) { final String resourcesLocation = resourcesDirectory == null ? "src/main/resources" : resourcesDirectory; System.err .println("ERROR: No binary POS tagger dictionary available for language " + this.lang + " in " + resourcesLocation + "!!"); System.exit(1); } try { this.dictMorphoTagger = new MorfologikTagger(binDictMorphoTaggerURL, this.lang); } catch (final IOException e) { e.printStackTrace(); } }
class class_name[name] begin[{] method[loadMorphoTaggerDicts, return_type[void], modifier[private], parameter[props]] begin[{] local_variable[type[String], resourcesDirectory] local_variable[type[Resources], resources] local_variable[type[URL], binDictMorphoTaggerURL] if[binary_operation[member[.binDictMorphoTaggerURL], ==, literal[null]]] begin[{] local_variable[type[String], resourcesLocation] call[System.err.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["ERROR: No binary POS tagger dictionary available for language "], +, THIS[member[None.lang]]], +, literal[" in "]], +, member[.resourcesLocation]], +, literal["!!"]]]] call[System.exit, parameter[literal[1]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dictMorphoTagger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[MemberReference(member=binDictMorphoTaggerURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=lang, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MorfologikTagger, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[loadMorphoTaggerDicts] operator[SEP] Keyword[final] identifier[Properties] identifier[props] operator[SEP] { Keyword[final] identifier[String] identifier[resourcesDirectory] operator[=] identifier[props] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Resources] identifier[resources] operator[=] Keyword[new] identifier[Resources] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[URL] identifier[binDictMorphoTaggerURL] operator[=] identifier[resources] operator[SEP] identifier[getBinaryTaggerDict] operator[SEP] Keyword[this] operator[SEP] identifier[lang] , identifier[resourcesDirectory] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[binDictMorphoTaggerURL] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[String] identifier[resourcesLocation] operator[=] identifier[resourcesDirectory] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[resourcesDirectory] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[lang] operator[+] literal[String] operator[+] identifier[resourcesLocation] operator[+] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[try] { Keyword[this] operator[SEP] identifier[dictMorphoTagger] operator[=] Keyword[new] identifier[MorfologikTagger] operator[SEP] identifier[binDictMorphoTaggerURL] , Keyword[this] operator[SEP] identifier[lang] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
@Override public boolean visitBegin(Node node) throws Exception { BindableCpoWhere jcw = (BindableCpoWhere) node; whereClause.append(jcw.toString(cpoClass)); if (jcw.hasParent() || jcw.getLogical() != CpoWhere.LOGIC_NONE) { whereClause.append(" ("); } else { whereClause.append(" "); } return true; }
class class_name[name] begin[{] method[visitBegin, return_type[type[boolean]], modifier[public], parameter[node]] begin[{] local_variable[type[BindableCpoWhere], jcw] call[whereClause.append, parameter[call[jcw.toString, parameter[member[.cpoClass]]]]] if[binary_operation[call[jcw.hasParent, parameter[]], ||, binary_operation[call[jcw.getLogical, parameter[]], !=, member[CpoWhere.LOGIC_NONE]]]] begin[{] call[whereClause.append, parameter[literal[" ("]]] else begin[{] call[whereClause.append, parameter[literal[" "]]] end[}] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[visitBegin] operator[SEP] identifier[Node] identifier[node] operator[SEP] Keyword[throws] identifier[Exception] { identifier[BindableCpoWhere] identifier[jcw] operator[=] operator[SEP] identifier[BindableCpoWhere] operator[SEP] identifier[node] operator[SEP] identifier[whereClause] operator[SEP] identifier[append] operator[SEP] identifier[jcw] operator[SEP] identifier[toString] operator[SEP] identifier[cpoClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jcw] operator[SEP] identifier[hasParent] operator[SEP] operator[SEP] operator[||] identifier[jcw] operator[SEP] identifier[getLogical] operator[SEP] operator[SEP] operator[!=] identifier[CpoWhere] operator[SEP] identifier[LOGIC_NONE] operator[SEP] { identifier[whereClause] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[whereClause] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public Object put(String key, Object o) { explode(); return delegee.put(key, o); }
class class_name[name] begin[{] method[put, return_type[type[Object]], modifier[public], parameter[key, o]] begin[{] call[.explode, parameter[]] return[call[delegee.put, parameter[member[.key], member[.o]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[put] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[o] operator[SEP] { identifier[explode] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[delegee] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[o] operator[SEP] operator[SEP] }
public void reset() throws SQLException { try { this.sessionProxy.resetSession(); } catch (HsqlException e) { throw Util.sqlException(ErrorCode.X_08006, e.getMessage(), e); } }
class class_name[name] begin[{] method[reset, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessionProxy, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=resetSession, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=X_08006, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sqlException, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['HsqlException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[reset] operator[SEP] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[try] { Keyword[this] operator[SEP] identifier[sessionProxy] operator[SEP] identifier[resetSession] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[HsqlException] identifier[e] operator[SEP] { Keyword[throw] identifier[Util] operator[SEP] identifier[sqlException] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[X_08006] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static Point2d get2DCenter(Iterable<IAtom> atoms) { double xsum = 0; double ysum = 0; int length = 0; for (IAtom atom : atoms) { if (atom.getPoint2d() != null) { xsum += atom.getPoint2d().x; ysum += atom.getPoint2d().y; length++; } } return new Point2d(xsum / (double) length, ysum / (double) length); }
class class_name[name] begin[{] method[get2DCenter, return_type[type[Point2d]], modifier[public static], parameter[atoms]] begin[{] local_variable[type[double], xsum] local_variable[type[double], ysum] local_variable[type[int], length] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPoint2d, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=xsum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getPoint2d, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MemberReference(member=x, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ysum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getPoint2d, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MemberReference(member=y, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=length, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=atoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))), label=None) return[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=xsum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), operator=/), BinaryOperation(operandl=MemberReference(member=ysum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), operator=/)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point2d, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Point2d] identifier[get2DCenter] operator[SEP] identifier[Iterable] operator[<] identifier[IAtom] operator[>] identifier[atoms] operator[SEP] { Keyword[double] identifier[xsum] operator[=] Other[0] operator[SEP] Keyword[double] identifier[ysum] operator[=] Other[0] operator[SEP] Keyword[int] identifier[length] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[IAtom] identifier[atom] operator[:] identifier[atoms] operator[SEP] { Keyword[if] operator[SEP] identifier[atom] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[xsum] operator[+=] identifier[atom] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[ysum] operator[+=] identifier[atom] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[y] operator[SEP] identifier[length] operator[++] operator[SEP] } } Keyword[return] Keyword[new] identifier[Point2d] operator[SEP] identifier[xsum] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[length] , identifier[ysum] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
public static boolean isNegative(ZMatrixD1 a, ZMatrixD1 b, double tol) { if( a.numRows != b.numRows || a.numCols != b.numCols ) throw new IllegalArgumentException("Matrix dimensions must match"); int length = a.getNumElements()*2; for( int i = 0; i < length; i++ ) { if( !(Math.abs(a.data[i]+b.data[i]) <= tol) ) return false; } return true; }
class class_name[name] begin[{] method[isNegative, return_type[type[boolean]], modifier[public static], parameter[a, b, tol]] begin[{] if[binary_operation[binary_operation[member[a.numRows], !=, member[b.numRows]], ||, binary_operation[member[a.numCols], !=, member[b.numCols]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Matrix dimensions must match")], 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], length] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=MemberReference(member=tol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isNegative] operator[SEP] identifier[ZMatrixD1] identifier[a] , identifier[ZMatrixD1] identifier[b] , Keyword[double] identifier[tol] operator[SEP] { Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[numRows] operator[!=] identifier[b] operator[SEP] identifier[numRows] operator[||] identifier[a] operator[SEP] identifier[numCols] operator[!=] identifier[b] operator[SEP] identifier[numCols] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[a] operator[SEP] identifier[getNumElements] operator[SEP] operator[SEP] operator[*] Other[2] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[a] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[b] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[<=] identifier[tol] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private static Set<Key> conditionToKeys(int keyLength, Map<String, Set<Object>> condition) { return crossProduct(new ArrayList<>(condition.values())).stream() .map(v -> Keys.key(keyLength, v.toArray())) .collect(Collectors.toSet()); }
class class_name[name] begin[{] method[conditionToKeys, return_type[type[Set]], modifier[private static], parameter[keyLength, condition]] begin[{] return[call[.crossProduct, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=condition, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Set] operator[<] identifier[Key] operator[>] identifier[conditionToKeys] operator[SEP] Keyword[int] identifier[keyLength] , identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[Object] operator[>] operator[>] identifier[condition] operator[SEP] { Keyword[return] identifier[crossProduct] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[condition] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[v] operator[->] identifier[Keys] operator[SEP] identifier[key] operator[SEP] identifier[keyLength] , identifier[v] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public <T> T convert(Object value, final Class<T> toType) { return useDefault(value, toType) ? getDefaultValue(toType) : super.convert(value, toType); }
class class_name[name] begin[{] method[convert, return_type[type[T]], modifier[public], parameter[value, toType]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=useDefault, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=SuperMethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[convert] operator[SEP] identifier[Object] identifier[value] , Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[toType] operator[SEP] { Keyword[return] identifier[useDefault] operator[SEP] identifier[value] , identifier[toType] operator[SEP] operator[?] identifier[getDefaultValue] operator[SEP] identifier[toType] operator[SEP] operator[:] Keyword[super] operator[SEP] identifier[convert] operator[SEP] identifier[value] , identifier[toType] operator[SEP] operator[SEP] }
static <E> ImmutableSortedSet<E> construct( Comparator<? super E> comparator, int n, E... contents) { if (n == 0) { return emptySet(comparator); } checkElementsNotNull(contents, n); Arrays.sort(contents, 0, n, comparator); int uniques = 1; for (int i = 1; i < n; i++) { E cur = contents[i]; E prev = contents[uniques - 1]; if (comparator.compare(cur, prev) != 0) { contents[uniques++] = cur; } } Arrays.fill(contents, uniques, n, null); if (uniques < contents.length / 2) { // Deduplication eliminated many of the elements. We don't want to retain an arbitrarily // large array relative to the number of elements, so we cap the ratio. contents = Arrays.copyOf(contents, uniques); } return new RegularImmutableSortedSet<E>( ImmutableList.<E>asImmutableList(contents, uniques), comparator); }
class class_name[name] begin[{] method[construct, return_type[type[ImmutableSortedSet]], modifier[static], parameter[comparator, n, contents]] begin[{] if[binary_operation[member[.n], ==, literal[0]]] begin[{] return[call[.emptySet, parameter[member[.comparator]]]] else begin[{] None end[}] call[.checkElementsNotNull, parameter[member[.contents], member[.n]]] call[Arrays.sort, parameter[member[.contents], literal[0], member[.n], member[.comparator]]] local_variable[type[int], uniques] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=contents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=cur)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=contents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=uniques, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), name=prev)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=comparator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=contents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=uniques, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=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=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[Arrays.fill, parameter[member[.contents], member[.uniques], member[.n], literal[null]]] if[binary_operation[member[.uniques], <, binary_operation[member[contents.length], /, literal[2]]]] begin[{] assign[member[.contents], call[Arrays.copyOf, parameter[member[.contents], member[.uniques]]]] else begin[{] None end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=contents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uniques, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ImmutableList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))]), MemberReference(member=comparator, 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=E, sub_type=None))], dimensions=None, name=RegularImmutableSortedSet, sub_type=None))] end[}] END[}]
Keyword[static] operator[<] identifier[E] operator[>] identifier[ImmutableSortedSet] operator[<] identifier[E] operator[>] identifier[construct] operator[SEP] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[E] operator[>] identifier[comparator] , Keyword[int] identifier[n] , identifier[E] operator[...] identifier[contents] operator[SEP] { Keyword[if] operator[SEP] identifier[n] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[emptySet] operator[SEP] identifier[comparator] operator[SEP] operator[SEP] } identifier[checkElementsNotNull] operator[SEP] identifier[contents] , identifier[n] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[contents] , Other[0] , identifier[n] , identifier[comparator] operator[SEP] operator[SEP] Keyword[int] identifier[uniques] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[E] identifier[cur] operator[=] identifier[contents] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[E] identifier[prev] operator[=] identifier[contents] operator[SEP] identifier[uniques] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comparator] operator[SEP] identifier[compare] operator[SEP] identifier[cur] , identifier[prev] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[contents] operator[SEP] identifier[uniques] operator[++] operator[SEP] operator[=] identifier[cur] operator[SEP] } } identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[contents] , identifier[uniques] , identifier[n] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[uniques] operator[<] identifier[contents] operator[SEP] identifier[length] operator[/] Other[2] operator[SEP] { identifier[contents] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[contents] , identifier[uniques] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[RegularImmutableSortedSet] operator[<] identifier[E] operator[>] operator[SEP] identifier[ImmutableList] operator[SEP] operator[<] identifier[E] operator[>] identifier[asImmutableList] operator[SEP] identifier[contents] , identifier[uniques] operator[SEP] , identifier[comparator] operator[SEP] operator[SEP] }
public <T, K> void remove(ColumnFamily<K, String> columnFamily, T item) throws Exception { @SuppressWarnings({ "unchecked" }) Class<T> clazz = (Class<T>) item.getClass(); Mapping<T> mapping = getMapping(clazz); @SuppressWarnings({ "unchecked" }) Class<K> idFieldClass = (Class<K>) mapping.getIdFieldClass(); // safe - // after // erasure, // this is // all // just // Class // anyway MutationBatch mutationBatch = keyspace.prepareMutationBatch(); mutationBatch.withRow(columnFamily, mapping.getIdValue(item, idFieldClass)).delete(); mutationBatch.execute(); }
class class_name[name] begin[{] method[remove, return_type[void], modifier[public], parameter[columnFamily, item]] begin[{] local_variable[type[Class], clazz] local_variable[type[Mapping], mapping] local_variable[type[Class], idFieldClass] local_variable[type[MutationBatch], mutationBatch] call[mutationBatch.withRow, parameter[member[.columnFamily], call[mapping.getIdValue, parameter[member[.item], member[.idFieldClass]]]]] call[mutationBatch.execute, parameter[]] end[}] END[}]
Keyword[public] operator[<] identifier[T] , identifier[K] operator[>] Keyword[void] identifier[remove] operator[SEP] identifier[ColumnFamily] operator[<] identifier[K] , identifier[String] operator[>] identifier[columnFamily] , identifier[T] identifier[item] operator[SEP] Keyword[throws] identifier[Exception] { annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] } operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[=] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] operator[SEP] identifier[item] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[Mapping] operator[<] identifier[T] operator[>] identifier[mapping] operator[=] identifier[getMapping] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] } operator[SEP] identifier[Class] operator[<] identifier[K] operator[>] identifier[idFieldClass] operator[=] operator[SEP] identifier[Class] operator[<] identifier[K] operator[>] operator[SEP] identifier[mapping] operator[SEP] identifier[getIdFieldClass] operator[SEP] operator[SEP] operator[SEP] identifier[MutationBatch] identifier[mutationBatch] operator[=] identifier[keyspace] operator[SEP] identifier[prepareMutationBatch] operator[SEP] operator[SEP] operator[SEP] identifier[mutationBatch] operator[SEP] identifier[withRow] operator[SEP] identifier[columnFamily] , identifier[mapping] operator[SEP] identifier[getIdValue] operator[SEP] identifier[item] , identifier[idFieldClass] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[mutationBatch] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] }
private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked if (highlighted_outlier != null){ highlighted_outlier.highlight(false); highlighted_outlier = null; } }
class class_name[name] begin[{] method[formMouseClicked, return_type[void], modifier[private], parameter[evt]] begin[{] if[binary_operation[member[.highlighted_outlier], !=, literal[null]]] begin[{] call[highlighted_outlier.highlight, parameter[literal[false]]] assign[member[.highlighted_outlier], literal[null]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[formMouseClicked] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[MouseEvent] identifier[evt] operator[SEP] { Keyword[if] operator[SEP] identifier[highlighted_outlier] operator[!=] Other[null] operator[SEP] { identifier[highlighted_outlier] operator[SEP] identifier[highlight] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[highlighted_outlier] operator[=] Other[null] operator[SEP] } }
@Override public int delete(Integer id, boolean autoCommit) throws SQLException { try { // Handle "cascading" delete or constraints on deleting entities that other entities depend on // (e.g., keep a calendar from being deleted if trips reference it). // FIXME: actually add "cascading"? Currently, it just deletes one level down. deleteFromReferencingTables(tablePrefix, specTable, id); // Next, delete the actual record specified by id. PreparedStatement statement = connection.prepareStatement(specTable.generateDeleteSql(tablePrefix)); statement.setInt(1, id); LOG.info(statement.toString()); // Execute query int result = statement.executeUpdate(); if (result == 0) { LOG.error("Could not delete {} entity with id: {}", specTable.name, id); throw new SQLException("Could not delete entity"); } if (autoCommit) connection.commit(); // FIXME: change return message based on result value return result; } catch (Exception e) { LOG.error("Could not delete {} entity with id: {}", specTable.name, id); e.printStackTrace(); // Rollback changes if errors encountered. connection.rollback(); throw e; } finally { // Always close connection if auto-committing. Otherwise, leave open (for potential further updates). if (autoCommit) connection.close(); } }
class class_name[name] begin[{] method[delete, return_type[type[int]], modifier[public], parameter[id, autoCommit]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tablePrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=specTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteFromReferencingTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=tablePrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateDeleteSql, postfix_operators=[], prefix_operators=[], qualifier=specTable, selectors=[], type_arguments=None)], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), name=statement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PreparedStatement, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not delete {} entity with id: {}"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=specTable, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not delete entity")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None)])), IfStatement(condition=MemberReference(member=autoCommit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not delete {} entity with id: {}"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=specTable, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=rollback, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[IfStatement(condition=MemberReference(member=autoCommit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None))], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[delete] operator[SEP] identifier[Integer] identifier[id] , Keyword[boolean] identifier[autoCommit] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[try] { identifier[deleteFromReferencingTables] operator[SEP] identifier[tablePrefix] , identifier[specTable] , identifier[id] operator[SEP] operator[SEP] identifier[PreparedStatement] identifier[statement] operator[=] identifier[connection] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[specTable] operator[SEP] identifier[generateDeleteSql] operator[SEP] identifier[tablePrefix] operator[SEP] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[id] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[statement] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[result] operator[=] identifier[statement] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[specTable] operator[SEP] identifier[name] , identifier[id] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[autoCommit] operator[SEP] identifier[connection] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[specTable] operator[SEP] identifier[name] , identifier[id] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[rollback] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[autoCommit] operator[SEP] identifier[connection] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public boolean hardLinkTo(String src, String dst) throws IOException { INode dstNode = hardLinkToInternal(src, dst); getEditLog().logSync(false); if (dstNode != null && auditLog.isInfoEnabled()) { logAuditEvent(getCurrentUGI(), Server.getRemoteIp(), "hardlink", src, dst, dstNode); } return dstNode != null; }
class class_name[name] begin[{] method[hardLinkTo, return_type[type[boolean]], modifier[public], parameter[src, dst]] begin[{] local_variable[type[INode], dstNode] call[.getEditLog, parameter[]] if[binary_operation[binary_operation[member[.dstNode], !=, literal[null]], &&, call[auditLog.isInfoEnabled, parameter[]]]] begin[{] call[.logAuditEvent, parameter[call[.getCurrentUGI, parameter[]], call[Server.getRemoteIp, parameter[]], literal["hardlink"], member[.src], member[.dst], member[.dstNode]]] else begin[{] None end[}] return[binary_operation[member[.dstNode], !=, literal[null]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[hardLinkTo] operator[SEP] identifier[String] identifier[src] , identifier[String] identifier[dst] operator[SEP] Keyword[throws] identifier[IOException] { identifier[INode] identifier[dstNode] operator[=] identifier[hardLinkToInternal] operator[SEP] identifier[src] , identifier[dst] operator[SEP] operator[SEP] identifier[getEditLog] operator[SEP] operator[SEP] operator[SEP] identifier[logSync] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dstNode] operator[!=] Other[null] operator[&&] identifier[auditLog] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logAuditEvent] operator[SEP] identifier[getCurrentUGI] operator[SEP] operator[SEP] , identifier[Server] operator[SEP] identifier[getRemoteIp] operator[SEP] operator[SEP] , literal[String] , identifier[src] , identifier[dst] , identifier[dstNode] operator[SEP] operator[SEP] } Keyword[return] identifier[dstNode] operator[!=] Other[null] operator[SEP] }
public static <T> FunctionToTransformerAdapter<T> of(Function<T, T> function) { return new FunctionToTransformerAdapter<>(function); }
class class_name[name] begin[{] method[of, return_type[type[FunctionToTransformerAdapter]], modifier[public static], parameter[function]] begin[{] return[ClassCreator(arguments=[MemberReference(member=function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=FunctionToTransformerAdapter, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[FunctionToTransformerAdapter] operator[<] identifier[T] operator[>] identifier[of] operator[SEP] identifier[Function] operator[<] identifier[T] , identifier[T] operator[>] identifier[function] operator[SEP] { Keyword[return] Keyword[new] identifier[FunctionToTransformerAdapter] operator[<] operator[>] operator[SEP] identifier[function] operator[SEP] operator[SEP] }
public String[] getSynonyms(String string) { if (SYNONYM_MAP != null) { return SYNONYM_MAP.getSynonyms(string.toLowerCase()); } else { return new String[0]; } }
class class_name[name] begin[{] method[getSynonyms, return_type[type[String]], modifier[public], parameter[string]] begin[{] if[binary_operation[member[.SYNONYM_MAP], !=, literal[null]]] begin[{] return[call[SYNONYM_MAP.getSynonyms, parameter[call[string.toLowerCase, parameter[]]]]] else begin[{] return[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=String, sub_type=None))] end[}] end[}] END[}]
Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getSynonyms] operator[SEP] identifier[String] identifier[string] operator[SEP] { Keyword[if] operator[SEP] identifier[SYNONYM_MAP] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[SYNONYM_MAP] operator[SEP] identifier[getSynonyms] operator[SEP] identifier[string] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] } }
public static String[] split(String input, char delimiter){ if(input == null) throw new NullPointerException("input cannot be null"); final int len = input.length(); // find the number of strings to split into int nSplits = 1; for (int i = 0; i < len; i++) { if (input.charAt(i) == delimiter) { nSplits++; } } // do the actual splitting String[] result = new String[nSplits]; int lastMark = 0; int lastSplit = 0; for (int i = 0; i < len; i++) { if (input.charAt(i) == delimiter) { result[lastSplit] = input.substring(lastMark, i); lastSplit++; lastMark = i + 1;// 1 == delimiter length } } result[lastSplit] = input.substring(lastMark, len); return result; }
class class_name[name] begin[{] method[split, return_type[type[String]], modifier[public static], parameter[input, delimiter]] begin[{] if[binary_operation[member[.input], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="input cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], len] local_variable[type[int], nSplits] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=MemberReference(member=delimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=nSplits, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, 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) local_variable[type[String], result] local_variable[type[int], lastMark] local_variable[type[int], lastSplit] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=MemberReference(member=delimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=lastSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=lastMark, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=lastSplit, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastMark, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, 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) assign[member[.result], call[input.substring, parameter[member[.lastMark], member[.len]]]] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[String] identifier[input] , Keyword[char] identifier[delimiter] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[len] operator[=] identifier[input] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[nSplits] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[delimiter] operator[SEP] { identifier[nSplits] operator[++] operator[SEP] } } identifier[String] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[nSplits] operator[SEP] operator[SEP] Keyword[int] identifier[lastMark] operator[=] Other[0] operator[SEP] Keyword[int] identifier[lastSplit] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[delimiter] operator[SEP] { identifier[result] operator[SEP] identifier[lastSplit] operator[SEP] operator[=] identifier[input] operator[SEP] identifier[substring] operator[SEP] identifier[lastMark] , identifier[i] operator[SEP] operator[SEP] identifier[lastSplit] operator[++] operator[SEP] identifier[lastMark] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } } identifier[result] operator[SEP] identifier[lastSplit] operator[SEP] operator[=] identifier[input] operator[SEP] identifier[substring] operator[SEP] identifier[lastMark] , identifier[len] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static boolean checkSign(PayResultInfo rst, String pubKey) { if (rst == null || pubKey == null) { return false; } Map<String, Object> paramsa = new HashMap<String, Object>(); // 必选参数 paramsa.put("returnCode", rst.getReturnCode()); paramsa.put("userName", rst.getUserName()); paramsa.put("requestId", rst.getRequestId()); paramsa.put("amount", rst.getAmount()); paramsa.put("time", rst.getTime()); // 可选参数 paramsa.put("orderID", rst.getOrderID()); paramsa.put("withholdID", rst.getWithholdID()); paramsa.put("errMsg", rst.getErrMsg()); String noSignStr = getNoSign(paramsa, false); return doCheck(noSignStr, rst.getSign(), pubKey); }
class class_name[name] begin[{] method[checkSign, return_type[type[boolean]], modifier[public static], parameter[rst, pubKey]] begin[{] if[binary_operation[binary_operation[member[.rst], ==, literal[null]], ||, binary_operation[member[.pubKey], ==, literal[null]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Map], paramsa] call[paramsa.put, parameter[literal["returnCode"], call[rst.getReturnCode, parameter[]]]] call[paramsa.put, parameter[literal["userName"], call[rst.getUserName, parameter[]]]] call[paramsa.put, parameter[literal["requestId"], call[rst.getRequestId, parameter[]]]] call[paramsa.put, parameter[literal["amount"], call[rst.getAmount, parameter[]]]] call[paramsa.put, parameter[literal["time"], call[rst.getTime, parameter[]]]] call[paramsa.put, parameter[literal["orderID"], call[rst.getOrderID, parameter[]]]] call[paramsa.put, parameter[literal["withholdID"], call[rst.getWithholdID, parameter[]]]] call[paramsa.put, parameter[literal["errMsg"], call[rst.getErrMsg, parameter[]]]] local_variable[type[String], noSignStr] return[call[.doCheck, parameter[member[.noSignStr], call[rst.getSign, parameter[]], member[.pubKey]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[checkSign] operator[SEP] identifier[PayResultInfo] identifier[rst] , identifier[String] identifier[pubKey] operator[SEP] { Keyword[if] operator[SEP] identifier[rst] operator[==] Other[null] operator[||] identifier[pubKey] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[paramsa] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getReturnCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getRequestId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getAmount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getOrderID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getWithholdID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[paramsa] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rst] operator[SEP] identifier[getErrMsg] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[noSignStr] operator[=] identifier[getNoSign] operator[SEP] identifier[paramsa] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[doCheck] operator[SEP] identifier[noSignStr] , identifier[rst] operator[SEP] identifier[getSign] operator[SEP] operator[SEP] , identifier[pubKey] operator[SEP] operator[SEP] }
@Override public long select(final long j) throws IllegalArgumentException { if (!doCacheCardinalities) { return selectNoCache(j); } // Ensure all cumulatives as we we have straightforward way to know in advance the high of the // j-th value int indexOk = ensureCumulatives(highestHigh()); if (highToBitmap.isEmpty()) { return throwSelectInvalidIndex(j); } // Use normal binarySearch as cardinality does not depends on considering longs signed or // unsigned // We need sortedCumulatedCardinality not to contain duplicated, else binarySearch may return // any of the duplicates: we need to ensure it holds no high associated to an empty bitmap int position = Arrays.binarySearch(sortedCumulatedCardinality, 0, indexOk, j); if (position >= 0) { if (position == indexOk - 1) { // .select has been called on this.getCardinality return throwSelectInvalidIndex(j); } // There is a bucket leading to this cardinality: the j-th element is the first element of // next bucket int high = sortedHighs[position + 1]; BitmapDataProvider nextBitmap = highToBitmap.get(high); return RoaringIntPacking.pack(high, nextBitmap.select(0)); } else { // There is no bucket with this cardinality int insertionPoint = -position - 1; final long previousBucketCardinality; if (insertionPoint == 0) { previousBucketCardinality = 0L; } else if (insertionPoint >= indexOk) { return throwSelectInvalidIndex(j); } else { previousBucketCardinality = sortedCumulatedCardinality[insertionPoint - 1]; } // We get a 'select' query for a single bitmap: should fit in an int final int givenBitmapSelect = (int) (j - previousBucketCardinality); int high = sortedHighs[insertionPoint]; BitmapDataProvider lowBitmap = highToBitmap.get(high); int low = lowBitmap.select(givenBitmapSelect); return RoaringIntPacking.pack(high, low); } }
class class_name[name] begin[{] method[select, return_type[type[long]], modifier[public], parameter[j]] begin[{] if[member[.doCacheCardinalities]] begin[{] return[call[.selectNoCache, parameter[member[.j]]]] else begin[{] None end[}] local_variable[type[int], indexOk] if[call[highToBitmap.isEmpty, parameter[]]] begin[{] return[call[.throwSelectInvalidIndex, parameter[member[.j]]]] else begin[{] None end[}] local_variable[type[int], position] if[binary_operation[member[.position], >=, literal[0]]] begin[{] if[binary_operation[member[.position], ==, binary_operation[member[.indexOk], -, literal[1]]]] begin[{] return[call[.throwSelectInvalidIndex, parameter[member[.j]]]] else begin[{] None end[}] local_variable[type[int], high] local_variable[type[BitmapDataProvider], nextBitmap] return[call[RoaringIntPacking.pack, parameter[member[.high], call[nextBitmap.select, parameter[literal[0]]]]]] else begin[{] local_variable[type[int], insertionPoint] local_variable[type[long], previousBucketCardinality] if[binary_operation[member[.insertionPoint], ==, literal[0]]] begin[{] assign[member[.previousBucketCardinality], literal[0L]] else begin[{] if[binary_operation[member[.insertionPoint], >=, member[.indexOk]]] begin[{] return[call[.throwSelectInvalidIndex, parameter[member[.j]]]] else begin[{] assign[member[.previousBucketCardinality], member[.sortedCumulatedCardinality]] end[}] end[}] local_variable[type[int], givenBitmapSelect] local_variable[type[int], high] local_variable[type[BitmapDataProvider], lowBitmap] local_variable[type[int], low] return[call[RoaringIntPacking.pack, parameter[member[.high], member[.low]]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[select] operator[SEP] Keyword[final] Keyword[long] identifier[j] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[if] operator[SEP] operator[!] identifier[doCacheCardinalities] operator[SEP] { Keyword[return] identifier[selectNoCache] operator[SEP] identifier[j] operator[SEP] operator[SEP] } Keyword[int] identifier[indexOk] operator[=] identifier[ensureCumulatives] operator[SEP] identifier[highestHigh] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[highToBitmap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[throwSelectInvalidIndex] operator[SEP] identifier[j] operator[SEP] operator[SEP] } Keyword[int] identifier[position] operator[=] identifier[Arrays] operator[SEP] identifier[binarySearch] operator[SEP] identifier[sortedCumulatedCardinality] , Other[0] , identifier[indexOk] , identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[position] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[position] operator[==] identifier[indexOk] operator[-] Other[1] operator[SEP] { Keyword[return] identifier[throwSelectInvalidIndex] operator[SEP] identifier[j] operator[SEP] operator[SEP] } Keyword[int] identifier[high] operator[=] identifier[sortedHighs] operator[SEP] identifier[position] operator[+] Other[1] operator[SEP] operator[SEP] identifier[BitmapDataProvider] identifier[nextBitmap] operator[=] identifier[highToBitmap] operator[SEP] identifier[get] operator[SEP] identifier[high] operator[SEP] operator[SEP] Keyword[return] identifier[RoaringIntPacking] operator[SEP] identifier[pack] operator[SEP] identifier[high] , identifier[nextBitmap] operator[SEP] identifier[select] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[insertionPoint] operator[=] operator[-] identifier[position] operator[-] Other[1] operator[SEP] Keyword[final] Keyword[long] identifier[previousBucketCardinality] operator[SEP] Keyword[if] operator[SEP] identifier[insertionPoint] operator[==] Other[0] operator[SEP] { identifier[previousBucketCardinality] operator[=] Other[0L] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[insertionPoint] operator[>=] identifier[indexOk] operator[SEP] { Keyword[return] identifier[throwSelectInvalidIndex] operator[SEP] identifier[j] operator[SEP] operator[SEP] } Keyword[else] { identifier[previousBucketCardinality] operator[=] identifier[sortedCumulatedCardinality] operator[SEP] identifier[insertionPoint] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[givenBitmapSelect] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[j] operator[-] identifier[previousBucketCardinality] operator[SEP] operator[SEP] Keyword[int] identifier[high] operator[=] identifier[sortedHighs] operator[SEP] identifier[insertionPoint] operator[SEP] operator[SEP] identifier[BitmapDataProvider] identifier[lowBitmap] operator[=] identifier[highToBitmap] operator[SEP] identifier[get] operator[SEP] identifier[high] operator[SEP] operator[SEP] Keyword[int] identifier[low] operator[=] identifier[lowBitmap] operator[SEP] identifier[select] operator[SEP] identifier[givenBitmapSelect] operator[SEP] operator[SEP] Keyword[return] identifier[RoaringIntPacking] operator[SEP] identifier[pack] operator[SEP] identifier[high] , identifier[low] operator[SEP] operator[SEP] } }
public boolean resume(BaasHandler<?> handler) { return BaasBox.getDefaultChecked().resume(this, handler==null?BaasHandler.NOOP:handler); }
class class_name[name] begin[{] method[resume, return_type[type[boolean]], modifier[public], parameter[handler]] begin[{] return[call[BaasBox.getDefaultChecked, parameter[]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[resume] operator[SEP] identifier[BaasHandler] operator[<] operator[?] operator[>] identifier[handler] operator[SEP] { Keyword[return] identifier[BaasBox] operator[SEP] identifier[getDefaultChecked] operator[SEP] operator[SEP] operator[SEP] identifier[resume] operator[SEP] Keyword[this] , identifier[handler] operator[==] Other[null] operator[?] identifier[BaasHandler] operator[SEP] identifier[NOOP] operator[:] identifier[handler] operator[SEP] operator[SEP] }
public JulianDate add(final JulianDate jds) { int i = this.integer + jds.integer; double f = this.fraction + jds.fraction; return new JulianDate(i, f); }
class class_name[name] begin[{] method[add, return_type[type[JulianDate]], modifier[public], parameter[jds]] begin[{] local_variable[type[int], i] local_variable[type[double], f] return[ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=f, 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=JulianDate, sub_type=None))] end[}] END[}]
Keyword[public] identifier[JulianDate] identifier[add] operator[SEP] Keyword[final] identifier[JulianDate] identifier[jds] operator[SEP] { Keyword[int] identifier[i] operator[=] Keyword[this] operator[SEP] identifier[integer] operator[+] identifier[jds] operator[SEP] identifier[integer] operator[SEP] Keyword[double] identifier[f] operator[=] Keyword[this] operator[SEP] identifier[fraction] operator[+] identifier[jds] operator[SEP] identifier[fraction] operator[SEP] Keyword[return] Keyword[new] identifier[JulianDate] operator[SEP] identifier[i] , identifier[f] operator[SEP] operator[SEP] }
@Override public void performKeyStoreAction(Collection<String> modifiedKeyStores) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "performSAFKeyRingAction", new Object[] { modifiedKeyStores }); for (String modifiedKeyStore : modifiedKeyStores) { try { com.ibm.ws.ssl.config.KeyStoreManager.getInstance().findKeyStoreInMapAndClear(modifiedKeyStore); com.ibm.ws.ssl.provider.AbstractJSSEProvider.removeEntryFromSSLContextMap(modifiedKeyStore); com.ibm.ws.ssl.config.SSLConfigManager.getInstance().resetDefaultSSLContextIfNeeded(modifiedKeyStore); Tr.audit(tc, "ssl.keystore.modified.CWPKI0811I", modifiedKeyStores.toArray()); } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Exception while trying to reload keystore file, exception is: " + e.getMessage()); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "performSAFKeyRingAction"); }
class class_name[name] begin[{] method[performKeyStoreAction, return_type[void], modifier[public], parameter[modifiedKeyStores]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["performSAFKeyRingAction"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=modifiedKeyStores, 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[}] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ssl.config.KeyStoreManager, selectors=[MethodInvocation(arguments=[MemberReference(member=modifiedKeyStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findKeyStoreInMapAndClear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=modifiedKeyStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeEntryFromSSLContextMap, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ssl.provider.AbstractJSSEProvider, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ssl.config.SSLConfigManager, selectors=[MethodInvocation(arguments=[MemberReference(member=modifiedKeyStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resetDefaultSSLContextIfNeeded, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ssl.keystore.modified.CWPKI0811I"), MethodInvocation(arguments=[], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=modifiedKeyStores, selectors=[], type_arguments=None)], member=audit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception while trying to reload keystore file, exception is: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, 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=modifiedKeyStores, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=modifiedKeyStore)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["performSAFKeyRingAction"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[performKeyStoreAction] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[modifiedKeyStores] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[modifiedKeyStores] } operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[modifiedKeyStore] operator[:] identifier[modifiedKeyStores] operator[SEP] { Keyword[try] { identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ssl] operator[SEP] identifier[config] operator[SEP] identifier[KeyStoreManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[findKeyStoreInMapAndClear] operator[SEP] identifier[modifiedKeyStore] operator[SEP] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ssl] operator[SEP] identifier[provider] operator[SEP] identifier[AbstractJSSEProvider] operator[SEP] identifier[removeEntryFromSSLContextMap] operator[SEP] identifier[modifiedKeyStore] operator[SEP] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ssl] operator[SEP] identifier[config] operator[SEP] identifier[SSLConfigManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[resetDefaultSSLContextIfNeeded] operator[SEP] identifier[modifiedKeyStore] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[audit] operator[SEP] identifier[tc] , literal[String] , identifier[modifiedKeyStores] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
protected final PrcInvoiceLnGfe<RS, IInvoiceLine<IInvoice>, IInvoice> lazyGetPrcInvoiceLnGfe( final Map<String, Object> pAddParam) throws Exception { @SuppressWarnings("unchecked") PrcInvoiceLnGfe<RS, IInvoiceLine<IInvoice>, IInvoice> proc = (PrcInvoiceLnGfe<RS, IInvoiceLine<IInvoice>, IInvoice>) this.processorsMap.get(PrcInvoiceLnGfe.class.getSimpleName()); if (proc == null) { proc = new PrcInvoiceLnGfe<RS, IInvoiceLine<IInvoice>, IInvoice>(); @SuppressWarnings("unchecked") PrcEntityPbEditDelete<RS, IInvoiceLine<IInvoice>> procDlg = (PrcEntityPbEditDelete<RS, IInvoiceLine<IInvoice>>) this .fctBnEntitiesProcessors .lazyGet(pAddParam, PrcEntityPbEditDelete.class.getSimpleName()); proc.setPrcEntityPbEditDelete(procDlg); //assigning fully initialized object: this.processorsMap .put(PrcInvoiceLnGfe.class.getSimpleName(), proc); } return proc; }
class class_name[name] begin[{] method[lazyGetPrcInvoiceLnGfe, return_type[type[PrcInvoiceLnGfe]], modifier[final protected], parameter[pAddParam]] begin[{] local_variable[type[PrcInvoiceLnGfe], proc] if[binary_operation[member[.proc], ==, literal[null]]] begin[{] assign[member[.proc], 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=RS, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IInvoice, sub_type=None))], dimensions=[], name=IInvoiceLine, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IInvoice, sub_type=None))], dimensions=None, name=PrcInvoiceLnGfe, sub_type=None))] local_variable[type[PrcEntityPbEditDelete], procDlg] call[proc.setPrcEntityPbEditDelete, parameter[member[.procDlg]]] 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=PrcInvoiceLnGfe, sub_type=None)), member[.proc]]]] else begin[{] None end[}] return[member[.proc]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[PrcInvoiceLnGfe] operator[<] identifier[RS] , identifier[IInvoiceLine] operator[<] identifier[IInvoice] operator[>] , identifier[IInvoice] operator[>] identifier[lazyGetPrcInvoiceLnGfe] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pAddParam] operator[SEP] Keyword[throws] identifier[Exception] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[PrcInvoiceLnGfe] operator[<] identifier[RS] , identifier[IInvoiceLine] operator[<] identifier[IInvoice] operator[>] , identifier[IInvoice] operator[>] identifier[proc] operator[=] operator[SEP] identifier[PrcInvoiceLnGfe] operator[<] identifier[RS] , identifier[IInvoiceLine] operator[<] identifier[IInvoice] operator[>] , identifier[IInvoice] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[get] operator[SEP] identifier[PrcInvoiceLnGfe] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proc] operator[==] Other[null] operator[SEP] { identifier[proc] operator[=] Keyword[new] identifier[PrcInvoiceLnGfe] operator[<] identifier[RS] , identifier[IInvoiceLine] operator[<] identifier[IInvoice] operator[>] , identifier[IInvoice] operator[>] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[PrcEntityPbEditDelete] operator[<] identifier[RS] , identifier[IInvoiceLine] operator[<] identifier[IInvoice] operator[>] operator[>] identifier[procDlg] operator[=] operator[SEP] identifier[PrcEntityPbEditDelete] operator[<] identifier[RS] , identifier[IInvoiceLine] operator[<] identifier[IInvoice] operator[>] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[fctBnEntitiesProcessors] operator[SEP] identifier[lazyGet] operator[SEP] identifier[pAddParam] , identifier[PrcEntityPbEditDelete] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setPrcEntityPbEditDelete] operator[SEP] identifier[procDlg] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[put] operator[SEP] identifier[PrcInvoiceLnGfe] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[proc] operator[SEP] operator[SEP] } Keyword[return] identifier[proc] operator[SEP] }
public boolean discover(){ boolean helloResponse = false; for (int helloRetries = this.retries; helloRetries >= 0; helloRetries--) { List<InetAddress> broadcast = listAllBroadcastAddresses(); if (broadcast == null) return false; for (InetAddress i : broadcast) { if (hello(i)) { helloResponse = true; break; } } if (helloResponse) break; } return helloResponse; }
class class_name[name] begin[{] method[discover, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[boolean], helloResponse] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=listAllBroadcastAddresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=broadcast)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=broadcast, 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=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hello, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=helloResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=broadcast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=helloResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=helloRetries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=retries, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), name=helloRetries)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=helloRetries, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.helloResponse]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[discover] operator[SEP] operator[SEP] { Keyword[boolean] identifier[helloResponse] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[helloRetries] operator[=] Keyword[this] operator[SEP] identifier[retries] operator[SEP] identifier[helloRetries] operator[>=] Other[0] operator[SEP] identifier[helloRetries] operator[--] operator[SEP] { identifier[List] operator[<] identifier[InetAddress] operator[>] identifier[broadcast] operator[=] identifier[listAllBroadcastAddresses] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[broadcast] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[InetAddress] identifier[i] operator[:] identifier[broadcast] operator[SEP] { Keyword[if] operator[SEP] identifier[hello] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[helloResponse] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[helloResponse] operator[SEP] Keyword[break] operator[SEP] } Keyword[return] identifier[helloResponse] operator[SEP] }
public static ImportNodeData createNodeData(NodeData parent, InternalQName name, InternalQName primaryTypeName, int index, int orderNumber) { ImportNodeData nodeData = null; QPath path = QPath.makeChildPath(parent.getQPath(), name, index); nodeData = new ImportNodeData(path, IdGenerator.generate(), -1, primaryTypeName, new InternalQName[0], orderNumber, parent.getIdentifier(), parent.getACL()); return nodeData; }
class class_name[name] begin[{] method[createNodeData, return_type[type[ImportNodeData]], modifier[public static], parameter[parent, name, primaryTypeName, index, orderNumber]] begin[{] local_variable[type[ImportNodeData], nodeData] local_variable[type[QPath], path] assign[member[.nodeData], ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=generate, postfix_operators=[], prefix_operators=[], qualifier=IdGenerator, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), MemberReference(member=primaryTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=InternalQName, sub_type=None)), MemberReference(member=orderNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getACL, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ImportNodeData, sub_type=None))] return[member[.nodeData]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ImportNodeData] identifier[createNodeData] operator[SEP] identifier[NodeData] identifier[parent] , identifier[InternalQName] identifier[name] , identifier[InternalQName] identifier[primaryTypeName] , Keyword[int] identifier[index] , Keyword[int] identifier[orderNumber] operator[SEP] { identifier[ImportNodeData] identifier[nodeData] operator[=] Other[null] operator[SEP] identifier[QPath] identifier[path] operator[=] identifier[QPath] operator[SEP] identifier[makeChildPath] operator[SEP] identifier[parent] operator[SEP] identifier[getQPath] operator[SEP] operator[SEP] , identifier[name] , identifier[index] operator[SEP] operator[SEP] identifier[nodeData] operator[=] Keyword[new] identifier[ImportNodeData] operator[SEP] identifier[path] , identifier[IdGenerator] operator[SEP] identifier[generate] operator[SEP] operator[SEP] , operator[-] Other[1] , identifier[primaryTypeName] , Keyword[new] identifier[InternalQName] operator[SEP] Other[0] operator[SEP] , identifier[orderNumber] , identifier[parent] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] , identifier[parent] operator[SEP] identifier[getACL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[nodeData] operator[SEP] }
private static boolean checkFieldsWithDataAnnotation(Class<? extends AbstractPlugin> pluginClass) { List<Field> dataFields = new ArrayList<>(); for (Field field : pluginClass.getDeclaredFields()) { if (field.isAnnotationPresent(Plugin.Data.class)) { dataFields.add(field); } } return shouldHasUniqueValues(dataFields); }
class class_name[name] begin[{] method[checkFieldsWithDataAnnotation, return_type[type[boolean]], modifier[private static], parameter[pluginClass]] begin[{] local_variable[type[List], dataFields] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=Plugin, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Data, sub_type=None))], member=isAnnotationPresent, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=dataFields, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDeclaredFields, postfix_operators=[], prefix_operators=[], qualifier=pluginClass, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) return[call[.shouldHasUniqueValues, parameter[member[.dataFields]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[checkFieldsWithDataAnnotation] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[AbstractPlugin] operator[>] identifier[pluginClass] operator[SEP] { identifier[List] operator[<] identifier[Field] operator[>] identifier[dataFields] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[field] operator[:] identifier[pluginClass] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Plugin] operator[SEP] identifier[Data] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[dataFields] operator[SEP] identifier[add] operator[SEP] identifier[field] operator[SEP] operator[SEP] } } Keyword[return] identifier[shouldHasUniqueValues] operator[SEP] identifier[dataFields] operator[SEP] operator[SEP] }
public static void setDefaultJMXDomain (@Nonnull @Nonempty final String sDefaultJMXDomain) { ValueEnforcer.notEmpty (sDefaultJMXDomain, "DefaultJMXDomain"); if (sDefaultJMXDomain.indexOf (':') >= 0 || sDefaultJMXDomain.indexOf (' ') >= 0) throw new IllegalArgumentException ("defaultJMXDomain contains invalid chars: " + sDefaultJMXDomain); s_aRWLock.writeLocked ( () -> s_sDefaultJMXDomain = sDefaultJMXDomain); }
class class_name[name] begin[{] method[setDefaultJMXDomain, return_type[void], modifier[public static], parameter[sDefaultJMXDomain]] begin[{] call[ValueEnforcer.notEmpty, parameter[member[.sDefaultJMXDomain], literal["DefaultJMXDomain"]]] if[binary_operation[binary_operation[call[sDefaultJMXDomain.indexOf, parameter[literal[':']]], >=, literal[0]], ||, binary_operation[call[sDefaultJMXDomain.indexOf, parameter[literal[' ']]], >=, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="defaultJMXDomain contains invalid chars: "), operandr=MemberReference(member=sDefaultJMXDomain, 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[}] call[s_aRWLock.writeLocked, parameter[LambdaExpression(body=Assignment(expressionl=MemberReference(member=s_sDefaultJMXDomain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=sDefaultJMXDomain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), parameters=[])]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setDefaultJMXDomain] operator[SEP] annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sDefaultJMXDomain] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notEmpty] operator[SEP] identifier[sDefaultJMXDomain] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sDefaultJMXDomain] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[||] identifier[sDefaultJMXDomain] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[sDefaultJMXDomain] operator[SEP] operator[SEP] identifier[s_aRWLock] operator[SEP] identifier[writeLocked] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[s_sDefaultJMXDomain] operator[=] identifier[sDefaultJMXDomain] operator[SEP] operator[SEP] }
public HomeResources homeResources() { if (home.get() == null) { home.compareAndSet(null, new HomeResourcesImpl(this)); } return home.get(); }
class class_name[name] begin[{] method[homeResources, return_type[type[HomeResources]], modifier[public], parameter[]] begin[{] if[binary_operation[call[home.get, parameter[]], ==, literal[null]]] begin[{] call[home.compareAndSet, parameter[literal[null], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HomeResourcesImpl, sub_type=None))]] else begin[{] None end[}] return[call[home.get, parameter[]]] end[}] END[}]
Keyword[public] identifier[HomeResources] identifier[homeResources] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[home] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[home] operator[SEP] identifier[compareAndSet] operator[SEP] Other[null] , Keyword[new] identifier[HomeResourcesImpl] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[home] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] }
public static Type[] getArgumentTypes(final Method method) { Class[] classes = method.getParameterTypes(); Type[] types = new Type[classes.length]; for (int i = classes.length - 1; i >= 0; --i) { types[i] = getType(classes[i]); } return types; }
class class_name[name] begin[{] method[getArgumentTypes, return_type[type[Type]], modifier[public static], parameter[method]] begin[{] local_variable[type[Class], classes] local_variable[type[Type], types] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=classes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[])]), label=None) return[member[.types]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Type] operator[SEP] operator[SEP] identifier[getArgumentTypes] operator[SEP] Keyword[final] identifier[Method] identifier[method] operator[SEP] { identifier[Class] operator[SEP] operator[SEP] identifier[classes] operator[=] identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[types] operator[=] Keyword[new] identifier[Type] operator[SEP] identifier[classes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[classes] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] operator[--] identifier[i] operator[SEP] { identifier[types] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[getType] operator[SEP] identifier[classes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[types] operator[SEP] }
@Deprecated protected void handleComputeFields(int julianDay) { int era, year; int[] fields = new int[3]; jdToCE(julianDay, getJDEpochOffset(), fields); // fields[0] eyear // fields[1] month // fields[2] day if (fields[0] <= 0) { era = BCE; year = 1 - fields[0]; } else { era = CE; year = fields[0]; } internalSet(EXTENDED_YEAR, fields[0]); internalSet(ERA, era); internalSet(YEAR, year); internalSet(MONTH, fields[1]); internalSet(DAY_OF_MONTH, fields[2]); internalSet(DAY_OF_YEAR, (30 * fields[1]) + fields[2]); }
class class_name[name] begin[{] method[handleComputeFields, return_type[void], modifier[protected], parameter[julianDay]] begin[{] local_variable[type[int], era] local_variable[type[int], fields] call[.jdToCE, parameter[member[.julianDay], call[.getJDEpochOffset, parameter[]], member[.fields]]] if[binary_operation[member[.fields], <=, literal[0]]] begin[{] assign[member[.era], member[.BCE]] assign[member[.year], binary_operation[literal[1], -, member[.fields]]] else begin[{] assign[member[.era], member[.CE]] assign[member[.year], member[.fields]] end[}] call[.internalSet, parameter[member[.EXTENDED_YEAR], member[.fields]]] call[.internalSet, parameter[member[.ERA], member[.era]]] call[.internalSet, parameter[member[.YEAR], member[.year]]] call[.internalSet, parameter[member[.MONTH], member[.fields]]] call[.internalSet, parameter[member[.DAY_OF_MONTH], member[.fields]]] call[.internalSet, parameter[member[.DAY_OF_YEAR], binary_operation[binary_operation[literal[30], *, member[.fields]], +, member[.fields]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[protected] Keyword[void] identifier[handleComputeFields] operator[SEP] Keyword[int] identifier[julianDay] operator[SEP] { Keyword[int] identifier[era] , identifier[year] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[fields] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[jdToCE] operator[SEP] identifier[julianDay] , identifier[getJDEpochOffset] operator[SEP] operator[SEP] , identifier[fields] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fields] operator[SEP] Other[0] operator[SEP] operator[<=] Other[0] operator[SEP] { identifier[era] operator[=] identifier[BCE] operator[SEP] identifier[year] operator[=] Other[1] operator[-] identifier[fields] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[era] operator[=] identifier[CE] operator[SEP] identifier[year] operator[=] identifier[fields] operator[SEP] Other[0] operator[SEP] operator[SEP] } identifier[internalSet] operator[SEP] identifier[EXTENDED_YEAR] , identifier[fields] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[internalSet] operator[SEP] identifier[ERA] , identifier[era] operator[SEP] operator[SEP] identifier[internalSet] operator[SEP] identifier[YEAR] , identifier[year] operator[SEP] operator[SEP] identifier[internalSet] operator[SEP] identifier[MONTH] , identifier[fields] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[internalSet] operator[SEP] identifier[DAY_OF_MONTH] , identifier[fields] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[internalSet] operator[SEP] identifier[DAY_OF_YEAR] , operator[SEP] Other[30] operator[*] identifier[fields] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[+] identifier[fields] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] }
protected RegisteredService resolveRegisteredServiceInRequestContext(final RequestContext requestContext) { val resolvedService = resolveServiceFromAuthenticationRequest(requestContext); if (resolvedService != null) { val service = getWebflowEventResolutionConfigurationContext().getServicesManager().findServiceBy(resolvedService); RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(resolvedService, service); return service; } LOGGER.debug("Authentication request is not accompanied by a service given none is specified"); return null; }
class class_name[name] begin[{] method[resolveRegisteredServiceInRequestContext, return_type[type[RegisteredService]], modifier[protected], parameter[requestContext]] begin[{] local_variable[type[val], resolvedService] if[binary_operation[member[.resolvedService], !=, literal[null]]] begin[{] local_variable[type[val], service] call[RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed, parameter[member[.resolvedService], member[.service]]] return[member[.service]] else begin[{] None end[}] call[LOGGER.debug, parameter[literal["Authentication request is not accompanied by a service given none is specified"]]] return[literal[null]] end[}] END[}]
Keyword[protected] identifier[RegisteredService] identifier[resolveRegisteredServiceInRequestContext] operator[SEP] Keyword[final] identifier[RequestContext] identifier[requestContext] operator[SEP] { identifier[val] identifier[resolvedService] operator[=] identifier[resolveServiceFromAuthenticationRequest] operator[SEP] identifier[requestContext] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolvedService] operator[!=] Other[null] operator[SEP] { identifier[val] identifier[service] operator[=] identifier[getWebflowEventResolutionConfigurationContext] operator[SEP] operator[SEP] operator[SEP] identifier[getServicesManager] operator[SEP] operator[SEP] operator[SEP] identifier[findServiceBy] operator[SEP] identifier[resolvedService] operator[SEP] operator[SEP] identifier[RegisteredServiceAccessStrategyUtils] operator[SEP] identifier[ensureServiceAccessIsAllowed] operator[SEP] identifier[resolvedService] , identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
@Override public Object execute(Rose rose) throws Throwable { InvocationBean inv = rose.getInvocation(); ServletRequest request = inv.getRequest(); // if (request.getCharacterEncoding() == null) { request.setCharacterEncoding("UTF-8"); if (logger.isDebugEnabled()) { logger.debug("set request.characterEncoding by default:" + request.getCharacterEncoding()); } } // final RequestPath requestPath = inv.getRequestPath(); // save before include if (requestPath.isIncludeRequest()) { saveAttributesBeforeInclude(inv); // 恢复include请求前的各种请求属性(包括Model对象) rose.addAfterCompletion(new AfterCompletion() { @Override public void afterCompletion(Invocation inv, Throwable ex) throws Exception { restoreRequestAttributesAfterInclude(inv); } }); } // 调用之前设置内置属性 inv.addModel("invocation", inv); inv.addModel("ctxpath", requestPath.getCtxpath()); // instruction是控制器action方法的返回结果或其对应的Instruction对象(也可能是拦截器、错误处理器返回的) Object instruction = rose.doNext(); if (Thread.currentThread().isInterrupted()) { logger.info("stop to render: thread is interrupted"); } else { // 写flash消息到Cookie (被include的请求不会有功能) if (!requestPath.isIncludeRequest()) { FlashImpl flash = (FlashImpl) inv.getFlash(false); if (flash != null) { flash.writeNewMessages(); } } // 渲染页面 instructionExecutor.render(inv, instruction); } return instruction; }
class class_name[name] begin[{] method[execute, return_type[type[Object]], modifier[public], parameter[rose]] begin[{] local_variable[type[InvocationBean], inv] local_variable[type[ServletRequest], request] if[binary_operation[call[request.getCharacterEncoding, parameter[]], ==, literal[null]]] begin[{] call[request.setCharacterEncoding, parameter[literal["UTF-8"]]] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[binary_operation[literal["set request.characterEncoding by default:"], +, call[request.getCharacterEncoding, parameter[]]]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[RequestPath], requestPath] if[call[requestPath.isIncludeRequest, parameter[]]] begin[{] call[.saveAttributesBeforeInclude, parameter[member[.inv]]] call[rose.addAfterCompletion, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=restoreRequestAttributesAfterInclude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=afterCompletion, parameters=[FormalParameter(annotations=[], modifiers=set(), name=inv, type=ReferenceType(arguments=None, dimensions=[], name=Invocation, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=ex, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=['Exception'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AfterCompletion, sub_type=None))]] else begin[{] None end[}] call[inv.addModel, parameter[literal["invocation"], member[.inv]]] call[inv.addModel, parameter[literal["ctxpath"], call[requestPath.getCtxpath, parameter[]]]] local_variable[type[Object], instruction] if[call[Thread.currentThread, parameter[]]] begin[{] call[logger.info, parameter[literal["stop to render: thread is interrupted"]]] else begin[{] if[call[requestPath.isIncludeRequest, parameter[]]] begin[{] local_variable[type[FlashImpl], flash] if[binary_operation[member[.flash], !=, literal[null]]] begin[{] call[flash.writeNewMessages, parameter[]] else begin[{] None end[}] else begin[{] None end[}] call[instructionExecutor.render, parameter[member[.inv], member[.instruction]]] end[}] return[member[.instruction]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[execute] operator[SEP] identifier[Rose] identifier[rose] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[InvocationBean] identifier[inv] operator[=] identifier[rose] operator[SEP] identifier[getInvocation] operator[SEP] operator[SEP] operator[SEP] identifier[ServletRequest] identifier[request] operator[=] identifier[inv] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getCharacterEncoding] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[setCharacterEncoding] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[request] operator[SEP] identifier[getCharacterEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[final] identifier[RequestPath] identifier[requestPath] operator[=] identifier[inv] operator[SEP] identifier[getRequestPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[requestPath] operator[SEP] identifier[isIncludeRequest] operator[SEP] operator[SEP] operator[SEP] { identifier[saveAttributesBeforeInclude] operator[SEP] identifier[inv] operator[SEP] operator[SEP] identifier[rose] operator[SEP] identifier[addAfterCompletion] operator[SEP] Keyword[new] identifier[AfterCompletion] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[afterCompletion] operator[SEP] identifier[Invocation] identifier[inv] , identifier[Throwable] identifier[ex] operator[SEP] Keyword[throws] identifier[Exception] { identifier[restoreRequestAttributesAfterInclude] operator[SEP] identifier[inv] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } identifier[inv] operator[SEP] identifier[addModel] operator[SEP] literal[String] , identifier[inv] operator[SEP] operator[SEP] identifier[inv] operator[SEP] identifier[addModel] operator[SEP] literal[String] , identifier[requestPath] operator[SEP] identifier[getCtxpath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[instruction] operator[=] identifier[rose] operator[SEP] identifier[doNext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[isInterrupted] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[requestPath] operator[SEP] identifier[isIncludeRequest] operator[SEP] operator[SEP] operator[SEP] { identifier[FlashImpl] identifier[flash] operator[=] operator[SEP] identifier[FlashImpl] operator[SEP] identifier[inv] operator[SEP] identifier[getFlash] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[flash] operator[!=] Other[null] operator[SEP] { identifier[flash] operator[SEP] identifier[writeNewMessages] operator[SEP] operator[SEP] operator[SEP] } } identifier[instructionExecutor] operator[SEP] identifier[render] operator[SEP] identifier[inv] , identifier[instruction] operator[SEP] operator[SEP] } Keyword[return] identifier[instruction] operator[SEP] }
@Override public void delete(IEntityLock lock) throws LockingException { Map m = getLockCache(lock.getEntityType()); synchronized (m) { m.remove(getCacheKey(lock)); } }
class class_name[name] begin[{] method[delete, return_type[void], modifier[public], parameter[lock]] begin[{] local_variable[type[Map], m] SYNCHRONIZED[member[.m]] BEGIN[{] call[m.remove, parameter[call[.getCacheKey, parameter[member[.lock]]]]] END[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[delete] operator[SEP] identifier[IEntityLock] identifier[lock] operator[SEP] Keyword[throws] identifier[LockingException] { identifier[Map] identifier[m] operator[=] identifier[getLockCache] operator[SEP] identifier[lock] operator[SEP] identifier[getEntityType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[m] operator[SEP] { identifier[m] operator[SEP] identifier[remove] operator[SEP] identifier[getCacheKey] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] } }
public final void remove(final int index) { AbstractItem removedItem = items.remove(index); if (removedItem instanceof Item && ((Item) removedItem).getIcon() != null) { iconCount--; } else if (removedItem instanceof Divider) { dividerCount--; } rawItems = null; notifyOnDataSetChanged(); }
class class_name[name] begin[{] method[remove, return_type[void], modifier[final public], parameter[index]] begin[{] local_variable[type[AbstractItem], removedItem] if[binary_operation[binary_operation[member[.removedItem], instanceof, type[Item]], &&, binary_operation[Cast(expression=MemberReference(member=removedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Item, sub_type=None)), !=, literal[null]]]] begin[{] member[.iconCount] else begin[{] if[binary_operation[member[.removedItem], instanceof, type[Divider]]] begin[{] member[.dividerCount] else begin[{] None end[}] end[}] assign[member[.rawItems], literal[null]] call[.notifyOnDataSetChanged, parameter[]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[remove] operator[SEP] Keyword[final] Keyword[int] identifier[index] operator[SEP] { identifier[AbstractItem] identifier[removedItem] operator[=] identifier[items] operator[SEP] identifier[remove] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[removedItem] Keyword[instanceof] identifier[Item] operator[&&] operator[SEP] operator[SEP] identifier[Item] operator[SEP] identifier[removedItem] operator[SEP] operator[SEP] identifier[getIcon] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[iconCount] operator[--] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[removedItem] Keyword[instanceof] identifier[Divider] operator[SEP] { identifier[dividerCount] operator[--] operator[SEP] } identifier[rawItems] operator[=] Other[null] operator[SEP] identifier[notifyOnDataSetChanged] operator[SEP] operator[SEP] operator[SEP] }
public synchronized void setCms(CmsObject cms) { if (m_perThreadCmsObject == null) { m_perThreadCmsObject = new ThreadLocal<CmsObject>(); } m_perThreadCmsObject.set(cms); }
class class_name[name] begin[{] method[setCms, return_type[void], modifier[synchronized public], parameter[cms]] begin[{] if[binary_operation[member[.m_perThreadCmsObject], ==, literal[null]]] begin[{] assign[member[.m_perThreadCmsObject], 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=CmsObject, sub_type=None))], dimensions=None, name=ThreadLocal, sub_type=None))] else begin[{] None end[}] call[m_perThreadCmsObject.set, parameter[member[.cms]]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[setCms] operator[SEP] identifier[CmsObject] identifier[cms] operator[SEP] { Keyword[if] operator[SEP] identifier[m_perThreadCmsObject] operator[==] Other[null] operator[SEP] { identifier[m_perThreadCmsObject] operator[=] Keyword[new] identifier[ThreadLocal] operator[<] identifier[CmsObject] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[m_perThreadCmsObject] operator[SEP] identifier[set] operator[SEP] identifier[cms] operator[SEP] operator[SEP] }
@Override public void getCommentsByApplication(SocializeSession session, int startIndex, int endIndex, CommentListener listener) { listAsync(session, ENDPOINT, null, null, null, startIndex, endIndex, listener); }
class class_name[name] begin[{] method[getCommentsByApplication, return_type[void], modifier[public], parameter[session, startIndex, endIndex, listener]] begin[{] call[.listAsync, parameter[member[.session], member[.ENDPOINT], literal[null], literal[null], literal[null], member[.startIndex], member[.endIndex], member[.listener]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[getCommentsByApplication] operator[SEP] identifier[SocializeSession] identifier[session] , Keyword[int] identifier[startIndex] , Keyword[int] identifier[endIndex] , identifier[CommentListener] identifier[listener] operator[SEP] { identifier[listAsync] operator[SEP] identifier[session] , identifier[ENDPOINT] , Other[null] , Other[null] , Other[null] , identifier[startIndex] , identifier[endIndex] , identifier[listener] operator[SEP] operator[SEP] }
public void init(EntityConfig config) { // Instance Members. this.response = (Phrase) config.getValue(SOURCE); this.resource = (Phrase) config.getValue(RESOURCE); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[config]] begin[{] assign[THIS[member[None.response]], Cast(expression=MethodInvocation(arguments=[MemberReference(member=SOURCE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Phrase, sub_type=None))] assign[THIS[member[None.resource]], Cast(expression=MethodInvocation(arguments=[MemberReference(member=RESOURCE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Phrase, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[EntityConfig] identifier[config] operator[SEP] { Keyword[this] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[Phrase] operator[SEP] identifier[config] operator[SEP] identifier[getValue] operator[SEP] identifier[SOURCE] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[resource] operator[=] operator[SEP] identifier[Phrase] operator[SEP] identifier[config] operator[SEP] identifier[getValue] operator[SEP] identifier[RESOURCE] operator[SEP] operator[SEP] }
private static <T> boolean quickSort(List<T> list, int l, int r, Comparator<? super T> comparator, SortStatistics stats, int currentRecursion, int maxRecursion) { int M=4; if((r-l)>M) { int i=(r+l)/2; if(compare(list, l, i, comparator, stats)>0) swap(list, l, i, stats); // Tri-Median Methode! if(compare(list, l, r, comparator, stats)>0) swap(list, l, r, stats); if(compare(list, i, r, comparator, stats)>0) swap(list, i, r, stats); int j=r-1; swap(list, i, j, stats); i=l; T v=get(list, j, stats); for(;;) { while(compare(get(list, ++i, stats), v, comparator, stats)<0) { // Empty while } while(compare(get(list, --j, stats), v, comparator, stats)>0) { // Empty while } if(j<i) break; swap(list, i, j, stats); } swap(list, i, r-1, stats); int newRecursion=currentRecursion+1; if(newRecursion>maxRecursion) return false; if(stats!=null) stats.sortRecursing(); if(!quickSort(list, l, j, comparator, stats, newRecursion, maxRecursion)) return false; if(stats!=null) stats.sortUnrecursing(); if(stats!=null) stats.sortRecursing(); if(!quickSort(list, i+1, r, comparator, stats, newRecursion, maxRecursion)) return false; if(stats!=null) stats.sortUnrecursing(); } return true; }
class class_name[name] begin[{] method[quickSort, return_type[type[boolean]], modifier[private static], parameter[list, l, r, comparator, stats, currentRecursion, maxRecursion]] begin[{] local_variable[type[int], M] if[binary_operation[binary_operation[member[.r], -, member[.l]], >, member[.M]]] begin[{] local_variable[type[int], i] if[binary_operation[call[.compare, parameter[member[.list], member[.l], member[.i], member[.comparator], member[.stats]]], >, literal[0]]] begin[{] call[.swap, parameter[member[.list], member[.l], member[.i], member[.stats]]] else begin[{] None end[}] if[binary_operation[call[.compare, parameter[member[.list], member[.l], member[.r], member[.comparator], member[.stats]]], >, literal[0]]] begin[{] call[.swap, parameter[member[.list], member[.l], member[.r], member[.stats]]] else begin[{] None end[}] if[binary_operation[call[.compare, parameter[member[.list], member[.i], member[.r], member[.comparator], member[.stats]]], >, literal[0]]] begin[{] call[.swap, parameter[member[.list], member[.i], member[.r], member[.stats]]] else begin[{] None end[}] local_variable[type[int], j] call[.swap, parameter[member[.list], member[.i], member[.j], member[.stats]]] assign[member[.i], member[.l]] local_variable[type[T], v] ForStatement(body=BlockStatement(label=None, statements=[WhileStatement(body=BlockStatement(label=None, statements=[]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=comparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), label=None), WhileStatement(body=BlockStatement(label=None, statements=[]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=comparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None) call[.swap, parameter[member[.list], member[.i], binary_operation[member[.r], -, literal[1]], member[.stats]]] local_variable[type[int], newRecursion] if[binary_operation[member[.newRecursion], >, member[.maxRecursion]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.stats], !=, literal[null]]] begin[{] call[stats.sortRecursing, parameter[]] else begin[{] None end[}] if[call[.quickSort, parameter[member[.list], member[.l], member[.j], member[.comparator], member[.stats], member[.newRecursion], member[.maxRecursion]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.stats], !=, literal[null]]] begin[{] call[stats.sortUnrecursing, parameter[]] else begin[{] None end[}] if[binary_operation[member[.stats], !=, literal[null]]] begin[{] call[stats.sortRecursing, parameter[]] else begin[{] None end[}] if[call[.quickSort, parameter[member[.list], binary_operation[member[.i], +, literal[1]], member[.r], member[.comparator], member[.stats], member[.newRecursion], member[.maxRecursion]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.stats], !=, literal[null]]] begin[{] call[stats.sortUnrecursing, parameter[]] else begin[{] None end[}] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] Keyword[boolean] identifier[quickSort] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[list] , Keyword[int] identifier[l] , Keyword[int] identifier[r] , identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[comparator] , identifier[SortStatistics] identifier[stats] , Keyword[int] identifier[currentRecursion] , Keyword[int] identifier[maxRecursion] operator[SEP] { Keyword[int] identifier[M] operator[=] Other[4] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[r] operator[-] identifier[l] operator[SEP] operator[>] identifier[M] operator[SEP] { Keyword[int] identifier[i] operator[=] operator[SEP] identifier[r] operator[+] identifier[l] operator[SEP] operator[/] Other[2] operator[SEP] Keyword[if] operator[SEP] identifier[compare] operator[SEP] identifier[list] , identifier[l] , identifier[i] , identifier[comparator] , identifier[stats] operator[SEP] operator[>] Other[0] operator[SEP] identifier[swap] operator[SEP] identifier[list] , identifier[l] , identifier[i] , identifier[stats] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[compare] operator[SEP] identifier[list] , identifier[l] , identifier[r] , identifier[comparator] , identifier[stats] operator[SEP] operator[>] Other[0] operator[SEP] identifier[swap] operator[SEP] identifier[list] , identifier[l] , identifier[r] , identifier[stats] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[compare] operator[SEP] identifier[list] , identifier[i] , identifier[r] , identifier[comparator] , identifier[stats] operator[SEP] operator[>] Other[0] operator[SEP] identifier[swap] operator[SEP] identifier[list] , identifier[i] , identifier[r] , identifier[stats] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[r] operator[-] Other[1] operator[SEP] identifier[swap] operator[SEP] identifier[list] , identifier[i] , identifier[j] , identifier[stats] operator[SEP] operator[SEP] identifier[i] operator[=] identifier[l] operator[SEP] identifier[T] identifier[v] operator[=] identifier[get] operator[SEP] identifier[list] , identifier[j] , identifier[stats] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[while] operator[SEP] identifier[compare] operator[SEP] identifier[get] operator[SEP] identifier[list] , operator[++] identifier[i] , identifier[stats] operator[SEP] , identifier[v] , identifier[comparator] , identifier[stats] operator[SEP] operator[<] Other[0] operator[SEP] { } Keyword[while] operator[SEP] identifier[compare] operator[SEP] identifier[get] operator[SEP] identifier[list] , operator[--] identifier[j] , identifier[stats] operator[SEP] , identifier[v] , identifier[comparator] , identifier[stats] operator[SEP] operator[>] Other[0] operator[SEP] { } Keyword[if] operator[SEP] identifier[j] operator[<] identifier[i] operator[SEP] Keyword[break] operator[SEP] identifier[swap] operator[SEP] identifier[list] , identifier[i] , identifier[j] , identifier[stats] operator[SEP] operator[SEP] } identifier[swap] operator[SEP] identifier[list] , identifier[i] , identifier[r] operator[-] Other[1] , identifier[stats] operator[SEP] operator[SEP] Keyword[int] identifier[newRecursion] operator[=] identifier[currentRecursion] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[newRecursion] operator[>] identifier[maxRecursion] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[stats] operator[!=] Other[null] operator[SEP] identifier[stats] operator[SEP] identifier[sortRecursing] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[quickSort] operator[SEP] identifier[list] , identifier[l] , identifier[j] , identifier[comparator] , identifier[stats] , identifier[newRecursion] , identifier[maxRecursion] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[stats] operator[!=] Other[null] operator[SEP] identifier[stats] operator[SEP] identifier[sortUnrecursing] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stats] operator[!=] Other[null] operator[SEP] identifier[stats] operator[SEP] identifier[sortRecursing] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[quickSort] operator[SEP] identifier[list] , identifier[i] operator[+] Other[1] , identifier[r] , identifier[comparator] , identifier[stats] , identifier[newRecursion] , identifier[maxRecursion] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[stats] operator[!=] Other[null] operator[SEP] identifier[stats] operator[SEP] identifier[sortUnrecursing] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private void setButtonsVisibleForPreHC() { if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { ViewHelper.setAlpha(mMidContainer, 1.0f); ViewHelper.setAlpha(mLeftContainer, 1.0f); ViewHelper.setAlpha(mRightContainer, 1.0f); } }
class class_name[name] begin[{] method[setButtonsVisibleForPreHC, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[android.os.Build.VERSION.SDK_INT], <, member[Build.VERSION_CODES.HONEYCOMB]]] begin[{] call[ViewHelper.setAlpha, parameter[member[.mMidContainer], literal[1.0f]]] call[ViewHelper.setAlpha, parameter[member[.mLeftContainer], literal[1.0f]]] call[ViewHelper.setAlpha, parameter[member[.mRightContainer], literal[1.0f]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[setButtonsVisibleForPreHC] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[android] operator[SEP] identifier[os] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[<] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[HONEYCOMB] operator[SEP] { identifier[ViewHelper] operator[SEP] identifier[setAlpha] operator[SEP] identifier[mMidContainer] , literal[Float] operator[SEP] operator[SEP] identifier[ViewHelper] operator[SEP] identifier[setAlpha] operator[SEP] identifier[mLeftContainer] , literal[Float] operator[SEP] operator[SEP] identifier[ViewHelper] operator[SEP] identifier[setAlpha] operator[SEP] identifier[mRightContainer] , literal[Float] operator[SEP] operator[SEP] } }
public static boolean isSystemHeaderAndNotGruu(ModifiableRule modifiableRule, Parameterable parameterable) { boolean isSettingGruu = false; if(modifiableRule == ModifiableRule.ContactSystem && (parameterable.getParameter("gruu") != null || parameterable.getParameter("gr") != null)) { isSettingGruu = true; if (logger.isDebugEnabled()) logger.debug("Setting gruu so modifying contact header address is allowed"); } return !isSettingGruu && isSystemHeader(modifiableRule); }
class class_name[name] begin[{] method[isSystemHeaderAndNotGruu, return_type[type[boolean]], modifier[public static], parameter[modifiableRule, parameterable]] begin[{] local_variable[type[boolean], isSettingGruu] if[binary_operation[binary_operation[member[.modifiableRule], ==, member[ModifiableRule.ContactSystem]], &&, binary_operation[binary_operation[call[parameterable.getParameter, parameter[literal["gruu"]]], !=, literal[null]], ||, binary_operation[call[parameterable.getParameter, parameter[literal["gr"]]], !=, literal[null]]]]] begin[{] assign[member[.isSettingGruu], literal[true]] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[literal["Setting gruu so modifying contact header address is allowed"]]] else begin[{] None end[}] else begin[{] None end[}] return[binary_operation[member[.isSettingGruu], &&, call[.isSystemHeader, parameter[member[.modifiableRule]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isSystemHeaderAndNotGruu] operator[SEP] identifier[ModifiableRule] identifier[modifiableRule] , identifier[Parameterable] identifier[parameterable] operator[SEP] { Keyword[boolean] identifier[isSettingGruu] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[modifiableRule] operator[==] identifier[ModifiableRule] operator[SEP] identifier[ContactSystem] operator[&&] operator[SEP] identifier[parameterable] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[||] identifier[parameterable] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] { identifier[isSettingGruu] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[!] identifier[isSettingGruu] operator[&&] identifier[isSystemHeader] operator[SEP] identifier[modifiableRule] operator[SEP] operator[SEP] }
protected void renderTableFooterRow(FacesContext facesContext, ResponseWriter writer, UIComponent component, UIComponent footerFacet, String footerStyleClass, int colspan) throws IOException { renderTableHeaderOrFooterRow(facesContext, writer, component, footerFacet, footerStyleClass, HTML.TD_ELEM, colspan, false); }
class class_name[name] begin[{] method[renderTableFooterRow, return_type[void], modifier[protected], parameter[facesContext, writer, component, footerFacet, footerStyleClass, colspan]] begin[{] call[.renderTableHeaderOrFooterRow, parameter[member[.facesContext], member[.writer], member[.component], member[.footerFacet], member[.footerStyleClass], member[HTML.TD_ELEM], member[.colspan], literal[false]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[renderTableFooterRow] operator[SEP] identifier[FacesContext] identifier[facesContext] , identifier[ResponseWriter] identifier[writer] , identifier[UIComponent] identifier[component] , identifier[UIComponent] identifier[footerFacet] , identifier[String] identifier[footerStyleClass] , Keyword[int] identifier[colspan] operator[SEP] Keyword[throws] identifier[IOException] { identifier[renderTableHeaderOrFooterRow] operator[SEP] identifier[facesContext] , identifier[writer] , identifier[component] , identifier[footerFacet] , identifier[footerStyleClass] , identifier[HTML] operator[SEP] identifier[TD_ELEM] , identifier[colspan] , literal[boolean] operator[SEP] operator[SEP] }
public List<LibertyFeature> getRequiredFeatures(LibertyFeature feature, Map<String, LibertyFeature> allFeatures) throws MavenRepoGeneratorException { List<LibertyFeature> dependencies = new ArrayList<LibertyFeature>(); Map<String, Collection<String>> requiredFeaturesWithTolerates = feature.getRequiredFeaturesWithTolerates(); if (requiredFeaturesWithTolerates != null) { for (String requireFeature : requiredFeaturesWithTolerates.keySet()) { Collection<String> toleratesVersions = null; if (allFeatures.containsKey(requireFeature)) { dependencies.add(allFeatures.get(requireFeature)); } else if ((toleratesVersions = requiredFeaturesWithTolerates.get(requireFeature)) != null) { log("For feature " + feature.getSymbolicName() + ", cannot find direct dependency to required feature " + requireFeature + " so it must use tolerates list: " + toleratesVersions, LogLevel.WARN.getLevel()); boolean tolerateFeatureFound = false; for (String version : toleratesVersions) { String tolerateFeatureAndVersion = requireFeature.substring(0, requireFeature.lastIndexOf("-")) + "-" + version; if (allFeatures.containsKey(tolerateFeatureAndVersion)) { dependencies.add(allFeatures.get(tolerateFeatureAndVersion)); log("For feature " + feature.getSymbolicName() + ", found tolerated dependency " + tolerateFeatureAndVersion, LogLevel.DEBUG.getLevel()); tolerateFeatureFound = true; break; } } if (!tolerateFeatureFound) { throw new MavenRepoGeneratorException( "For feature " + feature.getSymbolicName() + ", cannot find required feature " + requireFeature + " or any of its tolerated versions: " + toleratesVersions); } } else { throw new MavenRepoGeneratorException( "For feature " + feature.getSymbolicName() + ", cannot find required feature " + requireFeature); } } } return dependencies; }
class class_name[name] begin[{] method[getRequiredFeatures, return_type[type[List]], modifier[public], parameter[feature, allFeatures]] begin[{] local_variable[type[List], dependencies] local_variable[type[Map], requiredFeaturesWithTolerates] if[binary_operation[member[.requiredFeaturesWithTolerates], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=toleratesVersions)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=requireFeature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=allFeatures, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=toleratesVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=requireFeature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=requiredFeaturesWithTolerates, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="For feature "), operandr=MethodInvocation(arguments=[], member=getSymbolicName, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", cannot find required feature "), operator=+), operandr=MemberReference(member=requireFeature, 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=MavenRepoGeneratorException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="For feature "), operandr=MethodInvocation(arguments=[], member=getSymbolicName, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", cannot find direct dependency to required feature "), operator=+), operandr=MemberReference(member=requireFeature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" so it must use tolerates list: "), operator=+), operandr=MemberReference(member=toleratesVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[], member=getLevel, postfix_operators=[], prefix_operators=[], qualifier=LogLevel.WARN, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=tolerateFeatureFound)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=requireFeature, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=requireFeature, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), operandr=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=tolerateFeatureAndVersion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tolerateFeatureAndVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=allFeatures, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=tolerateFeatureAndVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=allFeatures, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dependencies, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="For feature "), operandr=MethodInvocation(arguments=[], member=getSymbolicName, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", found tolerated dependency "), operator=+), operandr=MemberReference(member=tolerateFeatureAndVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[], member=getLevel, postfix_operators=[], prefix_operators=[], qualifier=LogLevel.DEBUG, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tolerateFeatureFound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=toleratesVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=version)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=tolerateFeatureFound, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="For feature "), operandr=MethodInvocation(arguments=[], member=getSymbolicName, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", cannot find required feature "), operator=+), operandr=MemberReference(member=requireFeature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" or any of its tolerated versions: "), operator=+), operandr=MemberReference(member=toleratesVersions, 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=MavenRepoGeneratorException, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=requireFeature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=allFeatures, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dependencies, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=requiredFeaturesWithTolerates, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=requireFeature)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] return[member[.dependencies]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[LibertyFeature] operator[>] identifier[getRequiredFeatures] operator[SEP] identifier[LibertyFeature] identifier[feature] , identifier[Map] operator[<] identifier[String] , identifier[LibertyFeature] operator[>] identifier[allFeatures] operator[SEP] Keyword[throws] identifier[MavenRepoGeneratorException] { identifier[List] operator[<] identifier[LibertyFeature] operator[>] identifier[dependencies] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[LibertyFeature] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[String] operator[>] operator[>] identifier[requiredFeaturesWithTolerates] operator[=] identifier[feature] operator[SEP] identifier[getRequiredFeaturesWithTolerates] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[requiredFeaturesWithTolerates] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[requireFeature] operator[:] identifier[requiredFeaturesWithTolerates] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Collection] operator[<] identifier[String] operator[>] identifier[toleratesVersions] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[allFeatures] operator[SEP] identifier[containsKey] operator[SEP] identifier[requireFeature] operator[SEP] operator[SEP] { identifier[dependencies] operator[SEP] identifier[add] operator[SEP] identifier[allFeatures] operator[SEP] identifier[get] operator[SEP] identifier[requireFeature] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[toleratesVersions] operator[=] identifier[requiredFeaturesWithTolerates] operator[SEP] identifier[get] operator[SEP] identifier[requireFeature] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[log] operator[SEP] literal[String] operator[+] identifier[feature] operator[SEP] identifier[getSymbolicName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[requireFeature] operator[+] literal[String] operator[+] identifier[toleratesVersions] , identifier[LogLevel] operator[SEP] identifier[WARN] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[tolerateFeatureFound] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[version] operator[:] identifier[toleratesVersions] operator[SEP] { identifier[String] identifier[tolerateFeatureAndVersion] operator[=] identifier[requireFeature] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[requireFeature] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[version] operator[SEP] Keyword[if] operator[SEP] identifier[allFeatures] operator[SEP] identifier[containsKey] operator[SEP] identifier[tolerateFeatureAndVersion] operator[SEP] operator[SEP] { identifier[dependencies] operator[SEP] identifier[add] operator[SEP] identifier[allFeatures] operator[SEP] identifier[get] operator[SEP] identifier[tolerateFeatureAndVersion] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] literal[String] operator[+] identifier[feature] operator[SEP] identifier[getSymbolicName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[tolerateFeatureAndVersion] , identifier[LogLevel] operator[SEP] identifier[DEBUG] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tolerateFeatureFound] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[tolerateFeatureFound] operator[SEP] { Keyword[throw] Keyword[new] identifier[MavenRepoGeneratorException] operator[SEP] literal[String] operator[+] identifier[feature] operator[SEP] identifier[getSymbolicName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[requireFeature] operator[+] literal[String] operator[+] identifier[toleratesVersions] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[MavenRepoGeneratorException] operator[SEP] literal[String] operator[+] identifier[feature] operator[SEP] identifier[getSymbolicName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[requireFeature] operator[SEP] operator[SEP] } } } Keyword[return] identifier[dependencies] operator[SEP] }
public static br_broker[] reboot(nitro_service client, br_broker[] resources) throws Exception { if(resources == null) throw new Exception("Null resource array"); if(resources.length == 1) return ((br_broker[]) resources[0].perform_operation(client, "reboot")); return ((br_broker[]) perform_operation_bulk_request(client, resources, "reboot")); }
class class_name[name] begin[{] method[reboot, return_type[type[br_broker]], modifier[public static], parameter[client, resources]] begin[{] if[binary_operation[member[.resources], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Null resource array")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[resources.length], ==, literal[1]]] begin[{] return[Cast(expression=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="reboot")], member=perform_operation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[None], name=br_broker, sub_type=None))] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="reboot")], member=perform_operation_bulk_request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=br_broker, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[br_broker] operator[SEP] operator[SEP] identifier[reboot] operator[SEP] identifier[nitro_service] identifier[client] , identifier[br_broker] operator[SEP] operator[SEP] identifier[resources] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[resources] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[br_broker] operator[SEP] operator[SEP] operator[SEP] identifier[resources] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[perform_operation] operator[SEP] identifier[client] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[br_broker] operator[SEP] operator[SEP] operator[SEP] identifier[perform_operation_bulk_request] operator[SEP] identifier[client] , identifier[resources] , literal[String] operator[SEP] operator[SEP] operator[SEP] }
public CmsProject createProject( String name, String description, String groupname, String managergroupname, CmsProject.CmsProjectType projecttype) throws CmsException { return m_securityManager.createProject(m_context, name, description, groupname, managergroupname, projecttype); }
class class_name[name] begin[{] method[createProject, return_type[type[CmsProject]], modifier[public], parameter[name, description, groupname, managergroupname, projecttype]] begin[{] return[call[m_securityManager.createProject, parameter[member[.m_context], member[.name], member[.description], member[.groupname], member[.managergroupname], member[.projecttype]]]] end[}] END[}]
Keyword[public] identifier[CmsProject] identifier[createProject] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[description] , identifier[String] identifier[groupname] , identifier[String] identifier[managergroupname] , identifier[CmsProject] operator[SEP] identifier[CmsProjectType] identifier[projecttype] operator[SEP] Keyword[throws] identifier[CmsException] { Keyword[return] identifier[m_securityManager] operator[SEP] identifier[createProject] operator[SEP] identifier[m_context] , identifier[name] , identifier[description] , identifier[groupname] , identifier[managergroupname] , identifier[projecttype] operator[SEP] operator[SEP] }
public final void close () throws IOException { LOGGER.info("Closing was requested."); for (Connection c : connections) { c.close(); } connections.clear(); // stop session task thread factory.closedSession(this); executor.shutdown(); }
class class_name[name] begin[{] method[close, return_type[void], modifier[final public], parameter[]] begin[{] call[LOGGER.info, parameter[literal["Closing was requested."]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=connections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None))), label=None) call[connections.clear, parameter[]] call[factory.closedSession, parameter[THIS[]]] call[executor.shutdown, parameter[]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Connection] identifier[c] operator[:] identifier[connections] operator[SEP] { identifier[c] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } identifier[connections] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[factory] operator[SEP] identifier[closedSession] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[executor] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] }
private static void closeConnection(Connection connection, GuacamoleStatus guacStatus) { closeConnection(connection, guacStatus.getGuacamoleStatusCode(), guacStatus.getWebSocketCode()); }
class class_name[name] begin[{] method[closeConnection, return_type[void], modifier[private static], parameter[connection, guacStatus]] begin[{] call[.closeConnection, parameter[member[.connection], call[guacStatus.getGuacamoleStatusCode, parameter[]], call[guacStatus.getWebSocketCode, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[closeConnection] operator[SEP] identifier[Connection] identifier[connection] , identifier[GuacamoleStatus] identifier[guacStatus] operator[SEP] { identifier[closeConnection] operator[SEP] identifier[connection] , identifier[guacStatus] operator[SEP] identifier[getGuacamoleStatusCode] operator[SEP] operator[SEP] , identifier[guacStatus] operator[SEP] identifier[getWebSocketCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void setupForExpandedWar() { webapp.setServerClasses(getServerClasses()); webapp.setDescriptor(webapp + "/WEB-INF/web.xml"); webapp.setResourceBase(resourceBase); webapp.setParentLoaderPriority(false); }
class class_name[name] begin[{] method[setupForExpandedWar, return_type[void], modifier[protected], parameter[]] begin[{] call[webapp.setServerClasses, parameter[call[.getServerClasses, parameter[]]]] call[webapp.setDescriptor, parameter[binary_operation[member[.webapp], +, literal["/WEB-INF/web.xml"]]]] call[webapp.setResourceBase, parameter[member[.resourceBase]]] call[webapp.setParentLoaderPriority, parameter[literal[false]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[setupForExpandedWar] operator[SEP] operator[SEP] { identifier[webapp] operator[SEP] identifier[setServerClasses] operator[SEP] identifier[getServerClasses] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[webapp] operator[SEP] identifier[setDescriptor] operator[SEP] identifier[webapp] operator[+] literal[String] operator[SEP] operator[SEP] identifier[webapp] operator[SEP] identifier[setResourceBase] operator[SEP] identifier[resourceBase] operator[SEP] operator[SEP] identifier[webapp] operator[SEP] identifier[setParentLoaderPriority] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
public static LocalDateRangeRandomizer aNewLocalDateRangeRandomizer(final LocalDate min, final LocalDate max, final long seed) { return new LocalDateRangeRandomizer(min, max, seed); }
class class_name[name] begin[{] method[aNewLocalDateRangeRandomizer, return_type[type[LocalDateRangeRandomizer]], modifier[public static], parameter[min, max, seed]] begin[{] return[ClassCreator(arguments=[MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seed, 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=LocalDateRangeRandomizer, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[LocalDateRangeRandomizer] identifier[aNewLocalDateRangeRandomizer] operator[SEP] Keyword[final] identifier[LocalDate] identifier[min] , Keyword[final] identifier[LocalDate] identifier[max] , Keyword[final] Keyword[long] identifier[seed] operator[SEP] { Keyword[return] Keyword[new] identifier[LocalDateRangeRandomizer] operator[SEP] identifier[min] , identifier[max] , identifier[seed] operator[SEP] operator[SEP] }
public final double getMeanDeviation() { double mean = getArithmeticMean(); double diffs = 0; for (int i = 0; i < dataSetSize; i++) { diffs += Math.abs(mean - dataSet[i]); } return diffs / dataSetSize; }
class class_name[name] begin[{] method[getMeanDeviation, return_type[type[double]], modifier[final public], parameter[]] begin[{] local_variable[type[double], mean] local_variable[type[double], diffs] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=diffs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=mean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dataSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dataSetSize, 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[binary_operation[member[.diffs], /, member[.dataSetSize]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[double] identifier[getMeanDeviation] operator[SEP] operator[SEP] { Keyword[double] identifier[mean] operator[=] identifier[getArithmeticMean] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[diffs] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dataSetSize] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[diffs] operator[+=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[mean] operator[-] identifier[dataSet] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[diffs] operator[/] identifier[dataSetSize] operator[SEP] }
protected static String join(final Collection<String> elements, final String joinSeparator) { String separator = ","; if (elements == null) { return null; } if (joinSeparator != null) { separator = joinSeparator; } StringBuilder buffer = new StringBuilder(); boolean isFirst = true; for (String element : elements) { if (!isFirst) { buffer.append(separator); } else { isFirst = false; } if (element != null) { buffer.append(element); } } return buffer.toString(); }
class class_name[name] begin[{] method[join, return_type[type[String]], modifier[static protected], parameter[elements, joinSeparator]] begin[{] local_variable[type[String], separator] if[binary_operation[member[.elements], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.joinSeparator], !=, literal[null]]] begin[{] assign[member[.separator], member[.joinSeparator]] else begin[{] None end[}] local_variable[type[StringBuilder], buffer] local_variable[type[boolean], isFirst] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=isFirst, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isFirst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[String] identifier[join] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[elements] , Keyword[final] identifier[String] identifier[joinSeparator] operator[SEP] { identifier[String] identifier[separator] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[elements] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[joinSeparator] operator[!=] Other[null] operator[SEP] { identifier[separator] operator[=] identifier[joinSeparator] operator[SEP] } identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isFirst] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[element] operator[:] identifier[elements] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isFirst] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[separator] operator[SEP] operator[SEP] } Keyword[else] { identifier[isFirst] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[element] operator[!=] Other[null] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[element] operator[SEP] operator[SEP] } } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }