code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
protected void initMessageObject() { try { if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) { // create a new message info object m_msgInfo = new CmsMessageInfo(); } else { // this is not the initial call, get the message info object from session m_msgInfo = (CmsMessageInfo)getDialogObject(); } } catch (Exception e) { // create a new message info object m_msgInfo = new CmsMessageInfo(); } m_msgInfo.setFrom(getCms().getRequestContext().getCurrentUser().getFullName()); m_msgInfo.setTo(getToNames()); }
class class_name[name] begin[{] method[initMessageObject, return_type[void], modifier[protected], parameter[]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParamAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=CmsStringUtil, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParamAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=CmsDialog.DIALOG_INITIAL, selectors=[], type_arguments=None), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_msgInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getDialogObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CmsMessageInfo, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_msgInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsMessageInfo, sub_type=None))), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_msgInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsMessageInfo, 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[m_msgInfo.setFrom, parameter[call[.getCms, parameter[]]]] call[m_msgInfo.setTo, parameter[call[.getToNames, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[initMessageObject] operator[SEP] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[getParamAction] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[CmsDialog] operator[SEP] identifier[DIALOG_INITIAL] operator[SEP] identifier[equals] operator[SEP] identifier[getParamAction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[m_msgInfo] operator[=] Keyword[new] identifier[CmsMessageInfo] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_msgInfo] operator[=] operator[SEP] identifier[CmsMessageInfo] operator[SEP] identifier[getDialogObject] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[m_msgInfo] operator[=] Keyword[new] identifier[CmsMessageInfo] operator[SEP] operator[SEP] operator[SEP] } identifier[m_msgInfo] operator[SEP] identifier[setFrom] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentUser] operator[SEP] operator[SEP] operator[SEP] identifier[getFullName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_msgInfo] operator[SEP] identifier[setTo] operator[SEP] identifier[getToNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void fillDetailField(CmsListItem item, String detailId) { StringBuffer html = new StringBuffer(); // search for the corresponding A_CmsSearchIndex: String idxFieldName = (String)item.get(LIST_COLUMN_NAME); List<CmsSearchField> fields = OpenCms.getSearchManager().getFieldConfiguration( m_paramFieldconfiguration).getFields(); Iterator<CmsSearchField> itFields = fields.iterator(); CmsLuceneField idxField = null; while (itFields.hasNext()) { CmsLuceneField curField = (CmsLuceneField)itFields.next(); if (curField.getName().equals(idxFieldName)) { idxField = curField; } } if (idxField != null) { html.append("<ul>\n"); Iterator<I_CmsSearchFieldMapping> itMappings = idxField.getMappings().iterator(); while (itMappings.hasNext()) { CmsSearchFieldMapping mapping = (CmsSearchFieldMapping)itMappings.next(); html.append(" <li>\n").append(" "); html.append(mapping.getType().toString()); if (CmsStringUtil.isNotEmpty(mapping.getParam())) { html.append("=").append(mapping.getParam()).append("\n"); } html.append(" </li>"); } html.append("</ul>\n"); } item.set(detailId, html.toString()); }
class class_name[name] begin[{] method[fillDetailField, return_type[void], modifier[private], parameter[item, detailId]] begin[{] local_variable[type[StringBuffer], html] local_variable[type[String], idxFieldName] local_variable[type[List], fields] local_variable[type[Iterator], itFields] local_variable[type[CmsLuceneField], idxField] while[call[itFields.hasNext, parameter[]]] begin[{] local_variable[type[CmsLuceneField], curField] if[call[curField.getName, parameter[]]] begin[{] assign[member[.idxField], member[.curField]] else begin[{] None end[}] end[}] if[binary_operation[member[.idxField], !=, literal[null]]] begin[{] call[html.append, parameter[literal["<ul>\n"]]] local_variable[type[Iterator], itMappings] while[call[itMappings.hasNext, parameter[]]] begin[{] local_variable[type[CmsSearchFieldMapping], mapping] call[html.append, parameter[literal[" <li>\n"]]] call[html.append, parameter[call[mapping.getType, parameter[]]]] if[call[CmsStringUtil.isNotEmpty, parameter[call[mapping.getParam, parameter[]]]]] begin[{] call[html.append, parameter[literal["="]]] else begin[{] None end[}] call[html.append, parameter[literal[" </li>"]]] end[}] call[html.append, parameter[literal["</ul>\n"]]] else begin[{] None end[}] call[item.set, parameter[member[.detailId], call[html.toString, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[fillDetailField] operator[SEP] identifier[CmsListItem] identifier[item] , identifier[String] identifier[detailId] operator[SEP] { identifier[StringBuffer] identifier[html] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[idxFieldName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[item] operator[SEP] identifier[get] operator[SEP] identifier[LIST_COLUMN_NAME] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsSearchField] operator[>] identifier[fields] operator[=] identifier[OpenCms] operator[SEP] identifier[getSearchManager] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldConfiguration] operator[SEP] identifier[m_paramFieldconfiguration] operator[SEP] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[CmsSearchField] operator[>] identifier[itFields] operator[=] identifier[fields] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[CmsLuceneField] identifier[idxField] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[itFields] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[CmsLuceneField] identifier[curField] operator[=] operator[SEP] identifier[CmsLuceneField] operator[SEP] identifier[itFields] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[curField] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[idxFieldName] operator[SEP] operator[SEP] { identifier[idxField] operator[=] identifier[curField] operator[SEP] } } Keyword[if] operator[SEP] identifier[idxField] operator[!=] Other[null] operator[SEP] { identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[I_CmsSearchFieldMapping] operator[>] identifier[itMappings] operator[=] identifier[idxField] operator[SEP] identifier[getMappings] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itMappings] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[CmsSearchFieldMapping] identifier[mapping] operator[=] operator[SEP] identifier[CmsSearchFieldMapping] operator[SEP] identifier[itMappings] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[mapping] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[mapping] operator[SEP] identifier[getParam] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[mapping] operator[SEP] identifier[getParam] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[item] operator[SEP] identifier[set] operator[SEP] identifier[detailId] , identifier[html] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.MPS__RG_LENGTH: setRGLength(RG_LENGTH_EDEFAULT); return; case AfplibPackage.MPS__RESERVED: setReserved(RESERVED_EDEFAULT); return; case AfplibPackage.MPS__FIXED_LENGTH_RG: getFixedLengthRG().clear(); return; } super.eUnset(featureID); }
class class_name[name] begin[{] method[eUnset, return_type[void], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=MPS__RG_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RG_LENGTH_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRGLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=MPS__RESERVED, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RESERVED_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setReserved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=MPS__FIXED_LENGTH_RG, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getFixedLengthRG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eUnset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eUnset] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[MPS__RG_LENGTH] operator[:] identifier[setRGLength] operator[SEP] identifier[RG_LENGTH_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[MPS__RESERVED] operator[:] identifier[setReserved] operator[SEP] identifier[RESERVED_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[MPS__FIXED_LENGTH_RG] operator[:] identifier[getFixedLengthRG] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eUnset] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
@QueueCallback({QueueCallbackType.EMPTY, QueueCallbackType.IDLE, QueueCallbackType.LIMIT}) public void process() { reactor.process(); time = timer.time(); }
class class_name[name] begin[{] method[process, return_type[void], modifier[public], parameter[]] begin[{] call[reactor.process, parameter[]] assign[member[.time], call[timer.time, parameter[]]] end[}] END[}]
annotation[@] identifier[QueueCallback] operator[SEP] { identifier[QueueCallbackType] operator[SEP] identifier[EMPTY] , identifier[QueueCallbackType] operator[SEP] identifier[IDLE] , identifier[QueueCallbackType] operator[SEP] identifier[LIMIT] } operator[SEP] Keyword[public] Keyword[void] identifier[process] operator[SEP] operator[SEP] { identifier[reactor] operator[SEP] identifier[process] operator[SEP] operator[SEP] operator[SEP] identifier[time] operator[=] identifier[timer] operator[SEP] identifier[time] operator[SEP] operator[SEP] operator[SEP] }
public boolean resultSubtype(Type t, Type s, Warner warner) { List<Type> tvars = t.getTypeArguments(); List<Type> svars = s.getTypeArguments(); Type tres = t.getReturnType(); Type sres = subst(s.getReturnType(), svars, tvars); return covariantReturnType(tres, sres, warner); }
class class_name[name] begin[{] method[resultSubtype, return_type[type[boolean]], modifier[public], parameter[t, s, warner]] begin[{] local_variable[type[List], tvars] local_variable[type[List], svars] local_variable[type[Type], tres] local_variable[type[Type], sres] return[call[.covariantReturnType, parameter[member[.tres], member[.sres], member[.warner]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[resultSubtype] operator[SEP] identifier[Type] identifier[t] , identifier[Type] identifier[s] , identifier[Warner] identifier[warner] operator[SEP] { identifier[List] operator[<] identifier[Type] operator[>] identifier[tvars] operator[=] identifier[t] operator[SEP] identifier[getTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Type] operator[>] identifier[svars] operator[=] identifier[s] operator[SEP] identifier[getTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[Type] identifier[tres] operator[=] identifier[t] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] identifier[Type] identifier[sres] operator[=] identifier[subst] operator[SEP] identifier[s] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] , identifier[svars] , identifier[tvars] operator[SEP] operator[SEP] Keyword[return] identifier[covariantReturnType] operator[SEP] identifier[tres] , identifier[sres] , identifier[warner] operator[SEP] operator[SEP] }
public final void mT__133() throws RecognitionException { try { int _type = T__133; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalSARL.g:119:8: ( 'super' ) // InternalSARL.g:119:10: 'super' { match("super"); } state.type = _type; state.channel = _channel; } finally { } }
class class_name[name] begin[{] method[mT__133, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=T__133, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="super")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[mT__133] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { Keyword[int] identifier[_type] operator[=] identifier[T__133] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP] } Keyword[finally] { } }
public static void init(final GwAPI gwAPI, GwFacade facade) throws Exception { //////// // Overall APIs /////// gwAPI.route(HttpMethods.GET,"/api",API.VOID,new GwCode(facade,"Document API", true) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.getAPI(trans,resp,gwAPI); switch(r.status) { case OK: resp.setStatus(HttpStatus.OK_200); break; default: context.error(trans,resp,r); } } }); //////// // Overall Examples /////// gwAPI.route(HttpMethods.GET,"/api/example/*",API.VOID,new GwCode(facade,"Document API", true) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { String pathInfo = req.getPathInfo(); int question = pathInfo.lastIndexOf('?'); pathInfo = pathInfo.substring(13, question<0?pathInfo.length():question);// IMPORTANT, this is size of "/api/example/" String nameOrContextType=Symm.base64noSplit.decode(pathInfo); // String param = req.getParameter("optional"); Result<Void> r = context.getAPIExample(trans,resp,nameOrContextType, question>=0 && "optional=true".equalsIgnoreCase(req.getPathInfo().substring(question+1)) ); switch(r.status) { case OK: resp.setStatus(HttpStatus.OK_200); break; default: context.error(trans,resp,r); } } }); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public static], parameter[gwAPI, facade]] begin[{] call[gwAPI.route, parameter[member[HttpMethods.GET], literal["/api"], member[API.VOID], ClassCreator(arguments=[MemberReference(member=facade, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Document API"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=trans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gwAPI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAPI, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=[], name=Result, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=['OK'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OK_200, postfix_operators=[], prefix_operators=[], qualifier=HttpStatus, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=trans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=trans, type=ReferenceType(arguments=None, dimensions=[], name=AuthzTrans, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=req, type=ReferenceType(arguments=None, dimensions=[], name=HttpServletRequest, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=resp, type=ReferenceType(arguments=None, dimensions=[], name=HttpServletResponse, 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=GwCode, sub_type=None))]] call[gwAPI.route, parameter[member[HttpMethods.GET], literal["/api/example/*"], member[API.VOID], ClassCreator(arguments=[MemberReference(member=facade, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Document API"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPathInfo, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), name=pathInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='?')], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=pathInfo, selectors=[], type_arguments=None), name=question)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pathInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=13), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=question, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MemberReference(member=question, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pathInfo, selectors=[], type_arguments=None))], member=substring, postfix_operators=[], prefix_operators=[], qualifier=pathInfo, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pathInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=Symm.base64noSplit, selectors=[], type_arguments=None), name=nameOrContextType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=trans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nameOrContextType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=question, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPathInfo, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=question, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="optional=true"), operator=&&)], member=getAPIExample, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=[], name=Result, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=['OK'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OK_200, postfix_operators=[], prefix_operators=[], qualifier=HttpStatus, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=trans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=trans, type=ReferenceType(arguments=None, dimensions=[], name=AuthzTrans, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=req, type=ReferenceType(arguments=None, dimensions=[], name=HttpServletRequest, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=resp, type=ReferenceType(arguments=None, dimensions=[], name=HttpServletResponse, 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=GwCode, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[init] operator[SEP] Keyword[final] identifier[GwAPI] identifier[gwAPI] , identifier[GwFacade] identifier[facade] operator[SEP] Keyword[throws] identifier[Exception] { identifier[gwAPI] operator[SEP] identifier[route] operator[SEP] identifier[HttpMethods] operator[SEP] identifier[GET] , literal[String] , identifier[API] operator[SEP] identifier[VOID] , Keyword[new] identifier[GwCode] operator[SEP] identifier[facade] , literal[String] , literal[boolean] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[AuthzTrans] identifier[trans] , identifier[HttpServletRequest] identifier[req] , identifier[HttpServletResponse] identifier[resp] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Result] operator[<] identifier[Void] operator[>] identifier[r] operator[=] identifier[context] operator[SEP] identifier[getAPI] operator[SEP] identifier[trans] , identifier[resp] , identifier[gwAPI] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[r] operator[SEP] identifier[status] operator[SEP] { Keyword[case] identifier[OK] operator[:] identifier[resp] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpStatus] operator[SEP] identifier[OK_200] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[context] operator[SEP] identifier[error] operator[SEP] identifier[trans] , identifier[resp] , identifier[r] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] identifier[gwAPI] operator[SEP] identifier[route] operator[SEP] identifier[HttpMethods] operator[SEP] identifier[GET] , literal[String] , identifier[API] operator[SEP] identifier[VOID] , Keyword[new] identifier[GwCode] operator[SEP] identifier[facade] , literal[String] , literal[boolean] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[AuthzTrans] identifier[trans] , identifier[HttpServletRequest] identifier[req] , identifier[HttpServletResponse] identifier[resp] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[pathInfo] operator[=] identifier[req] operator[SEP] identifier[getPathInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[question] operator[=] identifier[pathInfo] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pathInfo] operator[=] identifier[pathInfo] operator[SEP] identifier[substring] operator[SEP] Other[13] , identifier[question] operator[<] Other[0] operator[?] identifier[pathInfo] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[:] identifier[question] operator[SEP] operator[SEP] identifier[String] identifier[nameOrContextType] operator[=] identifier[Symm] operator[SEP] identifier[base64noSplit] operator[SEP] identifier[decode] operator[SEP] identifier[pathInfo] operator[SEP] operator[SEP] identifier[Result] operator[<] identifier[Void] operator[>] identifier[r] operator[=] identifier[context] operator[SEP] identifier[getAPIExample] operator[SEP] identifier[trans] , identifier[resp] , identifier[nameOrContextType] , identifier[question] operator[>=] Other[0] operator[&&] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[req] operator[SEP] identifier[getPathInfo] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[question] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[r] operator[SEP] identifier[status] operator[SEP] { Keyword[case] identifier[OK] operator[:] identifier[resp] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpStatus] operator[SEP] identifier[OK_200] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[context] operator[SEP] identifier[error] operator[SEP] identifier[trans] , identifier[resp] , identifier[r] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
@Override public float getFloat(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null ? flValue.asFloat() : 0.0F; }
class class_name[name] begin[{] method[getFloat, return_type[type[float]], modifier[public], parameter[index]] begin[{] call[.check, parameter[member[.index]]] local_variable[type[FLValue], flValue] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=flValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0F), if_true=MethodInvocation(arguments=[], member=asFloat, postfix_operators=[], prefix_operators=[], qualifier=flValue, selectors=[], type_arguments=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[float] identifier[getFloat] operator[SEP] Keyword[int] identifier[index] operator[SEP] { identifier[check] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[final] identifier[FLValue] identifier[flValue] operator[=] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[return] identifier[flValue] operator[!=] Other[null] operator[?] identifier[flValue] operator[SEP] identifier[asFloat] operator[SEP] operator[SEP] operator[:] literal[Float] operator[SEP] }
public void setMdcTags(Set<String> mdcTags) { if (mdcTags == null) { this.mdcTags = new HashSet<>(); } else { this.mdcTags = mdcTags; } }
class class_name[name] begin[{] method[setMdcTags, return_type[void], modifier[public], parameter[mdcTags]] begin[{] if[binary_operation[member[.mdcTags], ==, literal[null]]] begin[{] assign[THIS[member[None.mdcTags]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))] else begin[{] assign[THIS[member[None.mdcTags]], member[.mdcTags]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMdcTags] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[mdcTags] operator[SEP] { Keyword[if] operator[SEP] identifier[mdcTags] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[mdcTags] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[mdcTags] operator[=] identifier[mdcTags] operator[SEP] } }
@Override public Map getAttribute(String attributeName, Map defaultValue) { // TODO Auto-generated method stub return server.getAttribute(attributeName, defaultValue); }
class class_name[name] begin[{] method[getAttribute, return_type[type[Map]], modifier[public], parameter[attributeName, defaultValue]] begin[{] return[call[server.getAttribute, parameter[member[.attributeName], member[.defaultValue]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Map] identifier[getAttribute] operator[SEP] identifier[String] identifier[attributeName] , identifier[Map] identifier[defaultValue] operator[SEP] { Keyword[return] identifier[server] operator[SEP] identifier[getAttribute] operator[SEP] identifier[attributeName] , identifier[defaultValue] operator[SEP] operator[SEP] }
public int getNumberOfPoints(String monitorDir) throws IOException { if (!recoveryTimes.containsKey(monitorDir)) { return 0; } return recoveryTimes.get(monitorDir).getNumberOfPoints(); }
class class_name[name] begin[{] method[getNumberOfPoints, return_type[type[int]], modifier[public], parameter[monitorDir]] begin[{] if[call[recoveryTimes.containsKey, parameter[member[.monitorDir]]]] begin[{] return[literal[0]] else begin[{] None end[}] return[call[recoveryTimes.get, parameter[member[.monitorDir]]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getNumberOfPoints] operator[SEP] identifier[String] identifier[monitorDir] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[recoveryTimes] operator[SEP] identifier[containsKey] operator[SEP] identifier[monitorDir] operator[SEP] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[return] identifier[recoveryTimes] operator[SEP] identifier[get] operator[SEP] identifier[monitorDir] operator[SEP] operator[SEP] identifier[getNumberOfPoints] operator[SEP] operator[SEP] operator[SEP] }
private void organizeContent() { table = new TableBox(el, g, ctx); table.adoptParent(this); table.setStyle(style); for (Iterator<Box> it = nested.iterator(); it.hasNext(); ) { Box box = it.next(); if (box instanceof TableCaptionBox) { caption = (TableCaptionBox) box; } else if (box instanceof BlockBox && ((BlockBox) box).isPositioned()) { //positioned boxes are ignored } else //other elements belong to the table itself { table.addSubBox(box); box.setContainingBlockBox(table); box.setParent(table); it.remove(); endChild--; } } addSubBox(table); }
class class_name[name] begin[{] method[organizeContent, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.table], ClassCreator(arguments=[MemberReference(member=el, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ctx, 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=TableBox, sub_type=None))] call[table.adoptParent, parameter[THIS[]]] call[table.setStyle, parameter[member[.style]]] 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=box)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Box, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=box, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TableCaptionBox, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=box, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BlockBox, sub_type=None), operator=instanceof), operandr=Cast(expression=MemberReference(member=box, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BlockBox, sub_type=None)), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=box, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSubBox, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContainingBlockBox, postfix_operators=[], prefix_operators=[], qualifier=box, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=box, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=endChild, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=box, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TableCaptionBox, sub_type=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=iterator, postfix_operators=[], prefix_operators=[], qualifier=nested, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Box, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) call[.addSubBox, parameter[member[.table]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[organizeContent] operator[SEP] operator[SEP] { identifier[table] operator[=] Keyword[new] identifier[TableBox] operator[SEP] identifier[el] , identifier[g] , identifier[ctx] operator[SEP] operator[SEP] identifier[table] operator[SEP] identifier[adoptParent] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[table] operator[SEP] identifier[setStyle] operator[SEP] identifier[style] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Box] operator[>] identifier[it] operator[=] identifier[nested] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Box] identifier[box] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[box] Keyword[instanceof] identifier[TableCaptionBox] operator[SEP] { identifier[caption] operator[=] operator[SEP] identifier[TableCaptionBox] operator[SEP] identifier[box] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[box] Keyword[instanceof] identifier[BlockBox] operator[&&] operator[SEP] operator[SEP] identifier[BlockBox] operator[SEP] identifier[box] operator[SEP] operator[SEP] identifier[isPositioned] operator[SEP] operator[SEP] operator[SEP] { } Keyword[else] { identifier[table] operator[SEP] identifier[addSubBox] operator[SEP] identifier[box] operator[SEP] operator[SEP] identifier[box] operator[SEP] identifier[setContainingBlockBox] operator[SEP] identifier[table] operator[SEP] operator[SEP] identifier[box] operator[SEP] identifier[setParent] operator[SEP] identifier[table] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[endChild] operator[--] operator[SEP] } } identifier[addSubBox] operator[SEP] identifier[table] operator[SEP] operator[SEP] }
public void setRequestProperty(String key, String value) { if (connected) throw new IllegalStateException("Already connected"); if (key == null) throw new NullPointerException ("key is null"); if (requests == null) requests = new MessageHeader(); requests.set(key, value); }
class class_name[name] begin[{] method[setRequestProperty, return_type[void], modifier[public], parameter[key, value]] begin[{] if[member[.connected]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Already connected")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.key], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="key is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.requests], ==, literal[null]]] begin[{] assign[member[.requests], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MessageHeader, sub_type=None))] else begin[{] None end[}] call[requests.set, parameter[member[.key], member[.value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setRequestProperty] operator[SEP] identifier[String] identifier[key] , identifier[String] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[connected] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[requests] operator[==] Other[null] operator[SEP] identifier[requests] operator[=] Keyword[new] identifier[MessageHeader] operator[SEP] operator[SEP] operator[SEP] identifier[requests] operator[SEP] identifier[set] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] }
public static SentryClient getStoredClient() { if (storedClient != null) { return storedClient; } synchronized (Sentry.class) { if (storedClient == null && !autoInitAttempted.get()) { // attempt initialization by using configuration found in the environment autoInitAttempted.set(true); init(); } } return storedClient; }
class class_name[name] begin[{] method[getStoredClient, return_type[type[SentryClient]], modifier[public static], parameter[]] begin[{] if[binary_operation[member[.storedClient], !=, literal[null]]] begin[{] return[member[.storedClient]] else begin[{] None end[}] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Sentry, sub_type=None))] BEGIN[{] if[binary_operation[binary_operation[member[.storedClient], ==, literal[null]], &&, call[autoInitAttempted.get, parameter[]]]] begin[{] call[autoInitAttempted.set, parameter[literal[true]]] call[.init, parameter[]] else begin[{] None end[}] END[}] return[member[.storedClient]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SentryClient] identifier[getStoredClient] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[storedClient] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[storedClient] operator[SEP] } Keyword[synchronized] operator[SEP] identifier[Sentry] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[storedClient] operator[==] Other[null] operator[&&] operator[!] identifier[autoInitAttempted] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] { identifier[autoInitAttempted] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[init] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[storedClient] operator[SEP] }
@Override public void doFilter(ServletRequest servReq, ServletResponse servRes, FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpReq = (HttpServletRequest) servReq; final HttpServletResponse httpRes = (HttpServletResponse) servRes; final String requestPath = extractActionRequestPath(httpReq); handleForced404NotFoundRouting(httpReq, requestPath); if (!isRoutingTarget(httpReq, requestPath)) { // e.g. foo.jsp, foo.do, foo.js, foo.css chain.doFilter(httpReq, httpRes); return; } // no extension here (may be LastaFlute URL) final ActionPathResolver resolver = getRequestManager().getActionPathResolver(); try { final String contextPath = extractContextPath(httpReq); final ActionFoundPathHandler handler = createActionFoundPathHandler(httpReq, httpRes, contextPath); // (#to_action) if (resolver.handleActionPath(requestPath, handler)) { // #to_action return; } } catch (Exception e) { if (e instanceof IOException) { throw (IOException) e; } else if (e instanceof ServletException) { throw (ServletException) e; } else if (e instanceof RuntimeException) { throw (RuntimeException) e; } else { // no way, just in case throw new IllegalStateException("*No way", e); } } // no routing here showExpectedRouting(requestPath, resolver); // for developer handleNoRoutingRequest(httpReq, requestPath); // 404 if it needs chain.doFilter(servReq, servRes); // to next filter outside LastaFlute }
class class_name[name] begin[{] method[doFilter, return_type[void], modifier[public], parameter[servReq, servRes, chain]] begin[{] local_variable[type[HttpServletRequest], httpReq] local_variable[type[HttpServletResponse], httpRes] local_variable[type[String], requestPath] call[.handleForced404NotFoundRouting, parameter[member[.httpReq], member[.requestPath]]] if[call[.isRoutingTarget, parameter[member[.httpReq], member[.requestPath]]]] begin[{] call[chain.doFilter, parameter[member[.httpReq], member[.httpRes]]] return[None] else begin[{] None end[}] local_variable[type[ActionPathResolver], resolver] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=httpReq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractContextPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=contextPath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=httpReq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpRes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contextPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createActionFoundPathHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=handler)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ActionFoundPathHandler, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=requestPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleActionPath, postfix_operators=[], prefix_operators=[], qualifier=resolver, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)]))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ServletException, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*No way"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)]), label=None, 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=RuntimeException, sub_type=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=ServletException, sub_type=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=IOException, 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[.showExpectedRouting, parameter[member[.requestPath], member[.resolver]]] call[.handleNoRoutingRequest, parameter[member[.httpReq], member[.requestPath]]] call[chain.doFilter, parameter[member[.servReq], member[.servRes]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doFilter] operator[SEP] identifier[ServletRequest] identifier[servReq] , identifier[ServletResponse] identifier[servRes] , identifier[FilterChain] identifier[chain] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { Keyword[final] identifier[HttpServletRequest] identifier[httpReq] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[servReq] operator[SEP] Keyword[final] identifier[HttpServletResponse] identifier[httpRes] operator[=] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[servRes] operator[SEP] Keyword[final] identifier[String] identifier[requestPath] operator[=] identifier[extractActionRequestPath] operator[SEP] identifier[httpReq] operator[SEP] operator[SEP] identifier[handleForced404NotFoundRouting] operator[SEP] identifier[httpReq] , identifier[requestPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isRoutingTarget] operator[SEP] identifier[httpReq] , identifier[requestPath] operator[SEP] operator[SEP] { identifier[chain] operator[SEP] identifier[doFilter] operator[SEP] identifier[httpReq] , identifier[httpRes] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[ActionPathResolver] identifier[resolver] operator[=] identifier[getRequestManager] operator[SEP] operator[SEP] operator[SEP] identifier[getActionPathResolver] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[String] identifier[contextPath] operator[=] identifier[extractContextPath] operator[SEP] identifier[httpReq] operator[SEP] operator[SEP] Keyword[final] identifier[ActionFoundPathHandler] identifier[handler] operator[=] identifier[createActionFoundPathHandler] operator[SEP] identifier[httpReq] , identifier[httpRes] , identifier[contextPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolver] operator[SEP] identifier[handleActionPath] operator[SEP] identifier[requestPath] , identifier[handler] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[IOException] operator[SEP] { Keyword[throw] operator[SEP] identifier[IOException] operator[SEP] identifier[e] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[ServletException] operator[SEP] { Keyword[throw] operator[SEP] identifier[ServletException] operator[SEP] identifier[e] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[RuntimeException] operator[SEP] { Keyword[throw] operator[SEP] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } identifier[showExpectedRouting] operator[SEP] identifier[requestPath] , identifier[resolver] operator[SEP] operator[SEP] identifier[handleNoRoutingRequest] operator[SEP] identifier[httpReq] , identifier[requestPath] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[doFilter] operator[SEP] identifier[servReq] , identifier[servRes] operator[SEP] operator[SEP] }
public ServiceFuture<List<ResourceHealthMetadataInner>> listBySiteSlotAsync(final String resourceGroupName, final String name, final String slot, final ListOperationCallback<ResourceHealthMetadataInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listBySiteSlotSinglePageAsync(resourceGroupName, name, slot), new Func1<String, Observable<ServiceResponse<Page<ResourceHealthMetadataInner>>>>() { @Override public Observable<ServiceResponse<Page<ResourceHealthMetadataInner>>> call(String nextPageLink) { return listBySiteSlotNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
class class_name[name] begin[{] method[listBySiteSlotAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, name, slot, serviceCallback]] begin[{] return[call[AzureServiceFuture.fromPageResponse, parameter[call[.listBySiteSlotSinglePageAsync, parameter[member[.resourceGroupName], member[.name], member[.slot]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listBySiteSlotNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceHealthMetadataInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceHealthMetadataInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None))], dimensions=None, name=Func1, sub_type=None)), member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[ResourceHealthMetadataInner] operator[>] operator[>] identifier[listBySiteSlotAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[slot] , Keyword[final] identifier[ListOperationCallback] operator[<] identifier[ResourceHealthMetadataInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[listBySiteSlotSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[name] , identifier[slot] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[ResourceHealthMetadataInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[ResourceHealthMetadataInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listBySiteSlotNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] } } , identifier[serviceCallback] operator[SEP] operator[SEP] }
public static void writeShortLittleEndian(IO.WritableByteStream io, short value) throws IOException { io.write((byte)(value & 0xFF)); io.write((byte)((value >> 8) & 0xFF)); }
class class_name[name] begin[{] method[writeShortLittleEndian, return_type[void], modifier[public static], parameter[io, value]] begin[{] call[io.write, parameter[Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))]] call[io.write, parameter[Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeShortLittleEndian] operator[SEP] identifier[IO] operator[SEP] identifier[WritableByteStream] identifier[io] , Keyword[short] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { identifier[io] operator[SEP] identifier[write] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[io] operator[SEP] identifier[write] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] }
public static LogFactory init() { try { LogFactory theLogFactory = (LogFactory) EPackage.Registry.INSTANCE.getEFactory(LogPackage.eNS_URI); if (theLogFactory != null) { return theLogFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new LogFactoryImpl(); }
class class_name[name] begin[{] method[init, return_type[type[LogFactory]], modifier[public static], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=LogPackage, selectors=[])], member=getEFactory, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=LogFactory, sub_type=None)), name=theLogFactory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LogFactory, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=theLogFactory, 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=[ReturnStatement(expression=MemberReference(member=theLogFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=EcorePlugin.INSTANCE, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['Exception']))], finally_block=None, label=None, resources=None) return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LogFactoryImpl, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[LogFactory] identifier[init] operator[SEP] operator[SEP] { Keyword[try] { identifier[LogFactory] identifier[theLogFactory] operator[=] operator[SEP] identifier[LogFactory] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEFactory] operator[SEP] identifier[LogPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[theLogFactory] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[theLogFactory] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[exception] operator[SEP] { identifier[EcorePlugin] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[log] operator[SEP] identifier[exception] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[LogFactoryImpl] operator[SEP] operator[SEP] operator[SEP] }
Rectangle getBoxSize(String boxName) { PdfRectangle r = (PdfRectangle)thisBoxSize.get(boxName); if (r != null) return r.getRectangle(); return null; }
class class_name[name] begin[{] method[getBoxSize, return_type[type[Rectangle]], modifier[default], parameter[boxName]] begin[{] local_variable[type[PdfRectangle], r] if[binary_operation[member[.r], !=, literal[null]]] begin[{] return[call[r.getRectangle, parameter[]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
identifier[Rectangle] identifier[getBoxSize] operator[SEP] identifier[String] identifier[boxName] operator[SEP] { identifier[PdfRectangle] identifier[r] operator[=] operator[SEP] identifier[PdfRectangle] operator[SEP] identifier[thisBoxSize] operator[SEP] identifier[get] operator[SEP] identifier[boxName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[r] operator[SEP] identifier[getRectangle] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public static <E> Stream<Stream<E>> group( Stream<E> stream, Predicate<? super E> open, boolean openingElementIncluded, Predicate<? super E> close, boolean closingElementIncluded) { Objects.requireNonNull(stream); Objects.requireNonNull(open); Objects.requireNonNull(close); GroupingOnGatingSpliterator<E> spliterator = GroupingOnGatingSpliterator.of(stream.spliterator(), open, openingElementIncluded, close, closingElementIncluded); return StreamSupport.stream(spliterator, stream.isParallel()).onClose(stream::close); }
class class_name[name] begin[{] method[group, return_type[type[Stream]], modifier[public static], parameter[stream, open, openingElementIncluded, close, closingElementIncluded]] begin[{] call[Objects.requireNonNull, parameter[member[.stream]]] call[Objects.requireNonNull, parameter[member[.open]]] call[Objects.requireNonNull, parameter[member[.close]]] local_variable[type[GroupingOnGatingSpliterator], spliterator] return[call[StreamSupport.stream, parameter[member[.spliterator], call[stream.isParallel, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[Stream] operator[<] identifier[Stream] operator[<] identifier[E] operator[>] operator[>] identifier[group] operator[SEP] identifier[Stream] operator[<] identifier[E] operator[>] identifier[stream] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[E] operator[>] identifier[open] , Keyword[boolean] identifier[openingElementIncluded] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[E] operator[>] identifier[close] , Keyword[boolean] identifier[closingElementIncluded] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[stream] operator[SEP] operator[SEP] identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[open] operator[SEP] operator[SEP] identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[close] operator[SEP] operator[SEP] identifier[GroupingOnGatingSpliterator] operator[<] identifier[E] operator[>] identifier[spliterator] operator[=] identifier[GroupingOnGatingSpliterator] operator[SEP] identifier[of] operator[SEP] identifier[stream] operator[SEP] identifier[spliterator] operator[SEP] operator[SEP] , identifier[open] , identifier[openingElementIncluded] , identifier[close] , identifier[closingElementIncluded] operator[SEP] operator[SEP] Keyword[return] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[spliterator] , identifier[stream] operator[SEP] identifier[isParallel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[onClose] operator[SEP] identifier[stream] operator[::] identifier[close] operator[SEP] operator[SEP] }
public void onEndJob (@Nullable final String sJobID, @Nonnull final ESuccess eExecSucess, @Nonnull final LongRunningJobResult aResult) { ValueEnforcer.notNull (eExecSucess, "ExecSuccess"); ValueEnforcer.notNull (aResult, "Result"); // Remove from running job list final LongRunningJobData aJobData = m_aRWLock.writeLocked ( () -> { final LongRunningJobData ret = m_aRunningJobs.remove (sJobID); if (ret == null) throw new IllegalArgumentException ("Illegal job ID '" + sJobID + "' passed!"); // End the job - inside the writeLock ret.onJobEnd (eExecSucess, aResult); return ret; }); // Remember it m_aResultMgr.addResult (aJobData); }
class class_name[name] begin[{] method[onEndJob, return_type[void], modifier[public], parameter[sJobID, eExecSucess, aResult]] begin[{] call[ValueEnforcer.notNull, parameter[member[.eExecSucess], literal["ExecSuccess"]]] call[ValueEnforcer.notNull, parameter[member[.aResult], literal["Result"]]] local_variable[type[LongRunningJobData], aJobData] call[m_aResultMgr.addResult, parameter[member[.aJobData]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[onEndJob] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[sJobID] , annotation[@] identifier[Nonnull] Keyword[final] identifier[ESuccess] identifier[eExecSucess] , annotation[@] identifier[Nonnull] Keyword[final] identifier[LongRunningJobResult] identifier[aResult] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[eExecSucess] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aResult] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[LongRunningJobData] identifier[aJobData] operator[=] identifier[m_aRWLock] operator[SEP] identifier[writeLocked] operator[SEP] operator[SEP] operator[SEP] operator[->] { Keyword[final] identifier[LongRunningJobData] identifier[ret] operator[=] identifier[m_aRunningJobs] operator[SEP] identifier[remove] operator[SEP] identifier[sJobID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[sJobID] operator[+] literal[String] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[onJobEnd] operator[SEP] identifier[eExecSucess] , identifier[aResult] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] } operator[SEP] operator[SEP] identifier[m_aResultMgr] operator[SEP] identifier[addResult] operator[SEP] identifier[aJobData] operator[SEP] operator[SEP] }
public String removeNamespace(String entityType) { String str = entityType.replace('\'', ' ').trim(); int index = str.indexOf(":"); if (index > 0) str = str.substring(index + 1); return str; }
class class_name[name] begin[{] method[removeNamespace, return_type[type[String]], modifier[public], parameter[entityType]] begin[{] local_variable[type[String], str] local_variable[type[int], index] if[binary_operation[member[.index], >, literal[0]]] begin[{] assign[member[.str], call[str.substring, parameter[binary_operation[member[.index], +, literal[1]]]]] else begin[{] None end[}] return[member[.str]] end[}] END[}]
Keyword[public] identifier[String] identifier[removeNamespace] operator[SEP] identifier[String] identifier[entityType] operator[SEP] { identifier[String] identifier[str] operator[=] identifier[entityType] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[str] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>] Other[0] operator[SEP] identifier[str] operator[=] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[str] operator[SEP] }
private String expandAffix(String pattern, StringBuffer buffer) { buffer.setLength(0); for (int i=0; i<pattern.length(); ) { char c = pattern.charAt(i++); if (c == QUOTE) { c = pattern.charAt(i++); switch (c) { case CURRENCY_SIGN: if (i<pattern.length() && pattern.charAt(i) == CURRENCY_SIGN) { ++i; buffer.append(symbols.getInternationalCurrencySymbol()); } else { buffer.append(symbols.getCurrencySymbol()); } continue; case PATTERN_PERCENT: c = symbols.getPercent(); break; case PATTERN_PER_MILLE: c = symbols.getPerMill(); break; case PATTERN_MINUS: c = symbols.getMinusSign(); break; } } buffer.append(c); } return buffer.toString(); }
class class_name[name] begin[{] method[expandAffix, return_type[type[String]], modifier[private], parameter[pattern, buffer]] begin[{] call[buffer.setLength, parameter[literal[0]]] 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=pattern, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=QUOTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None)), label=None), SwitchStatement(cases=[SwitchStatementCase(case=['CURRENCY_SIGN'], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operator=<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operandr=MemberReference(member=CURRENCY_SIGN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCurrencySymbol, postfix_operators=[], prefix_operators=[], qualifier=symbols, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInternationalCurrencySymbol, postfix_operators=[], prefix_operators=[], qualifier=symbols, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])), ContinueStatement(goto=None, label=None)]), SwitchStatementCase(case=['PATTERN_PERCENT'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPercent, postfix_operators=[], prefix_operators=[], qualifier=symbols, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PATTERN_PER_MILLE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPerMill, postfix_operators=[], prefix_operators=[], qualifier=symbols, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PATTERN_MINUS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMinusSign, postfix_operators=[], prefix_operators=[], qualifier=symbols, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pattern, 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=None), label=None) return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[expandAffix] operator[SEP] identifier[String] identifier[pattern] , identifier[StringBuffer] identifier[buffer] operator[SEP] { identifier[buffer] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[QUOTE] operator[SEP] { identifier[c] operator[=] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[++] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[c] operator[SEP] { Keyword[case] identifier[CURRENCY_SIGN] operator[:] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[CURRENCY_SIGN] operator[SEP] { operator[++] identifier[i] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[symbols] operator[SEP] identifier[getInternationalCurrencySymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[symbols] operator[SEP] identifier[getCurrencySymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[continue] operator[SEP] Keyword[case] identifier[PATTERN_PERCENT] operator[:] identifier[c] operator[=] identifier[symbols] operator[SEP] identifier[getPercent] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PATTERN_PER_MILLE] operator[:] identifier[c] operator[=] identifier[symbols] operator[SEP] identifier[getPerMill] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PATTERN_MINUS] operator[:] identifier[c] operator[=] identifier[symbols] operator[SEP] identifier[getMinusSign] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static boolean exampleHasAtLeastOneCriteriaCheck(Object parameter) { if (parameter != null) { try { if (parameter instanceof Example) { List<Example.Criteria> criteriaList = ((Example) parameter).getOredCriteria(); if (criteriaList != null && criteriaList.size() > 0) { return true; } } else { Method getter = parameter.getClass().getDeclaredMethod("getOredCriteria"); Object list = getter.invoke(parameter); if(list != null && list instanceof List && ((List) list).size() > 0){ return true; } } } catch (Exception e) { throw new MapperException(SAFE_DELETE_ERROR, e); } } throw new MapperException(SAFE_DELETE_EXCEPTION); }
class class_name[name] begin[{] method[exampleHasAtLeastOneCriteriaCheck, return_type[type[boolean]], modifier[public static], parameter[parameter]] begin[{] if[binary_operation[member[.parameter], !=, literal[null]]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Example, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getOredCriteria")], member=getDeclaredMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=getter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=getter, selectors=[], type_arguments=None), name=list)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None), operator=instanceof), operator=&&), operandr=BinaryOperation(operandl=Cast(expression=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Example, sub_type=None)), name=criteriaList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Example, sub_type=ReferenceType(arguments=None, dimensions=None, name=Criteria, sub_type=None)))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=criteriaList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=criteriaList, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=SAFE_DELETE_ERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=MapperException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=SAFE_DELETE_EXCEPTION, 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=MapperException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[exampleHasAtLeastOneCriteriaCheck] operator[SEP] identifier[Object] identifier[parameter] operator[SEP] { Keyword[if] operator[SEP] identifier[parameter] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[parameter] Keyword[instanceof] identifier[Example] operator[SEP] { identifier[List] operator[<] identifier[Example] operator[SEP] identifier[Criteria] operator[>] identifier[criteriaList] operator[=] operator[SEP] operator[SEP] identifier[Example] operator[SEP] identifier[parameter] operator[SEP] operator[SEP] identifier[getOredCriteria] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteriaList] operator[!=] Other[null] operator[&&] identifier[criteriaList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] { identifier[Method] identifier[getter] operator[=] identifier[parameter] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[list] operator[=] identifier[getter] operator[SEP] identifier[invoke] operator[SEP] identifier[parameter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[!=] Other[null] operator[&&] identifier[list] Keyword[instanceof] identifier[List] operator[&&] operator[SEP] operator[SEP] identifier[List] operator[SEP] identifier[list] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MapperException] operator[SEP] identifier[SAFE_DELETE_ERROR] , identifier[e] operator[SEP] operator[SEP] } } Keyword[throw] Keyword[new] identifier[MapperException] operator[SEP] identifier[SAFE_DELETE_EXCEPTION] operator[SEP] operator[SEP] }
@Bind(id = "exporterServices", specification = ExporterService.class, aggregate = true, optional = true) void bindExporterService(ServiceReference<ExporterService> serviceReference) { synchronized (lock) { try { exportersManager.add(serviceReference); } catch (InvalidFilterException invalidFilterException) { LOG.error("The ServiceProperty \"" + TARGET_FILTER_PROPERTY + "\" of the ExporterService " + bundleContext.getService(serviceReference) + " doesn't provides a valid Filter." + " To be used, it must provides a correct \"" + TARGET_FILTER_PROPERTY + "\" ServiceProperty.", invalidFilterException ); return; } if (!exportersManager.matched(serviceReference)) { return; } LOG.debug(linkerName + " : Bind the ExporterService " + exportersManager.getDeclarationBinder(serviceReference) + " with filter " + exportersManager.getTargetFilter(serviceReference)); exportersManager.createLinks(serviceReference); } }
class class_name[name] begin[{] method[bindExporterService, return_type[void], modifier[default], parameter[serviceReference]] begin[{] SYNCHRONIZED[member[.lock]] BEGIN[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=serviceReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=exportersManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The ServiceProperty \""), operandr=MemberReference(member=TARGET_FILTER_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" of the ExporterService "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=serviceReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getService, postfix_operators=[], prefix_operators=[], qualifier=bundleContext, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" doesn't provides a valid Filter."), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" To be used, it must provides a correct \""), operator=+), operandr=MemberReference(member=TARGET_FILTER_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" ServiceProperty."), operator=+), MemberReference(member=invalidFilterException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=invalidFilterException, types=['InvalidFilterException']))], finally_block=None, label=None, resources=None) if[call[exportersManager.matched, parameter[member[.serviceReference]]]] begin[{] return[None] else begin[{] None end[}] call[LOG.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[member[.linkerName], +, literal[" : Bind the ExporterService "]], +, call[exportersManager.getDeclarationBinder, parameter[member[.serviceReference]]]], +, literal[" with filter "]], +, call[exportersManager.getTargetFilter, parameter[member[.serviceReference]]]]]] call[exportersManager.createLinks, parameter[member[.serviceReference]]] END[}] end[}] END[}]
annotation[@] identifier[Bind] operator[SEP] identifier[id] operator[=] literal[String] , identifier[specification] operator[=] identifier[ExporterService] operator[SEP] Keyword[class] , identifier[aggregate] operator[=] literal[boolean] , identifier[optional] operator[=] literal[boolean] operator[SEP] Keyword[void] identifier[bindExporterService] operator[SEP] identifier[ServiceReference] operator[<] identifier[ExporterService] operator[>] identifier[serviceReference] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { Keyword[try] { identifier[exportersManager] operator[SEP] identifier[add] operator[SEP] identifier[serviceReference] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvalidFilterException] identifier[invalidFilterException] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[TARGET_FILTER_PROPERTY] operator[+] literal[String] operator[+] identifier[bundleContext] operator[SEP] identifier[getService] operator[SEP] identifier[serviceReference] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[TARGET_FILTER_PROPERTY] operator[+] literal[String] , identifier[invalidFilterException] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[exportersManager] operator[SEP] identifier[matched] operator[SEP] identifier[serviceReference] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[linkerName] operator[+] literal[String] operator[+] identifier[exportersManager] operator[SEP] identifier[getDeclarationBinder] operator[SEP] identifier[serviceReference] operator[SEP] operator[+] literal[String] operator[+] identifier[exportersManager] operator[SEP] identifier[getTargetFilter] operator[SEP] identifier[serviceReference] operator[SEP] operator[SEP] operator[SEP] identifier[exportersManager] operator[SEP] identifier[createLinks] operator[SEP] identifier[serviceReference] operator[SEP] operator[SEP] } }
private IGroupMember igetGroupMember(String key, Class<?> type) throws GroupsException { return compositeGroupService.getGroupMember(key, type); }
class class_name[name] begin[{] method[igetGroupMember, return_type[type[IGroupMember]], modifier[private], parameter[key, type]] begin[{] return[call[compositeGroupService.getGroupMember, parameter[member[.key], member[.type]]]] end[}] END[}]
Keyword[private] identifier[IGroupMember] identifier[igetGroupMember] operator[SEP] identifier[String] identifier[key] , identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] Keyword[throws] identifier[GroupsException] { Keyword[return] identifier[compositeGroupService] operator[SEP] identifier[getGroupMember] operator[SEP] identifier[key] , identifier[type] operator[SEP] operator[SEP] }
public void buildColorTable(int[] inPixels, int[] table) { int count = inPixels.length; maximumColors = table.length; for (int i = 0; i < count; i++) { insertColor(inPixels[i]); if (colors > reduceColors) reduceTree(reduceColors); } if (colors > maximumColors) reduceTree(maximumColors); buildColorTable(root, table, 0); }
class class_name[name] begin[{] method[buildColorTable, return_type[void], modifier[public], parameter[inPixels, table]] begin[{] local_variable[type[int], count] assign[member[.maximumColors], member[table.length]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inPixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=insertColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=colors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=reduceColors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=reduceColors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reduceTree, 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=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.colors], >, member[.maximumColors]]] begin[{] call[.reduceTree, parameter[member[.maximumColors]]] else begin[{] None end[}] call[.buildColorTable, parameter[member[.root], member[.table], literal[0]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[buildColorTable] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[inPixels] , Keyword[int] operator[SEP] operator[SEP] identifier[table] operator[SEP] { Keyword[int] identifier[count] operator[=] identifier[inPixels] operator[SEP] identifier[length] operator[SEP] identifier[maximumColors] operator[=] identifier[table] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[insertColor] operator[SEP] identifier[inPixels] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colors] operator[>] identifier[reduceColors] operator[SEP] identifier[reduceTree] operator[SEP] identifier[reduceColors] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[colors] operator[>] identifier[maximumColors] operator[SEP] identifier[reduceTree] operator[SEP] identifier[maximumColors] operator[SEP] operator[SEP] identifier[buildColorTable] operator[SEP] identifier[root] , identifier[table] , Other[0] operator[SEP] operator[SEP] }
public Vector4f set(Vector2fc v, float z, float w) { return set(v.x(), v.y(), z, w); }
class class_name[name] begin[{] method[set, return_type[type[Vector4f]], modifier[public], parameter[v, z, w]] begin[{] return[call[.set, parameter[call[v.x, parameter[]], call[v.y, parameter[]], member[.z], member[.w]]]] end[}] END[}]
Keyword[public] identifier[Vector4f] identifier[set] operator[SEP] identifier[Vector2fc] identifier[v] , Keyword[float] identifier[z] , Keyword[float] identifier[w] operator[SEP] { Keyword[return] identifier[set] operator[SEP] identifier[v] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[v] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[z] , identifier[w] operator[SEP] operator[SEP] }
@Override public void visitCode(Code obj) { try { Method m = getMethod(); Type retType = m.getReturnType(); if ("Ljava/lang/Boolean;".equals(retType.getSignature())) { stack.resetForMethodEntry(this); super.visitCode(obj); } } catch (StopOpcodeParsingException e) { // if the method was already reported } }
class class_name[name] begin[{] method[visitCode, return_type[void], modifier[public], parameter[obj]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getReturnType, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), name=retType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSignature, postfix_operators=[], prefix_operators=[], qualifier=retType, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="Ljava/lang/Boolean;"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=resetForMethodEntry, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None), StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitCode, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['StopOpcodeParsingException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitCode] operator[SEP] identifier[Code] identifier[obj] operator[SEP] { Keyword[try] { identifier[Method] identifier[m] operator[=] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[Type] identifier[retType] operator[=] identifier[m] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[retType] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[stack] operator[SEP] identifier[resetForMethodEntry] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[visitCode] operator[SEP] identifier[obj] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[StopOpcodeParsingException] identifier[e] operator[SEP] { } }
protected void setURI() { // set _uri StringBuffer buf = new StringBuffer(); // ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? if (_scheme != null) { buf.append(_scheme); buf.append(':'); } if (_is_net_path) { buf.append("//"); if (_authority != null) { // has_authority buf.append(_authority); } } if (_opaque != null && _is_opaque_part) { buf.append(_opaque); } else if (_path != null) { // _is_hier_part or _is_relativeURI if (_path.length != 0) { buf.append(_path); } } if (_query != null) { // has_query buf.append('?'); buf.append(_query); } // ignore the fragment identifier _uri = buf.toString().toCharArray(); hash = 0; }
class class_name[name] begin[{] method[setURI, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[StringBuffer], buf] if[binary_operation[member[._scheme], !=, literal[null]]] begin[{] call[buf.append, parameter[member[._scheme]]] call[buf.append, parameter[literal[':']]] else begin[{] None end[}] if[member[._is_net_path]] begin[{] call[buf.append, parameter[literal["//"]]] if[binary_operation[member[._authority], !=, literal[null]]] begin[{] call[buf.append, parameter[member[._authority]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[._opaque], !=, literal[null]], &&, member[._is_opaque_part]]] begin[{] call[buf.append, parameter[member[._opaque]]] else begin[{] if[binary_operation[member[._path], !=, literal[null]]] begin[{] if[binary_operation[member[_path.length], !=, literal[0]]] begin[{] call[buf.append, parameter[member[._path]]] else begin[{] None end[}] else begin[{] None end[}] end[}] if[binary_operation[member[._query], !=, literal[null]]] begin[{] call[buf.append, parameter[literal['?']]] call[buf.append, parameter[member[._query]]] else begin[{] None end[}] assign[member[._uri], call[buf.toString, parameter[]]] assign[member[.hash], literal[0]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[setURI] operator[SEP] operator[SEP] { identifier[StringBuffer] identifier[buf] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_scheme] operator[!=] Other[null] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[_scheme] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[_is_net_path] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_authority] operator[!=] Other[null] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[_authority] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[_opaque] operator[!=] Other[null] operator[&&] identifier[_is_opaque_part] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[_opaque] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[_path] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[_path] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[_path] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[_query] operator[!=] Other[null] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[_query] operator[SEP] operator[SEP] } identifier[_uri] operator[=] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[hash] operator[=] Other[0] operator[SEP] }
public static JusFragment newInstance() { JusFragment fragment = new JusFragment(); Bundle args = new Bundle(); fragment.setArguments(args); return fragment; }
class class_name[name] begin[{] method[newInstance, return_type[type[JusFragment]], modifier[public static], parameter[]] begin[{] local_variable[type[JusFragment], fragment] local_variable[type[Bundle], args] call[fragment.setArguments, parameter[member[.args]]] return[member[.fragment]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JusFragment] identifier[newInstance] operator[SEP] operator[SEP] { identifier[JusFragment] identifier[fragment] operator[=] Keyword[new] identifier[JusFragment] operator[SEP] operator[SEP] operator[SEP] identifier[Bundle] identifier[args] operator[=] Keyword[new] identifier[Bundle] operator[SEP] operator[SEP] operator[SEP] identifier[fragment] operator[SEP] identifier[setArguments] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[fragment] operator[SEP] }
public ThreddsMetadata getInheritableMetadata() { ThreddsMetadata tmi = (ThreddsMetadata) get(Dataset.ThreddsMetadataInheritable); if (tmi == null) { tmi = new ThreddsMetadata(); put(Dataset.ThreddsMetadataInheritable, tmi); } return tmi; }
class class_name[name] begin[{] method[getInheritableMetadata, return_type[type[ThreddsMetadata]], modifier[public], parameter[]] begin[{] local_variable[type[ThreddsMetadata], tmi] if[binary_operation[member[.tmi], ==, literal[null]]] begin[{] assign[member[.tmi], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThreddsMetadata, sub_type=None))] call[.put, parameter[member[Dataset.ThreddsMetadataInheritable], member[.tmi]]] else begin[{] None end[}] return[member[.tmi]] end[}] END[}]
Keyword[public] identifier[ThreddsMetadata] identifier[getInheritableMetadata] operator[SEP] operator[SEP] { identifier[ThreddsMetadata] identifier[tmi] operator[=] operator[SEP] identifier[ThreddsMetadata] operator[SEP] identifier[get] operator[SEP] identifier[Dataset] operator[SEP] identifier[ThreddsMetadataInheritable] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmi] operator[==] Other[null] operator[SEP] { identifier[tmi] operator[=] Keyword[new] identifier[ThreddsMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[Dataset] operator[SEP] identifier[ThreddsMetadataInheritable] , identifier[tmi] operator[SEP] operator[SEP] } Keyword[return] identifier[tmi] operator[SEP] }
public static long[] symmetry(IAtomContainer container, int[][] g) { return new Canon(g, basicInvariants(container, g), terminalHydrogens(container, g), true).symmetry; }
class class_name[name] begin[{] method[symmetry, return_type[type[long]], modifier[public static], parameter[container, g]] begin[{] return[ClassCreator(arguments=[MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=basicInvariants, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=terminalHydrogens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=symmetry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type=ReferenceType(arguments=None, dimensions=None, name=Canon, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] operator[SEP] operator[SEP] identifier[symmetry] operator[SEP] identifier[IAtomContainer] identifier[container] , Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[g] operator[SEP] { Keyword[return] Keyword[new] identifier[Canon] operator[SEP] identifier[g] , identifier[basicInvariants] operator[SEP] identifier[container] , identifier[g] operator[SEP] , identifier[terminalHydrogens] operator[SEP] identifier[container] , identifier[g] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[symmetry] operator[SEP] }
public void addListener(ChangeListener listener) { synchronized (hsChangeListeners) { hsChangeListeners.add(listener); changeListenerCount = hsChangeListeners.size(); bUpdateChangeListener = true; } }
class class_name[name] begin[{] method[addListener, return_type[void], modifier[public], parameter[listener]] begin[{] SYNCHRONIZED[member[.hsChangeListeners]] BEGIN[{] call[hsChangeListeners.add, parameter[member[.listener]]] assign[member[.changeListenerCount], call[hsChangeListeners.size, parameter[]]] assign[member[.bUpdateChangeListener], literal[true]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addListener] operator[SEP] identifier[ChangeListener] identifier[listener] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[hsChangeListeners] operator[SEP] { identifier[hsChangeListeners] operator[SEP] identifier[add] operator[SEP] identifier[listener] operator[SEP] operator[SEP] identifier[changeListenerCount] operator[=] identifier[hsChangeListeners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[bUpdateChangeListener] operator[=] literal[boolean] operator[SEP] } }
public App withCustomRules(CustomRule... customRules) { if (this.customRules == null) { setCustomRules(new java.util.ArrayList<CustomRule>(customRules.length)); } for (CustomRule ele : customRules) { this.customRules.add(ele); } return this; }
class class_name[name] begin[{] method[withCustomRules, return_type[type[App]], modifier[public], parameter[customRules]] begin[{] if[binary_operation[THIS[member[None.customRules]], ==, literal[null]]] begin[{] call[.setCustomRules, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=customRules, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CustomRule, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=customRules, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=customRules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CustomRule, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[App] identifier[withCustomRules] operator[SEP] identifier[CustomRule] operator[...] identifier[customRules] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[customRules] operator[==] Other[null] operator[SEP] { identifier[setCustomRules] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[CustomRule] operator[>] operator[SEP] identifier[customRules] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[CustomRule] identifier[ele] operator[:] identifier[customRules] operator[SEP] { Keyword[this] operator[SEP] identifier[customRules] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public boolean isOwner(String name) { boolean result = false; if (aclList.containsKey(name)) { result = aclList.get(name).isOwner(); } return result; }
class class_name[name] begin[{] method[isOwner, return_type[type[boolean]], modifier[public], parameter[name]] begin[{] local_variable[type[boolean], result] if[call[aclList.containsKey, parameter[member[.name]]]] begin[{] assign[member[.result], call[aclList.get, parameter[member[.name]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isOwner] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[aclList] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[aclList] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[isOwner] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static void main(String[] args) { try { VBucketInfo vbi[] = new VBucketInfo[1024]; for (int ii = 0; ii < vbi.length; ++ii) { vbi[ii] = new VBucketInfo(); } MemcachedServer server = new MemcachedServer(null, null, 11211, vbi, false); for (VBucketInfo aVbi : vbi) { aVbi.setOwner(server); } server.run(); } catch (IOException e) { Logger.getLogger(MemcachedServer.class.getName()).log(Level.SEVERE, "Fatal error! failed to create socket: ", e); } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VBucketInfo, sub_type=None)), name=vbi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VBucketInfo, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=vbi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VBucketInfo, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=vbi, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11211), MemberReference(member=vbi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MemcachedServer, sub_type=None)), name=server)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MemcachedServer, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOwner, postfix_operators=[], prefix_operators=[], qualifier=aVbi, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=vbi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aVbi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VBucketInfo, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=server, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MemcachedServer, sub_type=None))], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fatal error! failed to create socket: "), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[try] { identifier[VBucketInfo] identifier[vbi] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[VBucketInfo] operator[SEP] Other[1024] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] operator[SEP] identifier[ii] operator[<] identifier[vbi] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[ii] operator[SEP] { identifier[vbi] operator[SEP] identifier[ii] operator[SEP] operator[=] Keyword[new] identifier[VBucketInfo] operator[SEP] operator[SEP] operator[SEP] } identifier[MemcachedServer] identifier[server] operator[=] Keyword[new] identifier[MemcachedServer] operator[SEP] Other[null] , Other[null] , Other[11211] , identifier[vbi] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[VBucketInfo] identifier[aVbi] operator[:] identifier[vbi] operator[SEP] { identifier[aVbi] operator[SEP] identifier[setOwner] operator[SEP] identifier[server] operator[SEP] operator[SEP] } identifier[server] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] identifier[MemcachedServer] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[e] operator[SEP] operator[SEP] } }
private User resolveUser(RequestContext requestContext, User[] users) { User resolvedUser = null; for (User user : users) { if (user != null && resolvedUser != null && !user.getId().equals(resolvedUser.getId())) { Messages messages = Messages.getInstance(); Locale locale = requestContext.getRequest().getLocale(); throw new SmvcRuntimeException(EdelfoiStatusCode.LOGIN_MULTIPLE_ACCOUNTS, messages.getText(locale, "exception.1023.loginMultipleAccounts")); } else { resolvedUser = user == null ? resolvedUser : user; } } return resolvedUser; }
class class_name[name] begin[{] method[resolveUser, return_type[type[User]], modifier[private], parameter[requestContext, users]] begin[{] local_variable[type[User], resolvedUser] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=resolvedUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=['!'], qualifier=user, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=resolvedUser, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=resolvedUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=resolvedUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None), name=messages)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Messages, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRequest, postfix_operators=[], prefix_operators=[], qualifier=requestContext, selectors=[MethodInvocation(arguments=[], member=getLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=locale)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=LOGIN_MULTIPLE_ACCOUNTS, postfix_operators=[], prefix_operators=[], qualifier=EdelfoiStatusCode, selectors=[]), MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="exception.1023.loginMultipleAccounts")], member=getText, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SmvcRuntimeException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=users, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=user)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=User, sub_type=None))), label=None) return[member[.resolvedUser]] end[}] END[}]
Keyword[private] identifier[User] identifier[resolveUser] operator[SEP] identifier[RequestContext] identifier[requestContext] , identifier[User] operator[SEP] operator[SEP] identifier[users] operator[SEP] { identifier[User] identifier[resolvedUser] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[User] identifier[user] operator[:] identifier[users] operator[SEP] { Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[&&] identifier[resolvedUser] operator[!=] Other[null] operator[&&] operator[!] identifier[user] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[resolvedUser] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Messages] identifier[messages] operator[=] identifier[Messages] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[Locale] identifier[locale] operator[=] identifier[requestContext] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SmvcRuntimeException] operator[SEP] identifier[EdelfoiStatusCode] operator[SEP] identifier[LOGIN_MULTIPLE_ACCOUNTS] , identifier[messages] operator[SEP] identifier[getText] operator[SEP] identifier[locale] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[resolvedUser] operator[=] identifier[user] operator[==] Other[null] operator[?] identifier[resolvedUser] operator[:] identifier[user] operator[SEP] } } Keyword[return] identifier[resolvedUser] operator[SEP] }
public String beginConsumption(HttpServletRequest req, String identityUrl, String returnToUrl, String realm) throws OpenIDConsumerException { List<DiscoveryInformation> discoveries; try { discoveries = consumerManager.discover(identityUrl); } catch (DiscoveryException e) { throw new OpenIDConsumerException("Error during discovery", e); } DiscoveryInformation information = consumerManager.associate(discoveries); req.getSession().setAttribute(DISCOVERY_INFO_KEY, information); AuthRequest authReq; try { authReq = consumerManager.authenticate(information, returnToUrl, realm); logger.debug("Looking up attribute fetch list for identifier: " + identityUrl); List<OpenIDAttribute> attributesToFetch = attributesToFetchFactory .createAttributeList(identityUrl); if (!attributesToFetch.isEmpty()) { req.getSession().setAttribute(ATTRIBUTE_LIST_KEY, attributesToFetch); FetchRequest fetchRequest = FetchRequest.createFetchRequest(); for (OpenIDAttribute attr : attributesToFetch) { if (logger.isDebugEnabled()) { logger.debug("Adding attribute " + attr.getType() + " to fetch request"); } fetchRequest.addAttribute(attr.getName(), attr.getType(), attr.isRequired(), attr.getCount()); } authReq.addExtension(fetchRequest); } } catch (MessageException e) { throw new OpenIDConsumerException( "Error processing ConsumerManager authentication", e); } catch (ConsumerException e) { throw new OpenIDConsumerException( "Error processing ConsumerManager authentication", e); } return authReq.getDestinationUrl(true); }
class class_name[name] begin[{] method[beginConsumption, return_type[type[String]], modifier[public], parameter[req, identityUrl, returnToUrl, realm]] begin[{] local_variable[type[List], discoveries] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=discoveries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=identityUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=discover, postfix_operators=[], prefix_operators=[], qualifier=consumerManager, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during discovery"), 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=OpenIDConsumerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DiscoveryException']))], finally_block=None, label=None, resources=None) local_variable[type[DiscoveryInformation], information] call[req.getSession, parameter[]] local_variable[type[AuthRequest], authReq] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=authReq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=information, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=returnToUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=realm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=authenticate, postfix_operators=[], prefix_operators=[], qualifier=consumerManager, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Looking up attribute fetch list for identifier: "), operandr=MemberReference(member=identityUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=identityUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createAttributeList, postfix_operators=[], prefix_operators=[], qualifier=attributesToFetchFactory, selectors=[], type_arguments=None), name=attributesToFetch)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=OpenIDAttribute, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=attributesToFetch, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getSession, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[MethodInvocation(arguments=[MemberReference(member=ATTRIBUTE_LIST_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributesToFetch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=createFetchRequest, postfix_operators=[], prefix_operators=[], qualifier=FetchRequest, selectors=[], type_arguments=None), name=fetchRequest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FetchRequest, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding attribute "), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to fetch request"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isRequired, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None)], member=addAttribute, postfix_operators=[], prefix_operators=[], qualifier=fetchRequest, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=attributesToFetch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OpenIDAttribute, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fetchRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addExtension, postfix_operators=[], prefix_operators=[], qualifier=authReq, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error processing ConsumerManager authentication"), 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=OpenIDConsumerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MessageException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error processing ConsumerManager authentication"), 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=OpenIDConsumerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ConsumerException']))], finally_block=None, label=None, resources=None) return[call[authReq.getDestinationUrl, parameter[literal[true]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[beginConsumption] operator[SEP] identifier[HttpServletRequest] identifier[req] , identifier[String] identifier[identityUrl] , identifier[String] identifier[returnToUrl] , identifier[String] identifier[realm] operator[SEP] Keyword[throws] identifier[OpenIDConsumerException] { identifier[List] operator[<] identifier[DiscoveryInformation] operator[>] identifier[discoveries] operator[SEP] Keyword[try] { identifier[discoveries] operator[=] identifier[consumerManager] operator[SEP] identifier[discover] operator[SEP] identifier[identityUrl] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DiscoveryException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[OpenIDConsumerException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[DiscoveryInformation] identifier[information] operator[=] identifier[consumerManager] operator[SEP] identifier[associate] operator[SEP] identifier[discoveries] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[DISCOVERY_INFO_KEY] , identifier[information] operator[SEP] operator[SEP] identifier[AuthRequest] identifier[authReq] operator[SEP] Keyword[try] { identifier[authReq] operator[=] identifier[consumerManager] operator[SEP] identifier[authenticate] operator[SEP] identifier[information] , identifier[returnToUrl] , identifier[realm] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[identityUrl] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[OpenIDAttribute] operator[>] identifier[attributesToFetch] operator[=] identifier[attributesToFetchFactory] operator[SEP] identifier[createAttributeList] operator[SEP] identifier[identityUrl] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attributesToFetch] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[req] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[ATTRIBUTE_LIST_KEY] , identifier[attributesToFetch] operator[SEP] operator[SEP] identifier[FetchRequest] identifier[fetchRequest] operator[=] identifier[FetchRequest] operator[SEP] identifier[createFetchRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OpenIDAttribute] identifier[attr] operator[:] identifier[attributesToFetch] 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[attr] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[fetchRequest] operator[SEP] identifier[addAttribute] operator[SEP] identifier[attr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[attr] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[attr] operator[SEP] identifier[isRequired] operator[SEP] operator[SEP] , identifier[attr] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[authReq] operator[SEP] identifier[addExtension] operator[SEP] identifier[fetchRequest] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[MessageException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[OpenIDConsumerException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ConsumerException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[OpenIDConsumerException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[authReq] operator[SEP] identifier[getDestinationUrl] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
@Deprecated public void setClassesDir(File classesDir) { if (classesDir == null) throw new NullPointerException("classesDir"); getLogger().warn("The 'classesDir' property on the '{}' task is deprecated. Use 'classesDirs' of type FileCollection instead!", getName()); setClassesDirs(getProject().files(classesDir)); }
class class_name[name] begin[{] method[setClassesDir, return_type[void], modifier[public], parameter[classesDir]] begin[{] if[binary_operation[member[.classesDir], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="classesDir")], 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[}] call[.getLogger, parameter[]] call[.setClassesDirs, parameter[call[.getProject, parameter[]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[void] identifier[setClassesDir] operator[SEP] identifier[File] identifier[classesDir] operator[SEP] { Keyword[if] operator[SEP] identifier[classesDir] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setClassesDirs] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] identifier[files] operator[SEP] identifier[classesDir] operator[SEP] operator[SEP] operator[SEP] }
@Deprecated public static String getWebJarConfig(Map.Entry<String, String> webJar) { String webJarConfig = ""; // read the webJarConfigs String filename = WebJarAssetLocator.WEBJARS_PATH_PREFIX + "/" + webJar.getKey() + "/" + webJar.getValue() + "/" + "webjars-requirejs.js"; InputStream inputStream = RequireJS.class.getClassLoader().getResourceAsStream(filename); if (inputStream != null) { log.warn("The " + webJar.getKey() + " " + webJar.getValue() + " WebJar is using the legacy RequireJS config.\n" + "Please try a new version of the WebJar or file or file an issue at:\n" + "http://github.com/webjars/" + webJar.getKey() + "/issues/new"); StringBuilder webJarConfigBuilder = new StringBuilder("// WebJar config for " + webJar.getKey() + "\n"); BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); try { String line; while ((line = br.readLine()) != null) { webJarConfigBuilder.append(line).append("\n"); } webJarConfig = webJarConfigBuilder.toString(); } catch (IOException e) { log.warn(filename + " could not be read."); } finally { try { br.close(); } catch (IOException e) { // really? } } } return webJarConfig; }
class class_name[name] begin[{] method[getWebJarConfig, return_type[type[String]], modifier[public static], parameter[webJar]] begin[{] local_variable[type[String], webJarConfig] local_variable[type[String], filename] local_variable[type[InputStream], inputStream] if[binary_operation[member[.inputStream], !=, literal[null]]] begin[{] call[log.warn, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["The "], +, call[webJar.getKey, parameter[]]], +, literal[" "]], +, call[webJar.getValue, parameter[]]], +, literal[" WebJar is using the legacy RequireJS config.\n"]], +, literal["Please try a new version of the WebJar or file or file an issue at:\n"]], +, literal["http://github.com/webjars/"]], +, call[webJar.getKey, parameter[]]], +, literal["/issues/new"]]]] local_variable[type[StringBuilder], webJarConfigBuilder] local_variable[type[BufferedReader], br] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=webJarConfigBuilder, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=webJarConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=webJarConfigBuilder, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" could not be read."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)], label=None, resources=None) else begin[{] None end[}] return[member[.webJarConfig]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[String] identifier[getWebJarConfig] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[webJar] operator[SEP] { identifier[String] identifier[webJarConfig] operator[=] literal[String] operator[SEP] identifier[String] identifier[filename] operator[=] identifier[WebJarAssetLocator] operator[SEP] identifier[WEBJARS_PATH_PREFIX] operator[+] literal[String] operator[+] identifier[webJar] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[webJar] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] identifier[InputStream] identifier[inputStream] operator[=] identifier[RequireJS] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inputStream] operator[!=] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[webJar] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[webJar] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[webJar] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[webJarConfigBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[+] identifier[webJar] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[br] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[webJarConfigBuilder] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[webJarConfig] operator[=] identifier[webJarConfigBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[filename] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { identifier[br] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { } } } Keyword[return] identifier[webJarConfig] operator[SEP] }
@Override public BatchWriteItemResult batchWriteItem(BatchWriteItemRequest request) { request = beforeClientExecution(request); return executeBatchWriteItem(request); }
class class_name[name] begin[{] method[batchWriteItem, return_type[type[BatchWriteItemResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeBatchWriteItem, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BatchWriteItemResult] identifier[batchWriteItem] operator[SEP] identifier[BatchWriteItemRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeBatchWriteItem] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void marshall(ApplySchemaRequest applySchemaRequest, ProtocolMarshaller protocolMarshaller) { if (applySchemaRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(applySchemaRequest.getPublishedSchemaArn(), PUBLISHEDSCHEMAARN_BINDING); protocolMarshaller.marshall(applySchemaRequest.getDirectoryArn(), DIRECTORYARN_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[applySchemaRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.applySchemaRequest], ==, 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=getPublishedSchemaArn, postfix_operators=[], prefix_operators=[], qualifier=applySchemaRequest, selectors=[], type_arguments=None), MemberReference(member=PUBLISHEDSCHEMAARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDirectoryArn, postfix_operators=[], prefix_operators=[], qualifier=applySchemaRequest, selectors=[], type_arguments=None), MemberReference(member=DIRECTORYARN_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[ApplySchemaRequest] identifier[applySchemaRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[applySchemaRequest] 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[applySchemaRequest] operator[SEP] identifier[getPublishedSchemaArn] operator[SEP] operator[SEP] , identifier[PUBLISHEDSCHEMAARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[applySchemaRequest] operator[SEP] identifier[getDirectoryArn] operator[SEP] operator[SEP] , identifier[DIRECTORYARN_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 Configuration getConfiguration() throws Exception { Configuration result = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.executeConfigurationProviders(); result = manager.getConfiguration(); } finally { System.setProperty("user.dir", userDir); } } return result; }
class class_name[name] begin[{] method[getConfiguration, return_type[type[Configuration]], modifier[public], parameter[]] begin[{] local_variable[type[Configuration], result] if[call[cfg.exists, parameter[]]] begin[{] assign[member[.userDir], ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user.dir")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] call[System.setProperty, parameter[literal["user.dir"], call[options.getExecutionDirectory, parameter[]]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=cfg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigurationManager, sub_type=None)), name=manager)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationManager, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=executeConfigurationProviders, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user.dir"), MemberReference(member=userDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Configuration] identifier[getConfiguration] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Configuration] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[cfg] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[userDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[options] operator[SEP] identifier[getExecutionDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[ConfigurationManager] identifier[manager] operator[=] Keyword[new] identifier[ConfigurationManager] operator[SEP] identifier[cfg] , literal[boolean] operator[SEP] operator[SEP] identifier[manager] operator[SEP] identifier[executeConfigurationProviders] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[manager] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[userDir] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public void transfer_1_to_3(double x1 , double y1 , double x2 , double y2 , Point3D_F64 p3) { // Adjust the observations so that they lie on the epipolar lines exactly adjuster.process(F21,x1,y1,x2,y2,pa,pb); GeometryMath_F64.mult(F21,pa,la); // line through pb and perpendicular to la l.x = la.y; l.y = -la.x; l.z = -pb.x*la.y + pb.y*la.x; MultiViewOps.transfer_1_to_3(tensor,pa,l,p3); }
class class_name[name] begin[{] method[transfer_1_to_3, return_type[void], modifier[public], parameter[x1, y1, x2, y2, p3]] begin[{] call[adjuster.process, parameter[member[.F21], member[.x1], member[.y1], member[.x2], member[.y2], member[.pa], member[.pb]]] call[GeometryMath_F64.mult, parameter[member[.F21], member[.pa], member[.la]]] assign[member[l.x], member[la.y]] assign[member[l.y], member[la.x]] assign[member[l.z], binary_operation[binary_operation[member[pb.x], *, member[la.y]], +, binary_operation[member[pb.y], *, member[la.x]]]] call[MultiViewOps.transfer_1_to_3, parameter[member[.tensor], member[.pa], member[.l], member[.p3]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[transfer_1_to_3] operator[SEP] Keyword[double] identifier[x1] , Keyword[double] identifier[y1] , Keyword[double] identifier[x2] , Keyword[double] identifier[y2] , identifier[Point3D_F64] identifier[p3] operator[SEP] { identifier[adjuster] operator[SEP] identifier[process] operator[SEP] identifier[F21] , identifier[x1] , identifier[y1] , identifier[x2] , identifier[y2] , identifier[pa] , identifier[pb] operator[SEP] operator[SEP] identifier[GeometryMath_F64] operator[SEP] identifier[mult] operator[SEP] identifier[F21] , identifier[pa] , identifier[la] operator[SEP] operator[SEP] identifier[l] operator[SEP] identifier[x] operator[=] identifier[la] operator[SEP] identifier[y] operator[SEP] identifier[l] operator[SEP] identifier[y] operator[=] operator[-] identifier[la] operator[SEP] identifier[x] operator[SEP] identifier[l] operator[SEP] identifier[z] operator[=] operator[-] identifier[pb] operator[SEP] identifier[x] operator[*] identifier[la] operator[SEP] identifier[y] operator[+] identifier[pb] operator[SEP] identifier[y] operator[*] identifier[la] operator[SEP] identifier[x] operator[SEP] identifier[MultiViewOps] operator[SEP] identifier[transfer_1_to_3] operator[SEP] identifier[tensor] , identifier[pa] , identifier[l] , identifier[p3] operator[SEP] operator[SEP] }
public long getLWMScn(String source) { WaterMarkEntry e = sourceWaterMarkMap.get(source); return (e == null) ? 0 : e.getLWMScn(); }
class class_name[name] begin[{] method[getLWMScn, return_type[type[long]], modifier[public], parameter[source]] begin[{] local_variable[type[WaterMarkEntry], e] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getLWMScn, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))] end[}] END[}]
Keyword[public] Keyword[long] identifier[getLWMScn] operator[SEP] identifier[String] identifier[source] operator[SEP] { identifier[WaterMarkEntry] identifier[e] operator[=] identifier[sourceWaterMarkMap] operator[SEP] identifier[get] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[e] operator[==] Other[null] operator[SEP] operator[?] Other[0] operator[:] identifier[e] operator[SEP] identifier[getLWMScn] operator[SEP] operator[SEP] operator[SEP] }
private HttpUriRequest addDefaultHeaders(HttpUriRequest req) { req.addHeader(HttpHeaders.ACCEPT, "*/*"); req.addHeader(HttpHeaders.CONTENT_TYPE, "application/json"); return req; }
class class_name[name] begin[{] method[addDefaultHeaders, return_type[type[HttpUriRequest]], modifier[private], parameter[req]] begin[{] call[req.addHeader, parameter[member[HttpHeaders.ACCEPT], literal["*/*"]]] call[req.addHeader, parameter[member[HttpHeaders.CONTENT_TYPE], literal["application/json"]]] return[member[.req]] end[}] END[}]
Keyword[private] identifier[HttpUriRequest] identifier[addDefaultHeaders] operator[SEP] identifier[HttpUriRequest] identifier[req] operator[SEP] { identifier[req] operator[SEP] identifier[addHeader] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[ACCEPT] , literal[String] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[addHeader] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[CONTENT_TYPE] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[req] operator[SEP] }
public void init() { if (incNestingCount() > 1) { return; } SessionFactory sf = getSessionFactory(); if (sf == null) { return; } if (TransactionSynchronizationManager.hasResource(sf)) { // Do not modify the Session: just set the participate flag. setParticipate(true); } else { setParticipate(false); LOG.debug("Opening single Hibernate session in HibernatePersistenceContextInterceptor"); Session session = getSession(); HibernateRuntimeUtils.enableDynamicFilterEnablerIfPresent(sf, session); TransactionSynchronizationManager.bindResource(sf, new SessionHolder(session)); } }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[.incNestingCount, parameter[]], >, literal[1]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[SessionFactory], sf] if[binary_operation[member[.sf], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[call[TransactionSynchronizationManager.hasResource, parameter[member[.sf]]]] begin[{] call[.setParticipate, parameter[literal[true]]] else begin[{] call[.setParticipate, parameter[literal[false]]] call[LOG.debug, parameter[literal["Opening single Hibernate session in HibernatePersistenceContextInterceptor"]]] local_variable[type[Session], session] call[HibernateRuntimeUtils.enableDynamicFilterEnablerIfPresent, parameter[member[.sf], member[.session]]] call[TransactionSynchronizationManager.bindResource, parameter[member[.sf], ClassCreator(arguments=[MemberReference(member=session, 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=SessionHolder, sub_type=None))]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[incNestingCount] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { Keyword[return] operator[SEP] } identifier[SessionFactory] identifier[sf] operator[=] identifier[getSessionFactory] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sf] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[TransactionSynchronizationManager] operator[SEP] identifier[hasResource] operator[SEP] identifier[sf] operator[SEP] operator[SEP] { identifier[setParticipate] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[setParticipate] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Session] identifier[session] operator[=] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[HibernateRuntimeUtils] operator[SEP] identifier[enableDynamicFilterEnablerIfPresent] operator[SEP] identifier[sf] , identifier[session] operator[SEP] operator[SEP] identifier[TransactionSynchronizationManager] operator[SEP] identifier[bindResource] operator[SEP] identifier[sf] , Keyword[new] identifier[SessionHolder] operator[SEP] identifier[session] operator[SEP] operator[SEP] operator[SEP] } }
private String readAttributeAsString(Attribute attribute) throws UnsupportedKerasConfigurationException { synchronized (Hdf5Archive.LOCK_OBJECT) { VarLenType vl = attribute.getVarLenType(); int bufferSizeMult = 1; String s = null; /* TODO: find a less hacky way to do this. * Reading variable length strings (from attributes) is a giant * pain. There does not appear to be any way to determine the * length of the string in advance, so we use a hack: choose a * buffer size and read the config, increase buffer and repeat * until the buffer ends with \u0000 */ while (true) { byte[] attrBuffer = new byte[bufferSizeMult * 2000]; BytePointer attrPointer = new BytePointer(attrBuffer); attribute.read(vl, attrPointer); attrPointer.get(attrBuffer); s = new String(attrBuffer); if (s.endsWith("\u0000")) { s = s.replace("\u0000", ""); break; } bufferSizeMult++; if (bufferSizeMult > 1000) { throw new UnsupportedKerasConfigurationException("Could not read abnormally long HDF5 attribute"); } } vl.deallocate(); return s; } }
class class_name[name] begin[{] method[readAttributeAsString, return_type[type[String]], modifier[private], parameter[attribute]] begin[{] SYNCHRONIZED[member[Hdf5Archive.LOCK_OBJECT]] BEGIN[{] local_variable[type[VarLenType], vl] local_variable[type[int], bufferSizeMult] local_variable[type[String], s] while[literal[true]] begin[{] local_variable[type[byte], attrBuffer] local_variable[type[BytePointer], attrPointer] call[attribute.read, parameter[member[.vl], member[.attrPointer]]] call[attrPointer.get, parameter[member[.attrBuffer]]] assign[member[.s], ClassCreator(arguments=[MemberReference(member=attrBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] if[call[s.endsWith, parameter[literal[""]]]] begin[{] assign[member[.s], call[s.replace, parameter[literal[""], literal[""]]]] BreakStatement(goto=None, label=None) else begin[{] None end[}] member[.bufferSizeMult] if[binary_operation[member[.bufferSizeMult], >, literal[1000]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not read abnormally long HDF5 attribute")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedKerasConfigurationException, sub_type=None)), label=None) else begin[{] None end[}] end[}] call[vl.deallocate, parameter[]] return[member[.s]] END[}] end[}] END[}]
Keyword[private] identifier[String] identifier[readAttributeAsString] operator[SEP] identifier[Attribute] identifier[attribute] operator[SEP] Keyword[throws] identifier[UnsupportedKerasConfigurationException] { Keyword[synchronized] operator[SEP] identifier[Hdf5Archive] operator[SEP] identifier[LOCK_OBJECT] operator[SEP] { identifier[VarLenType] identifier[vl] operator[=] identifier[attribute] operator[SEP] identifier[getVarLenType] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[bufferSizeMult] operator[=] Other[1] operator[SEP] identifier[String] identifier[s] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[attrBuffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[bufferSizeMult] operator[*] Other[2000] operator[SEP] operator[SEP] identifier[BytePointer] identifier[attrPointer] operator[=] Keyword[new] identifier[BytePointer] operator[SEP] identifier[attrBuffer] operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[read] operator[SEP] identifier[vl] , identifier[attrPointer] operator[SEP] operator[SEP] identifier[attrPointer] operator[SEP] identifier[get] operator[SEP] identifier[attrBuffer] operator[SEP] operator[SEP] identifier[s] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[attrBuffer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[s] operator[=] identifier[s] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[bufferSizeMult] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[bufferSizeMult] operator[>] Other[1000] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedKerasConfigurationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[vl] operator[SEP] identifier[deallocate] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[SEP] } }
public String checkinNewContent(String sourceDirectory, String message) throws Exception { RmCommand remove = git.rm(); boolean hasFiles = false; for(String filename : new File(getBaseDirectory()).list()) { if(!filename.equals(".git")) { remove.addFilepattern(filename); hasFiles = true; } } if(hasFiles) { log.info("Removing old content."); remove.call(); } log.info("Copying in new content."); FileSystemManager.copyAllContent(sourceDirectory, getBaseDirectory(), true); log.info("Adding new content."); AddCommand add = git.add(); for(String filename : new File(getBaseDirectory()).list()) { if(!filename.equals(".git")) { add.addFilepattern(filename); } } add.call(); log.info("Committing new content."); git.commit().setMessage(message).call(); return getCurrentRevision(); }
class class_name[name] begin[{] method[checkinNewContent, return_type[type[String]], modifier[public], parameter[sourceDirectory, message]] begin[{] local_variable[type[RmCommand], remove] local_variable[type[boolean], hasFiles] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".git")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=filename, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFilepattern, postfix_operators=[], prefix_operators=[], qualifier=remove, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBaseDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=list, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=filename)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[member[.hasFiles]] begin[{] call[log.info, parameter[literal["Removing old content."]]] call[remove.call, parameter[]] else begin[{] None end[}] call[log.info, parameter[literal["Copying in new content."]]] call[FileSystemManager.copyAllContent, parameter[member[.sourceDirectory], call[.getBaseDirectory, parameter[]], literal[true]]] call[log.info, parameter[literal["Adding new content."]]] local_variable[type[AddCommand], add] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".git")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=filename, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFilepattern, postfix_operators=[], prefix_operators=[], qualifier=add, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBaseDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=list, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=filename)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[add.call, parameter[]] call[log.info, parameter[literal["Committing new content."]]] call[git.commit, parameter[]] return[call[.getCurrentRevision, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[checkinNewContent] operator[SEP] identifier[String] identifier[sourceDirectory] , identifier[String] identifier[message] operator[SEP] Keyword[throws] identifier[Exception] { identifier[RmCommand] identifier[remove] operator[=] identifier[git] operator[SEP] identifier[rm] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasFiles] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[filename] operator[:] Keyword[new] identifier[File] operator[SEP] identifier[getBaseDirectory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[filename] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[remove] operator[SEP] identifier[addFilepattern] operator[SEP] identifier[filename] operator[SEP] operator[SEP] identifier[hasFiles] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[hasFiles] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] } identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[FileSystemManager] operator[SEP] identifier[copyAllContent] operator[SEP] identifier[sourceDirectory] , identifier[getBaseDirectory] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[AddCommand] identifier[add] operator[=] identifier[git] operator[SEP] identifier[add] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[filename] operator[:] Keyword[new] identifier[File] operator[SEP] identifier[getBaseDirectory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[filename] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[add] operator[SEP] identifier[addFilepattern] operator[SEP] identifier[filename] operator[SEP] operator[SEP] } } identifier[add] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[git] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] identifier[setMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getCurrentRevision] operator[SEP] operator[SEP] operator[SEP] }
public java.util.List<NodeGroupConfiguration> getNodeGroupConfiguration() { if (nodeGroupConfiguration == null) { nodeGroupConfiguration = new com.amazonaws.internal.SdkInternalList<NodeGroupConfiguration>(); } return nodeGroupConfiguration; }
class class_name[name] begin[{] method[getNodeGroupConfiguration, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.nodeGroupConfiguration], ==, literal[null]]] begin[{] assign[member[.nodeGroupConfiguration], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeGroupConfiguration, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.nodeGroupConfiguration]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[NodeGroupConfiguration] operator[>] identifier[getNodeGroupConfiguration] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[nodeGroupConfiguration] operator[==] Other[null] operator[SEP] { identifier[nodeGroupConfiguration] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[NodeGroupConfiguration] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[nodeGroupConfiguration] operator[SEP] }
static String getValue(String key) { String result = StringUtils.defaultIfBlank(System.getProperty(key), StringUtils.EMPTY); result = StringUtils.defaultIfBlank(result, System.getenv(key)); return result; }
class class_name[name] begin[{] method[getValue, return_type[type[String]], modifier[static], parameter[key]] begin[{] local_variable[type[String], result] assign[member[.result], call[StringUtils.defaultIfBlank, parameter[member[.result], call[System.getenv, parameter[member[.key]]]]]] return[member[.result]] end[}] END[}]
Keyword[static] identifier[String] identifier[getValue] operator[SEP] identifier[String] identifier[key] operator[SEP] { identifier[String] identifier[result] operator[=] identifier[StringUtils] operator[SEP] identifier[defaultIfBlank] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] , identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[StringUtils] operator[SEP] identifier[defaultIfBlank] operator[SEP] identifier[result] , identifier[System] operator[SEP] identifier[getenv] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double rotation, double[] coord) { int[] sc = projection.screenProjectionBaseRatio(coord); int x = sc[0]; int y = sc[1]; AffineTransform transform = g2d.getTransform(); // Corner offset adjustment : Text Offset is used Here FontRenderContext frc = g2d.getFontRenderContext(); Font font = g2d.getFont(); double w = font.getStringBounds(label, frc).getWidth(); double h = font.getSize2D(); if (rotation != 0) { g2d.rotate(rotation, x, y); } x -= (int) (w * horizontalReference); y += (int) (h * verticalReference); g2d.drawString(label, x, y); g2d.setTransform(transform); }
class class_name[name] begin[{] method[drawTextBaseRatio, return_type[void], modifier[public], parameter[label, horizontalReference, verticalReference, rotation, coord]] begin[{] local_variable[type[int], sc] local_variable[type[int], x] local_variable[type[int], y] local_variable[type[AffineTransform], transform] local_variable[type[FontRenderContext], frc] local_variable[type[Font], font] local_variable[type[double], w] local_variable[type[double], h] if[binary_operation[member[.rotation], !=, literal[0]]] begin[{] call[g2d.rotate, parameter[member[.rotation], member[.x], member[.y]]] else begin[{] None end[}] assign[member[.x], Cast(expression=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=horizontalReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int))] assign[member[.y], Cast(expression=BinaryOperation(operandl=MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=verticalReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int))] call[g2d.drawString, parameter[member[.label], member[.x], member[.y]]] call[g2d.setTransform, parameter[member[.transform]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[drawTextBaseRatio] operator[SEP] identifier[String] identifier[label] , Keyword[double] identifier[horizontalReference] , Keyword[double] identifier[verticalReference] , Keyword[double] identifier[rotation] , Keyword[double] operator[SEP] operator[SEP] identifier[coord] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[sc] operator[=] identifier[projection] operator[SEP] identifier[screenProjectionBaseRatio] operator[SEP] identifier[coord] operator[SEP] operator[SEP] Keyword[int] identifier[x] operator[=] identifier[sc] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[sc] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[AffineTransform] identifier[transform] operator[=] identifier[g2d] operator[SEP] identifier[getTransform] operator[SEP] operator[SEP] operator[SEP] identifier[FontRenderContext] identifier[frc] operator[=] identifier[g2d] operator[SEP] identifier[getFontRenderContext] operator[SEP] operator[SEP] operator[SEP] identifier[Font] identifier[font] operator[=] identifier[g2d] operator[SEP] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[w] operator[=] identifier[font] operator[SEP] identifier[getStringBounds] operator[SEP] identifier[label] , identifier[frc] operator[SEP] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[h] operator[=] identifier[font] operator[SEP] identifier[getSize2D] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rotation] operator[!=] Other[0] operator[SEP] { identifier[g2d] operator[SEP] identifier[rotate] operator[SEP] identifier[rotation] , identifier[x] , identifier[y] operator[SEP] operator[SEP] } identifier[x] operator[-=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[w] operator[*] identifier[horizontalReference] operator[SEP] operator[SEP] identifier[y] operator[+=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[h] operator[*] identifier[verticalReference] operator[SEP] operator[SEP] identifier[g2d] operator[SEP] identifier[drawString] operator[SEP] identifier[label] , identifier[x] , identifier[y] operator[SEP] operator[SEP] identifier[g2d] operator[SEP] identifier[setTransform] operator[SEP] identifier[transform] operator[SEP] operator[SEP] }
public static FlinkJoinType toFlinkJoinType(JoinRelType joinRelType) { switch (joinRelType) { case INNER: return FlinkJoinType.INNER; case LEFT: return FlinkJoinType.LEFT; case RIGHT: return FlinkJoinType.RIGHT; case FULL: return FlinkJoinType.FULL; default: throw new IllegalArgumentException("invalid: " + joinRelType); } }
class class_name[name] begin[{] method[toFlinkJoinType, return_type[type[FlinkJoinType]], modifier[public static], parameter[joinRelType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['INNER'], statements=[ReturnStatement(expression=MemberReference(member=INNER, postfix_operators=[], prefix_operators=[], qualifier=FlinkJoinType, selectors=[]), label=None)]), SwitchStatementCase(case=['LEFT'], statements=[ReturnStatement(expression=MemberReference(member=LEFT, postfix_operators=[], prefix_operators=[], qualifier=FlinkJoinType, selectors=[]), label=None)]), SwitchStatementCase(case=['RIGHT'], statements=[ReturnStatement(expression=MemberReference(member=RIGHT, postfix_operators=[], prefix_operators=[], qualifier=FlinkJoinType, selectors=[]), label=None)]), SwitchStatementCase(case=['FULL'], statements=[ReturnStatement(expression=MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=FlinkJoinType, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid: "), operandr=MemberReference(member=joinRelType, 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)])], expression=MemberReference(member=joinRelType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[FlinkJoinType] identifier[toFlinkJoinType] operator[SEP] identifier[JoinRelType] identifier[joinRelType] operator[SEP] { Keyword[switch] operator[SEP] identifier[joinRelType] operator[SEP] { Keyword[case] identifier[INNER] operator[:] Keyword[return] identifier[FlinkJoinType] operator[SEP] identifier[INNER] operator[SEP] Keyword[case] identifier[LEFT] operator[:] Keyword[return] identifier[FlinkJoinType] operator[SEP] identifier[LEFT] operator[SEP] Keyword[case] identifier[RIGHT] operator[:] Keyword[return] identifier[FlinkJoinType] operator[SEP] identifier[RIGHT] operator[SEP] Keyword[case] identifier[FULL] operator[:] Keyword[return] identifier[FlinkJoinType] operator[SEP] identifier[FULL] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[joinRelType] operator[SEP] operator[SEP] } }
private void validateRelationship(String baseTableName, String relatedTableName, String relationName) { // Verify the base and related tables exist if (!geoPackage.isTable(baseTableName)) { throw new GeoPackageException( "Base Relationship table does not exist: " + baseTableName + ", Relation: " + relationName); } if (!geoPackage.isTable(relatedTableName)) { throw new GeoPackageException( "Related Relationship table does not exist: " + relatedTableName + ", Relation: " + relationName); } // Verify spec defined relation types RelationType relationType = RelationType.fromName(relationName); if (relationType != null) { validateRelationship(baseTableName, relatedTableName, relationType); } }
class class_name[name] begin[{] method[validateRelationship, return_type[void], modifier[private], parameter[baseTableName, relatedTableName, relationName]] begin[{] if[call[geoPackage.isTable, parameter[member[.baseTableName]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Base Relationship table does not exist: "), operandr=MemberReference(member=baseTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", Relation: "), operator=+), operandr=MemberReference(member=relationName, 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=GeoPackageException, sub_type=None)), label=None) else begin[{] None end[}] if[call[geoPackage.isTable, parameter[member[.relatedTableName]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Related Relationship table does not exist: "), operandr=MemberReference(member=relatedTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", Relation: "), operator=+), operandr=MemberReference(member=relationName, 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=GeoPackageException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[RelationType], relationType] if[binary_operation[member[.relationType], !=, literal[null]]] begin[{] call[.validateRelationship, parameter[member[.baseTableName], member[.relatedTableName], member[.relationType]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[validateRelationship] operator[SEP] identifier[String] identifier[baseTableName] , identifier[String] identifier[relatedTableName] , identifier[String] identifier[relationName] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[geoPackage] operator[SEP] identifier[isTable] operator[SEP] identifier[baseTableName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[baseTableName] operator[+] literal[String] operator[+] identifier[relationName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[geoPackage] operator[SEP] identifier[isTable] operator[SEP] identifier[relatedTableName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[relatedTableName] operator[+] literal[String] operator[+] identifier[relationName] operator[SEP] operator[SEP] } identifier[RelationType] identifier[relationType] operator[=] identifier[RelationType] operator[SEP] identifier[fromName] operator[SEP] identifier[relationName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[relationType] operator[!=] Other[null] operator[SEP] { identifier[validateRelationship] operator[SEP] identifier[baseTableName] , identifier[relatedTableName] , identifier[relationType] operator[SEP] operator[SEP] } }
public static INDArrayIndex[] allFor(INDArray arr) { INDArrayIndex[] ret = new INDArrayIndex[arr.rank()]; for (int i = 0; i < ret.length; i++) ret[i] = NDArrayIndex.all(); return ret; }
class class_name[name] begin[{] method[allFor, return_type[type[INDArrayIndex]], modifier[public static], parameter[arr]] begin[{] local_variable[type[INDArrayIndex], ret] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=all, postfix_operators=[], prefix_operators=[], qualifier=NDArrayIndex, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[INDArrayIndex] operator[SEP] operator[SEP] identifier[allFor] operator[SEP] identifier[INDArray] identifier[arr] operator[SEP] { identifier[INDArrayIndex] operator[SEP] operator[SEP] identifier[ret] operator[=] Keyword[new] identifier[INDArrayIndex] operator[SEP] identifier[arr] operator[SEP] identifier[rank] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ret] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[ret] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[NDArrayIndex] operator[SEP] identifier[all] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public static int getHydrogenCount(IAtomContainer atomContainer, IAtom atom) { return getExplicitHydrogenCount(atomContainer, atom) + getImplicitHydrogenCount(atom); }
class class_name[name] begin[{] method[getHydrogenCount, return_type[type[int]], modifier[public static], parameter[atomContainer, atom]] begin[{] return[binary_operation[call[.getExplicitHydrogenCount, parameter[member[.atomContainer], member[.atom]]], +, call[.getImplicitHydrogenCount, parameter[member[.atom]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getHydrogenCount] operator[SEP] identifier[IAtomContainer] identifier[atomContainer] , identifier[IAtom] identifier[atom] operator[SEP] { Keyword[return] identifier[getExplicitHydrogenCount] operator[SEP] identifier[atomContainer] , identifier[atom] operator[SEP] operator[+] identifier[getImplicitHydrogenCount] operator[SEP] identifier[atom] operator[SEP] operator[SEP] }
public Variable[] getVariables(String component, Object ... markingsToExclude) { ArrayList<Variable> ret = this.components.get(component); if (ret == null) return new Variable[0]; ArrayList<Variable> retFiltered = new ArrayList<Variable>(); for (Variable v : ret) { boolean found = false; if (v.getMarking() != null) for (Object m : markingsToExclude) { if (m.equals(v.getMarking())) { found = true; break; } } if (!found) retFiltered.add(v); } return retFiltered.toArray(new Variable[retFiltered.size()]); }
class class_name[name] begin[{] method[getVariables, return_type[type[Variable]], modifier[public], parameter[component, markingsToExclude]] begin[{] local_variable[type[ArrayList], ret] if[binary_operation[member[.ret], ==, literal[null]]] 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=Variable, sub_type=None))] else begin[{] None end[}] local_variable[type[ArrayList], retFiltered] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=found)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMarking, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMarking, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, 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=markingsToExclude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)), IfStatement(condition=MemberReference(member=found, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=retFiltered, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None))), label=None) return[call[retFiltered.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=retFiltered, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Variable, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Variable] operator[SEP] operator[SEP] identifier[getVariables] operator[SEP] identifier[String] identifier[component] , identifier[Object] operator[...] identifier[markingsToExclude] operator[SEP] { identifier[ArrayList] operator[<] identifier[Variable] operator[>] identifier[ret] operator[=] Keyword[this] operator[SEP] identifier[components] operator[SEP] identifier[get] operator[SEP] identifier[component] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[Variable] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Variable] operator[>] identifier[retFiltered] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Variable] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Variable] identifier[v] operator[:] identifier[ret] operator[SEP] { Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[SEP] identifier[getMarking] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[m] operator[:] identifier[markingsToExclude] operator[SEP] { Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[equals] operator[SEP] identifier[v] operator[SEP] identifier[getMarking] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] identifier[retFiltered] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] operator[SEP] } Keyword[return] identifier[retFiltered] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Variable] operator[SEP] identifier[retFiltered] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(DescribeHapgRequest describeHapgRequest, ProtocolMarshaller protocolMarshaller) { if (describeHapgRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeHapgRequest.getHapgArn(), HAPGARN_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[describeHapgRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeHapgRequest], ==, 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=getHapgArn, postfix_operators=[], prefix_operators=[], qualifier=describeHapgRequest, selectors=[], type_arguments=None), MemberReference(member=HAPGARN_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[DescribeHapgRequest] identifier[describeHapgRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeHapgRequest] 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[describeHapgRequest] operator[SEP] identifier[getHapgArn] operator[SEP] operator[SEP] , identifier[HAPGARN_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] } }
@Descriptor("Gets the discovery available in the platform") public void discovery(@Descriptor("discovery [discovery name]") String... parameters) { List<ServiceReference> discoveryRef = getAllServiceRefs(DiscoveryService.class); StringBuilder sbFinal = new StringBuilder(); if (discoveryRef.isEmpty()) { sbFinal.append("No discovery available.\n"); } else { for (ServiceReference reference : discoveryRef) { StringBuilder sb = new StringBuilder(); sb.append(displayServiceInfo(reference)); sb.append(createASCIIBox("Properties", displayServiceProperties(reference))); sbFinal.append(createASCIIBox("Discovery", sb)); } } print(sbFinal.toString()); }
class class_name[name] begin[{] method[discovery, return_type[void], modifier[public], parameter[parameters]] begin[{] local_variable[type[List], discoveryRef] local_variable[type[StringBuilder], sbFinal] if[call[discoveryRef.isEmpty, parameter[]]] begin[{] call[sbFinal.append, parameter[literal["No discovery available.\n"]]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=reference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=displayServiceInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Properties"), MethodInvocation(arguments=[MemberReference(member=reference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=displayServiceProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=createASCIIBox, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Discovery"), MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createASCIIBox, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbFinal, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=discoveryRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=reference)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServiceReference, sub_type=None))), label=None) end[}] call[.print, parameter[call[sbFinal.toString, parameter[]]]] end[}] END[}]
annotation[@] identifier[Descriptor] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[discovery] operator[SEP] annotation[@] identifier[Descriptor] operator[SEP] literal[String] operator[SEP] identifier[String] operator[...] identifier[parameters] operator[SEP] { identifier[List] operator[<] identifier[ServiceReference] operator[>] identifier[discoveryRef] operator[=] identifier[getAllServiceRefs] operator[SEP] identifier[DiscoveryService] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sbFinal] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[discoveryRef] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[sbFinal] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[ServiceReference] identifier[reference] operator[:] identifier[discoveryRef] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[displayServiceInfo] operator[SEP] identifier[reference] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[createASCIIBox] operator[SEP] literal[String] , identifier[displayServiceProperties] operator[SEP] identifier[reference] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sbFinal] operator[SEP] identifier[append] operator[SEP] identifier[createASCIIBox] operator[SEP] literal[String] , identifier[sb] operator[SEP] operator[SEP] operator[SEP] } } identifier[print] operator[SEP] identifier[sbFinal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public StorageNodeInfo getFetchStorage(String groupName, String filename) { TrackerGetFetchStorageCommand command = new TrackerGetFetchStorageCommand(groupName, filename, false); return trackerConnectionManager.executeFdfsTrackerCmd(command); }
class class_name[name] begin[{] method[getFetchStorage, return_type[type[StorageNodeInfo]], modifier[public], parameter[groupName, filename]] begin[{] local_variable[type[TrackerGetFetchStorageCommand], command] return[call[trackerConnectionManager.executeFdfsTrackerCmd, parameter[member[.command]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[StorageNodeInfo] identifier[getFetchStorage] operator[SEP] identifier[String] identifier[groupName] , identifier[String] identifier[filename] operator[SEP] { identifier[TrackerGetFetchStorageCommand] identifier[command] operator[=] Keyword[new] identifier[TrackerGetFetchStorageCommand] operator[SEP] identifier[groupName] , identifier[filename] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[trackerConnectionManager] operator[SEP] identifier[executeFdfsTrackerCmd] operator[SEP] identifier[command] operator[SEP] operator[SEP] }
@Trivial public static String normalizeCacheName(String cacheName, CacheConfig cacheConfig) { String tempCacheName = cacheName; if (cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_BASE_JNDI_NAME)) { tempCacheName = DCacheBase.DEFAULT_CACHE_NAME; } else if (cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_DMAP_JNDI_NAME)) { tempCacheName = DCacheBase.DEFAULT_DISTRIBUTED_MAP_NAME; } // Make sure the input cacheName matched with cacheConfig's cacheName. // If not match, set to the input cacheName for cacheConfig if (null != cacheConfig && !tempCacheName.equals(cacheConfig.cacheName)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "normalized cacheName=" + cacheName + " does not match with cacheConfig cacheName=" + cacheConfig.cacheName); } cacheConfig.cacheName = tempCacheName; } return tempCacheName; }
class class_name[name] begin[{] method[normalizeCacheName, return_type[type[String]], modifier[public static], parameter[cacheName, cacheConfig]] begin[{] local_variable[type[String], tempCacheName] if[call[cacheName.equalsIgnoreCase, parameter[member[DCacheBase.DEFAULT_BASE_JNDI_NAME]]]] begin[{] assign[member[.tempCacheName], member[DCacheBase.DEFAULT_CACHE_NAME]] else begin[{] if[call[cacheName.equalsIgnoreCase, parameter[member[DCacheBase.DEFAULT_DMAP_JNDI_NAME]]]] begin[{] assign[member[.tempCacheName], member[DCacheBase.DEFAULT_DISTRIBUTED_MAP_NAME]] else begin[{] None end[}] end[}] if[binary_operation[binary_operation[literal[null], !=, member[.cacheConfig]], &&, call[tempCacheName.equals, parameter[member[cacheConfig.cacheName]]]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["normalized cacheName="], +, member[.cacheName]], +, literal[" does not match with cacheConfig cacheName="]], +, member[cacheConfig.cacheName]]]] else begin[{] None end[}] assign[member[cacheConfig.cacheName], member[.tempCacheName]] else begin[{] None end[}] return[member[.tempCacheName]] end[}] END[}]
annotation[@] identifier[Trivial] Keyword[public] Keyword[static] identifier[String] identifier[normalizeCacheName] operator[SEP] identifier[String] identifier[cacheName] , identifier[CacheConfig] identifier[cacheConfig] operator[SEP] { identifier[String] identifier[tempCacheName] operator[=] identifier[cacheName] operator[SEP] Keyword[if] operator[SEP] identifier[cacheName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[DCacheBase] operator[SEP] identifier[DEFAULT_BASE_JNDI_NAME] operator[SEP] operator[SEP] { identifier[tempCacheName] operator[=] identifier[DCacheBase] operator[SEP] identifier[DEFAULT_CACHE_NAME] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[cacheName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[DCacheBase] operator[SEP] identifier[DEFAULT_DMAP_JNDI_NAME] operator[SEP] operator[SEP] { identifier[tempCacheName] operator[=] identifier[DCacheBase] operator[SEP] identifier[DEFAULT_DISTRIBUTED_MAP_NAME] operator[SEP] } Keyword[if] operator[SEP] Other[null] operator[!=] identifier[cacheConfig] operator[&&] operator[!] identifier[tempCacheName] operator[SEP] identifier[equals] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[cacheName] operator[SEP] 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[cacheName] operator[+] literal[String] operator[+] identifier[cacheConfig] operator[SEP] identifier[cacheName] operator[SEP] operator[SEP] } identifier[cacheConfig] operator[SEP] identifier[cacheName] operator[=] identifier[tempCacheName] operator[SEP] } Keyword[return] identifier[tempCacheName] operator[SEP] }
protected void attemptFlush() throws SIRollbackException, SIConnectionLostException, SIResourceException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc,"attemptFlush"); //The FlushComplete callback FlushComplete callback = null; //The old set of streams which has just been flushed StreamSet oldStreamSet = null; // Actions for a flushable stream. Note that we synchronize // up to step 4 to avoid races with threads handling control // messages. // 1. Cache and unset flushInProgress. // 2. Create a new stream ID // 3. Remove any data structures associated with the stream. // 4. Invoke the callback on the cached FlushComplete reference. synchronized (this) { // Resolve race between control message handlers who both // see a flushable stream. // flushInProgress was set by startFlush if (flushInProgress == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attemptFlush"); return; } // Also verify that the stream really is flushable in case // a thread handling a control message called us with a // stale source stream reference. if (!flushable()) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attemptFlush"); return; } // Now cache the callback. When we exit the synchronize block, // the flush will have officially ended. callback = flushInProgress; flushInProgress = null; // Cleanup the data structures and null out the // existing streamSet so we force creation of a new // set on the next message. oldStreamSet = streamSet; streamSet = null; if(oldStreamSet != null) { oldStreamSet.remove(); } } // Send out a flushed message. If this fails, make sure we get // to at least invoke the callback. try { // The Cellule argument is null as it is ignored by our parent handler // this flush message should be broadcast downstream. if (oldStreamSet != null) downControl.sendFlushedMessage(null, oldStreamSet.getStreamID()); } catch (Exception e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.gd.SourceStreamManager.attemptFlush", "1:1158:1.102", this); // Note that it doesn't make much sense to throw an exception here since // this is a callback from stream array map. if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attemptFlush", e); return; } finally { // Invoke the calback in the finally clause so we don't holdup // whoever's waiting for the flush to complete. callback.flushComplete(destinationHandler); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attemptFlush"); }
class class_name[name] begin[{] method[attemptFlush, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["attemptFlush"]]] else begin[{] None end[}] local_variable[type[FlushComplete], callback] local_variable[type[StreamSet], oldStreamSet] SYNCHRONIZED[THIS[]] BEGIN[{] if[binary_operation[member[.flushInProgress], ==, literal[null]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["attemptFlush"]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[call[.flushable, parameter[]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["attemptFlush"]]] else begin[{] None end[}] return[None] else begin[{] None end[}] assign[member[.callback], member[.flushInProgress]] assign[member[.flushInProgress], literal[null]] assign[member[.oldStreamSet], member[.streamSet]] assign[member[.streamSet], literal[null]] if[binary_operation[member[.oldStreamSet], !=, literal[null]]] begin[{] call[oldStreamSet.remove, parameter[]] else begin[{] None end[}] END[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=oldStreamSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getStreamID, postfix_operators=[], prefix_operators=[], qualifier=oldStreamSet, selectors=[], type_arguments=None)], member=sendFlushedMessage, postfix_operators=[], prefix_operators=[], qualifier=downControl, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.gd.SourceStreamManager.attemptFlush"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1158:1.102"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="attemptFlush"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=destinationHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=flushComplete, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], label=None, resources=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["attemptFlush"]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[attemptFlush] operator[SEP] operator[SEP] Keyword[throws] identifier[SIRollbackException] , identifier[SIConnectionLostException] , identifier[SIResourceException] , identifier[SIErrorException] { 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[FlushComplete] identifier[callback] operator[=] Other[null] operator[SEP] identifier[StreamSet] identifier[oldStreamSet] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[if] operator[SEP] identifier[flushInProgress] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[flushable] 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] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[callback] operator[=] identifier[flushInProgress] operator[SEP] identifier[flushInProgress] operator[=] Other[null] operator[SEP] identifier[oldStreamSet] operator[=] identifier[streamSet] operator[SEP] identifier[streamSet] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[oldStreamSet] operator[!=] Other[null] operator[SEP] { identifier[oldStreamSet] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } } Keyword[try] { Keyword[if] operator[SEP] identifier[oldStreamSet] operator[!=] Other[null] operator[SEP] identifier[downControl] operator[SEP] identifier[sendFlushedMessage] operator[SEP] Other[null] , identifier[oldStreamSet] operator[SEP] identifier[getStreamID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[finally] { identifier[callback] operator[SEP] identifier[flushComplete] operator[SEP] identifier[destinationHandler] 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] operator[SEP] operator[SEP] }
boolean processDirectory(String dirname, Collection<String> classNames) throws IOException { if (!Files.isDirectory(Paths.get(dirname))) { err.printf("%s: not a directory%n", dirname); return false; } classPath.add(0, new File(dirname)); if (classNames.isEmpty()) { Path base = Paths.get(dirname); int baseCount = base.getNameCount(); try (Stream<Path> paths = Files.walk(base)) { Stream<String> files = paths.filter(p -> p.getNameCount() > baseCount) .map(p -> p.subpath(baseCount, p.getNameCount())) .map(Path::toString); return doFileNames(files); } } else { return doClassNames(classNames); } }
class class_name[name] begin[{] method[processDirectory, return_type[type[boolean]], modifier[default], parameter[dirname, classNames]] begin[{] if[call[Files.isDirectory, parameter[call[Paths.get, parameter[member[.dirname]]]]]] begin[{] call[err.printf, parameter[literal["%s: not a directory%n"], member[.dirname]]] return[literal[false]] else begin[{] None end[}] call[classPath.add, parameter[literal[0], ClassCreator(arguments=[MemberReference(member=dirname, 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=File, sub_type=None))]] if[call[classNames.isEmpty, parameter[]]] begin[{] local_variable[type[Path], base] local_variable[type[int], baseCount] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[LambdaExpression(body=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNameCount, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), operandr=MemberReference(member=baseCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), parameters=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=filter, postfix_operators=[], prefix_operators=[], qualifier=paths, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=baseCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getNameCount, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=subpath, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), parameters=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=Path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=files)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Stream, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doFileNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=paths, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))], dimensions=[], name=Stream, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=walk, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None))]) else begin[{] return[call[.doClassNames, parameter[member[.classNames]]]] end[}] end[}] END[}]
Keyword[boolean] identifier[processDirectory] operator[SEP] identifier[String] identifier[dirname] , identifier[Collection] operator[<] identifier[String] operator[>] identifier[classNames] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[Files] operator[SEP] identifier[isDirectory] operator[SEP] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[dirname] operator[SEP] operator[SEP] operator[SEP] { identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[dirname] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[classPath] operator[SEP] identifier[add] operator[SEP] Other[0] , Keyword[new] identifier[File] operator[SEP] identifier[dirname] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classNames] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Path] identifier[base] operator[=] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[dirname] operator[SEP] operator[SEP] Keyword[int] identifier[baseCount] operator[=] identifier[base] operator[SEP] identifier[getNameCount] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[Stream] operator[<] identifier[Path] operator[>] identifier[paths] operator[=] identifier[Files] operator[SEP] identifier[walk] operator[SEP] identifier[base] operator[SEP] operator[SEP] { identifier[Stream] operator[<] identifier[String] operator[>] identifier[files] operator[=] identifier[paths] operator[SEP] identifier[filter] operator[SEP] identifier[p] operator[->] identifier[p] operator[SEP] identifier[getNameCount] operator[SEP] operator[SEP] operator[>] identifier[baseCount] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[p] operator[->] identifier[p] operator[SEP] identifier[subpath] operator[SEP] identifier[baseCount] , identifier[p] operator[SEP] identifier[getNameCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Path] operator[::] identifier[toString] operator[SEP] operator[SEP] Keyword[return] identifier[doFileNames] operator[SEP] identifier[files] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] identifier[doClassNames] operator[SEP] identifier[classNames] operator[SEP] operator[SEP] } }
public void fixate() { ransac = FactoryMultiViewRobust.trifocalRansac(configTriRansac,configError,configRansac); sba = FactoryMultiView.bundleSparseProjective(configSBA); }
class class_name[name] begin[{] method[fixate, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.ransac], call[FactoryMultiViewRobust.trifocalRansac, parameter[member[.configTriRansac], member[.configError], member[.configRansac]]]] assign[member[.sba], call[FactoryMultiView.bundleSparseProjective, parameter[member[.configSBA]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[fixate] operator[SEP] operator[SEP] { identifier[ransac] operator[=] identifier[FactoryMultiViewRobust] operator[SEP] identifier[trifocalRansac] operator[SEP] identifier[configTriRansac] , identifier[configError] , identifier[configRansac] operator[SEP] operator[SEP] identifier[sba] operator[=] identifier[FactoryMultiView] operator[SEP] identifier[bundleSparseProjective] operator[SEP] identifier[configSBA] operator[SEP] operator[SEP] }
public void marshall(GetThirdPartyJobDetailsRequest getThirdPartyJobDetailsRequest, ProtocolMarshaller protocolMarshaller) { if (getThirdPartyJobDetailsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getThirdPartyJobDetailsRequest.getJobId(), JOBID_BINDING); protocolMarshaller.marshall(getThirdPartyJobDetailsRequest.getClientToken(), CLIENTTOKEN_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[getThirdPartyJobDetailsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.getThirdPartyJobDetailsRequest], ==, 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=getJobId, postfix_operators=[], prefix_operators=[], qualifier=getThirdPartyJobDetailsRequest, selectors=[], type_arguments=None), MemberReference(member=JOBID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClientToken, postfix_operators=[], prefix_operators=[], qualifier=getThirdPartyJobDetailsRequest, selectors=[], type_arguments=None), MemberReference(member=CLIENTTOKEN_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[GetThirdPartyJobDetailsRequest] identifier[getThirdPartyJobDetailsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[getThirdPartyJobDetailsRequest] 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[getThirdPartyJobDetailsRequest] operator[SEP] identifier[getJobId] operator[SEP] operator[SEP] , identifier[JOBID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getThirdPartyJobDetailsRequest] operator[SEP] identifier[getClientToken] operator[SEP] operator[SEP] , identifier[CLIENTTOKEN_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] } }
protected ArchiveInputStream createArchiveInputStream(File archive) throws IOException { try { return CommonsStreamFactory.createArchiveInputStream(archive); } catch (ArchiveException e) { throw new IOException(e); } }
class class_name[name] begin[{] method[createArchiveInputStream, return_type[type[ArchiveInputStream]], modifier[protected], parameter[archive]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=archive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createArchiveInputStream, postfix_operators=[], prefix_operators=[], qualifier=CommonsStreamFactory, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ArchiveException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[ArchiveInputStream] identifier[createArchiveInputStream] operator[SEP] identifier[File] identifier[archive] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { Keyword[return] identifier[CommonsStreamFactory] operator[SEP] identifier[createArchiveInputStream] operator[SEP] identifier[archive] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ArchiveException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public void set(String name, Object obj) throws IOException { if (!(obj instanceof Integer)) { throw new IOException("Attribute must be of type Integer."); } if (name.equalsIgnoreCase(REASON)) { reasonCode = ((Integer)obj).intValue(); } else { throw new IOException ("Name not supported by CRLReasonCodeExtension"); } encodeThis(); }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[name, obj]] begin[{] if[binary_operation[member[.obj], instanceof, type[Integer]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attribute must be of type Integer.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] if[call[name.equalsIgnoreCase, parameter[member[.REASON]]]] begin[{] assign[member[.reasonCode], Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Name not supported by CRLReasonCodeExtension")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) end[}] call[.encodeThis, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[obj] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Integer] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[REASON] operator[SEP] operator[SEP] { identifier[reasonCode] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[encodeThis] operator[SEP] operator[SEP] operator[SEP] }
protected void redeliverMessage( AbstractMessage msg , MessageStore store , int handle ) { try { synchronized (storeLock) { // Unlock message in store store.unlock(handle); if (traceEnabled) log.trace("(Deferred) UNLOCKED "+msg.getJMSMessageID()); } // Dispatch notification sendAvailabilityNotification(msg); } catch (JMSException e) { ErrorTools.log(e, log); } }
class class_name[name] begin[{] method[redeliverMessage, return_type[void], modifier[protected], parameter[msg, store, handle]] begin[{] TryStatement(block=[SynchronizedStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=handle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=store, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=traceEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Deferred) UNLOCKED "), operandr=MethodInvocation(arguments=[], member=getJMSMessageID, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), operator=+)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None))], label=None, lock=MemberReference(member=storeLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendAvailabilityNotification, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=ErrorTools, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JMSException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[redeliverMessage] operator[SEP] identifier[AbstractMessage] identifier[msg] , identifier[MessageStore] identifier[store] , Keyword[int] identifier[handle] operator[SEP] { Keyword[try] { Keyword[synchronized] operator[SEP] identifier[storeLock] operator[SEP] { identifier[store] operator[SEP] identifier[unlock] operator[SEP] identifier[handle] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[traceEnabled] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[msg] operator[SEP] identifier[getJMSMessageID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[sendAvailabilityNotification] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JMSException] identifier[e] operator[SEP] { identifier[ErrorTools] operator[SEP] identifier[log] operator[SEP] identifier[e] , identifier[log] operator[SEP] operator[SEP] } }
protected String randomValue(List<String> values) { if (values == null || values.isEmpty()) { throw new InvalidFunctionUsageException("No values to choose from"); } final int idx = random.nextInt(values.size()); return values.get(idx); }
class class_name[name] begin[{] method[randomValue, return_type[type[String]], modifier[protected], parameter[values]] begin[{] if[binary_operation[binary_operation[member[.values], ==, literal[null]], ||, call[values.isEmpty, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No values to choose from")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidFunctionUsageException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], idx] return[call[values.get, parameter[member[.idx]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[randomValue] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[values] operator[==] Other[null] operator[||] identifier[values] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidFunctionUsageException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[idx] operator[=] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[idx] operator[SEP] operator[SEP] }
private void registerNativeFunctionHandlers( Map<String, HandlerDefinition> mappingInfos, Class<? extends AbstractNativeFunctionHandler> handlerClassType) throws SecurityException, NoSuchMethodException { Iterator<Entry<String, HandlerDefinition>> iterator = mappingInfos.entrySet() .iterator(); while (iterator.hasNext()) { Entry<String, HandlerDefinition> mappingInfo = iterator.next(); String url = mappingInfo.getKey(); HandlerDefinition handlerDefinition = mappingInfo.getValue(); registerNativeFunctionHandler(url, handlerDefinition, handlerClassType); } }
class class_name[name] begin[{] method[registerNativeFunctionHandlers, return_type[void], modifier[private], parameter[mappingInfos, handlerClassType]] begin[{] local_variable[type[Iterator], iterator] while[call[iterator.hasNext, parameter[]]] begin[{] local_variable[type[Entry], mappingInfo] local_variable[type[String], url] local_variable[type[HandlerDefinition], handlerDefinition] call[.registerNativeFunctionHandler, parameter[member[.url], member[.handlerDefinition], member[.handlerClassType]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[registerNativeFunctionHandlers] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[HandlerDefinition] operator[>] identifier[mappingInfos] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[AbstractNativeFunctionHandler] operator[>] identifier[handlerClassType] operator[SEP] Keyword[throws] identifier[SecurityException] , identifier[NoSuchMethodException] { identifier[Iterator] operator[<] identifier[Entry] operator[<] identifier[String] , identifier[HandlerDefinition] operator[>] operator[>] identifier[iterator] operator[=] identifier[mappingInfos] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Entry] operator[<] identifier[String] , identifier[HandlerDefinition] operator[>] identifier[mappingInfo] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[mappingInfo] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[HandlerDefinition] identifier[handlerDefinition] operator[=] identifier[mappingInfo] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[registerNativeFunctionHandler] operator[SEP] identifier[url] , identifier[handlerDefinition] , identifier[handlerClassType] operator[SEP] operator[SEP] } }
public ExecutionVertex duplicateVertex(final boolean preserveVertexID) { ExecutionVertexID newVertexID; if (preserveVertexID) { newVertexID = this.vertexID; } else { newVertexID = new ExecutionVertexID(); } final ExecutionVertex duplicatedVertex = new ExecutionVertex(newVertexID, this.executionGraph, this.groupVertex, this.outputGates.length, this.inputGates.length); // Duplicate gates for (int i = 0; i < this.outputGates.length; ++i) { duplicatedVertex.outputGates[i] = new ExecutionGate(new GateID(), duplicatedVertex, this.outputGates[i].getGroupEdge(), false); } for (int i = 0; i < this.inputGates.length; ++i) { duplicatedVertex.inputGates[i] = new ExecutionGate(new GateID(), duplicatedVertex, this.inputGates[i].getGroupEdge(), true); } // TODO set new profiling record with new vertex id duplicatedVertex.setAllocatedResource(this.allocatedResource.get()); return duplicatedVertex; }
class class_name[name] begin[{] method[duplicateVertex, return_type[type[ExecutionVertex]], modifier[public], parameter[preserveVertexID]] begin[{] local_variable[type[ExecutionVertexID], newVertexID] if[member[.preserveVertexID]] begin[{] assign[member[.newVertexID], THIS[member[None.vertexID]]] else begin[{] assign[member[.newVertexID], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExecutionVertexID, sub_type=None))] end[}] local_variable[type[ExecutionVertex], duplicatedVertex] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputGates, postfix_operators=[], prefix_operators=[], qualifier=duplicatedVertex, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GateID, sub_type=None)), MemberReference(member=duplicatedVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outputGates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getGroupEdge, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExecutionGate, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outputGates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inputGates, postfix_operators=[], prefix_operators=[], qualifier=duplicatedVertex, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GateID, sub_type=None)), MemberReference(member=duplicatedVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=inputGates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getGroupEdge, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExecutionGate, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=inputGates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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) call[duplicatedVertex.setAllocatedResource, parameter[THIS[member[None.allocatedResource]call[None.get, parameter[]]]]] return[member[.duplicatedVertex]] end[}] END[}]
Keyword[public] identifier[ExecutionVertex] identifier[duplicateVertex] operator[SEP] Keyword[final] Keyword[boolean] identifier[preserveVertexID] operator[SEP] { identifier[ExecutionVertexID] identifier[newVertexID] operator[SEP] Keyword[if] operator[SEP] identifier[preserveVertexID] operator[SEP] { identifier[newVertexID] operator[=] Keyword[this] operator[SEP] identifier[vertexID] operator[SEP] } Keyword[else] { identifier[newVertexID] operator[=] Keyword[new] identifier[ExecutionVertexID] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[ExecutionVertex] identifier[duplicatedVertex] operator[=] Keyword[new] identifier[ExecutionVertex] operator[SEP] identifier[newVertexID] , Keyword[this] operator[SEP] identifier[executionGraph] , Keyword[this] operator[SEP] identifier[groupVertex] , Keyword[this] operator[SEP] identifier[outputGates] operator[SEP] identifier[length] , Keyword[this] operator[SEP] identifier[inputGates] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[outputGates] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[duplicatedVertex] operator[SEP] identifier[outputGates] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[ExecutionGate] operator[SEP] Keyword[new] identifier[GateID] operator[SEP] operator[SEP] , identifier[duplicatedVertex] , Keyword[this] operator[SEP] identifier[outputGates] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getGroupEdge] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[inputGates] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[duplicatedVertex] operator[SEP] identifier[inputGates] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[ExecutionGate] operator[SEP] Keyword[new] identifier[GateID] operator[SEP] operator[SEP] , identifier[duplicatedVertex] , Keyword[this] operator[SEP] identifier[inputGates] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getGroupEdge] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] } identifier[duplicatedVertex] operator[SEP] identifier[setAllocatedResource] operator[SEP] Keyword[this] operator[SEP] identifier[allocatedResource] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[duplicatedVertex] operator[SEP] }
public Resource getMissingResource(final ResourceList resources) { try { return _withLock(new Callable<Resource>() { @Override public Resource call() { return resources.getConflict(inUse); } }); } catch (Exception e) { throw new IllegalStateException("Inner callable does not throw exception"); } }
class class_name[name] begin[{] method[getMissingResource, return_type[type[Resource]], modifier[public], parameter[resources]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=inUse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConflict, postfix_operators=[], prefix_operators=[], qualifier=resources, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Resource, 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=Resource, sub_type=None))], dimensions=None, name=Callable, sub_type=None))], member=_withLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Inner callable does not throw exception")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Resource] identifier[getMissingResource] operator[SEP] Keyword[final] identifier[ResourceList] identifier[resources] operator[SEP] { Keyword[try] { Keyword[return] identifier[_withLock] operator[SEP] Keyword[new] identifier[Callable] operator[<] identifier[Resource] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Resource] identifier[call] operator[SEP] operator[SEP] { Keyword[return] identifier[resources] operator[SEP] identifier[getConflict] operator[SEP] identifier[inUse] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public static HashMap<Group, Category> mapGroupsToCategories(List<Category> categories) { HashMap<Group, Category> groupCategoryMap = new HashMap<>(); for (Category category : categories) { if (category.getGroups() != null) { for (Group group : category.getGroups()) { groupCategoryMap.put(group, category); } } } return groupCategoryMap; }
class class_name[name] begin[{] method[mapGroupsToCategories, return_type[type[HashMap]], modifier[public static], parameter[categories]] begin[{] local_variable[type[HashMap], groupCategoryMap] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getGroups, postfix_operators=[], prefix_operators=[], qualifier=category, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=category, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=groupCategoryMap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getGroups, postfix_operators=[], prefix_operators=[], qualifier=category, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=group)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=categories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=category)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Category, sub_type=None))), label=None) return[member[.groupCategoryMap]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HashMap] operator[<] identifier[Group] , identifier[Category] operator[>] identifier[mapGroupsToCategories] operator[SEP] identifier[List] operator[<] identifier[Category] operator[>] identifier[categories] operator[SEP] { identifier[HashMap] operator[<] identifier[Group] , identifier[Category] operator[>] identifier[groupCategoryMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Category] identifier[category] operator[:] identifier[categories] operator[SEP] { Keyword[if] operator[SEP] identifier[category] operator[SEP] identifier[getGroups] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Group] identifier[group] operator[:] identifier[category] operator[SEP] identifier[getGroups] operator[SEP] operator[SEP] operator[SEP] { identifier[groupCategoryMap] operator[SEP] identifier[put] operator[SEP] identifier[group] , identifier[category] operator[SEP] operator[SEP] } } } Keyword[return] identifier[groupCategoryMap] operator[SEP] }
public Query adapt(Scan scan) { ReadHooks readHooks = new DefaultReadHooks(); Query query = Query.create(bigtableTableName.getTableId()); Adapters.SCAN_ADAPTER.adapt(scan, readHooks, query); readHooks.applyPreSendHook(query); return query; }
class class_name[name] begin[{] method[adapt, return_type[type[Query]], modifier[public], parameter[scan]] begin[{] local_variable[type[ReadHooks], readHooks] local_variable[type[Query], query] call[Adapters.SCAN_ADAPTER.adapt, parameter[member[.scan], member[.readHooks], member[.query]]] call[readHooks.applyPreSendHook, parameter[member[.query]]] return[member[.query]] end[}] END[}]
Keyword[public] identifier[Query] identifier[adapt] operator[SEP] identifier[Scan] identifier[scan] operator[SEP] { identifier[ReadHooks] identifier[readHooks] operator[=] Keyword[new] identifier[DefaultReadHooks] operator[SEP] operator[SEP] operator[SEP] identifier[Query] identifier[query] operator[=] identifier[Query] operator[SEP] identifier[create] operator[SEP] identifier[bigtableTableName] operator[SEP] identifier[getTableId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Adapters] operator[SEP] identifier[SCAN_ADAPTER] operator[SEP] identifier[adapt] operator[SEP] identifier[scan] , identifier[readHooks] , identifier[query] operator[SEP] operator[SEP] identifier[readHooks] operator[SEP] identifier[applyPreSendHook] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[return] identifier[query] operator[SEP] }
public String getFileName() { if (m_fileName == null) { // use "lazy initializing" if (!m_sitePath.endsWith("/")) { m_fileName = m_sitePath.substring(m_sitePath.lastIndexOf("/") + 1, m_sitePath.length()); } else { m_fileName = m_sitePath.substring( m_sitePath.substring(0, m_sitePath.length() - 1).lastIndexOf("/") + 1, m_sitePath.length()); } } return m_fileName; }
class class_name[name] begin[{] method[getFileName, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.m_fileName], ==, literal[null]]] begin[{] if[call[m_sitePath.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.m_fileName], call[m_sitePath.substring, parameter[binary_operation[call[m_sitePath.lastIndexOf, parameter[literal["/"]]], +, literal[1]], call[m_sitePath.length, parameter[]]]]] else begin[{] assign[member[.m_fileName], call[m_sitePath.substring, parameter[binary_operation[call[m_sitePath.substring, parameter[literal[0], binary_operation[call[m_sitePath.length, parameter[]], -, literal[1]]]], +, literal[1]], call[m_sitePath.length, parameter[]]]]] end[}] else begin[{] None end[}] return[member[.m_fileName]] end[}] END[}]
Keyword[public] identifier[String] identifier[getFileName] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_fileName] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[m_sitePath] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[m_fileName] operator[=] identifier[m_sitePath] operator[SEP] identifier[substring] operator[SEP] identifier[m_sitePath] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] , identifier[m_sitePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_fileName] operator[=] identifier[m_sitePath] operator[SEP] identifier[substring] operator[SEP] identifier[m_sitePath] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[m_sitePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] , identifier[m_sitePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[m_fileName] operator[SEP] }
protected boolean emailOK(ThreddsMetadata.Source p) { String email = p.getEmail(); return email.indexOf('@') >= 0; // should really do a regexp }
class class_name[name] begin[{] method[emailOK, return_type[type[boolean]], modifier[protected], parameter[p]] begin[{] local_variable[type[String], email] return[binary_operation[call[email.indexOf, parameter[literal['@']]], >=, literal[0]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[emailOK] operator[SEP] identifier[ThreddsMetadata] operator[SEP] identifier[Source] identifier[p] operator[SEP] { identifier[String] identifier[email] operator[=] identifier[p] operator[SEP] identifier[getEmail] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[email] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[SEP] }
protected void BuildGSubrsUsed(int Font) { int LBias = 0; int SizeOfNonCIDSubrsUsed = 0; if (fonts[Font].privateSubrs>=0) { LBias = CalcBias(fonts[Font].privateSubrs,Font); SizeOfNonCIDSubrsUsed = lSubrsUsedNonCID.size(); } // For each global subr used for (int i=0;i<lGSubrsUsed.size();i++) { //Pop the value + check valid int Subr = ((Integer)lGSubrsUsed.get(i)).intValue(); if (Subr < gsubrOffsets.length-1 && Subr>=0) { // Read the subr and process int Start = gsubrOffsets[Subr]; int End = gsubrOffsets[Subr+1]; if (fonts[Font].isCID) ReadASubr(Start,End,GBias,0,hGSubrsUsed,lGSubrsUsed,null); else { ReadASubr(Start,End,GBias,LBias,hSubrsUsedNonCID,lSubrsUsedNonCID,fonts[Font].SubrsOffsets); if (SizeOfNonCIDSubrsUsed < lSubrsUsedNonCID.size()) { for (int j=SizeOfNonCIDSubrsUsed;j<lSubrsUsedNonCID.size();j++) { //Pop the value + check valid int LSubr = ((Integer)lSubrsUsedNonCID.get(j)).intValue(); if (LSubr < fonts[Font].SubrsOffsets.length-1 && LSubr>=0) { // Read the subr and process int LStart = fonts[Font].SubrsOffsets[LSubr]; int LEnd = fonts[Font].SubrsOffsets[LSubr+1]; ReadASubr(LStart,LEnd,GBias,LBias,hSubrsUsedNonCID,lSubrsUsedNonCID,fonts[Font].SubrsOffsets); } } SizeOfNonCIDSubrsUsed = lSubrsUsedNonCID.size(); } } } } }
class class_name[name] begin[{] method[BuildGSubrsUsed, return_type[void], modifier[protected], parameter[Font]] begin[{] local_variable[type[int], LBias] local_variable[type[int], SizeOfNonCIDSubrsUsed] if[binary_operation[member[.fonts], >=, literal[0]]] begin[{] assign[member[.LBias], call[.CalcBias, parameter[member[.fonts], member[.Font]]]] assign[member[.SizeOfNonCIDSubrsUsed], call[lSubrsUsedNonCID.size, parameter[]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=lGSubrsUsed, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=Subr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=Subr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=gsubrOffsets, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=Subr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=gsubrOffsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=Subr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=Start)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=gsubrOffsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=Subr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), name=End)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MemberReference(member=fonts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=Font, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=isCID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=Start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=End, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=GBias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LBias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hSubrsUsedNonCID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lSubrsUsedNonCID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fonts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=Font, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=SubrsOffsets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=ReadASubr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SizeOfNonCIDSubrsUsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=lSubrsUsedNonCID, selectors=[], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=lSubrsUsedNonCID, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=LSubr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LSubr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=fonts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=Font, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=SubrsOffsets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=LSubr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=fonts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=Font, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=SubrsOffsets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=LSubr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=LStart)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=fonts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=Font, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=SubrsOffsets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=LSubr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), name=LEnd)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=GBias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LBias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hSubrsUsedNonCID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lSubrsUsedNonCID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fonts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=Font, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=SubrsOffsets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=ReadASubr, 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=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=lSubrsUsedNonCID, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=SizeOfNonCIDSubrsUsed, 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=SizeOfNonCIDSubrsUsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=lSubrsUsedNonCID, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=Start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=End, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=GBias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=hGSubrsUsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lGSubrsUsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=ReadASubr, 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=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=lGSubrsUsed, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[BuildGSubrsUsed] operator[SEP] Keyword[int] identifier[Font] operator[SEP] { Keyword[int] identifier[LBias] operator[=] Other[0] operator[SEP] Keyword[int] identifier[SizeOfNonCIDSubrsUsed] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[privateSubrs] operator[>=] Other[0] operator[SEP] { identifier[LBias] operator[=] identifier[CalcBias] operator[SEP] identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[privateSubrs] , identifier[Font] operator[SEP] operator[SEP] identifier[SizeOfNonCIDSubrsUsed] operator[=] identifier[lSubrsUsedNonCID] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[lGSubrsUsed] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[Subr] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[lGSubrsUsed] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Subr] operator[<] identifier[gsubrOffsets] operator[SEP] identifier[length] operator[-] Other[1] operator[&&] identifier[Subr] operator[>=] Other[0] operator[SEP] { Keyword[int] identifier[Start] operator[=] identifier[gsubrOffsets] operator[SEP] identifier[Subr] operator[SEP] operator[SEP] Keyword[int] identifier[End] operator[=] identifier[gsubrOffsets] operator[SEP] identifier[Subr] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[isCID] operator[SEP] identifier[ReadASubr] operator[SEP] identifier[Start] , identifier[End] , identifier[GBias] , Other[0] , identifier[hGSubrsUsed] , identifier[lGSubrsUsed] , Other[null] operator[SEP] operator[SEP] Keyword[else] { identifier[ReadASubr] operator[SEP] identifier[Start] , identifier[End] , identifier[GBias] , identifier[LBias] , identifier[hSubrsUsedNonCID] , identifier[lSubrsUsedNonCID] , identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[SubrsOffsets] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[SizeOfNonCIDSubrsUsed] operator[<] identifier[lSubrsUsedNonCID] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[SizeOfNonCIDSubrsUsed] operator[SEP] identifier[j] operator[<] identifier[lSubrsUsedNonCID] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[int] identifier[LSubr] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[lSubrsUsedNonCID] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LSubr] operator[<] identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[SubrsOffsets] operator[SEP] identifier[length] operator[-] Other[1] operator[&&] identifier[LSubr] operator[>=] Other[0] operator[SEP] { Keyword[int] identifier[LStart] operator[=] identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[SubrsOffsets] operator[SEP] identifier[LSubr] operator[SEP] operator[SEP] Keyword[int] identifier[LEnd] operator[=] identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[SubrsOffsets] operator[SEP] identifier[LSubr] operator[+] Other[1] operator[SEP] operator[SEP] identifier[ReadASubr] operator[SEP] identifier[LStart] , identifier[LEnd] , identifier[GBias] , identifier[LBias] , identifier[hSubrsUsedNonCID] , identifier[lSubrsUsedNonCID] , identifier[fonts] operator[SEP] identifier[Font] operator[SEP] operator[SEP] identifier[SubrsOffsets] operator[SEP] operator[SEP] } } identifier[SizeOfNonCIDSubrsUsed] operator[=] identifier[lSubrsUsedNonCID] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } } } } }
SqlgVertex putVertexIfAbsent(SqlgGraph sqlgGraph, String schema, String table, Long id) { RecordId recordId = RecordId.from(SchemaTable.of(schema, table), id); SqlgVertex sqlgVertex; if (this.cacheVertices) { sqlgVertex = this.vertexCache.get(recordId); if (sqlgVertex == null) { sqlgVertex = new SqlgVertex(sqlgGraph, id, schema, table); this.vertexCache.put(recordId, sqlgVertex); return sqlgVertex; } } else { sqlgVertex = new SqlgVertex(sqlgGraph, id, schema, table); } return sqlgVertex; }
class class_name[name] begin[{] method[putVertexIfAbsent, return_type[type[SqlgVertex]], modifier[default], parameter[sqlgGraph, schema, table, id]] begin[{] local_variable[type[RecordId], recordId] local_variable[type[SqlgVertex], sqlgVertex] if[THIS[member[None.cacheVertices]]] begin[{] assign[member[.sqlgVertex], THIS[member[None.vertexCache]call[None.get, parameter[member[.recordId]]]]] if[binary_operation[member[.sqlgVertex], ==, literal[null]]] begin[{] assign[member[.sqlgVertex], ClassCreator(arguments=[MemberReference(member=sqlgGraph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=table, 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=SqlgVertex, sub_type=None))] THIS[member[None.vertexCache]call[None.put, parameter[member[.recordId], member[.sqlgVertex]]]] return[member[.sqlgVertex]] else begin[{] None end[}] else begin[{] assign[member[.sqlgVertex], ClassCreator(arguments=[MemberReference(member=sqlgGraph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=table, 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=SqlgVertex, sub_type=None))] end[}] return[member[.sqlgVertex]] end[}] END[}]
identifier[SqlgVertex] identifier[putVertexIfAbsent] operator[SEP] identifier[SqlgGraph] identifier[sqlgGraph] , identifier[String] identifier[schema] , identifier[String] identifier[table] , identifier[Long] identifier[id] operator[SEP] { identifier[RecordId] identifier[recordId] operator[=] identifier[RecordId] operator[SEP] identifier[from] operator[SEP] identifier[SchemaTable] operator[SEP] identifier[of] operator[SEP] identifier[schema] , identifier[table] operator[SEP] , identifier[id] operator[SEP] operator[SEP] identifier[SqlgVertex] identifier[sqlgVertex] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[cacheVertices] operator[SEP] { identifier[sqlgVertex] operator[=] Keyword[this] operator[SEP] identifier[vertexCache] operator[SEP] identifier[get] operator[SEP] identifier[recordId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sqlgVertex] operator[==] Other[null] operator[SEP] { identifier[sqlgVertex] operator[=] Keyword[new] identifier[SqlgVertex] operator[SEP] identifier[sqlgGraph] , identifier[id] , identifier[schema] , identifier[table] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[vertexCache] operator[SEP] identifier[put] operator[SEP] identifier[recordId] , identifier[sqlgVertex] operator[SEP] operator[SEP] Keyword[return] identifier[sqlgVertex] operator[SEP] } } Keyword[else] { identifier[sqlgVertex] operator[=] Keyword[new] identifier[SqlgVertex] operator[SEP] identifier[sqlgGraph] , identifier[id] , identifier[schema] , identifier[table] operator[SEP] operator[SEP] } Keyword[return] identifier[sqlgVertex] operator[SEP] }
public List matchAll(String uri) { ClauseNode currentNode = root; ArrayList<Object> returnList = new ArrayList<Object>(); // extension matching done first in the matchAll case // since it is most generic // int dot = uri.lastIndexOf("."); if (dot != -1) { Object tar = extensions.get(uri.substring(dot + 1)); if (tar != null) { returnList.add(tar); } } // add the default node if it exists if (defaultNode != null) { returnList.add(defaultNode.getStarTarget()); } // walk the nodes adding star targets only boolean exact = true; int startIdx = 1; int slashIdx; boolean done = false; while (!done) { slashIdx = uri.indexOf('/', startIdx); String segment; if (slashIdx == -1) { // last segment done = true; slashIdx = uri.length(); segment = (startIdx < slashIdx) ? uri.substring(startIdx, slashIdx) : null; } else { segment = uri.substring(startIdx, slashIdx); } if (segment != null) { currentNode = currentNode.traverse(segment); // PM06111 if (currentNode == null) { // no exact match, matches star node if it exists exact = false; done = true; } else if (currentNode.getStarTarget() != null) { returnList.add(currentNode.getStarTarget()); } startIdx = slashIdx + 1; } } if (exact) { // add exact only nodes since star nodes were added already Object target = currentNode.getTarget(); if (target != null && currentNode.getStarTarget() == null) { returnList.add(target); } } return returnList; }
class class_name[name] begin[{] method[matchAll, return_type[type[List]], modifier[public], parameter[uri]] begin[{] local_variable[type[ClauseNode], currentNode] local_variable[type[ArrayList], returnList] local_variable[type[int], dot] if[binary_operation[member[.dot], !=, literal[1]]] begin[{] local_variable[type[Object], tar] if[binary_operation[member[.tar], !=, literal[null]]] begin[{] call[returnList.add, parameter[member[.tar]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.defaultNode], !=, literal[null]]] begin[{] call[returnList.add, parameter[call[defaultNode.getStarTarget, parameter[]]]] else begin[{] None end[}] local_variable[type[boolean], exact] local_variable[type[int], startIdx] local_variable[type[int], slashIdx] local_variable[type[boolean], done] while[member[.done]] begin[{] assign[member[.slashIdx], call[uri.indexOf, parameter[literal['/'], member[.startIdx]]]] local_variable[type[String], segment] if[binary_operation[member[.slashIdx], ==, literal[1]]] begin[{] assign[member[.done], literal[true]] assign[member[.slashIdx], call[uri.length, parameter[]]] assign[member[.segment], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=startIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=slashIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[MemberReference(member=startIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=slashIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None))] else begin[{] assign[member[.segment], call[uri.substring, parameter[member[.startIdx], member[.slashIdx]]]] end[}] if[binary_operation[member[.segment], !=, literal[null]]] begin[{] assign[member[.currentNode], call[currentNode.traverse, parameter[member[.segment]]]] if[binary_operation[member[.currentNode], ==, literal[null]]] begin[{] assign[member[.exact], literal[false]] assign[member[.done], literal[true]] else begin[{] if[binary_operation[call[currentNode.getStarTarget, parameter[]], !=, literal[null]]] begin[{] call[returnList.add, parameter[call[currentNode.getStarTarget, parameter[]]]] else begin[{] None end[}] end[}] assign[member[.startIdx], binary_operation[member[.slashIdx], +, literal[1]]] else begin[{] None end[}] end[}] if[member[.exact]] begin[{] local_variable[type[Object], target] if[binary_operation[binary_operation[member[.target], !=, literal[null]], &&, binary_operation[call[currentNode.getStarTarget, parameter[]], ==, literal[null]]]] begin[{] call[returnList.add, parameter[member[.target]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.returnList]] end[}] END[}]
Keyword[public] identifier[List] identifier[matchAll] operator[SEP] identifier[String] identifier[uri] operator[SEP] { identifier[ClauseNode] identifier[currentNode] operator[=] identifier[root] operator[SEP] identifier[ArrayList] operator[<] identifier[Object] operator[>] identifier[returnList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[dot] operator[=] identifier[uri] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dot] operator[!=] operator[-] Other[1] operator[SEP] { identifier[Object] identifier[tar] operator[=] identifier[extensions] operator[SEP] identifier[get] operator[SEP] identifier[uri] operator[SEP] identifier[substring] operator[SEP] identifier[dot] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tar] operator[!=] Other[null] operator[SEP] { identifier[returnList] operator[SEP] identifier[add] operator[SEP] identifier[tar] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[defaultNode] operator[!=] Other[null] operator[SEP] { identifier[returnList] operator[SEP] identifier[add] operator[SEP] identifier[defaultNode] operator[SEP] identifier[getStarTarget] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[exact] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[startIdx] operator[=] Other[1] operator[SEP] Keyword[int] identifier[slashIdx] operator[SEP] Keyword[boolean] identifier[done] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[done] operator[SEP] { identifier[slashIdx] operator[=] identifier[uri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[startIdx] operator[SEP] operator[SEP] identifier[String] identifier[segment] operator[SEP] Keyword[if] operator[SEP] identifier[slashIdx] operator[==] operator[-] Other[1] operator[SEP] { identifier[done] operator[=] literal[boolean] operator[SEP] identifier[slashIdx] operator[=] identifier[uri] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[segment] operator[=] operator[SEP] identifier[startIdx] operator[<] identifier[slashIdx] operator[SEP] operator[?] identifier[uri] operator[SEP] identifier[substring] operator[SEP] identifier[startIdx] , identifier[slashIdx] operator[SEP] operator[:] Other[null] operator[SEP] } Keyword[else] { identifier[segment] operator[=] identifier[uri] operator[SEP] identifier[substring] operator[SEP] identifier[startIdx] , identifier[slashIdx] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[segment] operator[!=] Other[null] operator[SEP] { identifier[currentNode] operator[=] identifier[currentNode] operator[SEP] identifier[traverse] operator[SEP] identifier[segment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentNode] operator[==] Other[null] operator[SEP] { identifier[exact] operator[=] literal[boolean] operator[SEP] identifier[done] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentNode] operator[SEP] identifier[getStarTarget] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[returnList] operator[SEP] identifier[add] operator[SEP] identifier[currentNode] operator[SEP] identifier[getStarTarget] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[startIdx] operator[=] identifier[slashIdx] operator[+] Other[1] operator[SEP] } } Keyword[if] operator[SEP] identifier[exact] operator[SEP] { identifier[Object] identifier[target] operator[=] identifier[currentNode] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[!=] Other[null] operator[&&] identifier[currentNode] operator[SEP] identifier[getStarTarget] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[returnList] operator[SEP] identifier[add] operator[SEP] identifier[target] operator[SEP] operator[SEP] } } Keyword[return] identifier[returnList] operator[SEP] }
@Override public PageElement getPageElementByKey(String key) { PageElement p; for (final Field f : getClass().getDeclaredFields()) { if (f.getType() == PageElement.class) { try { p = (PageElement) f.get(this); } catch (IllegalArgumentException | IllegalAccessException e) { logger.error("error Page.getPageElementByKey()", e); return null; } if (key.equals(p.getKey())) { return p; } } } return new PageElement(key); }
class class_name[name] begin[{] method[getPageElementByKey, return_type[type[PageElement]], modifier[public], parameter[key]] begin[{] local_variable[type[PageElement], p] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PageElement, sub_type=None)), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=PageElement, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error Page.getPageElementByKey()"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, 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=['IllegalArgumentException', 'IllegalAccessException']))], finally_block=None, label=None, resources=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getDeclaredFields, 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=f)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) return[ClassCreator(arguments=[MemberReference(member=key, 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=PageElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[PageElement] identifier[getPageElementByKey] operator[SEP] identifier[String] identifier[key] operator[SEP] { identifier[PageElement] identifier[p] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Field] identifier[f] operator[:] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[PageElement] operator[SEP] Keyword[class] operator[SEP] { Keyword[try] { identifier[p] operator[=] operator[SEP] identifier[PageElement] operator[SEP] identifier[f] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] operator[|] identifier[IllegalAccessException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[p] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[p] operator[SEP] } } } Keyword[return] Keyword[new] identifier[PageElement] operator[SEP] identifier[key] operator[SEP] operator[SEP] }
private void onPersist(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders, Object connection) { // first open a pipeline AttributeWrapper wrapper = wrap(entityMetadata, entity); // add relations. if (rlHolders != null) { for (RelationHolder relation : rlHolders) { String name = relation.getRelationName(); Object value = relation.getRelationValue(); byte[] valueInBytes = PropertyAccessorHelper.getBytes(value); byte[] nameInBytes = getEncodedBytes(name); String valueAsStr = PropertyAccessorHelper.getString(value); wrapper.addColumn(nameInBytes, valueInBytes); wrapper.addIndex(getHashKey(entityMetadata.getTableName(), name), getDouble(valueAsStr)); // this index is required to work for UNION/INTERSECT // support. wrapper.addIndex(getHashKey(entityMetadata.getTableName(), getHashKey(name, valueAsStr)), getDouble(valueAsStr)); } } // prepareCompositeKey MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( entityMetadata.getPersistenceUnit()); EntityType entityType = metaModel.entity(entityMetadata.getEntityClazz()); String discrColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn(); String discrValue = ((AbstractManagedType) entityType).getDiscriminatorValue(); // No need to check for empty or blank, as considering it as valid name // for nosql! if (discrColumn != null && discrValue != null) { byte[] valueInBytes = PropertyAccessorHelper.getBytes(discrValue); byte[] nameInBytes = getEncodedBytes(discrColumn); wrapper.addColumn(nameInBytes, valueInBytes); wrapper.addIndex(getHashKey(entityMetadata.getTableName(), discrColumn), getDouble(discrValue)); wrapper.addIndex(getHashKey(entityMetadata.getTableName(), getHashKey(discrColumn, discrValue)), getDouble(discrValue)); } String rowKey = null; if (metaModel.isEmbeddable(entityMetadata.getIdAttribute().getBindableJavaType())) { rowKey = KunderaCoreUtils.prepareCompositeKey(entityMetadata, id); } else { ObjectAccessor accessor = new ObjectAccessor(); rowKey = accessor.toString(id); // rowKey = /*PropertyAccessorHelper.getString(entity, (Field) // entityMetadata.getIdAttribute().getJavaMember())*/ ; } String hashKey = getHashKey(entityMetadata.getTableName(), rowKey); if (resource != null && resource.isActive()) { ((Transaction) connection).hmset(getEncodedBytes(hashKey), wrapper.getColumns()); } else { ((Pipeline) connection).hmset(getEncodedBytes(hashKey), wrapper.getColumns()); } // Add inverted indexes for column based search. // // Add row key to list(Required for wild search over table). // // wrapper.addIndex(getHashKey(entityMetadata.getTableName(), // ((AbstractAttribute) // entityMetadata.getIdAttribute()).getJPAColumnName()), // getDouble(rowKey)); // // // Add row-key as inverted index as well needed for multiple clause // // search with key and non row key. // wrapper.addIndex(getHashKey( // entityMetadata.getTableName(), // getHashKey(((AbstractAttribute) // entityMetadata.getIdAttribute()).getJPAColumnName(), rowKey)), // getDouble(rowKey)); KunderaCoreUtils.printQuery( "Persist data into " + entityMetadata.getSchema() + "." + entityMetadata.getTableName() + " for primary key " + rowKey, showQuery); addIndex(connection, wrapper, rowKey, entityMetadata); }
class class_name[name] begin[{] method[onPersist, return_type[void], modifier[private], parameter[entityMetadata, entity, id, rlHolders, connection]] begin[{] local_variable[type[AttributeWrapper], wrapper] if[binary_operation[member[.rlHolders], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRelationName, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRelationValue, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=PropertyAccessorHelper, selectors=[], type_arguments=None), name=valueInBytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEncodedBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=nameInBytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=PropertyAccessorHelper, selectors=[], type_arguments=None), name=valueAsStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nameInBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueInBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addColumn, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTableName, postfix_operators=[], prefix_operators=[], qualifier=entityMetadata, selectors=[], type_arguments=None), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHashKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueAsStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addIndex, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTableName, postfix_operators=[], prefix_operators=[], qualifier=entityMetadata, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueAsStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHashKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getHashKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueAsStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addIndex, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=rlHolders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=relation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RelationHolder, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[MetamodelImpl], metaModel] local_variable[type[EntityType], entityType] local_variable[type[String], discrColumn] local_variable[type[String], discrValue] if[binary_operation[binary_operation[member[.discrColumn], !=, literal[null]], &&, binary_operation[member[.discrValue], !=, literal[null]]]] begin[{] local_variable[type[byte], valueInBytes] local_variable[type[byte], nameInBytes] call[wrapper.addColumn, parameter[member[.nameInBytes], member[.valueInBytes]]] call[wrapper.addIndex, parameter[call[.getHashKey, parameter[call[entityMetadata.getTableName, parameter[]], member[.discrColumn]]], call[.getDouble, parameter[member[.discrValue]]]]] call[wrapper.addIndex, parameter[call[.getHashKey, parameter[call[entityMetadata.getTableName, parameter[]], call[.getHashKey, parameter[member[.discrColumn], member[.discrValue]]]]], call[.getDouble, parameter[member[.discrValue]]]]] else begin[{] None end[}] local_variable[type[String], rowKey] if[call[metaModel.isEmbeddable, parameter[call[entityMetadata.getIdAttribute, parameter[]]]]] begin[{] assign[member[.rowKey], call[KunderaCoreUtils.prepareCompositeKey, parameter[member[.entityMetadata], member[.id]]]] else begin[{] local_variable[type[ObjectAccessor], accessor] assign[member[.rowKey], call[accessor.toString, parameter[member[.id]]]] end[}] local_variable[type[String], hashKey] if[binary_operation[binary_operation[member[.resource], !=, literal[null]], &&, call[resource.isActive, parameter[]]]] begin[{] Cast(expression=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Transaction, sub_type=None)) else begin[{] Cast(expression=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Pipeline, sub_type=None)) end[}] call[KunderaCoreUtils.printQuery, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Persist data into "], +, call[entityMetadata.getSchema, parameter[]]], +, literal["."]], +, call[entityMetadata.getTableName, parameter[]]], +, literal[" for primary key "]], +, member[.rowKey]], member[.showQuery]]] call[.addIndex, parameter[member[.connection], member[.wrapper], member[.rowKey], member[.entityMetadata]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[onPersist] operator[SEP] identifier[EntityMetadata] identifier[entityMetadata] , identifier[Object] identifier[entity] , identifier[Object] identifier[id] , identifier[List] operator[<] identifier[RelationHolder] operator[>] identifier[rlHolders] , identifier[Object] identifier[connection] operator[SEP] { identifier[AttributeWrapper] identifier[wrapper] operator[=] identifier[wrap] operator[SEP] identifier[entityMetadata] , identifier[entity] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rlHolders] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[RelationHolder] identifier[relation] operator[:] identifier[rlHolders] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[relation] operator[SEP] identifier[getRelationName] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[relation] operator[SEP] identifier[getRelationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[valueInBytes] operator[=] identifier[PropertyAccessorHelper] operator[SEP] identifier[getBytes] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[nameInBytes] operator[=] identifier[getEncodedBytes] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[String] identifier[valueAsStr] operator[=] identifier[PropertyAccessorHelper] operator[SEP] identifier[getString] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[addColumn] operator[SEP] identifier[nameInBytes] , identifier[valueInBytes] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[addIndex] operator[SEP] identifier[getHashKey] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[name] operator[SEP] , identifier[getDouble] operator[SEP] identifier[valueAsStr] operator[SEP] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[addIndex] operator[SEP] identifier[getHashKey] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[getHashKey] operator[SEP] identifier[name] , identifier[valueAsStr] operator[SEP] operator[SEP] , identifier[getDouble] operator[SEP] identifier[valueAsStr] operator[SEP] operator[SEP] operator[SEP] } } identifier[MetamodelImpl] identifier[metaModel] operator[=] operator[SEP] identifier[MetamodelImpl] operator[SEP] identifier[kunderaMetadata] operator[SEP] identifier[getApplicationMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getMetamodel] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getPersistenceUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[EntityType] identifier[entityType] operator[=] identifier[metaModel] operator[SEP] identifier[entity] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[discrColumn] operator[=] operator[SEP] operator[SEP] identifier[AbstractManagedType] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] identifier[getDiscriminatorColumn] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[discrValue] operator[=] operator[SEP] operator[SEP] identifier[AbstractManagedType] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] identifier[getDiscriminatorValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[discrColumn] operator[!=] Other[null] operator[&&] identifier[discrValue] operator[!=] Other[null] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[valueInBytes] operator[=] identifier[PropertyAccessorHelper] operator[SEP] identifier[getBytes] operator[SEP] identifier[discrValue] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[nameInBytes] operator[=] identifier[getEncodedBytes] operator[SEP] identifier[discrColumn] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[addColumn] operator[SEP] identifier[nameInBytes] , identifier[valueInBytes] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[addIndex] operator[SEP] identifier[getHashKey] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[discrColumn] operator[SEP] , identifier[getDouble] operator[SEP] identifier[discrValue] operator[SEP] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[addIndex] operator[SEP] identifier[getHashKey] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[getHashKey] operator[SEP] identifier[discrColumn] , identifier[discrValue] operator[SEP] operator[SEP] , identifier[getDouble] operator[SEP] identifier[discrValue] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[rowKey] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[metaModel] operator[SEP] identifier[isEmbeddable] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getIdAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[rowKey] operator[=] identifier[KunderaCoreUtils] operator[SEP] identifier[prepareCompositeKey] operator[SEP] identifier[entityMetadata] , identifier[id] operator[SEP] operator[SEP] } Keyword[else] { identifier[ObjectAccessor] identifier[accessor] operator[=] Keyword[new] identifier[ObjectAccessor] operator[SEP] operator[SEP] operator[SEP] identifier[rowKey] operator[=] identifier[accessor] operator[SEP] identifier[toString] operator[SEP] identifier[id] operator[SEP] operator[SEP] } identifier[String] identifier[hashKey] operator[=] identifier[getHashKey] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[rowKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resource] operator[!=] Other[null] operator[&&] identifier[resource] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] { operator[SEP] operator[SEP] identifier[Transaction] operator[SEP] identifier[connection] operator[SEP] operator[SEP] identifier[hmset] operator[SEP] identifier[getEncodedBytes] operator[SEP] identifier[hashKey] operator[SEP] , identifier[wrapper] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { operator[SEP] operator[SEP] identifier[Pipeline] operator[SEP] identifier[connection] operator[SEP] operator[SEP] identifier[hmset] operator[SEP] identifier[getEncodedBytes] operator[SEP] identifier[hashKey] operator[SEP] , identifier[wrapper] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[KunderaCoreUtils] operator[SEP] identifier[printQuery] operator[SEP] literal[String] operator[+] identifier[entityMetadata] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[entityMetadata] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[rowKey] , identifier[showQuery] operator[SEP] operator[SEP] identifier[addIndex] operator[SEP] identifier[connection] , identifier[wrapper] , identifier[rowKey] , identifier[entityMetadata] operator[SEP] operator[SEP] }
public ServiceFuture<List<QueryStatisticInner>> listByQueryAsync(String resourceGroupName, String serverName, String databaseName, String queryId, final ServiceCallback<List<QueryStatisticInner>> serviceCallback) { return ServiceFuture.fromResponse(listByQueryWithServiceResponseAsync(resourceGroupName, serverName, databaseName, queryId), serviceCallback); }
class class_name[name] begin[{] method[listByQueryAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, databaseName, queryId, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.listByQueryWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.databaseName], member[.queryId]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[QueryStatisticInner] operator[>] operator[>] identifier[listByQueryAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[databaseName] , identifier[String] identifier[queryId] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[List] operator[<] identifier[QueryStatisticInner] operator[>] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listByQueryWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[databaseName] , identifier[queryId] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public HiveShellContainer evaluateStatement(List<? extends Script> scripts, Object target, TemporaryFolder temporaryFolder, Statement base) throws Throwable { container = null; FileUtil.setPermission(temporaryFolder.getRoot(), FsPermission.getDirDefault()); try { LOGGER.info("Setting up {} in {}", getName(), temporaryFolder.getRoot().getAbsolutePath()); container = createHiveServerContainer(scripts, target, temporaryFolder); base.evaluate(); return container; } finally { tearDown(); } }
class class_name[name] begin[{] method[evaluateStatement, return_type[type[HiveShellContainer]], modifier[public], parameter[scripts, target, temporaryFolder, base]] begin[{] assign[member[.container], literal[null]] call[FileUtil.setPermission, parameter[call[temporaryFolder.getRoot, parameter[]], call[FsPermission.getDirDefault, parameter[]]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Setting up {} in {}"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=temporaryFolder, selectors=[MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=scripts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=temporaryFolder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createHiveServerContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=base, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=tearDown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[HiveShellContainer] identifier[evaluateStatement] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[Script] operator[>] identifier[scripts] , identifier[Object] identifier[target] , identifier[TemporaryFolder] identifier[temporaryFolder] , identifier[Statement] identifier[base] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[container] operator[=] Other[null] operator[SEP] identifier[FileUtil] operator[SEP] identifier[setPermission] operator[SEP] identifier[temporaryFolder] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] , identifier[FsPermission] operator[SEP] identifier[getDirDefault] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[getName] operator[SEP] operator[SEP] , identifier[temporaryFolder] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[=] identifier[createHiveServerContainer] operator[SEP] identifier[scripts] , identifier[target] , identifier[temporaryFolder] operator[SEP] operator[SEP] identifier[base] operator[SEP] identifier[evaluate] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[container] operator[SEP] } Keyword[finally] { identifier[tearDown] operator[SEP] operator[SEP] operator[SEP] } }
public void init(CmsObject cms, Locale locale) { init(cms, locale, cms.getRequestContext().getUri()); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[cms, locale]] begin[{] call[.init, parameter[member[.cms], member[.locale], call[cms.getRequestContext, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[Locale] identifier[locale] operator[SEP] { identifier[init] operator[SEP] identifier[cms] , identifier[locale] , identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private List<KeyedMessageWithType> invokeOperation(final Object instance, final Operation op, final KeyedMessage message) { if(instance != null) { // possibly passivated ... List<KeyedMessageWithType> result; try { if(traceEnabled) LOGGER.trace("invoking \"{}\" for {}", SafeString.valueOf(instance), message); statCollector.messageDispatched(message); result = op == Operation.output ? prototype.invokeOutput(instance) : prototype.invoke(instance, message); statCollector.messageProcessed(message); } catch(final ContainerException e) { result = null; LOGGER.warn("the container for " + clusterId + " failed to invoke " + op + " on the message processor " + SafeString.valueOf(prototype) + (op == Operation.handle ? (" with " + objectDescription(message)) : ""), e); statCollector.messageFailed(false); } // this is an exception thrown as a result of the reflected call having an illegal argument. // This should actually be impossible since the container itself manages the calling. catch(final IllegalArgumentException e) { result = null; LOGGER.error("the container for " + clusterId + " failed when trying to invoke " + op + " on " + objectDescription(instance) + " due to a declaration problem. Are you sure the method takes the type being routed to it? If this is an output operation are you sure the output method doesn't take any arguments?", e); statCollector.messageFailed(true); } // The app threw an exception. catch(final DempsyException e) { result = null; LOGGER.warn("the container for " + clusterId + " failed when trying to invoke " + op + " on " + objectDescription(instance) + " because an exception was thrown by the Message Processeor itself.", e); statCollector.messageFailed(true); } // RuntimeExceptions bookeeping catch(final RuntimeException e) { result = null; LOGGER.error("the container for " + clusterId + " failed when trying to invoke " + op + " on " + objectDescription(instance) + " due to an unknown exception.", e); statCollector.messageFailed(false); if(op == Operation.handle) throw e; } return result; } return null; }
class class_name[name] begin[{] method[invokeOperation, return_type[type[List]], modifier[private], parameter[instance, op, message]] begin[{] if[binary_operation[member[.instance], !=, literal[null]]] begin[{] local_variable[type[List], result] TryStatement(block=[IfStatement(condition=MemberReference(member=traceEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invoking \"{}\" for {}"), MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=SafeString, selectors=[], type_arguments=None), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=messageDispatched, postfix_operators=[], prefix_operators=[], qualifier=statCollector, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=Operation, selectors=[]), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=prototype, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeOutput, postfix_operators=[], prefix_operators=[], qualifier=prototype, selectors=[], type_arguments=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=messageProcessed, postfix_operators=[], prefix_operators=[], qualifier=statCollector, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the container for "), operandr=MemberReference(member=clusterId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed to invoke "), operator=+), operandr=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on the message processor "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=prototype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=SafeString, selectors=[], type_arguments=None), operator=+), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=handle, postfix_operators=[], prefix_operators=[], qualifier=Operation, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with "), operandr=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=messageFailed, postfix_operators=[], prefix_operators=[], qualifier=statCollector, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ContainerException'])), CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the container for "), operandr=MemberReference(member=clusterId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed when trying to invoke "), operator=+), operandr=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" due to a declaration problem. Are you sure the method takes the type being routed to it? If this is an output operation are you sure the output method doesn't take any arguments?"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=messageFailed, postfix_operators=[], prefix_operators=[], qualifier=statCollector, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException'])), CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the container for "), operandr=MemberReference(member=clusterId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed when trying to invoke "), operator=+), operandr=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" because an exception was thrown by the Message Processeor itself."), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=messageFailed, postfix_operators=[], prefix_operators=[], qualifier=statCollector, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DempsyException'])), CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the container for "), operandr=MemberReference(member=clusterId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed when trying to invoke "), operator=+), operandr=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" due to an unknown exception."), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=messageFailed, postfix_operators=[], prefix_operators=[], qualifier=statCollector, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=handle, postfix_operators=[], prefix_operators=[], qualifier=Operation, selectors=[]), operator===), else_statement=None, label=None, then_statement=ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException']))], finally_block=None, label=None, resources=None) return[member[.result]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[KeyedMessageWithType] operator[>] identifier[invokeOperation] operator[SEP] Keyword[final] identifier[Object] identifier[instance] , Keyword[final] identifier[Operation] identifier[op] , Keyword[final] identifier[KeyedMessage] identifier[message] operator[SEP] { Keyword[if] operator[SEP] identifier[instance] operator[!=] Other[null] operator[SEP] { identifier[List] operator[<] identifier[KeyedMessageWithType] operator[>] identifier[result] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[traceEnabled] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[SafeString] operator[SEP] identifier[valueOf] operator[SEP] identifier[instance] operator[SEP] , identifier[message] operator[SEP] operator[SEP] identifier[statCollector] operator[SEP] identifier[messageDispatched] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[op] operator[==] identifier[Operation] operator[SEP] identifier[output] operator[?] identifier[prototype] operator[SEP] identifier[invokeOutput] operator[SEP] identifier[instance] operator[SEP] operator[:] identifier[prototype] operator[SEP] identifier[invoke] operator[SEP] identifier[instance] , identifier[message] operator[SEP] operator[SEP] identifier[statCollector] operator[SEP] identifier[messageProcessed] operator[SEP] identifier[message] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[ContainerException] identifier[e] operator[SEP] { identifier[result] operator[=] Other[null] operator[SEP] identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[clusterId] operator[+] literal[String] operator[+] identifier[op] operator[+] literal[String] operator[+] identifier[SafeString] operator[SEP] identifier[valueOf] operator[SEP] identifier[prototype] operator[SEP] operator[+] operator[SEP] identifier[op] operator[==] identifier[Operation] operator[SEP] identifier[handle] operator[?] operator[SEP] literal[String] operator[+] identifier[objectDescription] operator[SEP] identifier[message] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[statCollector] operator[SEP] identifier[messageFailed] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IllegalArgumentException] identifier[e] operator[SEP] { identifier[result] operator[=] Other[null] operator[SEP] identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[clusterId] operator[+] literal[String] operator[+] identifier[op] operator[+] literal[String] operator[+] identifier[objectDescription] operator[SEP] identifier[instance] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[statCollector] operator[SEP] identifier[messageFailed] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[DempsyException] identifier[e] operator[SEP] { identifier[result] operator[=] Other[null] operator[SEP] identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[clusterId] operator[+] literal[String] operator[+] identifier[op] operator[+] literal[String] operator[+] identifier[objectDescription] operator[SEP] identifier[instance] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[statCollector] operator[SEP] identifier[messageFailed] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[RuntimeException] identifier[e] operator[SEP] { identifier[result] operator[=] Other[null] operator[SEP] identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[clusterId] operator[+] literal[String] operator[+] identifier[op] operator[+] literal[String] operator[+] identifier[objectDescription] operator[SEP] identifier[instance] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[statCollector] operator[SEP] identifier[messageFailed] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[op] operator[==] identifier[Operation] operator[SEP] identifier[handle] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[return] identifier[result] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public void marshall(DescribeIdentityPoolRequest describeIdentityPoolRequest, ProtocolMarshaller protocolMarshaller) { if (describeIdentityPoolRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeIdentityPoolRequest.getIdentityPoolId(), IDENTITYPOOLID_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[describeIdentityPoolRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeIdentityPoolRequest], ==, 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=getIdentityPoolId, postfix_operators=[], prefix_operators=[], qualifier=describeIdentityPoolRequest, selectors=[], type_arguments=None), MemberReference(member=IDENTITYPOOLID_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[DescribeIdentityPoolRequest] identifier[describeIdentityPoolRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeIdentityPoolRequest] 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[describeIdentityPoolRequest] operator[SEP] identifier[getIdentityPoolId] operator[SEP] operator[SEP] , identifier[IDENTITYPOOLID_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] } }
@SafeVarargs public final PGL objects(uk.kludje.property.Getter<T>... getters) { PGL result = (PGL) this; for (uk.kludje.property.Getter<T> g : getters) { result = newInstance(result, "", g); } return result; }
class class_name[name] begin[{] method[objects, return_type[type[PGL]], modifier[final public], parameter[getters]] begin[{] local_variable[type[PGL], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=getters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=g)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=uk, sub_type=ReferenceType(arguments=None, dimensions=None, name=kludje, sub_type=ReferenceType(arguments=None, dimensions=None, name=property, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=Getter, sub_type=None)))))), label=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[SafeVarargs] Keyword[public] Keyword[final] identifier[PGL] identifier[objects] operator[SEP] identifier[uk] operator[SEP] identifier[kludje] operator[SEP] identifier[property] operator[SEP] identifier[Getter] operator[<] identifier[T] operator[>] operator[...] identifier[getters] operator[SEP] { identifier[PGL] identifier[result] operator[=] operator[SEP] identifier[PGL] operator[SEP] Keyword[this] operator[SEP] Keyword[for] operator[SEP] identifier[uk] operator[SEP] identifier[kludje] operator[SEP] identifier[property] operator[SEP] identifier[Getter] operator[<] identifier[T] operator[>] identifier[g] operator[:] identifier[getters] operator[SEP] { identifier[result] operator[=] identifier[newInstance] operator[SEP] identifier[result] , literal[String] , identifier[g] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@SuppressWarnings("serial") public Map<String, PullMeasure<?>> createPullsFromFields(final Object object) { Map<String, PullMeasure<?>> measures = new HashMap<String, PullMeasure<?>>(); Class<? extends Object> clazz = object.getClass(); for (final Field field : clazz.getFields()) { String key = field.getName(); // TODO exploit return type to restrict the generics measures.put(key, new SimplePullMeasure<Object>(key) { @Override public Object get() { try { return field.get(object); } catch (IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException(); } } }); } return measures; }
class class_name[name] begin[{] method[createPullsFromFields, return_type[type[Map]], modifier[public], parameter[object]] begin[{] local_variable[type[Map], measures] local_variable[type[Class], clazz] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException', 'IllegalAccessException']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=get, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, 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=Object, sub_type=None))], dimensions=None, name=SimplePullMeasure, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=measures, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFields, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) return[member[.measures]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[PullMeasure] operator[<] operator[?] operator[>] operator[>] identifier[createPullsFromFields] operator[SEP] Keyword[final] identifier[Object] identifier[object] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[PullMeasure] operator[<] operator[?] operator[>] operator[>] identifier[measures] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[PullMeasure] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Object] operator[>] identifier[clazz] operator[=] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Field] identifier[field] operator[:] identifier[clazz] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[key] operator[=] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[measures] operator[SEP] identifier[put] operator[SEP] identifier[key] , Keyword[new] identifier[SimplePullMeasure] operator[<] identifier[Object] operator[>] operator[SEP] identifier[key] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[get] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] identifier[field] operator[SEP] identifier[get] operator[SEP] identifier[object] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] operator[|] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] } Keyword[return] identifier[measures] operator[SEP] }
@SuppressWarnings("unchecked") public MergeObservableList<T> insertList(@NonNull ObservableList<? extends T> list) { list.addOnListChangedCallback(callback); int oldSize = size(); lists.add(list); modCount += 1; if (!list.isEmpty()) { listeners.notifyInserted(this, oldSize, list.size()); } return this; }
class class_name[name] begin[{] method[insertList, return_type[type[MergeObservableList]], modifier[public], parameter[list]] begin[{] call[list.addOnListChangedCallback, parameter[member[.callback]]] local_variable[type[int], oldSize] call[lists.add, parameter[member[.list]]] assign[member[.modCount], literal[1]] if[call[list.isEmpty, parameter[]]] begin[{] call[listeners.notifyInserted, parameter[THIS[], member[.oldSize], call[list.size, parameter[]]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[MergeObservableList] operator[<] identifier[T] operator[>] identifier[insertList] operator[SEP] annotation[@] identifier[NonNull] identifier[ObservableList] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[list] operator[SEP] { identifier[list] operator[SEP] identifier[addOnListChangedCallback] operator[SEP] identifier[callback] operator[SEP] operator[SEP] Keyword[int] identifier[oldSize] operator[=] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[lists] operator[SEP] identifier[add] operator[SEP] identifier[list] operator[SEP] operator[SEP] identifier[modCount] operator[+=] Other[1] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[listeners] operator[SEP] identifier[notifyInserted] operator[SEP] Keyword[this] , identifier[oldSize] , identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public <K> Stream<Grouped<K, T>> groupBy(final Func1<? super T, ? extends K> groupSelector) { return groupBy(groupSelector, new Func1<T, T>() { @Override public T call(T value) { return value; } }); }
class class_name[name] begin[{] method[groupBy, return_type[type[Stream]], modifier[public], parameter[groupSelector]] begin[{] return[call[.groupBy, parameter[member[.groupSelector], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=value, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=T, 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=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=Func1, sub_type=None))]]] end[}] END[}]
Keyword[public] operator[<] identifier[K] operator[>] identifier[Stream] operator[<] identifier[Grouped] operator[<] identifier[K] , identifier[T] operator[>] operator[>] identifier[groupBy] operator[SEP] Keyword[final] identifier[Func1] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[K] operator[>] identifier[groupSelector] operator[SEP] { Keyword[return] identifier[groupBy] operator[SEP] identifier[groupSelector] , Keyword[new] identifier[Func1] operator[<] identifier[T] , identifier[T] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[call] operator[SEP] identifier[T] identifier[value] operator[SEP] { Keyword[return] identifier[value] operator[SEP] } } operator[SEP] operator[SEP] }
private void parseExprSingle() throws TTXPathException { mPipeBuilder.addExpressionSingle(); final String tContent = mToken.getContent(); if ("for".equals(tContent)) { parseForExpr(); } else if ("some".equals(tContent) || "every".equals(tContent)) { parseQuantifiedExpr(); } else if ("if".equals(tContent)) { parseIfExpr(); } else { parseOrExpr(); } }
class class_name[name] begin[{] method[parseExprSingle, return_type[void], modifier[private], parameter[]] begin[{] call[mPipeBuilder.addExpressionSingle, parameter[]] local_variable[type[String], tContent] if[literal["for"]] begin[{] call[.parseForExpr, parameter[]] else begin[{] if[binary_operation[literal["some"], ||, literal["every"]]] begin[{] call[.parseQuantifiedExpr, parameter[]] else begin[{] if[literal["if"]] begin[{] call[.parseIfExpr, parameter[]] else begin[{] call[.parseOrExpr, parameter[]] end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseExprSingle] operator[SEP] operator[SEP] Keyword[throws] identifier[TTXPathException] { identifier[mPipeBuilder] operator[SEP] identifier[addExpressionSingle] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[tContent] operator[=] identifier[mToken] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[tContent] operator[SEP] operator[SEP] { identifier[parseForExpr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[tContent] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[tContent] operator[SEP] operator[SEP] { identifier[parseQuantifiedExpr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[tContent] operator[SEP] operator[SEP] { identifier[parseIfExpr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[parseOrExpr] operator[SEP] operator[SEP] operator[SEP] } }
private void setupFilters(Analyzer analyzer) { String exclude = analyzer.getProperty("importless.packager.excludes"); String[] excludesAll = exclude.split(","); for (String excludesIndividual:excludesAll) { if (excludesIndividual.endsWith("*")) excludePrefixes.add(excludesIndividual.substring(0,excludesIndividual.length()-1)); else excludes.add(excludesIndividual); } System.out.println("excludePrefixes: " + excludePrefixes +" excludes: " + excludes); }
class class_name[name] begin[{] method[setupFilters, return_type[void], modifier[private], parameter[analyzer]] begin[{] local_variable[type[String], exclude] local_variable[type[String], excludesAll] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=excludesIndividual, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=excludesIndividual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=excludes, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=excludesIndividual, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=excludesIndividual, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=excludePrefixes, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=excludesAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=excludesIndividual)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["excludePrefixes: "], +, member[.excludePrefixes]], +, literal[" excludes: "]], +, member[.excludes]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setupFilters] operator[SEP] identifier[Analyzer] identifier[analyzer] operator[SEP] { identifier[String] identifier[exclude] operator[=] identifier[analyzer] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[excludesAll] operator[=] identifier[exclude] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[excludesIndividual] operator[:] identifier[excludesAll] operator[SEP] { Keyword[if] operator[SEP] identifier[excludesIndividual] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[excludePrefixes] operator[SEP] identifier[add] operator[SEP] identifier[excludesIndividual] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[excludesIndividual] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[excludes] operator[SEP] identifier[add] operator[SEP] identifier[excludesIndividual] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[excludePrefixes] operator[+] literal[String] operator[+] identifier[excludes] operator[SEP] operator[SEP] }
Filter getFilter() throws InvalidSyntaxException { if (filter == null && filterSpec != null) { filter = eventEngine.getBundleContext().createFilter(filterSpec); } return filter; }
class class_name[name] begin[{] method[getFilter, return_type[type[Filter]], modifier[default], parameter[]] begin[{] if[binary_operation[binary_operation[member[.filter], ==, literal[null]], &&, binary_operation[member[.filterSpec], !=, literal[null]]]] begin[{] assign[member[.filter], call[eventEngine.getBundleContext, parameter[]]] else begin[{] None end[}] return[member[.filter]] end[}] END[}]
identifier[Filter] identifier[getFilter] operator[SEP] operator[SEP] Keyword[throws] identifier[InvalidSyntaxException] { Keyword[if] operator[SEP] identifier[filter] operator[==] Other[null] operator[&&] identifier[filterSpec] operator[!=] Other[null] operator[SEP] { identifier[filter] operator[=] identifier[eventEngine] operator[SEP] identifier[getBundleContext] operator[SEP] operator[SEP] operator[SEP] identifier[createFilter] operator[SEP] identifier[filterSpec] operator[SEP] operator[SEP] } Keyword[return] identifier[filter] operator[SEP] }
public void setVersao(final String versao) { StringValidador.equals(MDFe.VERSAO, versao); this.versao = versao; }
class class_name[name] begin[{] method[setVersao, return_type[void], modifier[public], parameter[versao]] begin[{] call[StringValidador.equals, parameter[member[MDFe.VERSAO], member[.versao]]] assign[THIS[member[None.versao]], member[.versao]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setVersao] operator[SEP] Keyword[final] identifier[String] identifier[versao] operator[SEP] { identifier[StringValidador] operator[SEP] identifier[equals] operator[SEP] identifier[MDFe] operator[SEP] identifier[VERSAO] , identifier[versao] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[versao] operator[=] identifier[versao] operator[SEP] }
@RequestMapping(value = "group", method = RequestMethod.GET) public String newGroupGet(Model model) { model.addAttribute("groups", pathOverrideService.findAllGroups()); return "groups"; }
class class_name[name] begin[{] method[newGroupGet, return_type[type[String]], modifier[public], parameter[model]] begin[{] call[model.addAttribute, parameter[literal["groups"], call[pathOverrideService.findAllGroups, parameter[]]]] return[literal["groups"]] end[}] END[}]
annotation[@] identifier[RequestMapping] operator[SEP] identifier[value] operator[=] literal[String] , identifier[method] operator[=] identifier[RequestMethod] operator[SEP] identifier[GET] operator[SEP] Keyword[public] identifier[String] identifier[newGroupGet] operator[SEP] identifier[Model] identifier[model] operator[SEP] { identifier[model] operator[SEP] identifier[addAttribute] operator[SEP] literal[String] , identifier[pathOverrideService] operator[SEP] identifier[findAllGroups] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] }
public static int int4(byte[] bytes, int idx) { return ((bytes[idx] & 255) << 24) + ((bytes[idx + 1] & 255) << 16) + ((bytes[idx + 2] & 255) << 8) + ((bytes[idx + 3] & 255)); }
class class_name[name] begin[{] method[int4, return_type[type[int]], modifier[public static], parameter[bytes, idx]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.bytes], &, literal[255]], <<, literal[24]], +, binary_operation[binary_operation[member[.bytes], &, literal[255]], <<, literal[16]]], +, binary_operation[binary_operation[member[.bytes], &, literal[255]], <<, literal[8]]], +, binary_operation[member[.bytes], &, literal[255]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[int4] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[int] identifier[idx] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[idx] operator[SEP] operator[&] Other[255] operator[SEP] operator[<<] Other[24] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[idx] operator[+] Other[1] operator[SEP] operator[&] Other[255] operator[SEP] operator[<<] Other[16] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[idx] operator[+] Other[2] operator[SEP] operator[&] Other[255] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[idx] operator[+] Other[3] operator[SEP] operator[&] Other[255] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(Trigger trigger, ProtocolMarshaller protocolMarshaller) { if (trigger == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(trigger.getName(), NAME_BINDING); protocolMarshaller.marshall(trigger.getId(), ID_BINDING); protocolMarshaller.marshall(trigger.getType(), TYPE_BINDING); protocolMarshaller.marshall(trigger.getState(), STATE_BINDING); protocolMarshaller.marshall(trigger.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(trigger.getSchedule(), SCHEDULE_BINDING); protocolMarshaller.marshall(trigger.getActions(), ACTIONS_BINDING); protocolMarshaller.marshall(trigger.getPredicate(), PREDICATE_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[trigger, protocolMarshaller]] begin[{] if[binary_operation[member[.trigger], ==, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=ID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=TYPE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=STATE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=DESCRIPTION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSchedule, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=SCHEDULE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getActions, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=ACTIONS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPredicate, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[], type_arguments=None), MemberReference(member=PREDICATE_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[Trigger] identifier[trigger] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[trigger] 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[trigger] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trigger] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[ID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trigger] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[TYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trigger] operator[SEP] identifier[getState] operator[SEP] operator[SEP] , identifier[STATE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trigger] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[DESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trigger] operator[SEP] identifier[getSchedule] operator[SEP] operator[SEP] , identifier[SCHEDULE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trigger] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] , identifier[ACTIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trigger] operator[SEP] identifier[getPredicate] operator[SEP] operator[SEP] , identifier[PREDICATE_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 Attribute addAttribute(Group parent, Attribute att) { if (immutable) throw new IllegalStateException("Cant modify"); if (parent == null) parent = rootGroup; parent.addAttribute(att); return att; }
class class_name[name] begin[{] method[addAttribute, return_type[type[Attribute]], modifier[public], parameter[parent, att]] begin[{] if[member[.immutable]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cant modify")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.parent], ==, literal[null]]] begin[{] assign[member[.parent], member[.rootGroup]] else begin[{] None end[}] call[parent.addAttribute, parameter[member[.att]]] return[member[.att]] end[}] END[}]
Keyword[public] identifier[Attribute] identifier[addAttribute] operator[SEP] identifier[Group] identifier[parent] , identifier[Attribute] identifier[att] operator[SEP] { Keyword[if] operator[SEP] identifier[immutable] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] identifier[parent] operator[=] identifier[rootGroup] operator[SEP] identifier[parent] operator[SEP] identifier[addAttribute] operator[SEP] identifier[att] operator[SEP] operator[SEP] Keyword[return] identifier[att] operator[SEP] }
private synchronized CodeSource mapSignersToCodeSource(URL url, CodeSigner[] signers) { Map map; if (url == lastURL) { map = lastURLMap; } else { map = (Map) urlToCodeSourceMap.get(url); if (map == null) { map = new HashMap(); urlToCodeSourceMap.put(url, map); } lastURLMap = map; lastURL = url; } CodeSource cs = (CodeSource) map.get(signers); if (cs == null) { cs = new VerifierCodeSource(csdomain, url, signers); signerToCodeSource.put(signers, cs); } return cs; }
class class_name[name] begin[{] method[mapSignersToCodeSource, return_type[type[CodeSource]], modifier[synchronized private], parameter[url, signers]] begin[{] local_variable[type[Map], map] if[binary_operation[member[.url], ==, member[.lastURL]]] begin[{] assign[member[.map], member[.lastURLMap]] else begin[{] assign[member[.map], Cast(expression=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=urlToCodeSourceMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))] if[binary_operation[member[.map], ==, literal[null]]] begin[{] assign[member[.map], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))] call[urlToCodeSourceMap.put, parameter[member[.url], member[.map]]] else begin[{] None end[}] assign[member[.lastURLMap], member[.map]] assign[member[.lastURL], member[.url]] end[}] local_variable[type[CodeSource], cs] if[binary_operation[member[.cs], ==, literal[null]]] begin[{] assign[member[.cs], ClassCreator(arguments=[MemberReference(member=csdomain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=signers, 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=VerifierCodeSource, sub_type=None))] call[signerToCodeSource.put, parameter[member[.signers], member[.cs]]] else begin[{] None end[}] return[member[.cs]] end[}] END[}]
Keyword[private] Keyword[synchronized] identifier[CodeSource] identifier[mapSignersToCodeSource] operator[SEP] identifier[URL] identifier[url] , identifier[CodeSigner] operator[SEP] operator[SEP] identifier[signers] operator[SEP] { identifier[Map] identifier[map] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[==] identifier[lastURL] operator[SEP] { identifier[map] operator[=] identifier[lastURLMap] operator[SEP] } Keyword[else] { identifier[map] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[urlToCodeSourceMap] operator[SEP] identifier[get] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[map] operator[==] Other[null] operator[SEP] { identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] identifier[urlToCodeSourceMap] operator[SEP] identifier[put] operator[SEP] identifier[url] , identifier[map] operator[SEP] operator[SEP] } identifier[lastURLMap] operator[=] identifier[map] operator[SEP] identifier[lastURL] operator[=] identifier[url] operator[SEP] } identifier[CodeSource] identifier[cs] operator[=] operator[SEP] identifier[CodeSource] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[signers] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cs] operator[==] Other[null] operator[SEP] { identifier[cs] operator[=] Keyword[new] identifier[VerifierCodeSource] operator[SEP] identifier[csdomain] , identifier[url] , identifier[signers] operator[SEP] operator[SEP] identifier[signerToCodeSource] operator[SEP] identifier[put] operator[SEP] identifier[signers] , identifier[cs] operator[SEP] operator[SEP] } Keyword[return] identifier[cs] operator[SEP] }