code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
static <R extends ChronoLocalDate> ChronoLocalDateTimeImpl<R> ensureValid(Chronology chrono, Temporal temporal) { @SuppressWarnings("unchecked") ChronoLocalDateTimeImpl<R> other = (ChronoLocalDateTimeImpl<R>) temporal; if (chrono.equals(other.getChronology()) == false) { throw new ClassCastException("Chronology mismatch, required: " + chrono.getId() + ", actual: " + other.getChronology().getId()); } return other; }
class class_name[name] begin[{] method[ensureValid, return_type[type[ChronoLocalDateTimeImpl]], modifier[static], parameter[chrono, temporal]] begin[{] local_variable[type[ChronoLocalDateTimeImpl], other] if[binary_operation[call[chrono.equals, parameter[call[other.getChronology, parameter[]]]], ==, literal[false]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Chronology mismatch, required: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=chrono, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", actual: "), operator=+), operandr=MethodInvocation(arguments=[], member=getChronology, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[MethodInvocation(arguments=[], member=getId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassCastException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.other]] end[}] END[}]
Keyword[static] operator[<] identifier[R] Keyword[extends] identifier[ChronoLocalDate] operator[>] identifier[ChronoLocalDateTimeImpl] operator[<] identifier[R] operator[>] identifier[ensureValid] operator[SEP] identifier[Chronology] identifier[chrono] , identifier[Temporal] identifier[temporal] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[ChronoLocalDateTimeImpl] operator[<] identifier[R] operator[>] identifier[other] operator[=] operator[SEP] identifier[ChronoLocalDateTimeImpl] operator[<] identifier[R] operator[>] operator[SEP] identifier[temporal] operator[SEP] Keyword[if] operator[SEP] identifier[chrono] operator[SEP] identifier[equals] operator[SEP] identifier[other] operator[SEP] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[throw] Keyword[new] identifier[ClassCastException] operator[SEP] literal[String] operator[+] identifier[chrono] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[other] operator[SEP] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[other] operator[SEP] }
public static void storeProperties(Properties p, File file) throws IOException { FileOutputStream fos = new FileOutputStream(file); try { p.store(fos,""); } finally { ArchiveUtils.closeQuietly(fos); } }
class class_name[name] begin[{] method[storeProperties, return_type[void], modifier[public static], parameter[p, file]] begin[{] local_variable[type[FileOutputStream], fos] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=store, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=ArchiveUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[storeProperties] operator[SEP] identifier[Properties] identifier[p] , identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[IOException] { identifier[FileOutputStream] identifier[fos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[try] { identifier[p] operator[SEP] identifier[store] operator[SEP] identifier[fos] , literal[String] operator[SEP] operator[SEP] } Keyword[finally] { identifier[ArchiveUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[fos] operator[SEP] operator[SEP] } }
public static void copyParamsToAttributes( final HttpServletRequest servletRequest, final boolean treatEmptyParamsAsNull, final boolean ignoreEmptyRequestParams) { Enumeration paramNames = servletRequest.getParameterNames(); while (paramNames.hasMoreElements()) { String paramName = (String) paramNames.nextElement(); if (servletRequest.getAttribute(paramName) != null) { continue; } String[] paramValues = servletRequest.getParameterValues(paramName); paramValues = prepareParameters(paramValues, treatEmptyParamsAsNull, ignoreEmptyRequestParams); if (paramValues == null) { continue; } servletRequest.setAttribute(paramName, paramValues.length == 1 ? paramValues[0] : paramValues); } // multipart if (!(servletRequest instanceof MultipartRequestWrapper)) { return; } MultipartRequestWrapper multipartRequest = (MultipartRequestWrapper) servletRequest; if (!multipartRequest.isMultipart()) { return; } paramNames = multipartRequest.getFileParameterNames(); while (paramNames.hasMoreElements()) { String paramName = (String) paramNames.nextElement(); if (servletRequest.getAttribute(paramName) != null) { continue; } FileUpload[] paramValues = multipartRequest.getFiles(paramName); servletRequest.setAttribute(paramName, paramValues.length == 1 ? paramValues[0] : paramValues); } }
class class_name[name] begin[{] method[copyParamsToAttributes, return_type[void], modifier[public static], parameter[servletRequest, treatEmptyParamsAsNull, ignoreEmptyRequestParams]] begin[{] local_variable[type[Enumeration], paramNames] while[call[paramNames.hasMoreElements, parameter[]]] begin[{] local_variable[type[String], paramName] if[binary_operation[call[servletRequest.getAttribute, parameter[member[.paramName]]], !=, literal[null]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[String], paramValues] assign[member[.paramValues], call[.prepareParameters, parameter[member[.paramValues], member[.treatEmptyParamsAsNull], member[.ignoreEmptyRequestParams]]]] if[binary_operation[member[.paramValues], ==, literal[null]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] call[servletRequest.setAttribute, parameter[member[.paramName], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paramValues, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), if_false=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]))]] end[}] if[binary_operation[member[.servletRequest], instanceof, type[MultipartRequestWrapper]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[MultipartRequestWrapper], multipartRequest] if[call[multipartRequest.isMultipart, parameter[]]] begin[{] return[None] else begin[{] None end[}] assign[member[.paramNames], call[multipartRequest.getFileParameterNames, parameter[]]] while[call[paramNames.hasMoreElements, parameter[]]] begin[{] local_variable[type[String], paramName] if[binary_operation[call[servletRequest.getAttribute, parameter[member[.paramName]]], !=, literal[null]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[FileUpload], paramValues] call[servletRequest.setAttribute, parameter[member[.paramName], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paramValues, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), if_false=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]))]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[copyParamsToAttributes] operator[SEP] Keyword[final] identifier[HttpServletRequest] identifier[servletRequest] , Keyword[final] Keyword[boolean] identifier[treatEmptyParamsAsNull] , Keyword[final] Keyword[boolean] identifier[ignoreEmptyRequestParams] operator[SEP] { identifier[Enumeration] identifier[paramNames] operator[=] identifier[servletRequest] operator[SEP] identifier[getParameterNames] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[paramNames] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[paramName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[paramNames] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[servletRequest] operator[SEP] identifier[getAttribute] operator[SEP] identifier[paramName] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[paramValues] operator[=] identifier[servletRequest] operator[SEP] identifier[getParameterValues] operator[SEP] identifier[paramName] operator[SEP] operator[SEP] identifier[paramValues] operator[=] identifier[prepareParameters] operator[SEP] identifier[paramValues] , identifier[treatEmptyParamsAsNull] , identifier[ignoreEmptyRequestParams] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[paramValues] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[servletRequest] operator[SEP] identifier[setAttribute] operator[SEP] identifier[paramName] , identifier[paramValues] operator[SEP] identifier[length] operator[==] Other[1] operator[?] identifier[paramValues] operator[SEP] Other[0] operator[SEP] operator[:] identifier[paramValues] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[servletRequest] Keyword[instanceof] identifier[MultipartRequestWrapper] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[MultipartRequestWrapper] identifier[multipartRequest] operator[=] operator[SEP] identifier[MultipartRequestWrapper] operator[SEP] identifier[servletRequest] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[multipartRequest] operator[SEP] identifier[isMultipart] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[paramNames] operator[=] identifier[multipartRequest] operator[SEP] identifier[getFileParameterNames] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[paramNames] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[paramName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[paramNames] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[servletRequest] operator[SEP] identifier[getAttribute] operator[SEP] identifier[paramName] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[FileUpload] operator[SEP] operator[SEP] identifier[paramValues] operator[=] identifier[multipartRequest] operator[SEP] identifier[getFiles] operator[SEP] identifier[paramName] operator[SEP] operator[SEP] identifier[servletRequest] operator[SEP] identifier[setAttribute] operator[SEP] identifier[paramName] , identifier[paramValues] operator[SEP] identifier[length] operator[==] Other[1] operator[?] identifier[paramValues] operator[SEP] Other[0] operator[SEP] operator[:] identifier[paramValues] operator[SEP] operator[SEP] } }
@Override protected void initParser() throws MtasConfigException { namespaceURI = "http://ilk.uvt.nl/folia"; namespaceURI_id = "http://www.w3.org/XML/1998/namespace"; rootTag = "FoLiA"; contentTag = "text"; allowNonContent = true; super.initParser(); }
class class_name[name] begin[{] method[initParser, return_type[void], modifier[protected], parameter[]] begin[{] assign[member[.namespaceURI], literal["http://ilk.uvt.nl/folia"]] assign[member[.namespaceURI_id], literal["http://www.w3.org/XML/1998/namespace"]] assign[member[.rootTag], literal["FoLiA"]] assign[member[.contentTag], literal["text"]] assign[member[.allowNonContent], literal[true]] SuperMethodInvocation(arguments=[], member=initParser, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[initParser] operator[SEP] operator[SEP] Keyword[throws] identifier[MtasConfigException] { identifier[namespaceURI] operator[=] literal[String] operator[SEP] identifier[namespaceURI_id] operator[=] literal[String] operator[SEP] identifier[rootTag] operator[=] literal[String] operator[SEP] identifier[contentTag] operator[=] literal[String] operator[SEP] identifier[allowNonContent] operator[=] literal[boolean] operator[SEP] Keyword[super] operator[SEP] identifier[initParser] operator[SEP] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.SET_BI_LEVEL_IMAGE_COLOR__AREA: return getAREA(); case AfplibPackage.SET_BI_LEVEL_IMAGE_COLOR__RESERVED: return getReserved(); case AfplibPackage.SET_BI_LEVEL_IMAGE_COLOR__NAMECOLR: return getNAMECOLR(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SET_BI_LEVEL_IMAGE_COLOR__AREA, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getAREA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=SET_BI_LEVEL_IMAGE_COLOR__RESERVED, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getReserved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=SET_BI_LEVEL_IMAGE_COLOR__NAMECOLR, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getNAMECOLR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[SET_BI_LEVEL_IMAGE_COLOR__AREA] operator[:] Keyword[return] identifier[getAREA] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[SET_BI_LEVEL_IMAGE_COLOR__RESERVED] operator[:] Keyword[return] identifier[getReserved] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[SET_BI_LEVEL_IMAGE_COLOR__NAMECOLR] operator[:] Keyword[return] identifier[getNAMECOLR] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public String getDescription(Locale locale) { if (m_systemRole) { // localize role names for system roles return Messages.get().getBundle(locale).key("GUI_ROLE_DESCRIPTION_" + m_roleName + "_0"); } else { return getName(locale); } }
class class_name[name] begin[{] method[getDescription, return_type[type[String]], modifier[public], parameter[locale]] begin[{] if[member[.m_systemRole]] begin[{] return[call[Messages.get, parameter[]]] else begin[{] return[call[.getName, parameter[member[.locale]]]] end[}] end[}] END[}]
Keyword[public] identifier[String] identifier[getDescription] operator[SEP] identifier[Locale] identifier[locale] operator[SEP] { Keyword[if] operator[SEP] identifier[m_systemRole] operator[SEP] { Keyword[return] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[key] operator[SEP] literal[String] operator[+] identifier[m_roleName] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[getName] operator[SEP] identifier[locale] operator[SEP] operator[SEP] } }
@Override public JsonObject serialize(CallDetailRecordList cdrList, Type type, JsonSerializationContext context) { JsonObject result = new JsonObject(); JsonArray array = new JsonArray(); for (CallDetailRecord cdr : cdrList.getCallDetailRecords()) { array.add(context.serialize(cdr)); } if (total != null && pageSize != null && page != null) { result.addProperty("page", page); result.addProperty("num_pages", getTotalPages()); result.addProperty("page_size", pageSize); result.addProperty("total", total); result.addProperty("start", getFirstIndex()); result.addProperty("end", getLastIndex(cdrList)); result.addProperty("uri", pathUri); result.addProperty("first_page_uri", getFirstPageUri()); result.addProperty("previous_page_uri", getPreviousPageUri()); result.addProperty("next_page_uri", getNextPageUri(cdrList)); result.addProperty("last_page_uri", getLastPageUri()); } result.add("calls", array); return result; }
class class_name[name] begin[{] method[serialize, return_type[type[JsonObject]], modifier[public], parameter[cdrList, type, context]] begin[{] local_variable[type[JsonObject], result] local_variable[type[JsonArray], array] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cdr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCallDetailRecords, postfix_operators=[], prefix_operators=[], qualifier=cdrList, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cdr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CallDetailRecord, sub_type=None))), label=None) if[binary_operation[binary_operation[binary_operation[member[.total], !=, literal[null]], &&, binary_operation[member[.pageSize], !=, literal[null]]], &&, binary_operation[member[.page], !=, literal[null]]]] begin[{] call[result.addProperty, parameter[literal["page"], member[.page]]] call[result.addProperty, parameter[literal["num_pages"], call[.getTotalPages, parameter[]]]] call[result.addProperty, parameter[literal["page_size"], member[.pageSize]]] call[result.addProperty, parameter[literal["total"], member[.total]]] call[result.addProperty, parameter[literal["start"], call[.getFirstIndex, parameter[]]]] call[result.addProperty, parameter[literal["end"], call[.getLastIndex, parameter[member[.cdrList]]]]] call[result.addProperty, parameter[literal["uri"], member[.pathUri]]] call[result.addProperty, parameter[literal["first_page_uri"], call[.getFirstPageUri, parameter[]]]] call[result.addProperty, parameter[literal["previous_page_uri"], call[.getPreviousPageUri, parameter[]]]] call[result.addProperty, parameter[literal["next_page_uri"], call[.getNextPageUri, parameter[member[.cdrList]]]]] call[result.addProperty, parameter[literal["last_page_uri"], call[.getLastPageUri, parameter[]]]] else begin[{] None end[}] call[result.add, parameter[literal["calls"], member[.array]]] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[JsonObject] identifier[serialize] operator[SEP] identifier[CallDetailRecordList] identifier[cdrList] , identifier[Type] identifier[type] , identifier[JsonSerializationContext] identifier[context] operator[SEP] { identifier[JsonObject] identifier[result] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[JsonArray] identifier[array] operator[=] Keyword[new] identifier[JsonArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CallDetailRecord] identifier[cdr] operator[:] identifier[cdrList] operator[SEP] identifier[getCallDetailRecords] operator[SEP] operator[SEP] operator[SEP] { identifier[array] operator[SEP] identifier[add] operator[SEP] identifier[context] operator[SEP] identifier[serialize] operator[SEP] identifier[cdr] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[total] operator[!=] Other[null] operator[&&] identifier[pageSize] operator[!=] Other[null] operator[&&] identifier[page] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[page] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[getTotalPages] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[pageSize] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[total] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[getFirstIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[getLastIndex] operator[SEP] identifier[cdrList] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[pathUri] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[getFirstPageUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[getPreviousPageUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[getNextPageUri] operator[SEP] identifier[cdrList] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[getLastPageUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[array] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
private Integer parseDateComponent(final String component, final char padding) { if (component != null && component.indexOf(padding) == -1) { try { return Integer.valueOf(component); } catch (NumberFormatException e) { return null; } } return null; }
class class_name[name] begin[{] method[parseDateComponent, return_type[type[Integer]], modifier[private], parameter[component, padding]] begin[{] if[binary_operation[binary_operation[member[.component], !=, literal[null]], &&, binary_operation[call[component.indexOf, parameter[member[.padding]]], ==, literal[1]]]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[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=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[Integer] identifier[parseDateComponent] operator[SEP] Keyword[final] identifier[String] identifier[component] , Keyword[final] Keyword[char] identifier[padding] operator[SEP] { Keyword[if] operator[SEP] identifier[component] operator[!=] Other[null] operator[&&] identifier[component] operator[SEP] identifier[indexOf] operator[SEP] identifier[padding] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { Keyword[try] { Keyword[return] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[component] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static String orderQuery(boolean isSandbox, Map<String, String> params) { if (isSandbox) return doPost(ORDERQUERY_SANDBOXNEW_URL, params); return doPost(ORDERQUERY_URL, params); }
class class_name[name] begin[{] method[orderQuery, return_type[type[String]], modifier[public static], parameter[isSandbox, params]] begin[{] if[member[.isSandbox]] begin[{] return[call[.doPost, parameter[member[.ORDERQUERY_SANDBOXNEW_URL], member[.params]]]] else begin[{] None end[}] return[call[.doPost, parameter[member[.ORDERQUERY_URL], member[.params]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[orderQuery] operator[SEP] Keyword[boolean] identifier[isSandbox] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[SEP] { Keyword[if] operator[SEP] identifier[isSandbox] operator[SEP] Keyword[return] identifier[doPost] operator[SEP] identifier[ORDERQUERY_SANDBOXNEW_URL] , identifier[params] operator[SEP] operator[SEP] Keyword[return] identifier[doPost] operator[SEP] identifier[ORDERQUERY_URL] , identifier[params] operator[SEP] operator[SEP] }
@Override public String interpreterCall( boolean isTagFile, String expression, Class expectedType, String fnmapvar, boolean XmlEscape, String pageContextVar) { //PK65013 /* * Determine which context object to use. */ String jspCtxt = null; if (isTagFile) jspCtxt = "getJspContext()"; else jspCtxt = pageContextVar; /* * Determine whether to use the expected type's textual name * or, if it's a primitive, the name of its correspondent boxed * type. */ String returnType = GeneratorUtils.getClassType(expectedType); //PI59436 String primitiveConverterMethod = GeneratorUtils.getPrimitiveConverterMethod(expectedType); /* * PI59436: Use targetType to as the expected type argument of PageContextImpl.proprietaryEvaluate(final String expression, * final Class expectedType, final PageContext pageContext, * final ProtectedFunctionMapper functionMap, final boolean escape) * This will ensure that if the expected value of an expression is a primitive type, * we will get the corresponding value according to EL 3.0 spec. * This will prevent using primitive wrapper class types as the expected type; * this is problematic in EL 3.0 because non-primitive classes, when are not set * will produce null as result. Section 1.23.1 of EL 3.0 spec.: * If X is null and Y is not a primitive type and also not a String, return null. */ String targetType = GeneratorUtils.toJavaSourceType(expectedType.getName()); if (primitiveConverterMethod != null) { XmlEscape = false; } /* * Build up the base call to the interpreter. */ // XXX - We use a proprietary call to the interpreter for now // as the current standard machinery is inefficient and requires // lots of wrappers and adapters. This should all clear up once // the EL interpreter moves out of JSTL and into its own project. // In the future, this should be replaced by code that calls // ExpressionEvaluator.parseExpression() and then cache the resulting // expression objects. The interpreterCall would simply select // one of the pre-cached expressions and evaluate it. // Note that PageContextImpl implements VariableResolver and // the generated Servlet/SimpleTag implements FunctionMapper, so // that machinery is already in place (mroth). StringBuffer call = new StringBuffer( "(" + returnType //PI59436 + ") " + "org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate" + "(" + GeneratorUtils.handleEscapes(GeneratorUtils.quote(expression)) + ", " + targetType + ".class, " + "(PageContext)" + jspCtxt + ", " + fnmapvar + ", " + XmlEscape + ")"); /* * Add the primitive converter method if we need to. */ if (primitiveConverterMethod != null) { call.insert(0, "("); call.append(")." + primitiveConverterMethod + "()"); } return call.toString(); }
class class_name[name] begin[{] method[interpreterCall, return_type[type[String]], modifier[public], parameter[isTagFile, expression, expectedType, fnmapvar, XmlEscape, pageContextVar]] begin[{] local_variable[type[String], jspCtxt] if[member[.isTagFile]] begin[{] assign[member[.jspCtxt], literal["getJspContext()"]] else begin[{] assign[member[.jspCtxt], member[.pageContextVar]] end[}] local_variable[type[String], returnType] local_variable[type[String], primitiveConverterMethod] local_variable[type[String], targetType] if[binary_operation[member[.primitiveConverterMethod], !=, literal[null]]] begin[{] assign[member[.XmlEscape], literal[false]] else begin[{] None end[}] local_variable[type[StringBuffer], call] if[binary_operation[member[.primitiveConverterMethod], !=, literal[null]]] begin[{] call[call.insert, parameter[literal[0], literal["("]]] call[call.append, parameter[binary_operation[binary_operation[literal[")."], +, member[.primitiveConverterMethod]], +, literal["()"]]]] else begin[{] None end[}] return[call[call.toString, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[interpreterCall] operator[SEP] Keyword[boolean] identifier[isTagFile] , identifier[String] identifier[expression] , identifier[Class] identifier[expectedType] , identifier[String] identifier[fnmapvar] , Keyword[boolean] identifier[XmlEscape] , identifier[String] identifier[pageContextVar] operator[SEP] { identifier[String] identifier[jspCtxt] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[isTagFile] operator[SEP] identifier[jspCtxt] operator[=] literal[String] operator[SEP] Keyword[else] identifier[jspCtxt] operator[=] identifier[pageContextVar] operator[SEP] identifier[String] identifier[returnType] operator[=] identifier[GeneratorUtils] operator[SEP] identifier[getClassType] operator[SEP] identifier[expectedType] operator[SEP] operator[SEP] identifier[String] identifier[primitiveConverterMethod] operator[=] identifier[GeneratorUtils] operator[SEP] identifier[getPrimitiveConverterMethod] operator[SEP] identifier[expectedType] operator[SEP] operator[SEP] identifier[String] identifier[targetType] operator[=] identifier[GeneratorUtils] operator[SEP] identifier[toJavaSourceType] operator[SEP] identifier[expectedType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[primitiveConverterMethod] operator[!=] Other[null] operator[SEP] { identifier[XmlEscape] operator[=] literal[boolean] operator[SEP] } identifier[StringBuffer] identifier[call] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[+] identifier[returnType] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[GeneratorUtils] operator[SEP] identifier[handleEscapes] operator[SEP] identifier[GeneratorUtils] operator[SEP] identifier[quote] operator[SEP] identifier[expression] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[targetType] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[jspCtxt] operator[+] literal[String] operator[+] identifier[fnmapvar] operator[+] literal[String] operator[+] identifier[XmlEscape] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[primitiveConverterMethod] operator[!=] Other[null] operator[SEP] { identifier[call] operator[SEP] identifier[insert] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[call] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[primitiveConverterMethod] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[call] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public void findOne(String sql, Object[] params, Result<Cursor> result) { _db.findOne(sql, result, params); }
class class_name[name] begin[{] method[findOne, return_type[void], modifier[public], parameter[sql, params, result]] begin[{] call[_db.findOne, parameter[member[.sql], member[.result], member[.params]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[findOne] operator[SEP] identifier[String] identifier[sql] , identifier[Object] operator[SEP] operator[SEP] identifier[params] , identifier[Result] operator[<] identifier[Cursor] operator[>] identifier[result] operator[SEP] { identifier[_db] operator[SEP] identifier[findOne] operator[SEP] identifier[sql] , identifier[result] , identifier[params] operator[SEP] operator[SEP] }
public static void clearCookie (HttpServletResponse rsp, String name) { Cookie c = new Cookie(name, "x"); c.setPath("/"); c.setMaxAge(0); rsp.addCookie(c); }
class class_name[name] begin[{] method[clearCookie, return_type[void], modifier[public static], parameter[rsp, name]] begin[{] local_variable[type[Cookie], c] call[c.setPath, parameter[literal["/"]]] call[c.setMaxAge, parameter[literal[0]]] call[rsp.addCookie, parameter[member[.c]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[clearCookie] operator[SEP] identifier[HttpServletResponse] identifier[rsp] , identifier[String] identifier[name] operator[SEP] { identifier[Cookie] identifier[c] operator[=] Keyword[new] identifier[Cookie] operator[SEP] identifier[name] , literal[String] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[setPath] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[setMaxAge] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[rsp] operator[SEP] identifier[addCookie] operator[SEP] identifier[c] operator[SEP] operator[SEP] }
public static void tql2(int n, double d[], double e[], double v[][]) { // This is derived from the Algol procedures tql2, by // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding // Fortran subroutine in EISPACK. System.arraycopy(e, 1, e, 0, n - 1); e[n - 1] = 0.0; double f = 0.0; double tst1 = 0.0; double eps = Math.pow(2.0, -52.0); for (int l = 0; l < n; l++) { // Find small subdiagonal element tst1 = Math.max(tst1, Math.abs(d[l]) + Math.abs(e[l])); int m = l; while (m < n) { if (Math.abs(e[m]) <= eps * tst1) { break; } m++; } // If m == l, d[l] is an eigenvalue, // otherwise, iterate. if (m > l) { int iter = 0; do { iter = iter + 1; // (Could check iteration count here.) // Compute implicit shift f += specificShift(l, n, d, e); // Implicit QL transformation. implicitQLTransformation(l, m, n, v, d, e); // Check for convergence. } while (Math.abs(e[l]) > eps * tst1); } d[l] = d[l] + f; e[l] = 0.0; } // Sort eigenvalues and corresponding vectors. sortEigenValues(n, d, v); }
class class_name[name] begin[{] method[tql2, return_type[void], modifier[public static], parameter[n, d, e, v]] begin[{] call[System.arraycopy, parameter[member[.e], literal[1], member[.e], literal[0], binary_operation[member[.n], -, literal[1]]]] assign[member[.e], literal[0.0]] local_variable[type[double], f] local_variable[type[double], tst1] local_variable[type[double], eps] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tst1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tst1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator=+)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=m)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=eps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tst1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=MemberReference(member=m, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=iter)], modifiers=set(), type=BasicType(dimensions=[], name=int)), DoStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=specificShift, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=implicitQLTransformation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=eps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tst1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=>), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=l, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[.sortEigenValues, parameter[member[.n], member[.d], member[.v]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[tql2] operator[SEP] Keyword[int] identifier[n] , Keyword[double] identifier[d] operator[SEP] operator[SEP] , Keyword[double] identifier[e] operator[SEP] operator[SEP] , Keyword[double] identifier[v] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[e] , Other[1] , identifier[e] , Other[0] , identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[f] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[tst1] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[eps] operator[=] identifier[Math] operator[SEP] identifier[pow] operator[SEP] literal[Float] , operator[-] literal[Float] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[l] operator[=] Other[0] operator[SEP] identifier[l] operator[<] identifier[n] operator[SEP] identifier[l] operator[++] operator[SEP] { identifier[tst1] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[tst1] , identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[d] operator[SEP] identifier[l] operator[SEP] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[e] operator[SEP] identifier[l] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[m] operator[=] identifier[l] operator[SEP] Keyword[while] operator[SEP] identifier[m] operator[<] identifier[n] operator[SEP] { Keyword[if] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[e] operator[SEP] identifier[m] operator[SEP] operator[SEP] operator[<=] identifier[eps] operator[*] identifier[tst1] operator[SEP] { Keyword[break] operator[SEP] } identifier[m] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[m] operator[>] identifier[l] operator[SEP] { Keyword[int] identifier[iter] operator[=] Other[0] operator[SEP] Keyword[do] { identifier[iter] operator[=] identifier[iter] operator[+] Other[1] operator[SEP] identifier[f] operator[+=] identifier[specificShift] operator[SEP] identifier[l] , identifier[n] , identifier[d] , identifier[e] operator[SEP] operator[SEP] identifier[implicitQLTransformation] operator[SEP] identifier[l] , identifier[m] , identifier[n] , identifier[v] , identifier[d] , identifier[e] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[e] operator[SEP] identifier[l] operator[SEP] operator[SEP] operator[>] identifier[eps] operator[*] identifier[tst1] operator[SEP] operator[SEP] } identifier[d] operator[SEP] identifier[l] operator[SEP] operator[=] identifier[d] operator[SEP] identifier[l] operator[SEP] operator[+] identifier[f] operator[SEP] identifier[e] operator[SEP] identifier[l] operator[SEP] operator[=] literal[Float] operator[SEP] } identifier[sortEigenValues] operator[SEP] identifier[n] , identifier[d] , identifier[v] operator[SEP] operator[SEP] }
public synchronized void putSIMessageHandles(SIMessageHandle[] siMsgHandles) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "putSIMessageHandles", siMsgHandles); putInt(siMsgHandles.length); for (int handleIndex = 0; handleIndex < siMsgHandles.length; ++handleIndex) { JsMessageHandle jsHandle = (JsMessageHandle)siMsgHandles[handleIndex]; putLong(jsHandle.getSystemMessageValue()); put(jsHandle.getSystemMessageSourceUuid().toByteArray()); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "message handle: "+siMsgHandles[handleIndex]); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "putSIMessageHandles"); }
class class_name[name] begin[{] method[putSIMessageHandles, return_type[void], modifier[synchronized public], parameter[siMsgHandles]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["putSIMessageHandles"], member[.siMsgHandles]]] else begin[{] None end[}] call[.putInt, parameter[member[siMsgHandles.length]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=siMsgHandles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=handleIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=JsMessageHandle, sub_type=None)), name=jsHandle)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsMessageHandle, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSystemMessageValue, postfix_operators=[], prefix_operators=[], qualifier=jsHandle, selectors=[], type_arguments=None)], member=putLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSystemMessageSourceUuid, postfix_operators=[], prefix_operators=[], qualifier=jsHandle, selectors=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=, 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=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="message handle: "), operandr=MemberReference(member=siMsgHandles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=handleIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=handleIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=siMsgHandles, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=handleIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=handleIndex, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["putSIMessageHandles"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[putSIMessageHandles] operator[SEP] identifier[SIMessageHandle] operator[SEP] operator[SEP] identifier[siMsgHandles] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[siMsgHandles] operator[SEP] operator[SEP] identifier[putInt] operator[SEP] identifier[siMsgHandles] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[handleIndex] operator[=] Other[0] operator[SEP] identifier[handleIndex] operator[<] identifier[siMsgHandles] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[handleIndex] operator[SEP] { identifier[JsMessageHandle] identifier[jsHandle] operator[=] operator[SEP] identifier[JsMessageHandle] operator[SEP] identifier[siMsgHandles] operator[SEP] identifier[handleIndex] operator[SEP] operator[SEP] identifier[putLong] operator[SEP] identifier[jsHandle] operator[SEP] identifier[getSystemMessageValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[jsHandle] operator[SEP] identifier[getSystemMessageSourceUuid] operator[SEP] operator[SEP] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[siMsgHandles] operator[SEP] identifier[handleIndex] 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] }
private Set<Artifact> getProjectDependencies() { Set<Artifact> result = new LinkedHashSet<Artifact>(); for (MavenProject p : getSession().getProjectDependencyGraph().getSortedProjects()) { for (Dependency dependency : p.getDependencies()) { result.add(toArtifact(dependency)); } } return result; }
class class_name[name] begin[{] method[getProjectDependencies, return_type[type[Set]], modifier[private], parameter[]] begin[{] local_variable[type[Set], result] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=dependency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toArtifact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDependencies, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dependency)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Dependency, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getProjectDependencyGraph, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getSortedProjects, 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=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MavenProject, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[private] identifier[Set] operator[<] identifier[Artifact] operator[>] identifier[getProjectDependencies] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[Artifact] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[Artifact] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MavenProject] identifier[p] operator[:] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[getProjectDependencyGraph] operator[SEP] operator[SEP] operator[SEP] identifier[getSortedProjects] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Dependency] identifier[dependency] operator[:] identifier[p] operator[SEP] identifier[getDependencies] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[toArtifact] operator[SEP] identifier[dependency] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public static AFPChain deleteHighestDistanceColumn(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException { int[][][] optAln = afpChain.getOptAln(); int maxBlock = 0; int maxPos = 0; double maxDistance = Double.MIN_VALUE; for (int b = 0; b < optAln.length; b++) { for (int p = 0; p < optAln[b][0].length; p++) { Atom ca2clone = ca2[optAln[b][1][p]]; Calc.rotate(ca2clone, afpChain.getBlockRotationMatrix()[b]); Calc.shift(ca2clone, afpChain.getBlockShiftVector()[b]); double distance = Calc.getDistance(ca1[optAln[b][0][p]], ca2clone); if (distance > maxDistance) { maxBlock = b; maxPos = p; maxDistance = distance; } } } return deleteColumn(afpChain, ca1, ca2, maxBlock, maxPos); }
class class_name[name] begin[{] method[deleteHighestDistanceColumn, return_type[type[AFPChain]], modifier[public static], parameter[afpChain, ca1, ca2]] begin[{] local_variable[type[int], optAln] local_variable[type[int], maxBlock] local_variable[type[int], maxPos] local_variable[type[double], maxDistance] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ca2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=optAln, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), ArraySelector(index=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))]), name=ca2clone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Atom, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ca2clone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBlockRotationMatrix, postfix_operators=[], prefix_operators=[], qualifier=afpChain, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None)], member=rotate, postfix_operators=[], prefix_operators=[], qualifier=Calc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ca2clone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBlockShiftVector, postfix_operators=[], prefix_operators=[], qualifier=afpChain, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None)], member=shift, postfix_operators=[], prefix_operators=[], qualifier=Calc, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ca1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=optAln, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), ArraySelector(index=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))]), MemberReference(member=ca2clone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDistance, postfix_operators=[], prefix_operators=[], qualifier=Calc, selectors=[], type_arguments=None), name=distance)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=distance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=distance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=optAln, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), 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=p)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=p, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=optAln, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=b, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[.deleteColumn, parameter[member[.afpChain], member[.ca1], member[.ca2], member[.maxBlock], member[.maxPos]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[AFPChain] identifier[deleteHighestDistanceColumn] operator[SEP] identifier[AFPChain] identifier[afpChain] , identifier[Atom] operator[SEP] operator[SEP] identifier[ca1] , identifier[Atom] operator[SEP] operator[SEP] identifier[ca2] operator[SEP] Keyword[throws] identifier[StructureException] { Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[optAln] operator[=] identifier[afpChain] operator[SEP] identifier[getOptAln] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[maxBlock] operator[=] Other[0] operator[SEP] Keyword[int] identifier[maxPos] operator[=] Other[0] operator[SEP] Keyword[double] identifier[maxDistance] operator[=] identifier[Double] operator[SEP] identifier[MIN_VALUE] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[b] operator[=] Other[0] operator[SEP] identifier[b] operator[<] identifier[optAln] operator[SEP] identifier[length] operator[SEP] identifier[b] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[p] operator[=] Other[0] operator[SEP] identifier[p] operator[<] identifier[optAln] operator[SEP] identifier[b] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[p] operator[++] operator[SEP] { identifier[Atom] identifier[ca2clone] operator[=] identifier[ca2] operator[SEP] identifier[optAln] operator[SEP] identifier[b] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[p] operator[SEP] operator[SEP] operator[SEP] identifier[Calc] operator[SEP] identifier[rotate] operator[SEP] identifier[ca2clone] , identifier[afpChain] operator[SEP] identifier[getBlockRotationMatrix] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[SEP] operator[SEP] operator[SEP] identifier[Calc] operator[SEP] identifier[shift] operator[SEP] identifier[ca2clone] , identifier[afpChain] operator[SEP] identifier[getBlockShiftVector] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[distance] operator[=] identifier[Calc] operator[SEP] identifier[getDistance] operator[SEP] identifier[ca1] operator[SEP] identifier[optAln] operator[SEP] identifier[b] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[p] operator[SEP] operator[SEP] , identifier[ca2clone] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[distance] operator[>] identifier[maxDistance] operator[SEP] { identifier[maxBlock] operator[=] identifier[b] operator[SEP] identifier[maxPos] operator[=] identifier[p] operator[SEP] identifier[maxDistance] operator[=] identifier[distance] operator[SEP] } } } Keyword[return] identifier[deleteColumn] operator[SEP] identifier[afpChain] , identifier[ca1] , identifier[ca2] , identifier[maxBlock] , identifier[maxPos] operator[SEP] operator[SEP] }
public void step() { if (this.isSolved()) return; explain = true; session.setGlobal("explain", explain); this.counter.setCount(1); session.update(session.getFactHandle(this.counter), this.counter); if( steppingFactHandle == null ){ steppingFactHandle = session.insert( stepping = new Stepping() ); } this.session.fireUntilHalt(); if( stepping.isEmergency() ){ this.unsolvable = true; } // dumpGrid(); }
class class_name[name] begin[{] method[step, return_type[void], modifier[public], parameter[]] begin[{] if[THIS[call[None.isSolved, parameter[]]]] begin[{] return[None] else begin[{] None end[}] assign[member[.explain], literal[true]] call[session.setGlobal, parameter[literal["explain"], member[.explain]]] THIS[member[None.counter]call[None.setCount, parameter[literal[1]]]] call[session.update, parameter[call[session.getFactHandle, parameter[THIS[member[None.counter]]]], THIS[member[None.counter]]]] if[binary_operation[member[.steppingFactHandle], ==, literal[null]]] begin[{] assign[member[.steppingFactHandle], call[session.insert, parameter[assign[member[.stepping], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Stepping, sub_type=None))]]]] else begin[{] None end[}] THIS[member[None.session]call[None.fireUntilHalt, parameter[]]] if[call[stepping.isEmergency, parameter[]]] begin[{] assign[THIS[member[None.unsolvable]], literal[true]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[step] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isSolved] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[explain] operator[=] literal[boolean] operator[SEP] identifier[session] operator[SEP] identifier[setGlobal] operator[SEP] literal[String] , identifier[explain] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[counter] operator[SEP] identifier[setCount] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[update] operator[SEP] identifier[session] operator[SEP] identifier[getFactHandle] operator[SEP] Keyword[this] operator[SEP] identifier[counter] operator[SEP] , Keyword[this] operator[SEP] identifier[counter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[steppingFactHandle] operator[==] Other[null] operator[SEP] { identifier[steppingFactHandle] operator[=] identifier[session] operator[SEP] identifier[insert] operator[SEP] identifier[stepping] operator[=] Keyword[new] identifier[Stepping] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[session] operator[SEP] identifier[fireUntilHalt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stepping] operator[SEP] identifier[isEmergency] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[unsolvable] operator[=] literal[boolean] operator[SEP] } }
public void setInstanceLevel(int[] enabled, int[] enabledSync, int newLevel, boolean recursive) { // fine grained spec is not defined, use 5.0 level if (newLevel != PmiConstants.LEVEL_FINEGRAIN) { if (newLevel != PmiConstants.LEVEL_UNDEFINED) { setInstanceLevel_V5(newLevel, recursive); /* * not need since PmiConfigManager.updateWithRuntimeSpec is always called before persisting * // Update in-memory EMF object (PMIModule) * if (instance == null) * { * if (PmiConfigManager.isInitialized()) * PmiConfigManager.updateSpec(new String[]{"pmi"}, "", newLevel, recursive, false); * } * else * { * if (PmiConfigManager.isInitialized()) * PmiConfigManager.updateSpec(instance.getPath(), instance.getWCCMStatsType(), newLevel, recursive, false); * } */ } } else { if (enabled != null) setInstanceLevel_FG(enabled, enabledSync, recursive); } // update the statistic set in PMIImpl/config //PMIImpl.setStatisticSet(StatConstants.STATISTIC_SET_CUSTOM); }
class class_name[name] begin[{] method[setInstanceLevel, return_type[void], modifier[public], parameter[enabled, enabledSync, newLevel, recursive]] begin[{] if[binary_operation[member[.newLevel], !=, member[PmiConstants.LEVEL_FINEGRAIN]]] begin[{] if[binary_operation[member[.newLevel], !=, member[PmiConstants.LEVEL_UNDEFINED]]] begin[{] call[.setInstanceLevel_V5, parameter[member[.newLevel], member[.recursive]]] else begin[{] None end[}] else begin[{] if[binary_operation[member[.enabled], !=, literal[null]]] begin[{] call[.setInstanceLevel_FG, parameter[member[.enabled], member[.enabledSync], member[.recursive]]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setInstanceLevel] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[enabled] , Keyword[int] operator[SEP] operator[SEP] identifier[enabledSync] , Keyword[int] identifier[newLevel] , Keyword[boolean] identifier[recursive] operator[SEP] { Keyword[if] operator[SEP] identifier[newLevel] operator[!=] identifier[PmiConstants] operator[SEP] identifier[LEVEL_FINEGRAIN] operator[SEP] { Keyword[if] operator[SEP] identifier[newLevel] operator[!=] identifier[PmiConstants] operator[SEP] identifier[LEVEL_UNDEFINED] operator[SEP] { identifier[setInstanceLevel_V5] operator[SEP] identifier[newLevel] , identifier[recursive] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[enabled] operator[!=] Other[null] operator[SEP] identifier[setInstanceLevel_FG] operator[SEP] identifier[enabled] , identifier[enabledSync] , identifier[recursive] operator[SEP] operator[SEP] } }
protected void fireInsertUpdate( DocumentEvent evt ) { super.fireInsertUpdate(evt); try { processChangedLines(evt.getOffset(), evt.getLength()); } catch (BadLocationException ex) { System.out.println("" + ex); } }
class class_name[name] begin[{] method[fireInsertUpdate, return_type[void], modifier[protected], parameter[evt]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fireInsertUpdate, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOffset, postfix_operators=[], prefix_operators=[], qualifier=evt, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=evt, selectors=[], type_arguments=None)], member=processChangedLines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['BadLocationException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[fireInsertUpdate] operator[SEP] identifier[DocumentEvent] identifier[evt] operator[SEP] { Keyword[super] operator[SEP] identifier[fireInsertUpdate] operator[SEP] identifier[evt] operator[SEP] operator[SEP] Keyword[try] { identifier[processChangedLines] operator[SEP] identifier[evt] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] , identifier[evt] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[BadLocationException] identifier[ex] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[ex] operator[SEP] operator[SEP] } }
protected void findMatching(Class<? extends T> type, BiPredicate<Class<? extends T>, D> predicate) { traverseType(type, predicate, new HashSet<>()); }
class class_name[name] begin[{] method[findMatching, return_type[void], modifier[protected], parameter[type, predicate]] begin[{] call[.traverseType, parameter[member[.type], member[.predicate], 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))]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[findMatching] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[type] , identifier[BiPredicate] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] , identifier[D] operator[>] identifier[predicate] operator[SEP] { identifier[traverseType] operator[SEP] identifier[type] , identifier[predicate] , Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setValue(final String key, final String value, final String profile) { if (profile == null) { data.putBaseProperty(key, value, false); } else { data.putProfileProperty(key, value, profile, false); } initialized = false; }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[public], parameter[key, value, profile]] begin[{] if[binary_operation[member[.profile], ==, literal[null]]] begin[{] call[data.putBaseProperty, parameter[member[.key], member[.value], literal[false]]] else begin[{] call[data.putProfileProperty, parameter[member[.key], member[.value], member[.profile], literal[false]]] end[}] assign[member[.initialized], literal[false]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setValue] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[String] identifier[value] , Keyword[final] identifier[String] identifier[profile] operator[SEP] { Keyword[if] operator[SEP] identifier[profile] operator[==] Other[null] operator[SEP] { identifier[data] operator[SEP] identifier[putBaseProperty] operator[SEP] identifier[key] , identifier[value] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[data] operator[SEP] identifier[putProfileProperty] operator[SEP] identifier[key] , identifier[value] , identifier[profile] , literal[boolean] operator[SEP] operator[SEP] } identifier[initialized] operator[=] literal[boolean] operator[SEP] }
@Override public void setExceptionHandler(final ExceptionHandler exceptionHandler) { for (final Worker worker : this.workers) { worker.setExceptionHandler(exceptionHandler); } }
class class_name[name] begin[{] method[setExceptionHandler, return_type[void], modifier[public], parameter[exceptionHandler]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exceptionHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setExceptionHandler, postfix_operators=[], prefix_operators=[], qualifier=worker, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=workers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=worker)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Worker, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setExceptionHandler] operator[SEP] Keyword[final] identifier[ExceptionHandler] identifier[exceptionHandler] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Worker] identifier[worker] operator[:] Keyword[this] operator[SEP] identifier[workers] operator[SEP] { identifier[worker] operator[SEP] identifier[setExceptionHandler] operator[SEP] identifier[exceptionHandler] operator[SEP] operator[SEP] } }
public void setFunctions(java.util.Collection<String> functions) { if (functions == null) { this.functions = null; return; } this.functions = new java.util.ArrayList<String>(functions); }
class class_name[name] begin[{] method[setFunctions, return_type[void], modifier[public], parameter[functions]] begin[{] if[binary_operation[member[.functions], ==, literal[null]]] begin[{] assign[THIS[member[None.functions]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.functions]], ClassCreator(arguments=[MemberReference(member=functions, 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=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFunctions] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[functions] operator[SEP] { Keyword[if] operator[SEP] identifier[functions] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[functions] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[functions] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[functions] operator[SEP] operator[SEP] }
@Override public void visitClassContext(ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); for (CompareSpec entry : compareClasses) { if (cls.implementationOf(entry.getCompareClass())) { methodInfo = entry.getMethodInfo(); stack = new OpcodeStack(); super.visitClassContext(classContext); break; } } } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); } finally { methodInfo = null; stack = null; } }
class class_name[name] begin[{] method[visitClassContext, return_type[void], modifier[public], parameter[classContext]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getJavaClass, postfix_operators=[], prefix_operators=[], qualifier=classContext, selectors=[], type_arguments=None), name=cls)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCompareClass, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=implementationOf, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMethodInfo, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stack, 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=OpcodeStack, sub_type=None))), label=None), StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=classContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitClassContext, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=compareClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CompareSpec, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cnfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportMissingClass, postfix_operators=[], prefix_operators=[], qualifier=bugReporter, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitClassContext] operator[SEP] identifier[ClassContext] identifier[classContext] operator[SEP] { Keyword[try] { identifier[JavaClass] identifier[cls] operator[=] identifier[classContext] operator[SEP] identifier[getJavaClass] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CompareSpec] identifier[entry] operator[:] identifier[compareClasses] operator[SEP] { Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[implementationOf] operator[SEP] identifier[entry] operator[SEP] identifier[getCompareClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[methodInfo] operator[=] identifier[entry] operator[SEP] identifier[getMethodInfo] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[=] Keyword[new] identifier[OpcodeStack] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[visitClassContext] operator[SEP] identifier[classContext] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] { identifier[bugReporter] operator[SEP] identifier[reportMissingClass] operator[SEP] identifier[cnfe] operator[SEP] operator[SEP] } Keyword[finally] { identifier[methodInfo] operator[=] Other[null] operator[SEP] identifier[stack] operator[=] Other[null] operator[SEP] } }
@Override public ExtendedSet<T> tailSet(T fromElement) { if (elements instanceof SortedSet<?>) { GenericExtendedSet<T> c = empty(); c.elements = ((SortedSet<T>) elements).tailSet(fromElement); return c; } return super.headSet(fromElement); }
class class_name[name] begin[{] method[tailSet, return_type[type[ExtendedSet]], modifier[public], parameter[fromElement]] begin[{] if[binary_operation[member[.elements], instanceof, type[SortedSet]]] begin[{] local_variable[type[GenericExtendedSet], c] assign[member[c.elements], Cast(expression=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=SortedSet, sub_type=None))] return[member[.c]] else begin[{] None end[}] return[SuperMethodInvocation(arguments=[MemberReference(member=fromElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=headSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ExtendedSet] operator[<] identifier[T] operator[>] identifier[tailSet] operator[SEP] identifier[T] identifier[fromElement] operator[SEP] { Keyword[if] operator[SEP] identifier[elements] Keyword[instanceof] identifier[SortedSet] operator[<] operator[?] operator[>] operator[SEP] { identifier[GenericExtendedSet] operator[<] identifier[T] operator[>] identifier[c] operator[=] identifier[empty] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[elements] operator[=] operator[SEP] operator[SEP] identifier[SortedSet] operator[<] identifier[T] operator[>] operator[SEP] identifier[elements] operator[SEP] operator[SEP] identifier[tailSet] operator[SEP] identifier[fromElement] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[headSet] operator[SEP] identifier[fromElement] operator[SEP] operator[SEP] }
@NonNull public Searcher updateFacetRefinement(@NonNull String attribute, @NonNull String value, boolean active) { if (active) { addFacetRefinement(attribute, value); } else { removeFacetRefinement(attribute, value); } return this; }
class class_name[name] begin[{] method[updateFacetRefinement, return_type[type[Searcher]], modifier[public], parameter[attribute, value, active]] begin[{] if[member[.active]] begin[{] call[.addFacetRefinement, parameter[member[.attribute], member[.value]]] else begin[{] call[.removeFacetRefinement, parameter[member[.attribute], member[.value]]] end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] identifier[Searcher] identifier[updateFacetRefinement] operator[SEP] annotation[@] identifier[NonNull] identifier[String] identifier[attribute] , annotation[@] identifier[NonNull] identifier[String] identifier[value] , Keyword[boolean] identifier[active] operator[SEP] { Keyword[if] operator[SEP] identifier[active] operator[SEP] { identifier[addFacetRefinement] operator[SEP] identifier[attribute] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { identifier[removeFacetRefinement] operator[SEP] identifier[attribute] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void rotateToFaceCamera(final GVRTransform transform) { //see http://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion final GVRTransform t = getMainCameraRig().getHeadTransform(); final Quaternionf q = new Quaternionf(0, t.getRotationY(), 0, t.getRotationW()).normalize(); transform.rotateWithPivot(q.w, q.x, q.y, q.z, 0, 0, 0); }
class class_name[name] begin[{] method[rotateToFaceCamera, return_type[void], modifier[public], parameter[transform]] begin[{] local_variable[type[GVRTransform], t] local_variable[type[Quaternionf], q] call[transform.rotateWithPivot, parameter[member[q.w], member[q.x], member[q.y], member[q.z], literal[0], literal[0], literal[0]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[rotateToFaceCamera] operator[SEP] Keyword[final] identifier[GVRTransform] identifier[transform] operator[SEP] { Keyword[final] identifier[GVRTransform] identifier[t] operator[=] identifier[getMainCameraRig] operator[SEP] operator[SEP] operator[SEP] identifier[getHeadTransform] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Quaternionf] identifier[q] operator[=] Keyword[new] identifier[Quaternionf] operator[SEP] Other[0] , identifier[t] operator[SEP] identifier[getRotationY] operator[SEP] operator[SEP] , Other[0] , identifier[t] operator[SEP] identifier[getRotationW] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] identifier[transform] operator[SEP] identifier[rotateWithPivot] operator[SEP] identifier[q] operator[SEP] identifier[w] , identifier[q] operator[SEP] identifier[x] , identifier[q] operator[SEP] identifier[y] , identifier[q] operator[SEP] identifier[z] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] }
public static MediaPictureConverter createConverter( String converterDescriptor, PixelFormat.Type pictureType, int pictureWidth, int pictureHeight, int imageWidth, int imageHeight) { MediaPictureConverter converter = null; // establish the converter type Type converterType = findRegisteredConverter(converterDescriptor); if (null == converterType) throw new UnsupportedOperationException( "No converter \"" + converterDescriptor + "\" found."); // create the converter try { // establish the constructor Constructor<? extends MediaPictureConverter> converterConstructor = converterType.getConverterClass().getConstructor(PixelFormat.Type.class, int.class, int.class, int.class, int.class); // create the converter converter = converterConstructor.newInstance( pictureType, pictureWidth, pictureHeight, imageWidth, imageHeight); } catch (NoSuchMethodException e) { throw new UnsupportedOperationException( "Converter " + converterType.getConverterClass() + " requries a constructor of the form " + "(PixelFormat.Type, int, int, int, int)"); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); if (cause != null && cause instanceof OutOfMemoryError) { throw (OutOfMemoryError)cause; } else { throw new UnsupportedOperationException( "Converter " + converterType.getConverterClass() + " constructor failed with: " + e.getCause()); } } catch (IllegalAccessException e) { Throwable cause = e.getCause(); if (cause != null && cause instanceof OutOfMemoryError) { throw (OutOfMemoryError)cause; } else { throw new UnsupportedOperationException( "Converter " + converterType.getConverterClass() + " constructor failed with: " + e.getCause()); } } catch (InstantiationException e) { Throwable cause = e.getCause(); if (cause != null && cause instanceof OutOfMemoryError) { throw (OutOfMemoryError)cause; } else { throw new UnsupportedOperationException( "Converter " + converterType.getConverterClass() + " constructor failed with: " + e.getCause()); } } // return the newly created converter return converter; }
class class_name[name] begin[{] method[createConverter, return_type[type[MediaPictureConverter]], modifier[public static], parameter[converterDescriptor, pictureType, pictureWidth, pictureHeight, imageWidth, imageHeight]] begin[{] local_variable[type[MediaPictureConverter], converter] local_variable[type[Type], converterType] if[binary_operation[literal[null], ==, member[.converterType]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No converter \""), operandr=MemberReference(member=converterDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" found."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConverterClass, postfix_operators=[], prefix_operators=[], qualifier=converterType, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=PixelFormat, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int))], member=getConstructor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=converterConstructor)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=MediaPictureConverter, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=pictureType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pictureWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pictureHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=imageWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=imageHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=converterConstructor, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Converter "), operandr=MethodInvocation(arguments=[], member=getConverterClass, postfix_operators=[], prefix_operators=[], qualifier=converterType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" requries a constructor of the form "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(PixelFormat.Type, int, int, int, int)"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=cause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=OutOfMemoryError, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Converter "), operandr=MethodInvocation(arguments=[], member=getConverterClass, postfix_operators=[], prefix_operators=[], qualifier=converterType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" constructor failed with: "), operator=+), operandr=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OutOfMemoryError, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=cause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=OutOfMemoryError, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Converter "), operandr=MethodInvocation(arguments=[], member=getConverterClass, postfix_operators=[], prefix_operators=[], qualifier=converterType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" constructor failed with: "), operator=+), operandr=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OutOfMemoryError, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=cause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=OutOfMemoryError, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Converter "), operandr=MethodInvocation(arguments=[], member=getConverterClass, postfix_operators=[], prefix_operators=[], qualifier=converterType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" constructor failed with: "), operator=+), operandr=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OutOfMemoryError, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstantiationException']))], finally_block=None, label=None, resources=None) return[member[.converter]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MediaPictureConverter] identifier[createConverter] operator[SEP] identifier[String] identifier[converterDescriptor] , identifier[PixelFormat] operator[SEP] identifier[Type] identifier[pictureType] , Keyword[int] identifier[pictureWidth] , Keyword[int] identifier[pictureHeight] , Keyword[int] identifier[imageWidth] , Keyword[int] identifier[imageHeight] operator[SEP] { identifier[MediaPictureConverter] identifier[converter] operator[=] Other[null] operator[SEP] identifier[Type] identifier[converterType] operator[=] identifier[findRegisteredConverter] operator[SEP] identifier[converterDescriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[converterType] operator[SEP] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[converterDescriptor] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[MediaPictureConverter] operator[>] identifier[converterConstructor] operator[=] identifier[converterType] operator[SEP] identifier[getConverterClass] operator[SEP] operator[SEP] operator[SEP] identifier[getConstructor] operator[SEP] identifier[PixelFormat] operator[SEP] identifier[Type] operator[SEP] Keyword[class] , Keyword[int] operator[SEP] Keyword[class] , Keyword[int] operator[SEP] Keyword[class] , Keyword[int] operator[SEP] Keyword[class] , Keyword[int] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[converter] operator[=] identifier[converterConstructor] operator[SEP] identifier[newInstance] operator[SEP] identifier[pictureType] , identifier[pictureWidth] , identifier[pictureHeight] , identifier[imageWidth] , identifier[imageHeight] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[converterType] operator[SEP] identifier[getConverterClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] { identifier[Throwable] identifier[cause] operator[=] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] operator[!=] Other[null] operator[&&] identifier[cause] Keyword[instanceof] identifier[OutOfMemoryError] operator[SEP] { Keyword[throw] operator[SEP] identifier[OutOfMemoryError] operator[SEP] identifier[cause] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[converterType] operator[SEP] identifier[getConverterClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { identifier[Throwable] identifier[cause] operator[=] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] operator[!=] Other[null] operator[&&] identifier[cause] Keyword[instanceof] identifier[OutOfMemoryError] operator[SEP] { Keyword[throw] operator[SEP] identifier[OutOfMemoryError] operator[SEP] identifier[cause] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[converterType] operator[SEP] identifier[getConverterClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] { identifier[Throwable] identifier[cause] operator[=] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] operator[!=] Other[null] operator[&&] identifier[cause] Keyword[instanceof] identifier[OutOfMemoryError] operator[SEP] { Keyword[throw] operator[SEP] identifier[OutOfMemoryError] operator[SEP] identifier[cause] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[converterType] operator[SEP] identifier[getConverterClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[converter] operator[SEP] }
private AmqpBuffer putBit(Boolean v) { byte value = 0; if (v) { value = 1; } if (this.bitCount > 0) { byte lastByte = this.getAt(this.position() - 1); lastByte = (byte)((value << this.bitCount) | lastByte); this.putAt(this.position() - 1, lastByte); } else { this.putUnsigned(value); } return this; }
class class_name[name] begin[{] method[putBit, return_type[type[AmqpBuffer]], modifier[private], parameter[v]] begin[{] local_variable[type[byte], value] if[member[.v]] begin[{] assign[member[.value], literal[1]] else begin[{] None end[}] if[binary_operation[THIS[member[None.bitCount]], >, literal[0]]] begin[{] local_variable[type[byte], lastByte] assign[member[.lastByte], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bitCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<<), operandr=MemberReference(member=lastByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), type=BasicType(dimensions=[], name=byte))] THIS[call[None.putAt, parameter[binary_operation[THIS[call[None.position, parameter[]]], -, literal[1]], member[.lastByte]]]] else begin[{] THIS[call[None.putUnsigned, parameter[member[.value]]]] end[}] return[THIS[]] end[}] END[}]
Keyword[private] identifier[AmqpBuffer] identifier[putBit] operator[SEP] identifier[Boolean] identifier[v] operator[SEP] { Keyword[byte] identifier[value] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[SEP] { identifier[value] operator[=] Other[1] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[bitCount] operator[>] Other[0] operator[SEP] { Keyword[byte] identifier[lastByte] operator[=] Keyword[this] operator[SEP] identifier[getAt] operator[SEP] Keyword[this] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[lastByte] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[<<] Keyword[this] operator[SEP] identifier[bitCount] operator[SEP] operator[|] identifier[lastByte] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[putAt] operator[SEP] Keyword[this] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[lastByte] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[putUnsigned] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void putClientMetrics(ClientMetrics clientMetrics) throws GalaxyFDSClientException { URI uri = formatUri(fdsConfig.getBaseUri(), "", (SubResource[]) null); ContentType contentType = ContentType.APPLICATION_JSON; HashMap<String, String> params = new HashMap<String, String>(); params.put("clientMetrics", ""); HttpEntity requestEntity = getJsonStringEntity(clientMetrics, contentType); HttpUriRequest httpRequest = prepareRequestMethod(uri, HttpMethod.PUT, contentType, null, params, null, requestEntity); HttpResponse response = executeHttpRequest(httpRequest, Action.PutClientMetrics); processResponse(response, null, "put client metrics"); }
class class_name[name] begin[{] method[putClientMetrics, return_type[void], modifier[public], parameter[clientMetrics]] begin[{] local_variable[type[URI], uri] local_variable[type[ContentType], contentType] local_variable[type[HashMap], params] call[params.put, parameter[literal["clientMetrics"], literal[""]]] local_variable[type[HttpEntity], requestEntity] local_variable[type[HttpUriRequest], httpRequest] local_variable[type[HttpResponse], response] call[.processResponse, parameter[member[.response], literal[null], literal["put client metrics"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[putClientMetrics] operator[SEP] identifier[ClientMetrics] identifier[clientMetrics] operator[SEP] Keyword[throws] identifier[GalaxyFDSClientException] { identifier[URI] identifier[uri] operator[=] identifier[formatUri] operator[SEP] identifier[fdsConfig] operator[SEP] identifier[getBaseUri] operator[SEP] operator[SEP] , literal[String] , operator[SEP] identifier[SubResource] operator[SEP] operator[SEP] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[ContentType] identifier[contentType] operator[=] identifier[ContentType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[HttpEntity] identifier[requestEntity] operator[=] identifier[getJsonStringEntity] operator[SEP] identifier[clientMetrics] , identifier[contentType] operator[SEP] operator[SEP] identifier[HttpUriRequest] identifier[httpRequest] operator[=] identifier[prepareRequestMethod] operator[SEP] identifier[uri] , identifier[HttpMethod] operator[SEP] identifier[PUT] , identifier[contentType] , Other[null] , identifier[params] , Other[null] , identifier[requestEntity] operator[SEP] operator[SEP] identifier[HttpResponse] identifier[response] operator[=] identifier[executeHttpRequest] operator[SEP] identifier[httpRequest] , identifier[Action] operator[SEP] identifier[PutClientMetrics] operator[SEP] operator[SEP] identifier[processResponse] operator[SEP] identifier[response] , Other[null] , literal[String] operator[SEP] operator[SEP] }
public static String getDisplayName(String localeID, ULocale displayLocale) { return getDisplayNameInternal(new ULocale(localeID), displayLocale); }
class class_name[name] begin[{] method[getDisplayName, return_type[type[String]], modifier[public static], parameter[localeID, displayLocale]] begin[{] return[call[.getDisplayNameInternal, parameter[ClassCreator(arguments=[MemberReference(member=localeID, 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=ULocale, sub_type=None)), member[.displayLocale]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getDisplayName] operator[SEP] identifier[String] identifier[localeID] , identifier[ULocale] identifier[displayLocale] operator[SEP] { Keyword[return] identifier[getDisplayNameInternal] operator[SEP] Keyword[new] identifier[ULocale] operator[SEP] identifier[localeID] operator[SEP] , identifier[displayLocale] operator[SEP] operator[SEP] }
public static boolean available(String groupName, String unitName) { return LocalUnitsManager.getLocalUnit(groupName, unitName) != null || UnitDiscovery.singleton != null && UnitDiscovery.singleton.firstInstance(Unit.fullName(groupName, unitName)) != null; }
class class_name[name] begin[{] method[available, return_type[type[boolean]], modifier[public static], parameter[groupName, unitName]] begin[{] return[binary_operation[binary_operation[call[LocalUnitsManager.getLocalUnit, parameter[member[.groupName], member[.unitName]]], !=, literal[null]], ||, binary_operation[binary_operation[member[UnitDiscovery.singleton], !=, literal[null]], &&, binary_operation[call[UnitDiscovery.singleton.firstInstance, parameter[call[Unit.fullName, parameter[member[.groupName], member[.unitName]]]]], !=, literal[null]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[available] operator[SEP] identifier[String] identifier[groupName] , identifier[String] identifier[unitName] operator[SEP] { Keyword[return] identifier[LocalUnitsManager] operator[SEP] identifier[getLocalUnit] operator[SEP] identifier[groupName] , identifier[unitName] operator[SEP] operator[!=] Other[null] operator[||] identifier[UnitDiscovery] operator[SEP] identifier[singleton] operator[!=] Other[null] operator[&&] identifier[UnitDiscovery] operator[SEP] identifier[singleton] operator[SEP] identifier[firstInstance] operator[SEP] identifier[Unit] operator[SEP] identifier[fullName] operator[SEP] identifier[groupName] , identifier[unitName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] }
public void setUniformDistribution(UniformDistributionType newUniformDistribution) { ((FeatureMap.Internal)getMixed()).set(BpsimPackage.Literals.DOCUMENT_ROOT__UNIFORM_DISTRIBUTION, newUniformDistribution); }
class class_name[name] begin[{] method[setUniformDistribution, return_type[void], modifier[public], parameter[newUniformDistribution]] begin[{] Cast(expression=MethodInvocation(arguments=[], member=getMixed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FeatureMap, sub_type=ReferenceType(arguments=None, dimensions=None, name=Internal, sub_type=None))) end[}] END[}]
Keyword[public] Keyword[void] identifier[setUniformDistribution] operator[SEP] identifier[UniformDistributionType] identifier[newUniformDistribution] operator[SEP] { operator[SEP] operator[SEP] identifier[FeatureMap] operator[SEP] identifier[Internal] operator[SEP] identifier[getMixed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[BpsimPackage] operator[SEP] identifier[Literals] operator[SEP] identifier[DOCUMENT_ROOT__UNIFORM_DISTRIBUTION] , identifier[newUniformDistribution] operator[SEP] operator[SEP] }
public void flushInternal() throws IOException { if (listener == null) { if (anyAreSet(state, FLAG_CLOSED)) { //just return return; } if (buffer != null && buffer.position() != 0) { writeBufferBlocking(false); } if (channel == null) { channel = servletRequestContext.getExchange().getResponseChannel(); } Channels.flushBlocking(channel); } else { if (anyAreClear(state, FLAG_READY)) { return; } createChannel(); if (buffer == null || buffer.position() == 0) { //nothing to flush, we just flush the underlying stream //it does not matter if this succeeds or not channel.flush(); return; } //we have some data in the buffer, we can just write it out //if the write fails we just compact, rather than changing the ready state setFlags(FLAG_WRITE_STARTED); buffer.flip(); long res; do { res = channel.write(buffer); } while (buffer.hasRemaining() && res != 0); if (!buffer.hasRemaining()) { channel.flush(); } buffer.compact(); } }
class class_name[name] begin[{] method[flushInternal, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.listener], ==, literal[null]]] begin[{] if[call[.anyAreSet, parameter[member[.state], member[.FLAG_CLOSED]]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[binary_operation[member[.buffer], !=, literal[null]], &&, binary_operation[call[buffer.position, parameter[]], !=, literal[0]]]] begin[{] call[.writeBufferBlocking, parameter[literal[false]]] else begin[{] None end[}] if[binary_operation[member[.channel], ==, literal[null]]] begin[{] assign[member[.channel], call[servletRequestContext.getExchange, parameter[]]] else begin[{] None end[}] call[Channels.flushBlocking, parameter[member[.channel]]] else begin[{] if[call[.anyAreClear, parameter[member[.state], member[.FLAG_READY]]]] begin[{] return[None] else begin[{] None end[}] call[.createChannel, parameter[]] if[binary_operation[binary_operation[member[.buffer], ==, literal[null]], ||, binary_operation[call[buffer.position, parameter[]], ==, literal[0]]]] begin[{] call[channel.flush, parameter[]] return[None] else begin[{] None end[}] call[.setFlags, parameter[member[.FLAG_WRITE_STARTED]]] call[buffer.flip, parameter[]] local_variable[type[long], res] do[binary_operation[call[buffer.hasRemaining, parameter[]], &&, binary_operation[member[.res], !=, literal[0]]]] begin[{] assign[member[.res], call[channel.write, parameter[member[.buffer]]]] end[}] if[call[buffer.hasRemaining, parameter[]]] begin[{] call[channel.flush, parameter[]] else begin[{] None end[}] call[buffer.compact, parameter[]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[flushInternal] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[listener] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[anyAreSet] operator[SEP] identifier[state] , identifier[FLAG_CLOSED] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[buffer] operator[!=] Other[null] operator[&&] identifier[buffer] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[writeBufferBlocking] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[channel] operator[==] Other[null] operator[SEP] { identifier[channel] operator[=] identifier[servletRequestContext] operator[SEP] identifier[getExchange] operator[SEP] operator[SEP] operator[SEP] identifier[getResponseChannel] operator[SEP] operator[SEP] operator[SEP] } identifier[Channels] operator[SEP] identifier[flushBlocking] operator[SEP] identifier[channel] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[anyAreClear] operator[SEP] identifier[state] , identifier[FLAG_READY] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[createChannel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buffer] operator[==] Other[null] operator[||] identifier[buffer] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[channel] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[setFlags] operator[SEP] identifier[FLAG_WRITE_STARTED] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[res] operator[SEP] Keyword[do] { identifier[res] operator[=] identifier[channel] operator[SEP] identifier[write] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[buffer] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[&&] identifier[res] operator[!=] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[buffer] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] { identifier[channel] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[compact] operator[SEP] operator[SEP] operator[SEP] } }
private void initClassPath() { /* Classpath can be specified in one of two ways, depending on whether the compilation is embedded or invoked from Jspc. 1. Calculated by the web container, and passed to Jasper in the context attribute. 2. Jspc directly invoke JspCompilationContext.setClassPath, in case the classPath initialzed here is ignored. */ StringBuilder cpath = new StringBuilder(); String sep = System.getProperty("path.separator"); cpath.append(options.getScratchDir() + sep); String cp = (String) context.getAttribute(Constants.SERVLET_CLASSPATH); if (cp == null || cp.equals("")) { cp = options.getClassPath(); } if (cp != null) { classpath = cpath.toString() + cp; } // START GlassFish Issue 845 if (classpath != null) { try { classpath = URLDecoder.decode(classpath, "UTF-8"); } catch (UnsupportedEncodingException e) { if (log.isLoggable(Level.FINE)) log.log(Level.FINE, "Exception decoding classpath : " + classpath, e); } } // END GlassFish Issue 845 }
class class_name[name] begin[{] method[initClassPath, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[StringBuilder], cpath] local_variable[type[String], sep] call[cpath.append, parameter[binary_operation[call[options.getScratchDir, parameter[]], +, member[.sep]]]] local_variable[type[String], cp] if[binary_operation[binary_operation[member[.cp], ==, literal[null]], ||, call[cp.equals, parameter[literal[""]]]]] begin[{] assign[member[.cp], call[options.getClassPath, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.cp], !=, literal[null]]] begin[{] assign[member[.classpath], binary_operation[call[cpath.toString, parameter[]], +, member[.cp]]] else begin[{] None end[}] if[binary_operation[member[.classpath], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=classpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=classpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=decode, postfix_operators=[], prefix_operators=[], qualifier=URLDecoder, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception decoding classpath : "), operandr=MemberReference(member=classpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[initClassPath] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[cpath] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[sep] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cpath] operator[SEP] identifier[append] operator[SEP] identifier[options] operator[SEP] identifier[getScratchDir] operator[SEP] operator[SEP] operator[+] identifier[sep] operator[SEP] operator[SEP] identifier[String] identifier[cp] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[context] operator[SEP] identifier[getAttribute] operator[SEP] identifier[Constants] operator[SEP] identifier[SERVLET_CLASSPATH] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cp] operator[==] Other[null] operator[||] identifier[cp] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[cp] operator[=] identifier[options] operator[SEP] identifier[getClassPath] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cp] operator[!=] Other[null] operator[SEP] { identifier[classpath] operator[=] identifier[cpath] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] identifier[cp] operator[SEP] } Keyword[if] operator[SEP] identifier[classpath] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[classpath] operator[=] identifier[URLDecoder] operator[SEP] identifier[decode] operator[SEP] identifier[classpath] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[+] identifier[classpath] , identifier[e] operator[SEP] operator[SEP] } } }
public ListBackupPlansResult withBackupPlansList(BackupPlansListMember... backupPlansList) { if (this.backupPlansList == null) { setBackupPlansList(new java.util.ArrayList<BackupPlansListMember>(backupPlansList.length)); } for (BackupPlansListMember ele : backupPlansList) { this.backupPlansList.add(ele); } return this; }
class class_name[name] begin[{] method[withBackupPlansList, return_type[type[ListBackupPlansResult]], modifier[public], parameter[backupPlansList]] begin[{] if[binary_operation[THIS[member[None.backupPlansList]], ==, literal[null]]] begin[{] call[.setBackupPlansList, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=backupPlansList, 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=BackupPlansListMember, 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=backupPlansList, 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=backupPlansList, 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=BackupPlansListMember, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ListBackupPlansResult] identifier[withBackupPlansList] operator[SEP] identifier[BackupPlansListMember] operator[...] identifier[backupPlansList] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[backupPlansList] operator[==] Other[null] operator[SEP] { identifier[setBackupPlansList] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[BackupPlansListMember] operator[>] operator[SEP] identifier[backupPlansList] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[BackupPlansListMember] identifier[ele] operator[:] identifier[backupPlansList] operator[SEP] { Keyword[this] operator[SEP] identifier[backupPlansList] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected void setProperties(Properties properties) { Properties oldProperties = internalProperties; synchronized(this) { internalProperties = properties; } notifyPropertiesChanged(oldProperties); }
class class_name[name] begin[{] method[setProperties, return_type[void], modifier[protected], parameter[properties]] begin[{] local_variable[type[Properties], oldProperties] SYNCHRONIZED[THIS[]] BEGIN[{] assign[member[.internalProperties], member[.properties]] END[}] call[.notifyPropertiesChanged, parameter[member[.oldProperties]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[setProperties] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] { identifier[Properties] identifier[oldProperties] operator[=] identifier[internalProperties] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[internalProperties] operator[=] identifier[properties] operator[SEP] } identifier[notifyPropertiesChanged] operator[SEP] identifier[oldProperties] operator[SEP] operator[SEP] }
public static RedissonCache monitor(MeterRegistry registry, RedissonCache cache, Iterable<Tag> tags) { new RedissonCacheMetrics(cache, tags).bindTo(registry); return cache; }
class class_name[name] begin[{] method[monitor, return_type[type[RedissonCache]], modifier[public static], parameter[registry, cache, tags]] begin[{] ClassCreator(arguments=[MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=registry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bindTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=RedissonCacheMetrics, sub_type=None)) return[member[.cache]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RedissonCache] identifier[monitor] operator[SEP] identifier[MeterRegistry] identifier[registry] , identifier[RedissonCache] identifier[cache] , identifier[Iterable] operator[<] identifier[Tag] operator[>] identifier[tags] operator[SEP] { Keyword[new] identifier[RedissonCacheMetrics] operator[SEP] identifier[cache] , identifier[tags] operator[SEP] operator[SEP] identifier[bindTo] operator[SEP] identifier[registry] operator[SEP] operator[SEP] Keyword[return] identifier[cache] operator[SEP] }
@Override public Headers getHeaders() { UIContext uic = UIContextHolder.getCurrent(); return uic == null ? null : uic.getHeaders(); }
class class_name[name] begin[{] method[getHeaders, return_type[type[Headers]], modifier[public], parameter[]] begin[{] local_variable[type[UIContext], uic] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=uic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getHeaders, postfix_operators=[], prefix_operators=[], qualifier=uic, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Headers] identifier[getHeaders] operator[SEP] operator[SEP] { identifier[UIContext] identifier[uic] operator[=] identifier[UIContextHolder] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[uic] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[uic] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] }
protected void linearScanBatchKNN(List<O> objs, List<KNNHeap> heaps) { final PrimitiveDistanceFunction<? super O> rawdist = this.rawdist; final Relation<? extends O> relation = getRelation(); final int size = objs.size(); // Linear scan style KNN. for(DBIDIter iter = relation.getDBIDs().iter(); iter.valid(); iter.advance()) { O candidate = relation.get(iter); for(int index = 0; index < size; index++) { final KNNHeap heap = heaps.get(index); final double dist = rawdist.distance(objs.get(index), candidate); if(dist <= heap.getKNNDistance()) { heap.insert(dist, iter); } } } }
class class_name[name] begin[{] method[linearScanBatchKNN, return_type[void], modifier[protected], parameter[objs, heaps]] begin[{] local_variable[type[PrimitiveDistanceFunction], rawdist] local_variable[type[Relation], relation] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None), name=candidate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=O, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=heaps, selectors=[], type_arguments=None), name=heap)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=KNNHeap, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=objs, selectors=[], type_arguments=None), MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=distance, postfix_operators=[], prefix_operators=[], qualifier=rawdist, selectors=[], type_arguments=None), name=dist)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getKNNDistance, postfix_operators=[], prefix_operators=[], qualifier=heap, selectors=[], type_arguments=None), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=heap, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getDBIDs, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[MethodInvocation(arguments=[], member=iter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None)]), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[linearScanBatchKNN] operator[SEP] identifier[List] operator[<] identifier[O] operator[>] identifier[objs] , identifier[List] operator[<] identifier[KNNHeap] operator[>] identifier[heaps] operator[SEP] { Keyword[final] identifier[PrimitiveDistanceFunction] operator[<] operator[?] Keyword[super] identifier[O] operator[>] identifier[rawdist] operator[=] Keyword[this] operator[SEP] identifier[rawdist] operator[SEP] Keyword[final] identifier[Relation] operator[<] operator[?] Keyword[extends] identifier[O] operator[>] identifier[relation] operator[=] identifier[getRelation] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[size] operator[=] identifier[objs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DBIDIter] identifier[iter] operator[=] identifier[relation] operator[SEP] identifier[getDBIDs] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] { identifier[O] identifier[candidate] operator[=] identifier[relation] operator[SEP] identifier[get] operator[SEP] identifier[iter] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[index] operator[<] identifier[size] operator[SEP] identifier[index] operator[++] operator[SEP] { Keyword[final] identifier[KNNHeap] identifier[heap] operator[=] identifier[heaps] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[dist] operator[=] identifier[rawdist] operator[SEP] identifier[distance] operator[SEP] identifier[objs] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] , identifier[candidate] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] operator[<=] identifier[heap] operator[SEP] identifier[getKNNDistance] operator[SEP] operator[SEP] operator[SEP] { identifier[heap] operator[SEP] identifier[insert] operator[SEP] identifier[dist] , identifier[iter] operator[SEP] operator[SEP] } } } }
@SuppressWarnings("unchecked") @Override public EList<IfcDocumentReference> getHasDocumentReferences() { return (EList<IfcDocumentReference>) eGet( Ifc4Package.Literals.IFC_DOCUMENT_INFORMATION__HAS_DOCUMENT_REFERENCES, true); }
class class_name[name] begin[{] method[getHasDocumentReferences, return_type[type[EList]], modifier[public], parameter[]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_DOCUMENT_INFORMATION__HAS_DOCUMENT_REFERENCES, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcDocumentReference, sub_type=None))], dimensions=[], name=EList, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[IfcDocumentReference] operator[>] identifier[getHasDocumentReferences] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcDocumentReference] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_DOCUMENT_INFORMATION__HAS_DOCUMENT_REFERENCES] , literal[boolean] operator[SEP] operator[SEP] }
public List<CmsRelation> readRelations(CmsRelationFilter filter) throws CmsException { return m_securityManager.getRelationsForResource(m_context, null, filter); }
class class_name[name] begin[{] method[readRelations, return_type[type[List]], modifier[public], parameter[filter]] begin[{] return[call[m_securityManager.getRelationsForResource, parameter[member[.m_context], literal[null], member[.filter]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CmsRelation] operator[>] identifier[readRelations] operator[SEP] identifier[CmsRelationFilter] identifier[filter] operator[SEP] Keyword[throws] identifier[CmsException] { Keyword[return] identifier[m_securityManager] operator[SEP] identifier[getRelationsForResource] operator[SEP] identifier[m_context] , Other[null] , identifier[filter] operator[SEP] operator[SEP] }
@Override public void registerAsynchConsumer( AsynchConsumerCallback callback, int maxActiveMessages, long messageLockExpiry, int maxBatchSize, Reliability unrecoverableReliability, boolean inLine, OrderingContextImpl orderingGroup, ExternalConsumerLock optionalCallbackBusyLock) throws SISessionUnavailableException, SISessionDroppedException, SIErrorException, SIIncorrectCallException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "registerAsynchConsumer", new Object[] { this, callback, Integer.valueOf(maxActiveMessages), Long.valueOf(messageLockExpiry), Integer.valueOf(maxBatchSize), unrecoverableReliability, Boolean.valueOf(inLine), orderingGroup, optionalCallbackBusyLock }); // Check that the values are valid checkParams(maxActiveMessages, messageLockExpiry, maxBatchSize); if (optionalCallbackBusyLock != null) { // The callback wants to block our asynch consumer thread sometimes. // It wants to know that when it has this lock, the asynch consumer // thread is not currently busy. // As of 14May2004, the only consumer to use this function is the // mediation point. Doing so prevents deadlocks between the mediation // state machine lock, and a separate async consumer lock, by making // them one and the same lock. // Thus, when an action is being processed within the state machine, // the async consumer is blocked, and similarly, if the async // consumer is busy passing a message to the mediation, no new events // can enter the mediation point state machine. // Use this optional lock instead of the default lock we wouls use. // ie: The "this" reference on the async consumer itself. _asynchConsumerBusyLock = optionalCallbackBusyLock; } // Synchronized against any other asyncConsumer work on this LCP or keyGroup synchronized (_asynchConsumerBusyLock) { // Synchronize on the consumer state this.lock(); try { // Only valid if the consumer session is still open checkNotClosed(); // we can't register a callback if the LCP is not in a stopped state // so throw an exception if (!_stopped) { SIIncorrectCallException e = new SIIncorrectCallException( nls.getFormattedMessage( "ASYNCH_CONSUMER_RUN_ERROR_CWSIP0176", new Object[] { _consumerDispatcher.getDestination().getName(), _consumerDispatcher.getMessageProcessor().getMessagingEngineName() }, null)); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "registerAsynchConsumer", e); throw e; } if (_waiting) // We're in a synchronous receive! { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "registerAsynchConsumer", "waiting == true"); throw new SIIncorrectCallException( nls.getFormattedMessage("RECEIVE_USAGE_ERROR_CWSIP0174", new Object[] { _consumerDispatcher.getDestination().getName(), _messageProcessor.getMessagingEngineName() }, null)); } // set the recoverability options (they will only be overridden by // an internal Core SPI user (Comms). if (unrecoverableReliability != null) setUnrecoverability(unrecoverableReliability); // Remember the callback object (could be null) _asynchConsumer.registerCallback(callback); if (callback != null) { // If ordered, override maxbatchsize to be 1 // defect 114998 if (_destinationAttachedTo.isOrdered() && maxBatchSize > 1) { _maxBatchSize = 1; // Override and warn if ordered destination SibTr.warning(tc, SibTr.Suppressor.ALL_AFTER_FIRST_SIMILAR_INSERTS, "MAX_BATCH_SIZE_OVERRIDE_WARNING_CWSIP0181", new Object[] { _destinationAttachedTo.getName() }); } else _maxBatchSize = maxBatchSize; _inLine = inLine; _maxActiveMessages = maxActiveMessages; if (_maxActiveMessages > 0) { // (F001731) // If the destination has the "MsgBlockWarningInterval" context property set (probably WPS event sequencing) // then we need to warn if this consumer ever stays stuck for too long with its maximum active messages. _activeMsgBlockInterval = -1; Object value = _destinationAttachedTo.getContextValue("MsgBlockWarningInterval"); if ((value != null) && (value instanceof Integer)) { _activeMsgBlockInterval = ((Integer) value).intValue(); if (_activeMsgBlockInterval < 0) _activeMsgBlockInterval = -1; } } // Reset the active messages under this new asynch consumer _currentActiveMessages = 0; // Tell the LME the currentmessageLockExpiry value _allLockedMessages.setMessageLockExpiry(messageLockExpiry); // This flag is checked by synchronous consumers _asynchConsumerRegistered = true; // Asynch consumers are always transacted. _transacted = true; // Create an ordering group member if we need one. // Ordering in conjunction with pubsub or reading ahead means nothing // so we just ignore the request to order if ((orderingGroup != null) && !_destinationAttachedTo.isPubSub() && !_consumerSession.getReadAhead()) { // If we're not just re-registering with the same orderingGroup we have some work // to do. if (_orderingGroup != orderingGroup) { // If we're already in a different group remove ourselves from it first if (_orderingGroup != null) _consumerKey.leaveKeyGroup(); _orderingGroup = orderingGroup; // Move this consumer's key into a key group that represents this // ordering group on this consumerDispatcher try { _keyGroup = (LocalQPConsumerKeyGroup) _consumerDispatcher.joinKeyGroup(_consumerKey, orderingGroup); } catch (SIResourceException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.registerAsynchConsumer", "1:2367:1.22.5.1", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "registerAsynchConsumer", "SIIncorrectCallException"); throw new SIIncorrectCallException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConsumerDispatcher", "1:2376:1.22.5.1", SIMPUtils.getStackTrace(e) }, null)); } if (_keyGroup != null) { // Where we would lock our asynchConsumer we now need to lock the // entire keyGroup. // NOTE: if a callback busy lock was supplied this overrides the group // lock, we assume this user knows what they are doing (all the ordered // members have the same callback lock passed in). // From this point on the lock we currently hold (asynchConsumer) is next // to useless as anyone else will lock the asynchGroupLock instead so we // must not do ANYTHING else important after this point! if (optionalCallbackBusyLock == null) _asynchConsumerBusyLock = _keyGroup.getAsynchGroupLock(); } } } } else { // The callback is actually being deregistered _asynchConsumerRegistered = false; // Restore the recoverability of the session resetBaseUnrecoverability(); _inLine = false; if (_orderingGroup != null) { // Remove us from the keyGroup _consumerKey.leaveKeyGroup(); _keyGroup = null; _asynchConsumerBusyLock = _asynchConsumer; _orderingGroup = null; } } // We keep a handle to the external lock object as we need to check // with it periodically to see if there is anyone wanting to take // the lock that we hold. _externalConsumerLock = optionalCallbackBusyLock; } // synchronized finally { this.unlock(); } } // synchronized if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "registerAsynchConsumer"); }
class class_name[name] begin[{] method[registerAsynchConsumer, return_type[void], modifier[public], parameter[callback, maxActiveMessages, messageLockExpiry, maxBatchSize, unrecoverableReliability, inLine, orderingGroup, optionalCallbackBusyLock]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["registerAsynchConsumer"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=maxActiveMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=messageLockExpiry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=maxBatchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MemberReference(member=unrecoverableReliability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=inLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MemberReference(member=orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=optionalCallbackBusyLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] call[.checkParams, parameter[member[.maxActiveMessages], member[.messageLockExpiry], member[.maxBatchSize]]] if[binary_operation[member[.optionalCallbackBusyLock], !=, literal[null]]] begin[{] assign[member[._asynchConsumerBusyLock], member[.optionalCallbackBusyLock]] else begin[{] None end[}] SYNCHRONIZED[member[._asynchConsumerBusyLock]] BEGIN[{] THIS[call[None.lock, parameter[]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkNotClosed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=_stopped, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ASYNCH_CONSUMER_RUN_ERROR_CWSIP0176"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getDestination, postfix_operators=[], prefix_operators=[], qualifier=_consumerDispatcher, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getMessageProcessor, postfix_operators=[], prefix_operators=[], qualifier=_consumerDispatcher, selectors=[MethodInvocation(arguments=[], member=getMessagingEngineName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIIncorrectCallException, sub_type=None)), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SIIncorrectCallException, sub_type=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="registerAsynchConsumer"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=MemberReference(member=_waiting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=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="registerAsynchConsumer"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="waiting == true")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="RECEIVE_USAGE_ERROR_CWSIP0174"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getDestination, postfix_operators=[], prefix_operators=[], qualifier=_consumerDispatcher, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getMessagingEngineName, postfix_operators=[], prefix_operators=[], qualifier=_messageProcessor, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIIncorrectCallException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=unrecoverableReliability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=unrecoverableReliability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setUnrecoverability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerCallback, postfix_operators=[], prefix_operators=[], qualifier=_asynchConsumer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_asynchConsumerRegistered, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=resetBaseUnrecoverability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_inLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=leaveKeyGroup, postfix_operators=[], prefix_operators=[], qualifier=_consumerKey, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_keyGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_asynchConsumerBusyLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=_asynchConsumer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isOrdered, postfix_operators=[], prefix_operators=[], qualifier=_destinationAttachedTo, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=maxBatchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), operator=&&), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=_maxBatchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=maxBatchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_maxBatchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_AFTER_FIRST_SIMILAR_INSERTS, postfix_operators=[], prefix_operators=[], qualifier=SibTr.Suppressor, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MAX_BATCH_SIZE_OVERRIDE_WARNING_CWSIP0181"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=_destinationAttachedTo, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=warning, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_inLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=inLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_maxActiveMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=maxActiveMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_maxActiveMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_activeMsgBlockInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MsgBlockWarningInterval")], member=getContextValue, postfix_operators=[], prefix_operators=[], qualifier=_destinationAttachedTo, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_activeMsgBlockInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_activeMsgBlockInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=_activeMsgBlockInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None))]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_currentActiveMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=messageLockExpiry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMessageLockExpiry, postfix_operators=[], prefix_operators=[], qualifier=_allLockedMessages, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_asynchConsumerRegistered, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_transacted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isPubSub, postfix_operators=[], prefix_operators=['!'], qualifier=_destinationAttachedTo, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=getReadAhead, postfix_operators=[], prefix_operators=['!'], qualifier=_consumerSession, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_orderingGroup, 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=[], member=leaveKeyGroup, postfix_operators=[], prefix_operators=[], qualifier=_consumerKey, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_keyGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=_consumerKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderingGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=joinKeyGroup, postfix_operators=[], prefix_operators=[], qualifier=_consumerDispatcher, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=LocalQPConsumerKeyGroup, sub_type=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.impl.JSLocalConsumerPoint.registerAsynchConsumer"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:2367:1.22.5.1"), 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="registerAsynchConsumer"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SIIncorrectCallException")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_MESSAGING_ERROR_CWSIP0002"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.ConsumerDispatcher"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:2376:1.22.5.1"), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=SIMPUtils, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIIncorrectCallException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIResourceException']))], finally_block=None, label=None, resources=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_keyGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=optionalCallbackBusyLock, 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=Assignment(expressionl=MemberReference(member=_asynchConsumerBusyLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAsynchGroupLock, postfix_operators=[], prefix_operators=[], qualifier=_keyGroup, selectors=[], type_arguments=None)), label=None))]))]))]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_externalConsumerLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=optionalCallbackBusyLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, resources=None) END[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["registerAsynchConsumer"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[registerAsynchConsumer] operator[SEP] identifier[AsynchConsumerCallback] identifier[callback] , Keyword[int] identifier[maxActiveMessages] , Keyword[long] identifier[messageLockExpiry] , Keyword[int] identifier[maxBatchSize] , identifier[Reliability] identifier[unrecoverableReliability] , Keyword[boolean] identifier[inLine] , identifier[OrderingContextImpl] identifier[orderingGroup] , identifier[ExternalConsumerLock] identifier[optionalCallbackBusyLock] operator[SEP] Keyword[throws] identifier[SISessionUnavailableException] , identifier[SISessionDroppedException] , identifier[SIErrorException] , identifier[SIIncorrectCallException] { 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] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[this] , identifier[callback] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[maxActiveMessages] operator[SEP] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[messageLockExpiry] operator[SEP] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[maxBatchSize] operator[SEP] , identifier[unrecoverableReliability] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[inLine] operator[SEP] , identifier[orderingGroup] , identifier[optionalCallbackBusyLock] } operator[SEP] operator[SEP] identifier[checkParams] operator[SEP] identifier[maxActiveMessages] , identifier[messageLockExpiry] , identifier[maxBatchSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[optionalCallbackBusyLock] operator[!=] Other[null] operator[SEP] { identifier[_asynchConsumerBusyLock] operator[=] identifier[optionalCallbackBusyLock] operator[SEP] } Keyword[synchronized] operator[SEP] identifier[_asynchConsumerBusyLock] operator[SEP] { Keyword[this] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[checkNotClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[_stopped] operator[SEP] { identifier[SIIncorrectCallException] identifier[e] operator[=] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[_consumerDispatcher] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[_consumerDispatcher] operator[SEP] identifier[getMessageProcessor] operator[SEP] operator[SEP] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] } , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[if] operator[SEP] identifier[_waiting] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[_consumerDispatcher] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[_messageProcessor] operator[SEP] identifier[getMessagingEngineName] operator[SEP] operator[SEP] } , Other[null] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[unrecoverableReliability] operator[!=] Other[null] operator[SEP] identifier[setUnrecoverability] operator[SEP] identifier[unrecoverableReliability] operator[SEP] operator[SEP] identifier[_asynchConsumer] operator[SEP] identifier[registerCallback] operator[SEP] identifier[callback] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[callback] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[_destinationAttachedTo] operator[SEP] identifier[isOrdered] operator[SEP] operator[SEP] operator[&&] identifier[maxBatchSize] operator[>] Other[1] operator[SEP] { identifier[_maxBatchSize] operator[=] Other[1] operator[SEP] identifier[SibTr] operator[SEP] identifier[warning] operator[SEP] identifier[tc] , identifier[SibTr] operator[SEP] identifier[Suppressor] operator[SEP] identifier[ALL_AFTER_FIRST_SIMILAR_INSERTS] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[_destinationAttachedTo] operator[SEP] identifier[getName] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } Keyword[else] identifier[_maxBatchSize] operator[=] identifier[maxBatchSize] operator[SEP] identifier[_inLine] operator[=] identifier[inLine] operator[SEP] identifier[_maxActiveMessages] operator[=] identifier[maxActiveMessages] operator[SEP] Keyword[if] operator[SEP] identifier[_maxActiveMessages] operator[>] Other[0] operator[SEP] { identifier[_activeMsgBlockInterval] operator[=] operator[-] Other[1] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[_destinationAttachedTo] operator[SEP] identifier[getContextValue] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[value] Keyword[instanceof] identifier[Integer] operator[SEP] operator[SEP] { identifier[_activeMsgBlockInterval] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_activeMsgBlockInterval] operator[<] Other[0] operator[SEP] identifier[_activeMsgBlockInterval] operator[=] operator[-] Other[1] operator[SEP] } } identifier[_currentActiveMessages] operator[=] Other[0] operator[SEP] identifier[_allLockedMessages] operator[SEP] identifier[setMessageLockExpiry] operator[SEP] identifier[messageLockExpiry] operator[SEP] operator[SEP] identifier[_asynchConsumerRegistered] operator[=] literal[boolean] operator[SEP] identifier[_transacted] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[orderingGroup] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[_destinationAttachedTo] operator[SEP] identifier[isPubSub] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[_consumerSession] operator[SEP] identifier[getReadAhead] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_orderingGroup] operator[!=] identifier[orderingGroup] operator[SEP] { Keyword[if] operator[SEP] identifier[_orderingGroup] operator[!=] Other[null] operator[SEP] identifier[_consumerKey] operator[SEP] identifier[leaveKeyGroup] operator[SEP] operator[SEP] operator[SEP] identifier[_orderingGroup] operator[=] identifier[orderingGroup] operator[SEP] Keyword[try] { identifier[_keyGroup] operator[=] operator[SEP] identifier[LocalQPConsumerKeyGroup] operator[SEP] identifier[_consumerDispatcher] operator[SEP] identifier[joinKeyGroup] operator[SEP] identifier[_consumerKey] , identifier[orderingGroup] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SIResourceException] 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] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] , identifier[SIMPUtils] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[e] operator[SEP] } , Other[null] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[_keyGroup] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[optionalCallbackBusyLock] operator[==] Other[null] operator[SEP] identifier[_asynchConsumerBusyLock] operator[=] identifier[_keyGroup] operator[SEP] identifier[getAsynchGroupLock] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[else] { identifier[_asynchConsumerRegistered] operator[=] literal[boolean] operator[SEP] identifier[resetBaseUnrecoverability] operator[SEP] operator[SEP] operator[SEP] identifier[_inLine] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[_orderingGroup] operator[!=] Other[null] operator[SEP] { identifier[_consumerKey] operator[SEP] identifier[leaveKeyGroup] operator[SEP] operator[SEP] operator[SEP] identifier[_keyGroup] operator[=] Other[null] operator[SEP] identifier[_asynchConsumerBusyLock] operator[=] identifier[_asynchConsumer] operator[SEP] identifier[_orderingGroup] operator[=] Other[null] operator[SEP] } } identifier[_externalConsumerLock] operator[=] identifier[optionalCallbackBusyLock] operator[SEP] } Keyword[finally] { Keyword[this] operator[SEP] identifier[unlock] 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] }
public void report() { try (Writer w = new NonClosingSystemOut()) { report(w); } catch (IOException e) { throw new IllegalStateException("Should never be an exception writing to System.out", e); } }
class class_name[name] begin[{] method[report, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=report, 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="Should never be an exception writing to System.out"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=w, type=ReferenceType(arguments=None, dimensions=[], name=Writer, sub_type=None), value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonClosingSystemOut, sub_type=None)))]) end[}] END[}]
Keyword[public] Keyword[void] identifier[report] operator[SEP] operator[SEP] { Keyword[try] operator[SEP] identifier[Writer] identifier[w] operator[=] Keyword[new] identifier[NonClosingSystemOut] operator[SEP] operator[SEP] operator[SEP] { identifier[report] operator[SEP] identifier[w] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static <T extends Parcelable> ParcelablePickerDialogFragment<T> newInstance( int pickerId, String title, String positiveButtonText, String negativeButtonText, boolean enableMultipleSelection, int[] selectedItemIndices, ArrayList<T> availableItems) { ParcelablePickerDialogFragment<T> f = new ParcelablePickerDialogFragment<T>(); Bundle args = buildCommonArgsBundle(pickerId, title, positiveButtonText, negativeButtonText, enableMultipleSelection, selectedItemIndices); args.putParcelableArrayList(ARG_AVAILABLE_ITEMS, availableItems); f.setArguments(args); return f; }
class class_name[name] begin[{] method[newInstance, return_type[type[ParcelablePickerDialogFragment]], modifier[public static], parameter[pickerId, title, positiveButtonText, negativeButtonText, enableMultipleSelection, selectedItemIndices, availableItems]] begin[{] local_variable[type[ParcelablePickerDialogFragment], f] local_variable[type[Bundle], args] call[args.putParcelableArrayList, parameter[member[.ARG_AVAILABLE_ITEMS], member[.availableItems]]] call[f.setArguments, parameter[member[.args]]] return[member[.f]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Parcelable] operator[>] identifier[ParcelablePickerDialogFragment] operator[<] identifier[T] operator[>] identifier[newInstance] operator[SEP] Keyword[int] identifier[pickerId] , identifier[String] identifier[title] , identifier[String] identifier[positiveButtonText] , identifier[String] identifier[negativeButtonText] , Keyword[boolean] identifier[enableMultipleSelection] , Keyword[int] operator[SEP] operator[SEP] identifier[selectedItemIndices] , identifier[ArrayList] operator[<] identifier[T] operator[>] identifier[availableItems] operator[SEP] { identifier[ParcelablePickerDialogFragment] operator[<] identifier[T] operator[>] identifier[f] operator[=] Keyword[new] identifier[ParcelablePickerDialogFragment] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Bundle] identifier[args] operator[=] identifier[buildCommonArgsBundle] operator[SEP] identifier[pickerId] , identifier[title] , identifier[positiveButtonText] , identifier[negativeButtonText] , identifier[enableMultipleSelection] , identifier[selectedItemIndices] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[putParcelableArrayList] operator[SEP] identifier[ARG_AVAILABLE_ITEMS] , identifier[availableItems] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[setArguments] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP] }
@Option(name = "-sl", aliases = "--select-length", metaVar = "<length>", usage = "Length of select in seconds.") void setSelectLength(Duration selectLength) { m_selectLength = selectLength; }
class class_name[name] begin[{] method[setSelectLength, return_type[void], modifier[default], parameter[selectLength]] begin[{] assign[member[.m_selectLength], member[.selectLength]] end[}] END[}]
annotation[@] identifier[Option] operator[SEP] identifier[name] operator[=] literal[String] , identifier[aliases] operator[=] literal[String] , identifier[metaVar] operator[=] literal[String] , identifier[usage] operator[=] literal[String] operator[SEP] Keyword[void] identifier[setSelectLength] operator[SEP] identifier[Duration] identifier[selectLength] operator[SEP] { identifier[m_selectLength] operator[=] identifier[selectLength] operator[SEP] }
@CheckReturnValue public MessageAction sendTo(MessageChannel channel) { Checks.notNull(channel, "Target Channel"); switch (channel.getType()) { case TEXT: final TextChannel text = (TextChannel) channel; final Member self = text.getGuild().getSelfMember(); if (!self.hasPermission(text, Permission.MESSAGE_READ)) throw new InsufficientPermissionException(Permission.MESSAGE_READ); if (!self.hasPermission(text, Permission.MESSAGE_WRITE)) throw new InsufficientPermissionException(Permission.MESSAGE_WRITE); break; case PRIVATE: final PrivateChannel priv = (PrivateChannel) channel; if (priv.getUser().isBot() && channel.getJDA().getAccountType() == AccountType.BOT) throw new UnsupportedOperationException("Cannot send a private message between bots."); } final Route.CompiledRoute route = Route.Messages.SEND_MESSAGE.compile(channel.getId()); final MessageAction action = new MessageAction(channel.getJDA(), route, channel, builder); return action.tts(isTTS).embed(embed).nonce(nonce); }
class class_name[name] begin[{] method[sendTo, return_type[type[MessageAction]], modifier[public], parameter[channel]] begin[{] call[Checks.notNull, parameter[member[.channel], literal["Target Channel"]]] SwitchStatement(cases=[SwitchStatementCase(case=['TEXT'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TextChannel, sub_type=None)), name=text)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TextChannel, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGuild, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[MethodInvocation(arguments=[], member=getSelfMember, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=self)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Member, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MESSAGE_READ, postfix_operators=[], prefix_operators=[], qualifier=Permission, selectors=[])], member=hasPermission, postfix_operators=[], prefix_operators=['!'], qualifier=self, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=MESSAGE_READ, postfix_operators=[], prefix_operators=[], qualifier=Permission, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InsufficientPermissionException, sub_type=None)), label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MESSAGE_WRITE, postfix_operators=[], prefix_operators=[], qualifier=Permission, selectors=[])], member=hasPermission, postfix_operators=[], prefix_operators=['!'], qualifier=self, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=MESSAGE_WRITE, postfix_operators=[], prefix_operators=[], qualifier=Permission, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InsufficientPermissionException, sub_type=None)), label=None)), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PRIVATE'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PrivateChannel, sub_type=None)), name=priv)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=PrivateChannel, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getUser, postfix_operators=[], prefix_operators=[], qualifier=priv, selectors=[MethodInvocation(arguments=[], member=isBot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getJDA, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[MethodInvocation(arguments=[], member=getAccountType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=BOT, postfix_operators=[], prefix_operators=[], qualifier=AccountType, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot send a private message between bots.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None))])], expression=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None), label=None) local_variable[type[Route], route] local_variable[type[MessageAction], action] return[call[action.tts, parameter[member[.isTTS]]]] end[}] END[}]
annotation[@] identifier[CheckReturnValue] Keyword[public] identifier[MessageAction] identifier[sendTo] operator[SEP] identifier[MessageChannel] identifier[channel] operator[SEP] { identifier[Checks] operator[SEP] identifier[notNull] operator[SEP] identifier[channel] , literal[String] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[channel] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[TEXT] operator[:] Keyword[final] identifier[TextChannel] identifier[text] operator[=] operator[SEP] identifier[TextChannel] operator[SEP] identifier[channel] operator[SEP] Keyword[final] identifier[Member] identifier[self] operator[=] identifier[text] operator[SEP] identifier[getGuild] operator[SEP] operator[SEP] operator[SEP] identifier[getSelfMember] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[self] operator[SEP] identifier[hasPermission] operator[SEP] identifier[text] , identifier[Permission] operator[SEP] identifier[MESSAGE_READ] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InsufficientPermissionException] operator[SEP] identifier[Permission] operator[SEP] identifier[MESSAGE_READ] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[self] operator[SEP] identifier[hasPermission] operator[SEP] identifier[text] , identifier[Permission] operator[SEP] identifier[MESSAGE_WRITE] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InsufficientPermissionException] operator[SEP] identifier[Permission] operator[SEP] identifier[MESSAGE_WRITE] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PRIVATE] operator[:] Keyword[final] identifier[PrivateChannel] identifier[priv] operator[=] operator[SEP] identifier[PrivateChannel] operator[SEP] identifier[channel] operator[SEP] Keyword[if] operator[SEP] identifier[priv] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[SEP] identifier[isBot] operator[SEP] operator[SEP] operator[&&] identifier[channel] operator[SEP] identifier[getJDA] operator[SEP] operator[SEP] operator[SEP] identifier[getAccountType] operator[SEP] operator[SEP] operator[==] identifier[AccountType] operator[SEP] identifier[BOT] operator[SEP] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[Route] operator[SEP] identifier[CompiledRoute] identifier[route] operator[=] identifier[Route] operator[SEP] identifier[Messages] operator[SEP] identifier[SEND_MESSAGE] operator[SEP] identifier[compile] operator[SEP] identifier[channel] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[MessageAction] identifier[action] operator[=] Keyword[new] identifier[MessageAction] operator[SEP] identifier[channel] operator[SEP] identifier[getJDA] operator[SEP] operator[SEP] , identifier[route] , identifier[channel] , identifier[builder] operator[SEP] operator[SEP] Keyword[return] identifier[action] operator[SEP] identifier[tts] operator[SEP] identifier[isTTS] operator[SEP] operator[SEP] identifier[embed] operator[SEP] identifier[embed] operator[SEP] operator[SEP] identifier[nonce] operator[SEP] identifier[nonce] operator[SEP] operator[SEP] }
@Override public RandomVariable getForward(AnalyticModel model, double fixingTime, double paymentOffset) { // @TODO: A warning should be issued that this implementation does not use // if(paymentOffset != this.getPaymentOffset(fixingTime)) { // Logger.getLogger("net.finmath").warning("Requesting forward with paymentOffsets not agreeing with original calibration. Requested: " + paymentOffsets +". Calibrated: " + getPaymentOffset(fixingTime) + "."); // } return this.getForward(model, fixingTime); }
class class_name[name] begin[{] method[getForward, return_type[type[RandomVariable]], modifier[public], parameter[model, fixingTime, paymentOffset]] begin[{] return[THIS[call[None.getForward, parameter[member[.model], member[.fixingTime]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[RandomVariable] identifier[getForward] operator[SEP] identifier[AnalyticModel] identifier[model] , Keyword[double] identifier[fixingTime] , Keyword[double] identifier[paymentOffset] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[getForward] operator[SEP] identifier[model] , identifier[fixingTime] operator[SEP] operator[SEP] }
private void processComponents(MAPDialogImpl mapDialogImpl, Component[] components) { // Now let us decode the Components for (Component c : components) { doProcessComponent(mapDialogImpl, c); } }
class class_name[name] begin[{] method[processComponents, return_type[void], modifier[private], parameter[mapDialogImpl, components]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mapDialogImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doProcessComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=components, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Component, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[processComponents] operator[SEP] identifier[MAPDialogImpl] identifier[mapDialogImpl] , identifier[Component] operator[SEP] operator[SEP] identifier[components] operator[SEP] { Keyword[for] operator[SEP] identifier[Component] identifier[c] operator[:] identifier[components] operator[SEP] { identifier[doProcessComponent] operator[SEP] identifier[mapDialogImpl] , identifier[c] operator[SEP] operator[SEP] } }
private StereoBond findStereoBond(IAtom atom) { for (IBond bond : stereoBonds) if (bond.contains(atom)) return (StereoBond) bond; return null; }
class class_name[name] begin[{] method[findStereoBond, return_type[type[StereoBond]], modifier[private], parameter[atom]] begin[{] ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Cast(expression=MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StereoBond, sub_type=None)), label=None)), control=EnhancedForControl(iterable=MemberReference(member=stereoBonds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] identifier[StereoBond] identifier[findStereoBond] operator[SEP] identifier[IAtom] identifier[atom] operator[SEP] { Keyword[for] operator[SEP] identifier[IBond] identifier[bond] operator[:] identifier[stereoBonds] operator[SEP] Keyword[if] operator[SEP] identifier[bond] operator[SEP] identifier[contains] operator[SEP] identifier[atom] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[StereoBond] operator[SEP] identifier[bond] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public void inputGraph(final InputStream jsonInputStream, int bufferSize, final Set<String> edgePropertyKeys, final Set<String> vertexPropertyKeys) throws IOException { final JsonParser jp = jsonFactory.createJsonParser(jsonInputStream); // if this is a transactional localGraph then we're buffering final BatchGraph batchGraph = BatchGraph.wrap(graph, bufferSize); final ElementFactory elementFactory = new GraphElementFactory(batchGraph); OGraphSONUtility graphson = new OGraphSONUtility(GraphSONMode.NORMAL, elementFactory, vertexPropertyKeys, edgePropertyKeys); long importedVertices = 0; long importedEdges = 0; while (jp.nextToken() != JsonToken.END_OBJECT) { final String fieldname = jp.getCurrentName() == null ? "" : jp.getCurrentName(); if (fieldname.equals(GraphSONTokens.MODE)) { jp.nextToken(); final GraphSONMode mode = GraphSONMode.valueOf(jp.getText()); graphson = new OGraphSONUtility(mode, elementFactory, vertexPropertyKeys, edgePropertyKeys); } else if (fieldname.equals(GraphSONTokens.VERTICES)) { jp.nextToken(); while (jp.nextToken() != JsonToken.END_ARRAY) { final JsonNode node = jp.readValueAsTree(); graphson.vertexFromJson(node); importedVertices++; printStatus(jp, importedVertices, importedEdges); if (importedVertices % 1000 == 0) ODatabaseRecordThreadLocal.instance().get().getLocalCache().invalidate(); } } else if (fieldname.equals(GraphSONTokens.EDGES)) { jp.nextToken(); while (jp.nextToken() != JsonToken.END_ARRAY) { final JsonNode node = jp.readValueAsTree(); final Vertex inV = batchGraph.getVertex(OGraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokens._IN_V))); final Vertex outV = batchGraph.getVertex(OGraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokens._OUT_V))); graphson.edgeFromJson(node, outV, inV); importedEdges++; printStatus(jp, importedVertices, importedEdges); if (importedEdges % 1000 == 0) ODatabaseRecordThreadLocal.instance().get().getLocalCache().invalidate(); } } } jp.close(); batchGraph.commit(); }
class class_name[name] begin[{] method[inputGraph, return_type[void], modifier[public], parameter[jsonInputStream, bufferSize, edgePropertyKeys, vertexPropertyKeys]] begin[{] local_variable[type[JsonParser], jp] local_variable[type[BatchGraph], batchGraph] local_variable[type[ElementFactory], elementFactory] local_variable[type[OGraphSONUtility], graphson] local_variable[type[long], importedVertices] local_variable[type[long], importedEdges] while[binary_operation[call[jp.nextToken, parameter[]], !=, member[JsonToken.END_OBJECT]]] begin[{] local_variable[type[String], fieldname] if[call[fieldname.equals, parameter[member[GraphSONTokens.MODE]]]] begin[{] call[jp.nextToken, parameter[]] local_variable[type[GraphSONMode], mode] assign[member[.graphson], ClassCreator(arguments=[MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elementFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vertexPropertyKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=edgePropertyKeys, 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=OGraphSONUtility, sub_type=None))] else begin[{] if[call[fieldname.equals, parameter[member[GraphSONTokens.VERTICES]]]] begin[{] call[jp.nextToken, parameter[]] while[binary_operation[call[jp.nextToken, parameter[]], !=, member[JsonToken.END_ARRAY]]] begin[{] local_variable[type[JsonNode], node] call[graphson.vertexFromJson, parameter[member[.node]]] member[.importedVertices] call[.printStatus, parameter[member[.jp], member[.importedVertices], member[.importedEdges]]] if[binary_operation[binary_operation[member[.importedVertices], %, literal[1000]], ==, literal[0]]] begin[{] call[ODatabaseRecordThreadLocal.instance, parameter[]] else begin[{] None end[}] end[}] else begin[{] if[call[fieldname.equals, parameter[member[GraphSONTokens.EDGES]]]] begin[{] call[jp.nextToken, parameter[]] while[binary_operation[call[jp.nextToken, parameter[]], !=, member[JsonToken.END_ARRAY]]] begin[{] local_variable[type[JsonNode], node] local_variable[type[Vertex], inV] local_variable[type[Vertex], outV] call[graphson.edgeFromJson, parameter[member[.node], member[.outV], member[.inV]]] member[.importedEdges] call[.printStatus, parameter[member[.jp], member[.importedVertices], member[.importedEdges]]] if[binary_operation[binary_operation[member[.importedEdges], %, literal[1000]], ==, literal[0]]] begin[{] call[ODatabaseRecordThreadLocal.instance, parameter[]] else begin[{] None end[}] end[}] else begin[{] None end[}] end[}] end[}] end[}] call[jp.close, parameter[]] call[batchGraph.commit, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[inputGraph] operator[SEP] Keyword[final] identifier[InputStream] identifier[jsonInputStream] , Keyword[int] identifier[bufferSize] , Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[edgePropertyKeys] , Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[vertexPropertyKeys] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[JsonParser] identifier[jp] operator[=] identifier[jsonFactory] operator[SEP] identifier[createJsonParser] operator[SEP] identifier[jsonInputStream] operator[SEP] operator[SEP] Keyword[final] identifier[BatchGraph] identifier[batchGraph] operator[=] identifier[BatchGraph] operator[SEP] identifier[wrap] operator[SEP] identifier[graph] , identifier[bufferSize] operator[SEP] operator[SEP] Keyword[final] identifier[ElementFactory] identifier[elementFactory] operator[=] Keyword[new] identifier[GraphElementFactory] operator[SEP] identifier[batchGraph] operator[SEP] operator[SEP] identifier[OGraphSONUtility] identifier[graphson] operator[=] Keyword[new] identifier[OGraphSONUtility] operator[SEP] identifier[GraphSONMode] operator[SEP] identifier[NORMAL] , identifier[elementFactory] , identifier[vertexPropertyKeys] , identifier[edgePropertyKeys] operator[SEP] operator[SEP] Keyword[long] identifier[importedVertices] operator[=] Other[0] operator[SEP] Keyword[long] identifier[importedEdges] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[jp] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[!=] identifier[JsonToken] operator[SEP] identifier[END_OBJECT] operator[SEP] { Keyword[final] identifier[String] identifier[fieldname] operator[=] identifier[jp] operator[SEP] identifier[getCurrentName] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[jp] operator[SEP] identifier[getCurrentName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldname] operator[SEP] identifier[equals] operator[SEP] identifier[GraphSONTokens] operator[SEP] identifier[MODE] operator[SEP] operator[SEP] { identifier[jp] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[GraphSONMode] identifier[mode] operator[=] identifier[GraphSONMode] operator[SEP] identifier[valueOf] operator[SEP] identifier[jp] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[graphson] operator[=] Keyword[new] identifier[OGraphSONUtility] operator[SEP] identifier[mode] , identifier[elementFactory] , identifier[vertexPropertyKeys] , identifier[edgePropertyKeys] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldname] operator[SEP] identifier[equals] operator[SEP] identifier[GraphSONTokens] operator[SEP] identifier[VERTICES] operator[SEP] operator[SEP] { identifier[jp] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[jp] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[!=] identifier[JsonToken] operator[SEP] identifier[END_ARRAY] operator[SEP] { Keyword[final] identifier[JsonNode] identifier[node] operator[=] identifier[jp] operator[SEP] identifier[readValueAsTree] operator[SEP] operator[SEP] operator[SEP] identifier[graphson] operator[SEP] identifier[vertexFromJson] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[importedVertices] operator[++] operator[SEP] identifier[printStatus] operator[SEP] identifier[jp] , identifier[importedVertices] , identifier[importedEdges] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[importedVertices] operator[%] Other[1000] operator[==] Other[0] operator[SEP] identifier[ODatabaseRecordThreadLocal] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getLocalCache] operator[SEP] operator[SEP] operator[SEP] identifier[invalidate] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[fieldname] operator[SEP] identifier[equals] operator[SEP] identifier[GraphSONTokens] operator[SEP] identifier[EDGES] operator[SEP] operator[SEP] { identifier[jp] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[jp] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[!=] identifier[JsonToken] operator[SEP] identifier[END_ARRAY] operator[SEP] { Keyword[final] identifier[JsonNode] identifier[node] operator[=] identifier[jp] operator[SEP] identifier[readValueAsTree] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Vertex] identifier[inV] operator[=] identifier[batchGraph] operator[SEP] identifier[getVertex] operator[SEP] identifier[OGraphSONUtility] operator[SEP] identifier[getTypedValueFromJsonNode] operator[SEP] identifier[node] operator[SEP] identifier[get] operator[SEP] identifier[GraphSONTokens] operator[SEP] identifier[_IN_V] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Vertex] identifier[outV] operator[=] identifier[batchGraph] operator[SEP] identifier[getVertex] operator[SEP] identifier[OGraphSONUtility] operator[SEP] identifier[getTypedValueFromJsonNode] operator[SEP] identifier[node] operator[SEP] identifier[get] operator[SEP] identifier[GraphSONTokens] operator[SEP] identifier[_OUT_V] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[graphson] operator[SEP] identifier[edgeFromJson] operator[SEP] identifier[node] , identifier[outV] , identifier[inV] operator[SEP] operator[SEP] identifier[importedEdges] operator[++] operator[SEP] identifier[printStatus] operator[SEP] identifier[jp] , identifier[importedVertices] , identifier[importedEdges] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[importedEdges] operator[%] Other[1000] operator[==] Other[0] operator[SEP] identifier[ODatabaseRecordThreadLocal] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getLocalCache] operator[SEP] operator[SEP] operator[SEP] identifier[invalidate] operator[SEP] operator[SEP] operator[SEP] } } } identifier[jp] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[batchGraph] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] }
public SAMLEndpointResponse getSAMLAssertionVerifying(String appId, String devideId, String stateToken, String otpToken, String urlEndpoint, Boolean doNotNotify) throws OAuthSystemException, OAuthProblemException, URISyntaxException { cleanError(); prepareToken(); String target; if (urlEndpoint != null && !urlEndpoint.isEmpty()) { target = urlEndpoint; } else { URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_SAML_VERIFY_FACTOR)); target = url.toString(); } OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient(); OAuthClient oAuthClient = new OAuthClient(httpClient); OAuthClientRequest bearerRequest = new OAuthBearerClientRequest(target) .buildHeaderMessage(); Map<String, String> headers = getAuthorizedHeader(); bearerRequest.setHeaders(headers); Map<String, Object> params = new HashMap<String, Object>(); params.put("app_id", appId); params.put("device_id", devideId); params.put("state_token", stateToken); params.put("do_not_notify", doNotNotify); if (otpToken != null && !otpToken.isEmpty()) { params.put("otp_token", otpToken); } String body = JSONUtils.buildJSON(params); bearerRequest.setBody(body); SAMLEndpointResponse samlEndpointResponse = null; OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient.resource(bearerRequest, OAuth.HttpMethod.POST, OneloginOAuthJSONResourceResponse.class); if (oAuthResponse.getResponseCode() == 200) { samlEndpointResponse = new SAMLEndpointResponse(oAuthResponse.getType(), oAuthResponse.getMessage()); if (oAuthResponse.getType().equals("success")) { if (oAuthResponse.getMessage().equals("Success")) { samlEndpointResponse.setSAMLResponse((String)oAuthResponse.getStringFromData()); } } } else { error = oAuthResponse.getError(); errorDescription = oAuthResponse.getErrorDescription(); } return samlEndpointResponse; }
class class_name[name] begin[{] method[getSAMLAssertionVerifying, return_type[type[SAMLEndpointResponse]], modifier[public], parameter[appId, devideId, stateToken, otpToken, urlEndpoint, doNotNotify]] begin[{] call[.cleanError, parameter[]] call[.prepareToken, parameter[]] local_variable[type[String], target] if[binary_operation[binary_operation[member[.urlEndpoint], !=, literal[null]], &&, call[urlEndpoint.isEmpty, parameter[]]]] begin[{] assign[member[.target], member[.urlEndpoint]] else begin[{] local_variable[type[URIBuilder], url] assign[member[.target], call[url.toString, parameter[]]] end[}] local_variable[type[OneloginURLConnectionClient], httpClient] local_variable[type[OAuthClient], oAuthClient] local_variable[type[OAuthClientRequest], bearerRequest] local_variable[type[Map], headers] call[bearerRequest.setHeaders, parameter[member[.headers]]] local_variable[type[Map], params] call[params.put, parameter[literal["app_id"], member[.appId]]] call[params.put, parameter[literal["device_id"], member[.devideId]]] call[params.put, parameter[literal["state_token"], member[.stateToken]]] call[params.put, parameter[literal["do_not_notify"], member[.doNotNotify]]] if[binary_operation[binary_operation[member[.otpToken], !=, literal[null]], &&, call[otpToken.isEmpty, parameter[]]]] begin[{] call[params.put, parameter[literal["otp_token"], member[.otpToken]]] else begin[{] None end[}] local_variable[type[String], body] call[bearerRequest.setBody, parameter[member[.body]]] local_variable[type[SAMLEndpointResponse], samlEndpointResponse] local_variable[type[OneloginOAuthJSONResourceResponse], oAuthResponse] if[binary_operation[call[oAuthResponse.getResponseCode, parameter[]], ==, literal[200]]] begin[{] assign[member[.samlEndpointResponse], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=oAuthResponse, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=oAuthResponse, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SAMLEndpointResponse, sub_type=None))] if[call[oAuthResponse.getType, parameter[]]] begin[{] if[call[oAuthResponse.getMessage, parameter[]]] begin[{] call[samlEndpointResponse.setSAMLResponse, parameter[Cast(expression=MethodInvocation(arguments=[], member=getStringFromData, postfix_operators=[], prefix_operators=[], qualifier=oAuthResponse, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] assign[member[.error], call[oAuthResponse.getError, parameter[]]] assign[member[.errorDescription], call[oAuthResponse.getErrorDescription, parameter[]]] end[}] return[member[.samlEndpointResponse]] end[}] END[}]
Keyword[public] identifier[SAMLEndpointResponse] identifier[getSAMLAssertionVerifying] operator[SEP] identifier[String] identifier[appId] , identifier[String] identifier[devideId] , identifier[String] identifier[stateToken] , identifier[String] identifier[otpToken] , identifier[String] identifier[urlEndpoint] , identifier[Boolean] identifier[doNotNotify] operator[SEP] Keyword[throws] identifier[OAuthSystemException] , identifier[OAuthProblemException] , identifier[URISyntaxException] { identifier[cleanError] operator[SEP] operator[SEP] operator[SEP] identifier[prepareToken] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[target] operator[SEP] Keyword[if] operator[SEP] identifier[urlEndpoint] operator[!=] Other[null] operator[&&] operator[!] identifier[urlEndpoint] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[target] operator[=] identifier[urlEndpoint] operator[SEP] } Keyword[else] { identifier[URIBuilder] identifier[url] operator[=] Keyword[new] identifier[URIBuilder] operator[SEP] identifier[settings] operator[SEP] identifier[getURL] operator[SEP] identifier[Constants] operator[SEP] identifier[GET_SAML_VERIFY_FACTOR] operator[SEP] operator[SEP] operator[SEP] identifier[target] operator[=] identifier[url] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[OneloginURLConnectionClient] identifier[httpClient] operator[=] Keyword[new] identifier[OneloginURLConnectionClient] operator[SEP] operator[SEP] operator[SEP] identifier[OAuthClient] identifier[oAuthClient] operator[=] Keyword[new] identifier[OAuthClient] operator[SEP] identifier[httpClient] operator[SEP] operator[SEP] identifier[OAuthClientRequest] identifier[bearerRequest] operator[=] Keyword[new] identifier[OAuthBearerClientRequest] operator[SEP] identifier[target] operator[SEP] operator[SEP] identifier[buildHeaderMessage] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] operator[=] identifier[getAuthorizedHeader] operator[SEP] operator[SEP] operator[SEP] identifier[bearerRequest] operator[SEP] identifier[setHeaders] operator[SEP] identifier[headers] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[appId] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[devideId] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[stateToken] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[doNotNotify] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[otpToken] operator[!=] Other[null] operator[&&] operator[!] identifier[otpToken] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[otpToken] operator[SEP] operator[SEP] } identifier[String] identifier[body] operator[=] identifier[JSONUtils] operator[SEP] identifier[buildJSON] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[bearerRequest] operator[SEP] identifier[setBody] operator[SEP] identifier[body] operator[SEP] operator[SEP] identifier[SAMLEndpointResponse] identifier[samlEndpointResponse] operator[=] Other[null] operator[SEP] identifier[OneloginOAuthJSONResourceResponse] identifier[oAuthResponse] operator[=] identifier[oAuthClient] operator[SEP] identifier[resource] operator[SEP] identifier[bearerRequest] , identifier[OAuth] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[POST] , identifier[OneloginOAuthJSONResourceResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oAuthResponse] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[==] Other[200] operator[SEP] { identifier[samlEndpointResponse] operator[=] Keyword[new] identifier[SAMLEndpointResponse] operator[SEP] identifier[oAuthResponse] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[oAuthResponse] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oAuthResponse] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[oAuthResponse] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[samlEndpointResponse] operator[SEP] identifier[setSAMLResponse] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[oAuthResponse] operator[SEP] identifier[getStringFromData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[error] operator[=] identifier[oAuthResponse] operator[SEP] identifier[getError] operator[SEP] operator[SEP] operator[SEP] identifier[errorDescription] operator[=] identifier[oAuthResponse] operator[SEP] identifier[getErrorDescription] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[samlEndpointResponse] operator[SEP] }
static public void writeNcML(NetcdfFile ncfile, Writer writer, WantValues showValues, String url) throws IOException { Preconditions.checkNotNull(ncfile); Preconditions.checkNotNull(writer); Preconditions.checkNotNull(showValues); Predicate<Variable> writeVarsPred; switch (showValues) { case none: writeVarsPred = NcMLWriter.writeNoVariablesPredicate; break; case coordsOnly: writeVarsPred = NcMLWriter.writeCoordinateVariablesPredicate; break; case all: writeVarsPred = NcMLWriter.writeAllVariablesPredicate; break; default: String message = String.format( "CAN'T HAPPEN: showValues (%s) != null and checked all possible enum values.", showValues); throw new AssertionError(message); } NcMLWriter ncmlWriter = new NcMLWriter(); ncmlWriter.setWriteVariablesPredicate(writeVarsPred); Element netcdfElement = ncmlWriter.makeNetcdfElement(ncfile, url); ncmlWriter.writeToWriter(netcdfElement, writer); }
class class_name[name] begin[{] method[writeNcML, return_type[void], modifier[public static], parameter[ncfile, writer, showValues, url]] begin[{] call[Preconditions.checkNotNull, parameter[member[.ncfile]]] call[Preconditions.checkNotNull, parameter[member[.writer]]] call[Preconditions.checkNotNull, parameter[member[.showValues]]] local_variable[type[Predicate], writeVarsPred] SwitchStatement(cases=[SwitchStatementCase(case=['none'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=writeVarsPred, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=writeNoVariablesPredicate, postfix_operators=[], prefix_operators=[], qualifier=NcMLWriter, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['coordsOnly'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=writeVarsPred, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=writeCoordinateVariablesPredicate, postfix_operators=[], prefix_operators=[], qualifier=NcMLWriter, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['all'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=writeVarsPred, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=writeAllVariablesPredicate, postfix_operators=[], prefix_operators=[], qualifier=NcMLWriter, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CAN'T HAPPEN: showValues (%s) != null and checked all possible enum values."), MemberReference(member=showValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, 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=AssertionError, sub_type=None)), label=None)])], expression=MemberReference(member=showValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) local_variable[type[NcMLWriter], ncmlWriter] call[ncmlWriter.setWriteVariablesPredicate, parameter[member[.writeVarsPred]]] local_variable[type[Element], netcdfElement] call[ncmlWriter.writeToWriter, parameter[member[.netcdfElement], member[.writer]]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[void] identifier[writeNcML] operator[SEP] identifier[NetcdfFile] identifier[ncfile] , identifier[Writer] identifier[writer] , identifier[WantValues] identifier[showValues] , identifier[String] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[ncfile] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[writer] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[showValues] operator[SEP] operator[SEP] identifier[Predicate] operator[<] identifier[Variable] operator[>] identifier[writeVarsPred] operator[SEP] Keyword[switch] operator[SEP] identifier[showValues] operator[SEP] { Keyword[case] identifier[none] operator[:] identifier[writeVarsPred] operator[=] identifier[NcMLWriter] operator[SEP] identifier[writeNoVariablesPredicate] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[coordsOnly] operator[:] identifier[writeVarsPred] operator[=] identifier[NcMLWriter] operator[SEP] identifier[writeCoordinateVariablesPredicate] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[all] operator[:] identifier[writeVarsPred] operator[=] identifier[NcMLWriter] operator[SEP] identifier[writeAllVariablesPredicate] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[String] identifier[message] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[showValues] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] identifier[message] operator[SEP] operator[SEP] } identifier[NcMLWriter] identifier[ncmlWriter] operator[=] Keyword[new] identifier[NcMLWriter] operator[SEP] operator[SEP] operator[SEP] identifier[ncmlWriter] operator[SEP] identifier[setWriteVariablesPredicate] operator[SEP] identifier[writeVarsPred] operator[SEP] operator[SEP] identifier[Element] identifier[netcdfElement] operator[=] identifier[ncmlWriter] operator[SEP] identifier[makeNetcdfElement] operator[SEP] identifier[ncfile] , identifier[url] operator[SEP] operator[SEP] identifier[ncmlWriter] operator[SEP] identifier[writeToWriter] operator[SEP] identifier[netcdfElement] , identifier[writer] operator[SEP] operator[SEP] }
public synchronized boolean next(DocumentID key, LineDocTextAndOp value) throws IOException { if (pos >= end) { return false; } // key is document id, which are bytes until first space if (!readInto(key.getText(), SPACE)) { return false; } // read operation: i/d/u, or ins/del/upd, or insert/delete/update Text opText = new Text(); if (!readInto(opText, SPACE)) { return false; } String opStr = opText.toString(); DocumentAndOp.Op op; if (opStr.equals("i") || opStr.equals("ins") || opStr.equals("insert")) { op = DocumentAndOp.Op.INSERT; } else if (opStr.equals("d") || opStr.equals("del") || opStr.equals("delete")) { op = DocumentAndOp.Op.DELETE; } else if (opStr.equals("u") || opStr.equals("upd") || opStr.equals("update")) { op = DocumentAndOp.Op.UPDATE; } else { // default is insert op = DocumentAndOp.Op.INSERT; } value.setOp(op); if (op == DocumentAndOp.Op.DELETE) { return true; } else { // read rest of the line return readInto(value.getText(), EOL); } }
class class_name[name] begin[{] method[next, return_type[type[boolean]], modifier[synchronized public], parameter[key, value]] begin[{] if[binary_operation[member[.pos], >=, member[.end]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.readInto, parameter[call[key.getText, parameter[]], member[.SPACE]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Text], opText] if[call[.readInto, parameter[member[.opText], member[.SPACE]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[String], opStr] local_variable[type[DocumentAndOp], op] if[binary_operation[binary_operation[call[opStr.equals, parameter[literal["i"]]], ||, call[opStr.equals, parameter[literal["ins"]]]], ||, call[opStr.equals, parameter[literal["insert"]]]]] begin[{] assign[member[.op], member[DocumentAndOp.Op.INSERT]] else begin[{] if[binary_operation[binary_operation[call[opStr.equals, parameter[literal["d"]]], ||, call[opStr.equals, parameter[literal["del"]]]], ||, call[opStr.equals, parameter[literal["delete"]]]]] begin[{] assign[member[.op], member[DocumentAndOp.Op.DELETE]] else begin[{] if[binary_operation[binary_operation[call[opStr.equals, parameter[literal["u"]]], ||, call[opStr.equals, parameter[literal["upd"]]]], ||, call[opStr.equals, parameter[literal["update"]]]]] begin[{] assign[member[.op], member[DocumentAndOp.Op.UPDATE]] else begin[{] assign[member[.op], member[DocumentAndOp.Op.INSERT]] end[}] end[}] end[}] call[value.setOp, parameter[member[.op]]] if[binary_operation[member[.op], ==, member[DocumentAndOp.Op.DELETE]]] begin[{] return[literal[true]] else begin[{] return[call[.readInto, parameter[call[value.getText, parameter[]], member[.EOL]]]] end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[next] operator[SEP] identifier[DocumentID] identifier[key] , identifier[LineDocTextAndOp] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[pos] operator[>=] identifier[end] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[readInto] operator[SEP] identifier[key] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[SPACE] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[Text] identifier[opText] operator[=] Keyword[new] identifier[Text] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[readInto] operator[SEP] identifier[opText] , identifier[SPACE] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[String] identifier[opStr] operator[=] identifier[opText] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[DocumentAndOp] operator[SEP] identifier[Op] identifier[op] operator[SEP] Keyword[if] operator[SEP] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[op] operator[=] identifier[DocumentAndOp] operator[SEP] identifier[Op] operator[SEP] identifier[INSERT] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[op] operator[=] identifier[DocumentAndOp] operator[SEP] identifier[Op] operator[SEP] identifier[DELETE] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[opStr] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[op] operator[=] identifier[DocumentAndOp] operator[SEP] identifier[Op] operator[SEP] identifier[UPDATE] operator[SEP] } Keyword[else] { identifier[op] operator[=] identifier[DocumentAndOp] operator[SEP] identifier[Op] operator[SEP] identifier[INSERT] operator[SEP] } identifier[value] operator[SEP] identifier[setOp] operator[SEP] identifier[op] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[op] operator[==] identifier[DocumentAndOp] operator[SEP] identifier[Op] operator[SEP] identifier[DELETE] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] identifier[readInto] operator[SEP] identifier[value] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[EOL] operator[SEP] operator[SEP] } }
public static Date parseDate(final String str) { ArgUtils.notEmpty(str, str); try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); format.setTimeZone(TimeZone.getTimeZone("GMT-00:00")); return format.parse(str); } catch (ParseException e) { throw new IllegalStateException(String.format("fail parse to Data from '%s',", str), e); } }
class class_name[name] begin[{] method[parseDate, return_type[type[Date]], modifier[public static], parameter[str]] begin[{] call[ArgUtils.notEmpty, parameter[member[.str], member[.str]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yyyy-MM-dd HH:mm:ss.SSS")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SimpleDateFormat, sub_type=None)), name=format)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SimpleDateFormat, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GMT-00:00")], member=getTimeZone, postfix_operators=[], prefix_operators=[], qualifier=TimeZone, selectors=[], type_arguments=None)], member=setTimeZone, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fail parse to Data from '%s',"), MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[parseDate] operator[SEP] Keyword[final] identifier[String] identifier[str] operator[SEP] { identifier[ArgUtils] operator[SEP] identifier[notEmpty] operator[SEP] identifier[str] , identifier[str] operator[SEP] operator[SEP] Keyword[try] { identifier[SimpleDateFormat] identifier[format] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[format] operator[SEP] identifier[setTimeZone] operator[SEP] identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[format] operator[SEP] identifier[parse] operator[SEP] identifier[str] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[str] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public FriendGroup addFriendGroup(String name) { final RosterGroup g = connection.getRoster().createGroup(name); if (g != null) { return new FriendGroup(this, connection, g); } return null; }
class class_name[name] begin[{] method[addFriendGroup, return_type[type[FriendGroup]], modifier[public], parameter[name]] begin[{] local_variable[type[RosterGroup], g] if[binary_operation[member[.g], !=, literal[null]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=g, 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=FriendGroup, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[FriendGroup] identifier[addFriendGroup] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[final] identifier[RosterGroup] identifier[g] operator[=] identifier[connection] operator[SEP] identifier[getRoster] operator[SEP] operator[SEP] operator[SEP] identifier[createGroup] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[g] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[FriendGroup] operator[SEP] Keyword[this] , identifier[connection] , identifier[g] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public TrackedPeer update(RequestEvent event, ByteBuffer peerId, String hexPeerId, String ip, int port, long uploaded, long downloaded, long left) throws UnsupportedEncodingException { logger.trace("event {}, Peer: {}:{}", new Object[]{event.getEventName(), ip, port}); TrackedPeer peer = null; TrackedPeer.PeerState state = TrackedPeer.PeerState.UNKNOWN; PeerUID peerUID = new PeerUID(new InetSocketAddress(ip, port), getHexInfoHash()); if (RequestEvent.STARTED.equals(event)) { state = TrackedPeer.PeerState.STARTED; } else if (RequestEvent.STOPPED.equals(event)) { peer = this.removePeer(peerUID); state = TrackedPeer.PeerState.STOPPED; } else if (RequestEvent.COMPLETED.equals(event)) { peer = this.getPeer(peerUID); state = TrackedPeer.PeerState.COMPLETED; } else if (RequestEvent.NONE.equals(event)) { peer = this.getPeer(peerUID); state = TrackedPeer.PeerState.STARTED; } else { throw new IllegalArgumentException("Unexpected announce event type!"); } if (peer == null) { peer = new TrackedPeer(this, ip, port, peerId); this.addPeer(peer); } peer.update(state, uploaded, downloaded, left); return peer; }
class class_name[name] begin[{] method[update, return_type[type[TrackedPeer]], modifier[public], parameter[event, peerId, hexPeerId, ip, port, uploaded, downloaded, left]] begin[{] call[logger.trace, parameter[literal["event {}, Peer: {}:{}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getEventName, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] local_variable[type[TrackedPeer], peer] local_variable[type[TrackedPeer], state] local_variable[type[PeerUID], peerUID] if[call[RequestEvent.STARTED.equals, parameter[member[.event]]]] begin[{] assign[member[.state], member[TrackedPeer.PeerState.STARTED]] else begin[{] if[call[RequestEvent.STOPPED.equals, parameter[member[.event]]]] begin[{] assign[member[.peer], THIS[call[None.removePeer, parameter[member[.peerUID]]]]] assign[member[.state], member[TrackedPeer.PeerState.STOPPED]] else begin[{] if[call[RequestEvent.COMPLETED.equals, parameter[member[.event]]]] begin[{] assign[member[.peer], THIS[call[None.getPeer, parameter[member[.peerUID]]]]] assign[member[.state], member[TrackedPeer.PeerState.COMPLETED]] else begin[{] if[call[RequestEvent.NONE.equals, parameter[member[.event]]]] begin[{] assign[member[.peer], THIS[call[None.getPeer, parameter[member[.peerUID]]]]] assign[member[.state], member[TrackedPeer.PeerState.STARTED]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected announce event type!")], 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) end[}] end[}] end[}] end[}] if[binary_operation[member[.peer], ==, literal[null]]] begin[{] assign[member[.peer], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=peerId, 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=TrackedPeer, sub_type=None))] THIS[call[None.addPeer, parameter[member[.peer]]]] else begin[{] None end[}] call[peer.update, parameter[member[.state], member[.uploaded], member[.downloaded], member[.left]]] return[member[.peer]] end[}] END[}]
Keyword[public] identifier[TrackedPeer] identifier[update] operator[SEP] identifier[RequestEvent] identifier[event] , identifier[ByteBuffer] identifier[peerId] , identifier[String] identifier[hexPeerId] , identifier[String] identifier[ip] , Keyword[int] identifier[port] , Keyword[long] identifier[uploaded] , Keyword[long] identifier[downloaded] , Keyword[long] identifier[left] operator[SEP] Keyword[throws] identifier[UnsupportedEncodingException] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[event] operator[SEP] identifier[getEventName] operator[SEP] operator[SEP] , identifier[ip] , identifier[port] } operator[SEP] operator[SEP] identifier[TrackedPeer] identifier[peer] operator[=] Other[null] operator[SEP] identifier[TrackedPeer] operator[SEP] identifier[PeerState] identifier[state] operator[=] identifier[TrackedPeer] operator[SEP] identifier[PeerState] operator[SEP] identifier[UNKNOWN] operator[SEP] identifier[PeerUID] identifier[peerUID] operator[=] Keyword[new] identifier[PeerUID] operator[SEP] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[ip] , identifier[port] operator[SEP] , identifier[getHexInfoHash] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[RequestEvent] operator[SEP] identifier[STARTED] operator[SEP] identifier[equals] operator[SEP] identifier[event] operator[SEP] operator[SEP] { identifier[state] operator[=] identifier[TrackedPeer] operator[SEP] identifier[PeerState] operator[SEP] identifier[STARTED] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[RequestEvent] operator[SEP] identifier[STOPPED] operator[SEP] identifier[equals] operator[SEP] identifier[event] operator[SEP] operator[SEP] { identifier[peer] operator[=] Keyword[this] operator[SEP] identifier[removePeer] operator[SEP] identifier[peerUID] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[TrackedPeer] operator[SEP] identifier[PeerState] operator[SEP] identifier[STOPPED] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[RequestEvent] operator[SEP] identifier[COMPLETED] operator[SEP] identifier[equals] operator[SEP] identifier[event] operator[SEP] operator[SEP] { identifier[peer] operator[=] Keyword[this] operator[SEP] identifier[getPeer] operator[SEP] identifier[peerUID] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[TrackedPeer] operator[SEP] identifier[PeerState] operator[SEP] identifier[COMPLETED] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[RequestEvent] operator[SEP] identifier[NONE] operator[SEP] identifier[equals] operator[SEP] identifier[event] operator[SEP] operator[SEP] { identifier[peer] operator[=] Keyword[this] operator[SEP] identifier[getPeer] operator[SEP] identifier[peerUID] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[TrackedPeer] operator[SEP] identifier[PeerState] operator[SEP] identifier[STARTED] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[peer] operator[==] Other[null] operator[SEP] { identifier[peer] operator[=] Keyword[new] identifier[TrackedPeer] operator[SEP] Keyword[this] , identifier[ip] , identifier[port] , identifier[peerId] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[addPeer] operator[SEP] identifier[peer] operator[SEP] operator[SEP] } identifier[peer] operator[SEP] identifier[update] operator[SEP] identifier[state] , identifier[uploaded] , identifier[downloaded] , identifier[left] operator[SEP] operator[SEP] Keyword[return] identifier[peer] operator[SEP] }
boolean allAlive(Frame fr) { for( Vec vec : fr.vecs() ) assert _refcnt.get(vec)._val > 0; return true; }
class class_name[name] begin[{] method[allAlive, return_type[type[boolean]], modifier[default], parameter[fr]] begin[{] ForStatement(body=AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=vec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_refcnt, selectors=[MemberReference(member=_val, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=vecs, postfix_operators=[], prefix_operators=[], qualifier=fr, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=vec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vec, sub_type=None))), label=None) return[literal[true]] end[}] END[}]
Keyword[boolean] identifier[allAlive] operator[SEP] identifier[Frame] identifier[fr] operator[SEP] { Keyword[for] operator[SEP] identifier[Vec] identifier[vec] operator[:] identifier[fr] operator[SEP] identifier[vecs] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[_refcnt] operator[SEP] identifier[get] operator[SEP] identifier[vec] operator[SEP] operator[SEP] identifier[_val] operator[>] Other[0] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public @NotNull Counter bytes(@NotNull String name) { return counters.computeIfAbsent("vertx_" + name + "_bytes", key -> register(Counter.build(key, "Read/written bytes") .labelNames("local_address", "type").create())); }
class class_name[name] begin[{] method[bytes, return_type[type[Counter]], modifier[public], parameter[name]] begin[{] return[call[counters.computeIfAbsent, parameter[binary_operation[binary_operation[literal["vertx_"], +, member[.name]], +, literal["_bytes"]], LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Read/written bytes")], member=build, postfix_operators=[], prefix_operators=[], qualifier=Counter, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="local_address"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type")], member=labelNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=register, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]] end[}] END[}]
Keyword[public] annotation[@] identifier[NotNull] identifier[Counter] identifier[bytes] operator[SEP] annotation[@] identifier[NotNull] identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[counters] operator[SEP] identifier[computeIfAbsent] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] , identifier[key] operator[->] identifier[register] operator[SEP] identifier[Counter] operator[SEP] identifier[build] operator[SEP] identifier[key] , literal[String] operator[SEP] operator[SEP] identifier[labelNames] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private boolean isMajorIsotope(int number, int mass) { try { IIsotope isotope = Isotopes.getInstance().getMajorIsotope(number); return isotope != null && isotope.getMassNumber().equals(mass); } catch (IOException e) { return false; } }
class class_name[name] begin[{] method[isMajorIsotope, return_type[type[boolean]], modifier[private], parameter[number, mass]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Isotopes, selectors=[MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMajorIsotope, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=isotope)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IIsotope, sub_type=None)), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=isotope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getMassNumber, postfix_operators=[], prefix_operators=[], qualifier=isotope, selectors=[MethodInvocation(arguments=[MemberReference(member=mass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isMajorIsotope] operator[SEP] Keyword[int] identifier[number] , Keyword[int] identifier[mass] operator[SEP] { Keyword[try] { identifier[IIsotope] identifier[isotope] operator[=] identifier[Isotopes] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMajorIsotope] operator[SEP] identifier[number] operator[SEP] operator[SEP] Keyword[return] identifier[isotope] operator[!=] Other[null] operator[&&] identifier[isotope] operator[SEP] identifier[getMassNumber] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[mass] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
private void initializeDrawer() { mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.show, R.string.hide); mDrawerLayout.setDrawerListener(mDrawerToggle); getActionBar().setDisplayHomeAsUpEnabled(true); mDrawerToggle.syncState(); }
class class_name[name] begin[{] method[initializeDrawer, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.mDrawerLayout], Cast(expression=MethodInvocation(arguments=[MemberReference(member=drawer_layout, postfix_operators=[], prefix_operators=[], qualifier=R.id, selectors=[])], member=findViewById, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DrawerLayout, sub_type=None))] assign[member[.mDrawerToggle], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=mDrawerLayout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ic_drawer, postfix_operators=[], prefix_operators=[], qualifier=R.drawable, selectors=[]), MemberReference(member=show, postfix_operators=[], prefix_operators=[], qualifier=R.string, selectors=[]), MemberReference(member=hide, postfix_operators=[], prefix_operators=[], qualifier=R.string, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActionBarDrawerToggle, sub_type=None))] call[mDrawerLayout.setDrawerListener, parameter[member[.mDrawerToggle]]] call[.getActionBar, parameter[]] call[mDrawerToggle.syncState, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[initializeDrawer] operator[SEP] operator[SEP] { identifier[mDrawerLayout] operator[=] operator[SEP] identifier[DrawerLayout] operator[SEP] identifier[findViewById] operator[SEP] identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[drawer_layout] operator[SEP] operator[SEP] identifier[mDrawerToggle] operator[=] Keyword[new] identifier[ActionBarDrawerToggle] operator[SEP] Keyword[this] , identifier[mDrawerLayout] , identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[ic_drawer] , identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[show] , identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[hide] operator[SEP] operator[SEP] identifier[mDrawerLayout] operator[SEP] identifier[setDrawerListener] operator[SEP] identifier[mDrawerToggle] operator[SEP] operator[SEP] identifier[getActionBar] operator[SEP] operator[SEP] operator[SEP] identifier[setDisplayHomeAsUpEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[mDrawerToggle] operator[SEP] identifier[syncState] operator[SEP] operator[SEP] operator[SEP] }
public static xen_websensevpx_image[] get(nitro_service client) throws Exception { xen_websensevpx_image resource = new xen_websensevpx_image(); resource.validate("get"); return (xen_websensevpx_image[]) resource.get_resources(client); }
class class_name[name] begin[{] method[get, return_type[type[xen_websensevpx_image]], modifier[public static], parameter[client]] begin[{] local_variable[type[xen_websensevpx_image], resource] call[resource.validate, parameter[literal["get"]]] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_resources, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=xen_websensevpx_image, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[xen_websensevpx_image] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] { identifier[xen_websensevpx_image] identifier[resource] operator[=] Keyword[new] identifier[xen_websensevpx_image] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[xen_websensevpx_image] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[get_resources] operator[SEP] identifier[client] operator[SEP] operator[SEP] }
public static void insertBand( GrayI8 input, int band , InterleavedI8 output) { final int numBands = output.numBands; for (int y = 0; y < input.height; y++) { int indexIn = input.getStartIndex() + y * input.getStride(); int indexOut = output.getStartIndex() + y * output.getStride() + band; int end = indexOut + output.width*numBands - band; for (; indexOut < end; indexOut += numBands , indexIn++ ) { output.data[indexOut] = input.data[indexIn]; } } }
class class_name[name] begin[{] method[insertBand, return_type[void], modifier[public static], parameter[input, band, output]] begin[{] local_variable[type[int], numBands] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStartIndex, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getStride, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operator=*), operator=+), name=indexIn)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStartIndex, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getStride, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), operator=*), operator=+), operandr=MemberReference(member=band, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=indexOut)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=indexOut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[]), operandr=MemberReference(member=numBands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operandr=MemberReference(member=band, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[ArraySelector(index=MemberReference(member=indexOut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[ArraySelector(index=MemberReference(member=indexIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=indexOut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[Assignment(expressionl=MemberReference(member=indexOut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=numBands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=indexIn, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[insertBand] operator[SEP] identifier[GrayI8] identifier[input] , Keyword[int] identifier[band] , identifier[InterleavedI8] identifier[output] operator[SEP] { Keyword[final] Keyword[int] identifier[numBands] operator[=] identifier[output] operator[SEP] identifier[numBands] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[input] operator[SEP] identifier[height] operator[SEP] identifier[y] operator[++] operator[SEP] { Keyword[int] identifier[indexIn] operator[=] identifier[input] operator[SEP] identifier[getStartIndex] operator[SEP] operator[SEP] operator[+] identifier[y] operator[*] identifier[input] operator[SEP] identifier[getStride] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[indexOut] operator[=] identifier[output] operator[SEP] identifier[getStartIndex] operator[SEP] operator[SEP] operator[+] identifier[y] operator[*] identifier[output] operator[SEP] identifier[getStride] operator[SEP] operator[SEP] operator[+] identifier[band] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[indexOut] operator[+] identifier[output] operator[SEP] identifier[width] operator[*] identifier[numBands] operator[-] identifier[band] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[indexOut] operator[<] identifier[end] operator[SEP] identifier[indexOut] operator[+=] identifier[numBands] , identifier[indexIn] operator[++] operator[SEP] { identifier[output] operator[SEP] identifier[data] operator[SEP] identifier[indexOut] operator[SEP] operator[=] identifier[input] operator[SEP] identifier[data] operator[SEP] identifier[indexIn] operator[SEP] operator[SEP] } } }
private static Map<String, Set<String>> expand(Map<String, Set<String>> viewToPropNames) { Set<String> baseProps = viewToPropNames.get(PropertyView.BASE_VIEW); if (baseProps == null) { baseProps = ImmutableSet.of(); } if (!SquigglyConfig.isFilterImplicitlyIncludeBaseFieldsInView()) { // make an exception for full view Set<String> fullView = viewToPropNames.get(PropertyView.FULL_VIEW); if (fullView != null) { fullView.addAll(baseProps); } return viewToPropNames; } for (Map.Entry<String, Set<String>> entry : viewToPropNames.entrySet()) { String viewName = entry.getKey(); Set<String> propNames = entry.getValue(); if (!PropertyView.BASE_VIEW.equals(viewName)) { propNames.addAll(baseProps); } } return viewToPropNames; }
class class_name[name] begin[{] method[expand, return_type[type[Map]], modifier[private static], parameter[viewToPropNames]] begin[{] local_variable[type[Set], baseProps] if[binary_operation[member[.baseProps], ==, literal[null]]] begin[{] assign[member[.baseProps], call[ImmutableSet.of, parameter[]]] else begin[{] None end[}] if[call[SquigglyConfig.isFilterImplicitlyIncludeBaseFieldsInView, parameter[]]] begin[{] local_variable[type[Set], fullView] if[binary_operation[member[.fullView], !=, literal[null]]] begin[{] call[fullView.addAll, parameter[member[.baseProps]]] else begin[{] None end[}] return[member[.viewToPropNames]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=viewName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=propNames)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=viewName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=PropertyView.BASE_VIEW, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=baseProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=propNames, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=viewToPropNames, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.viewToPropNames]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[expand] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[viewToPropNames] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[baseProps] operator[=] identifier[viewToPropNames] operator[SEP] identifier[get] operator[SEP] identifier[PropertyView] operator[SEP] identifier[BASE_VIEW] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[baseProps] operator[==] Other[null] operator[SEP] { identifier[baseProps] operator[=] identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[SquigglyConfig] operator[SEP] identifier[isFilterImplicitlyIncludeBaseFieldsInView] operator[SEP] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[fullView] operator[=] identifier[viewToPropNames] operator[SEP] identifier[get] operator[SEP] identifier[PropertyView] operator[SEP] identifier[FULL_VIEW] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fullView] operator[!=] Other[null] operator[SEP] { identifier[fullView] operator[SEP] identifier[addAll] operator[SEP] identifier[baseProps] operator[SEP] operator[SEP] } Keyword[return] identifier[viewToPropNames] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[viewToPropNames] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[viewName] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[propNames] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[PropertyView] operator[SEP] identifier[BASE_VIEW] operator[SEP] identifier[equals] operator[SEP] identifier[viewName] operator[SEP] operator[SEP] { identifier[propNames] operator[SEP] identifier[addAll] operator[SEP] identifier[baseProps] operator[SEP] operator[SEP] } } Keyword[return] identifier[viewToPropNames] operator[SEP] }
private DataResultSet getResultSet(String name, Service service) { ResultSet rs = service.getBinder().getResultSet(name); DataResultSet drs = new DataResultSet(); if (rs != null) { drs.copy(rs); return drs; } return null; }
class class_name[name] begin[{] method[getResultSet, return_type[type[DataResultSet]], modifier[private], parameter[name, service]] begin[{] local_variable[type[ResultSet], rs] local_variable[type[DataResultSet], drs] if[binary_operation[member[.rs], !=, literal[null]]] begin[{] call[drs.copy, parameter[member[.rs]]] return[member[.drs]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[DataResultSet] identifier[getResultSet] operator[SEP] identifier[String] identifier[name] , identifier[Service] identifier[service] operator[SEP] { identifier[ResultSet] identifier[rs] operator[=] identifier[service] operator[SEP] identifier[getBinder] operator[SEP] operator[SEP] operator[SEP] identifier[getResultSet] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[DataResultSet] identifier[drs] operator[=] Keyword[new] identifier[DataResultSet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rs] operator[!=] Other[null] operator[SEP] { identifier[drs] operator[SEP] identifier[copy] operator[SEP] identifier[rs] operator[SEP] operator[SEP] Keyword[return] identifier[drs] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private Integer zGetWeekNumberForASevenDayRange(LocalDate firstDateInRange, WeekFields weekFieldRules, boolean requireUnanimousWeekNumber) { // Get the week number for each of the seven days in the range. ArrayList<Integer> weekNumbersList = new ArrayList<Integer>(); for (int daysIntoTheFuture = 0; daysIntoTheFuture <= 6; ++daysIntoTheFuture) { LocalDate currentDateInRange; // This try block handles an exception that can occur at LocalDate.MAX try { currentDateInRange = firstDateInRange.plusDays(daysIntoTheFuture); int currentWeekNumber = currentDateInRange.get(weekFieldRules.weekOfWeekBasedYear()); weekNumbersList.add(currentWeekNumber); } catch (Exception ex) { return 1; } } // Find out if all the week numbers are the same. // We can check for a unanimous sequence by looking at the first and last number. boolean isUnanimous = (InternalUtilities.areObjectsEqual( weekNumbersList.get(0), weekNumbersList.get(6))); // If the week numbers are unanimous, then return the unanimous week number. if (isUnanimous) { return weekNumbersList.get(0); } // The week number is not unanimous. // If unanimous week numbers are required, then return null. if (requireUnanimousWeekNumber) { return null; } // Otherwise, return the most common week number. int mostCommonWeekNumber = InternalUtilities.getMostCommonElementInList(weekNumbersList); return mostCommonWeekNumber; }
class class_name[name] begin[{] method[zGetWeekNumberForASevenDayRange, return_type[type[Integer]], modifier[private], parameter[firstDateInRange, weekFieldRules, requireUnanimousWeekNumber]] begin[{] local_variable[type[ArrayList], weekNumbersList] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=currentDateInRange)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocalDate, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentDateInRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=daysIntoTheFuture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=plusDays, postfix_operators=[], prefix_operators=[], qualifier=firstDateInRange, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=weekOfWeekBasedYear, postfix_operators=[], prefix_operators=[], qualifier=weekFieldRules, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=currentDateInRange, selectors=[], type_arguments=None), name=currentWeekNumber)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentWeekNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=weekNumbersList, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=daysIntoTheFuture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=daysIntoTheFuture)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=daysIntoTheFuture, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[boolean], isUnanimous] if[member[.isUnanimous]] begin[{] return[call[weekNumbersList.get, parameter[literal[0]]]] else begin[{] None end[}] if[member[.requireUnanimousWeekNumber]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], mostCommonWeekNumber] return[member[.mostCommonWeekNumber]] end[}] END[}]
Keyword[private] identifier[Integer] identifier[zGetWeekNumberForASevenDayRange] operator[SEP] identifier[LocalDate] identifier[firstDateInRange] , identifier[WeekFields] identifier[weekFieldRules] , Keyword[boolean] identifier[requireUnanimousWeekNumber] operator[SEP] { identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[weekNumbersList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[daysIntoTheFuture] operator[=] Other[0] operator[SEP] identifier[daysIntoTheFuture] operator[<=] Other[6] operator[SEP] operator[++] identifier[daysIntoTheFuture] operator[SEP] { identifier[LocalDate] identifier[currentDateInRange] operator[SEP] Keyword[try] { identifier[currentDateInRange] operator[=] identifier[firstDateInRange] operator[SEP] identifier[plusDays] operator[SEP] identifier[daysIntoTheFuture] operator[SEP] operator[SEP] Keyword[int] identifier[currentWeekNumber] operator[=] identifier[currentDateInRange] operator[SEP] identifier[get] operator[SEP] identifier[weekFieldRules] operator[SEP] identifier[weekOfWeekBasedYear] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[weekNumbersList] operator[SEP] identifier[add] operator[SEP] identifier[currentWeekNumber] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[return] Other[1] operator[SEP] } } Keyword[boolean] identifier[isUnanimous] operator[=] operator[SEP] identifier[InternalUtilities] operator[SEP] identifier[areObjectsEqual] operator[SEP] identifier[weekNumbersList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[weekNumbersList] operator[SEP] identifier[get] operator[SEP] Other[6] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isUnanimous] operator[SEP] { Keyword[return] identifier[weekNumbersList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[requireUnanimousWeekNumber] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[mostCommonWeekNumber] operator[=] identifier[InternalUtilities] operator[SEP] identifier[getMostCommonElementInList] operator[SEP] identifier[weekNumbersList] operator[SEP] operator[SEP] Keyword[return] identifier[mostCommonWeekNumber] operator[SEP] }
boolean validate(StringBuilder out) { this.isValid = true; // If log from construction has content, append to validation output msg. if (this.log.length() > 0) { out.append(this.log); } // Validity check: 'name' cannot be null. (Though, 'name' // can be an empty string.) if (this.getName() == null) { isValid = false; out.append(" ** DatasetFilter (4): null value for name is not valid."); } // Check that type is not null. if (this.getType() == null) { isValid = false; out.append(" ** DatasetFilter (5): null value for type is not valid (set with bad string?)."); } // Validity check: 'matchPattern' must be null if 'type' value // is not 'RegExp'. if (this.type == DatasetFilter.Type.REGULAR_EXPRESSION && this.matchPattern == null) { isValid = false; out.append(" ** DatasetFilter (6): null value for matchPattern not valid when type is 'RegExp'."); } if (this.type != DatasetFilter.Type.REGULAR_EXPRESSION && this.type != null && this.matchPattern != null) { isValid = false; out.append(" ** DatasetFilter (7): matchPattern value (" + this.matchPattern + ") must be null if type is not 'RegExp'."); } return (this.isValid); }
class class_name[name] begin[{] method[validate, return_type[type[boolean]], modifier[default], parameter[out]] begin[{] assign[THIS[member[None.isValid]], literal[true]] if[binary_operation[THIS[member[None.log]call[None.length, parameter[]]], >, literal[0]]] begin[{] call[out.append, parameter[THIS[member[None.log]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getName, parameter[]]], ==, literal[null]]] begin[{] assign[member[.isValid], literal[false]] call[out.append, parameter[literal[" ** DatasetFilter (4): null value for name is not valid."]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getType, parameter[]]], ==, literal[null]]] begin[{] assign[member[.isValid], literal[false]] call[out.append, parameter[literal[" ** DatasetFilter (5): null value for type is not valid (set with bad string?)."]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[member[None.type]], ==, member[DatasetFilter.Type.REGULAR_EXPRESSION]], &&, binary_operation[THIS[member[None.matchPattern]], ==, literal[null]]]] begin[{] assign[member[.isValid], literal[false]] call[out.append, parameter[literal[" ** DatasetFilter (6): null value for matchPattern not valid when type is 'RegExp'."]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[THIS[member[None.type]], !=, member[DatasetFilter.Type.REGULAR_EXPRESSION]], &&, binary_operation[THIS[member[None.type]], !=, literal[null]]], &&, binary_operation[THIS[member[None.matchPattern]], !=, literal[null]]]] begin[{] assign[member[.isValid], literal[false]] call[out.append, parameter[binary_operation[binary_operation[literal[" ** DatasetFilter (7): matchPattern value ("], +, THIS[member[None.matchPattern]]], +, literal[") must be null if type is not 'RegExp'."]]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[boolean] identifier[validate] operator[SEP] identifier[StringBuilder] identifier[out] operator[SEP] { Keyword[this] operator[SEP] identifier[isValid] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[log] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[log] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[==] identifier[DatasetFilter] operator[SEP] identifier[Type] operator[SEP] identifier[REGULAR_EXPRESSION] operator[&&] Keyword[this] operator[SEP] identifier[matchPattern] operator[==] Other[null] operator[SEP] { identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[!=] identifier[DatasetFilter] operator[SEP] identifier[Type] operator[SEP] identifier[REGULAR_EXPRESSION] operator[&&] Keyword[this] operator[SEP] identifier[type] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[matchPattern] operator[!=] Other[null] operator[SEP] { identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[matchPattern] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] Keyword[this] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] }
@Draft public ZMsg msgBinaryPicture(String picture, Object... args) { if (!BINARY_FORMAT.matcher(picture).matches()) { throw new ZMQException(picture + " is not in expected binary format " + BINARY_FORMAT.pattern(), ZError.EPROTO); } ZMsg msg = new ZMsg(); // Pass 1: calculate total size of data frame int frameSize = 0; for (int index = 0; index < picture.length(); index++) { char pattern = picture.charAt(index); switch (pattern) { case '1': { frameSize += 1; break; } case '2': { frameSize += 2; break; } case '4': { frameSize += 4; break; } case '8': { frameSize += 8; break; } case 's': { String string = (String) args[index]; frameSize += 1 + (string != null ? string.getBytes(ZMQ.CHARSET).length : 0); break; } case 'S': { String string = (String) args[index]; frameSize += 4 + (string != null ? string.getBytes(ZMQ.CHARSET).length : 0); break; } case 'b': case 'c': { byte[] block = (byte[]) args[index]; frameSize += 4 + block.length; break; } case 'f': { ZFrame frame = (ZFrame) args[index]; msg.add(frame); break; } case 'm': { ZMsg other = (ZMsg) args[index]; if (other == null) { msg.add(new ZFrame((byte[]) null)); } else { other.forEach(msg::add); } break; } default: assert (false) : "invalid picture element '" + pattern + "'"; } } // Pass 2: encode data into data frame ZFrame frame = new ZFrame(new byte[frameSize]); ZNeedle needle = new ZNeedle(frame); for (int index = 0; index < picture.length(); index++) { char pattern = picture.charAt(index); switch (pattern) { case '1': { needle.putNumber1((int) args[index]); break; } case '2': { needle.putNumber2((int) args[index]); break; } case '4': { needle.putNumber4((int) args[index]); break; } case '8': { needle.putNumber8((long) args[index]); break; } case 's': { needle.putString((String) args[index]); break; } case 'S': { needle.putLongString((String) args[index]); break; } case 'b': case 'c': { byte[] block = (byte[]) args[index]; needle.putNumber4(block.length); needle.putBlock(block, block.length); break; } case 'f': case 'm': break; default: assert (false) : "invalid picture element '" + pattern + "'"; } } msg.addFirst(frame); return msg; }
class class_name[name] begin[{] method[msgBinaryPicture, return_type[type[ZMsg]], modifier[public], parameter[picture, args]] begin[{] if[call[BINARY_FORMAT.matcher, parameter[member[.picture]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=picture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not in expected binary format "), operator=+), operandr=MethodInvocation(arguments=[], member=pattern, postfix_operators=[], prefix_operators=[], qualifier=BINARY_FORMAT, selectors=[], type_arguments=None), operator=+), MemberReference(member=EPROTO, postfix_operators=[], prefix_operators=[], qualifier=ZError, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZMQException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ZMsg], msg] local_variable[type[int], frameSize] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), name=pattern)], modifiers=set(), type=BasicType(dimensions=[], name=char)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='1')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='2')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='4')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='8')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='s')], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=string)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=string, 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), if_true=MethodInvocation(arguments=[MemberReference(member=CHARSET, postfix_operators=[], prefix_operators=[], qualifier=ZMQ, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=string, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), operator=+)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='S')], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=string)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=string, 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), if_true=MethodInvocation(arguments=[MemberReference(member=CHARSET, postfix_operators=[], prefix_operators=[], qualifier=ZMQ, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=string, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), operator=+)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='c')], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[None], name=byte)), name=block)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=frameSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=block, selectors=[]), operator=+)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=ZFrame, sub_type=None)), name=frame)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZFrame, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=frame, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='m')], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=ZMsg, sub_type=None)), name=other)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZMsg, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=forEach, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=BasicType(dimensions=[None], name=byte))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZFrame, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[AssertStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid picture element '"), operandr=MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+))])], expression=MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[ZFrame], frame] local_variable[type[ZNeedle], needle] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), name=pattern)], modifiers=set(), type=BasicType(dimensions=[], name=char)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='1')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int))], member=putNumber1, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='2')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int))], member=putNumber2, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='4')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int))], member=putNumber4, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='8')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=long))], member=putNumber8, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='s')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=putString, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='S')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=putLongString, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='c')], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[None], name=byte)), name=block)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=block, selectors=[])], member=putNumber4, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=block, selectors=[])], member=putBlock, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='m')], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[AssertStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid picture element '"), operandr=MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+))])], expression=MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[msg.addFirst, parameter[member[.frame]]] return[member[.msg]] end[}] END[}]
annotation[@] identifier[Draft] Keyword[public] identifier[ZMsg] identifier[msgBinaryPicture] operator[SEP] identifier[String] identifier[picture] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[BINARY_FORMAT] operator[SEP] identifier[matcher] operator[SEP] identifier[picture] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ZMQException] operator[SEP] identifier[picture] operator[+] literal[String] operator[+] identifier[BINARY_FORMAT] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] , identifier[ZError] operator[SEP] identifier[EPROTO] operator[SEP] operator[SEP] } identifier[ZMsg] identifier[msg] operator[=] Keyword[new] identifier[ZMsg] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[frameSize] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[index] operator[<] identifier[picture] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[++] operator[SEP] { Keyword[char] identifier[pattern] operator[=] identifier[picture] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[pattern] operator[SEP] { Keyword[case] literal[String] operator[:] { identifier[frameSize] operator[+=] Other[1] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[frameSize] operator[+=] Other[2] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[frameSize] operator[+=] Other[4] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[frameSize] operator[+=] Other[8] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[String] identifier[string] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[frameSize] operator[+=] Other[1] operator[+] operator[SEP] identifier[string] operator[!=] Other[null] operator[?] identifier[string] operator[SEP] identifier[getBytes] operator[SEP] identifier[ZMQ] operator[SEP] identifier[CHARSET] operator[SEP] operator[SEP] identifier[length] operator[:] Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[String] identifier[string] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[frameSize] operator[+=] Other[4] operator[+] operator[SEP] identifier[string] operator[!=] Other[null] operator[?] identifier[string] operator[SEP] identifier[getBytes] operator[SEP] identifier[ZMQ] operator[SEP] identifier[CHARSET] operator[SEP] operator[SEP] identifier[length] operator[:] Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] { Keyword[byte] operator[SEP] operator[SEP] identifier[block] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[frameSize] operator[+=] Other[4] operator[+] identifier[block] operator[SEP] identifier[length] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[ZFrame] identifier[frame] operator[=] operator[SEP] identifier[ZFrame] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[add] operator[SEP] identifier[frame] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[ZMsg] identifier[other] operator[=] operator[SEP] identifier[ZMsg] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[other] operator[==] Other[null] operator[SEP] { identifier[msg] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZFrame] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] Other[null] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[other] operator[SEP] identifier[forEach] operator[SEP] identifier[msg] operator[::] identifier[add] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } Keyword[default] operator[:] Keyword[assert] operator[SEP] literal[boolean] operator[SEP] operator[:] literal[String] operator[+] identifier[pattern] operator[+] literal[String] operator[SEP] } } identifier[ZFrame] identifier[frame] operator[=] Keyword[new] identifier[ZFrame] operator[SEP] Keyword[new] Keyword[byte] operator[SEP] identifier[frameSize] operator[SEP] operator[SEP] operator[SEP] identifier[ZNeedle] identifier[needle] operator[=] Keyword[new] identifier[ZNeedle] operator[SEP] identifier[frame] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[index] operator[<] identifier[picture] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[++] operator[SEP] { Keyword[char] identifier[pattern] operator[=] identifier[picture] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[pattern] operator[SEP] { Keyword[case] literal[String] operator[:] { identifier[needle] operator[SEP] identifier[putNumber1] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[needle] operator[SEP] identifier[putNumber2] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[needle] operator[SEP] identifier[putNumber4] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[needle] operator[SEP] identifier[putNumber8] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[needle] operator[SEP] identifier[putString] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] { identifier[needle] operator[SEP] identifier[putLongString] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] { Keyword[byte] operator[SEP] operator[SEP] identifier[block] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[needle] operator[SEP] identifier[putNumber4] operator[SEP] identifier[block] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[needle] operator[SEP] identifier[putBlock] operator[SEP] identifier[block] , identifier[block] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[assert] operator[SEP] literal[boolean] operator[SEP] operator[:] literal[String] operator[+] identifier[pattern] operator[+] literal[String] operator[SEP] } } identifier[msg] operator[SEP] identifier[addFirst] operator[SEP] identifier[frame] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP] }
protected SQLException translateException(Exception e) { if (isAcquireTimeoutException(e)) { eventPublisher.publish(new ConnectionAcquireTimeoutEvent(configurationProperties.getUniqueName())); return new AcquireTimeoutException(e); } else if (e instanceof SQLException) { return (SQLException) e; } return new SQLException(e); }
class class_name[name] begin[{] method[translateException, return_type[type[SQLException]], modifier[protected], parameter[e]] begin[{] if[call[.isAcquireTimeoutException, parameter[member[.e]]]] begin[{] call[eventPublisher.publish, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getUniqueName, postfix_operators=[], prefix_operators=[], qualifier=configurationProperties, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConnectionAcquireTimeoutEvent, sub_type=None))]] return[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=AcquireTimeoutException, sub_type=None))] else begin[{] if[binary_operation[member[.e], instanceof, type[SQLException]]] begin[{] return[Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SQLException, sub_type=None))] else begin[{] None end[}] end[}] return[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=SQLException, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[SQLException] identifier[translateException] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[isAcquireTimeoutException] operator[SEP] identifier[e] operator[SEP] operator[SEP] { identifier[eventPublisher] operator[SEP] identifier[publish] operator[SEP] Keyword[new] identifier[ConnectionAcquireTimeoutEvent] operator[SEP] identifier[configurationProperties] operator[SEP] identifier[getUniqueName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AcquireTimeoutException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[SQLException] operator[SEP] { Keyword[return] operator[SEP] identifier[SQLException] operator[SEP] identifier[e] operator[SEP] } Keyword[return] Keyword[new] identifier[SQLException] operator[SEP] identifier[e] operator[SEP] operator[SEP] }
public static <T> List<T> toList(final Class<T> type, final EvaluationContext ctx, final List<Parameter> parameters) { List<T> values = new ArrayList(); if (null != parameters) { for (Parameter param : parameters) { consume(type, ctx, values, param.getValue()); } } return values; }
class class_name[name] begin[{] method[toList, return_type[type[List]], modifier[public static], parameter[type, ctx, parameters]] begin[{] local_variable[type[List], values] if[binary_operation[literal[null], !=, member[.parameters]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=consume, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Parameter, sub_type=None))), label=None) else begin[{] None end[}] return[member[.values]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[toList] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] , Keyword[final] identifier[EvaluationContext] identifier[ctx] , Keyword[final] identifier[List] operator[<] identifier[Parameter] operator[>] identifier[parameters] operator[SEP] { identifier[List] operator[<] identifier[T] operator[>] identifier[values] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[parameters] operator[SEP] { Keyword[for] operator[SEP] identifier[Parameter] identifier[param] operator[:] identifier[parameters] operator[SEP] { identifier[consume] operator[SEP] identifier[type] , identifier[ctx] , identifier[values] , identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[values] operator[SEP] }
public static JsonInputValidator getValidator(Class<?> clazz) { if (clazz.equals(Scope.class)) { return ScopeValidator.getInstance(); } if (clazz.equals(ApplicationInfo.class)) { return ApplicationInfoValidator.getInstance(); } return null; }
class class_name[name] begin[{] method[getValidator, return_type[type[JsonInputValidator]], modifier[public static], parameter[clazz]] begin[{] if[call[clazz.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Scope, sub_type=None))]]] begin[{] return[call[ScopeValidator.getInstance, parameter[]]] else begin[{] None end[}] if[call[clazz.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ApplicationInfo, sub_type=None))]]] begin[{] return[call[ApplicationInfoValidator.getInstance, parameter[]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JsonInputValidator] identifier[getValidator] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[equals] operator[SEP] identifier[Scope] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] identifier[ScopeValidator] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[equals] operator[SEP] identifier[ApplicationInfo] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] identifier[ApplicationInfoValidator] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private void fireBackgroundDataFlushExceptionEvent(final Throwable e) { for (final WeakReference<OBackgroundExceptionListener> ref : backgroundExceptionListeners) { final OBackgroundExceptionListener listener = ref.get(); if (listener != null) { listener.onException(e); } } }
class class_name[name] begin[{] method[fireBackgroundDataFlushExceptionEvent, return_type[void], modifier[private], parameter[e]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=ref, selectors=[], type_arguments=None), name=listener)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OBackgroundExceptionListener, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onException, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=backgroundExceptionListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ref)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=OBackgroundExceptionListener, sub_type=None))], dimensions=[], name=WeakReference, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[fireBackgroundDataFlushExceptionEvent] operator[SEP] Keyword[final] identifier[Throwable] identifier[e] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[WeakReference] operator[<] identifier[OBackgroundExceptionListener] operator[>] identifier[ref] operator[:] identifier[backgroundExceptionListeners] operator[SEP] { Keyword[final] identifier[OBackgroundExceptionListener] identifier[listener] operator[=] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listener] operator[!=] Other[null] operator[SEP] { identifier[listener] operator[SEP] identifier[onException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } }
public void marshall(UserPoolAddOnsType userPoolAddOnsType, ProtocolMarshaller protocolMarshaller) { if (userPoolAddOnsType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(userPoolAddOnsType.getAdvancedSecurityMode(), ADVANCEDSECURITYMODE_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[userPoolAddOnsType, protocolMarshaller]] begin[{] if[binary_operation[member[.userPoolAddOnsType], ==, 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=getAdvancedSecurityMode, postfix_operators=[], prefix_operators=[], qualifier=userPoolAddOnsType, selectors=[], type_arguments=None), MemberReference(member=ADVANCEDSECURITYMODE_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[UserPoolAddOnsType] identifier[userPoolAddOnsType] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[userPoolAddOnsType] 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[userPoolAddOnsType] operator[SEP] identifier[getAdvancedSecurityMode] operator[SEP] operator[SEP] , identifier[ADVANCEDSECURITYMODE_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] } }
private static String readString(String fieldName, ByteBuf in) { int length = in.bytesBefore(MAX_FIELD_LENGTH + 1, (byte) 0); if (length < 0) { throw new DecoderException("field '" + fieldName + "' longer than " + MAX_FIELD_LENGTH + " chars"); } String value = in.readSlice(length).toString(CharsetUtil.US_ASCII); in.skipBytes(1); // Skip the NUL. return value; }
class class_name[name] begin[{] method[readString, return_type[type[String]], modifier[private static], parameter[fieldName, in]] begin[{] local_variable[type[int], length] if[binary_operation[member[.length], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="field '"), operandr=MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' longer than "), operator=+), operandr=MemberReference(member=MAX_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" chars"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DecoderException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], value] call[in.skipBytes, parameter[literal[1]]] return[member[.value]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[readString] operator[SEP] identifier[String] identifier[fieldName] , identifier[ByteBuf] identifier[in] operator[SEP] { Keyword[int] identifier[length] operator[=] identifier[in] operator[SEP] identifier[bytesBefore] operator[SEP] identifier[MAX_FIELD_LENGTH] operator[+] Other[1] , operator[SEP] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[DecoderException] operator[SEP] literal[String] operator[+] identifier[fieldName] operator[+] literal[String] operator[+] identifier[MAX_FIELD_LENGTH] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[value] operator[=] identifier[in] operator[SEP] identifier[readSlice] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[toString] operator[SEP] identifier[CharsetUtil] operator[SEP] identifier[US_ASCII] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[skipBytes] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] }
@Override public EClass getIfcShadingDeviceType() { if (ifcShadingDeviceTypeEClass == null) { ifcShadingDeviceTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(594); } return ifcShadingDeviceTypeEClass; }
class class_name[name] begin[{] method[getIfcShadingDeviceType, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcShadingDeviceTypeEClass], ==, literal[null]]] begin[{] assign[member[.ifcShadingDeviceTypeEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=594)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcShadingDeviceTypeEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcShadingDeviceType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcShadingDeviceTypeEClass] operator[==] Other[null] operator[SEP] { identifier[ifcShadingDeviceTypeEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[594] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcShadingDeviceTypeEClass] operator[SEP] }
public static void initClass() { // registers a factory for creating new instances of this widget CmsWidgetFactoryRegistry.instance().registerFactory(WIDGET_TYPE, new I_CmsFormWidgetFactory() { /** * @see org.opencms.gwt.client.ui.input.form.I_CmsFormWidgetFactory#createWidget(java.util.Map, com.google.common.base.Optional) */ public I_CmsFormWidget createWidget(Map<String, String> widgetParams, Optional<String> defaultValue) { return new CmsLinkSelector(); } }); }
class class_name[name] begin[{] method[initClass, return_type[void], modifier[public static], parameter[]] begin[{] call[CmsWidgetFactoryRegistry.instance, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[initClass] operator[SEP] operator[SEP] { identifier[CmsWidgetFactoryRegistry] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[registerFactory] operator[SEP] identifier[WIDGET_TYPE] , Keyword[new] identifier[I_CmsFormWidgetFactory] operator[SEP] operator[SEP] { Keyword[public] identifier[I_CmsFormWidget] identifier[createWidget] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[widgetParams] , identifier[Optional] operator[<] identifier[String] operator[>] identifier[defaultValue] operator[SEP] { Keyword[return] Keyword[new] identifier[CmsLinkSelector] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void setFaces(java.util.Collection<FaceDetection> faces) { if (faces == null) { this.faces = null; return; } this.faces = new java.util.ArrayList<FaceDetection>(faces); }
class class_name[name] begin[{] method[setFaces, return_type[void], modifier[public], parameter[faces]] begin[{] if[binary_operation[member[.faces], ==, literal[null]]] begin[{] assign[THIS[member[None.faces]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.faces]], ClassCreator(arguments=[MemberReference(member=faces, 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=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FaceDetection, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFaces] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[FaceDetection] operator[>] identifier[faces] operator[SEP] { Keyword[if] operator[SEP] identifier[faces] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[faces] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[faces] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[FaceDetection] operator[>] operator[SEP] identifier[faces] operator[SEP] operator[SEP] }
public ModifyCallResponse modifyCall(String uuid, ModifyCallAction action) throws IOException, NexmoClientException { return this.modifyCall(new CallModifier(uuid, action)); }
class class_name[name] begin[{] method[modifyCall, return_type[type[ModifyCallResponse]], modifier[public], parameter[uuid, action]] begin[{] return[THIS[call[None.modifyCall, parameter[ClassCreator(arguments=[MemberReference(member=uuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=action, 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=CallModifier, sub_type=None))]]]] end[}] END[}]
Keyword[public] identifier[ModifyCallResponse] identifier[modifyCall] operator[SEP] identifier[String] identifier[uuid] , identifier[ModifyCallAction] identifier[action] operator[SEP] Keyword[throws] identifier[IOException] , identifier[NexmoClientException] { Keyword[return] Keyword[this] operator[SEP] identifier[modifyCall] operator[SEP] Keyword[new] identifier[CallModifier] operator[SEP] identifier[uuid] , identifier[action] operator[SEP] operator[SEP] operator[SEP] }
public Permissions getPerms(String photoId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_PERMS); parameters.put("photo_id", photoId); Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element permissionsElement = response.getPayload(); Permissions permissions = new Permissions(); permissions.setId(permissionsElement.getAttribute("id")); permissions.setPublicFlag("1".equals(permissionsElement.getAttribute("ispublic"))); permissions.setFamilyFlag("1".equals(permissionsElement.getAttribute("isfamily"))); permissions.setFriendFlag("1".equals(permissionsElement.getAttribute("isfriend"))); permissions.setComment(permissionsElement.getAttribute("permcomment")); permissions.setAddmeta(permissionsElement.getAttribute("permaddmeta")); return permissions; }
class class_name[name] begin[{] method[getPerms, return_type[type[Permissions]], modifier[public], parameter[photoId]] begin[{] local_variable[type[Map], parameters] call[parameters.put, parameter[literal["method"], member[.METHOD_GET_PERMS]]] call[parameters.put, parameter[literal["photo_id"], member[.photoId]]] local_variable[type[Response], response] if[call[response.isError, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getErrorCode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FlickrException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Element], permissionsElement] local_variable[type[Permissions], permissions] call[permissions.setId, parameter[call[permissionsElement.getAttribute, parameter[literal["id"]]]]] call[permissions.setPublicFlag, parameter[literal["1"]]] call[permissions.setFamilyFlag, parameter[literal["1"]]] call[permissions.setFriendFlag, parameter[literal["1"]]] call[permissions.setComment, parameter[call[permissionsElement.getAttribute, parameter[literal["permcomment"]]]]] call[permissions.setAddmeta, parameter[call[permissionsElement.getAttribute, parameter[literal["permaddmeta"]]]]] return[member[.permissions]] end[}] END[}]
Keyword[public] identifier[Permissions] identifier[getPerms] operator[SEP] identifier[String] identifier[photoId] operator[SEP] Keyword[throws] identifier[FlickrException] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[METHOD_GET_PERMS] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[photoId] operator[SEP] operator[SEP] identifier[Response] identifier[response] operator[=] identifier[transport] operator[SEP] identifier[get] operator[SEP] identifier[transport] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[parameters] , identifier[apiKey] , identifier[sharedSecret] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[FlickrException] operator[SEP] identifier[response] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] , identifier[response] operator[SEP] identifier[getErrorMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Element] identifier[permissionsElement] operator[=] identifier[response] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[Permissions] identifier[permissions] operator[=] Keyword[new] identifier[Permissions] operator[SEP] operator[SEP] operator[SEP] identifier[permissions] operator[SEP] identifier[setId] operator[SEP] identifier[permissionsElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[permissions] operator[SEP] identifier[setPublicFlag] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[permissionsElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[permissions] operator[SEP] identifier[setFamilyFlag] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[permissionsElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[permissions] operator[SEP] identifier[setFriendFlag] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[permissionsElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[permissions] operator[SEP] identifier[setComment] operator[SEP] identifier[permissionsElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[permissions] operator[SEP] identifier[setAddmeta] operator[SEP] identifier[permissionsElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[permissions] operator[SEP] }
public byte[] asByteArray( Object object ) { FSTObjectOutput objectOutput = getObjectOutput(); try { objectOutput.writeObject(object); return objectOutput.getCopyOfWrittenBuffer(); } catch (IOException e) { try { // FSTConfiguration.prettyPrintJson(object); endless cycle ! } catch (Exception ee) { // } FSTUtil.<RuntimeException>rethrow(e); } return null; }
class class_name[name] begin[{] method[asByteArray, return_type[type[byte]], modifier[public], parameter[object]] begin[{] local_variable[type[FSTObjectOutput], objectOutput] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=objectOutput, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=getCopyOfWrittenBuffer, postfix_operators=[], prefix_operators=[], qualifier=objectOutput, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[TryStatement(block=[], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ee, types=['Exception']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=FSTUtil, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None))]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[asByteArray] operator[SEP] identifier[Object] identifier[object] operator[SEP] { identifier[FSTObjectOutput] identifier[objectOutput] operator[=] identifier[getObjectOutput] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[objectOutput] operator[SEP] identifier[writeObject] operator[SEP] identifier[object] operator[SEP] operator[SEP] Keyword[return] identifier[objectOutput] operator[SEP] identifier[getCopyOfWrittenBuffer] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[try] { } Keyword[catch] operator[SEP] identifier[Exception] identifier[ee] operator[SEP] { } identifier[FSTUtil] operator[SEP] operator[<] identifier[RuntimeException] operator[>] identifier[rethrow] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
protected void scheduleEvent(final Event event, final long delay, final long period) { final Timer timer = new Timer(); timer.schedule(new ScheduleEvent().event(event), delay, period); timers.add(timer); }
class class_name[name] begin[{] method[scheduleEvent, return_type[void], modifier[protected], parameter[event, delay, period]] begin[{] local_variable[type[Timer], timer] call[timer.schedule, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=event, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ScheduleEvent, sub_type=None)), member[.delay], member[.period]]] call[timers.add, parameter[member[.timer]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[scheduleEvent] operator[SEP] Keyword[final] identifier[Event] identifier[event] , Keyword[final] Keyword[long] identifier[delay] , Keyword[final] Keyword[long] identifier[period] operator[SEP] { Keyword[final] identifier[Timer] identifier[timer] operator[=] Keyword[new] identifier[Timer] operator[SEP] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[schedule] operator[SEP] Keyword[new] identifier[ScheduleEvent] operator[SEP] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[event] operator[SEP] , identifier[delay] , identifier[period] operator[SEP] operator[SEP] identifier[timers] operator[SEP] identifier[add] operator[SEP] identifier[timer] operator[SEP] operator[SEP] }
public static final Level brokenConnection(Level level, Throwable thr) { if (thr instanceof EOFException) { return level; } if (thr instanceof ClosedChannelException) { return level; } if ((thr instanceof IOException) && ( "Broken pipe".equals(thr.getMessage()) || "Connection reset by peer".equals(thr.getMessage()) ) ) { return level; } if ((thr instanceof ConnectException) && ( "Connection timed out".equals(thr.getMessage()) || "Connection refused".equals(thr.getMessage()) ) ) { return level; } Throwable cause = thr.getCause(); if (cause != null) { return brokenConnection(level, cause); } return Level.SEVERE; }
class class_name[name] begin[{] method[brokenConnection, return_type[type[Level]], modifier[final public static], parameter[level, thr]] begin[{] if[binary_operation[member[.thr], instanceof, type[EOFException]]] begin[{] return[member[.level]] else begin[{] None end[}] if[binary_operation[member[.thr], instanceof, type[ClosedChannelException]]] begin[{] return[member[.level]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.thr], instanceof, type[IOException]], &&, binary_operation[literal["Broken pipe"], ||, literal["Connection reset by peer"]]]] begin[{] return[member[.level]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.thr], instanceof, type[ConnectException]], &&, binary_operation[literal["Connection timed out"], ||, literal["Connection refused"]]]] begin[{] return[member[.level]] else begin[{] None end[}] local_variable[type[Throwable], cause] if[binary_operation[member[.cause], !=, literal[null]]] begin[{] return[call[.brokenConnection, parameter[member[.level], member[.cause]]]] else begin[{] None end[}] return[member[Level.SEVERE]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[Level] identifier[brokenConnection] operator[SEP] identifier[Level] identifier[level] , identifier[Throwable] identifier[thr] operator[SEP] { Keyword[if] operator[SEP] identifier[thr] Keyword[instanceof] identifier[EOFException] operator[SEP] { Keyword[return] identifier[level] operator[SEP] } Keyword[if] operator[SEP] identifier[thr] Keyword[instanceof] identifier[ClosedChannelException] operator[SEP] { Keyword[return] identifier[level] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[thr] Keyword[instanceof] identifier[IOException] operator[SEP] operator[&&] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[thr] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[thr] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[level] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[thr] Keyword[instanceof] identifier[ConnectException] operator[SEP] operator[&&] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[thr] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[thr] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[level] operator[SEP] } identifier[Throwable] identifier[cause] operator[=] identifier[thr] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[brokenConnection] operator[SEP] identifier[level] , identifier[cause] operator[SEP] operator[SEP] } Keyword[return] identifier[Level] operator[SEP] identifier[SEVERE] operator[SEP] }
@Nonnull public static GregorianCalendar getCalendarUTC (final long nMillis) { final GregorianCalendar aCalendar = new GregorianCalendar (PDTConfig.getUTCTimeZone (), Locale.getDefault (Locale.Category.FORMAT)); aCalendar.setTimeInMillis (nMillis); return aCalendar; }
class class_name[name] begin[{] method[getCalendarUTC, return_type[type[GregorianCalendar]], modifier[public static], parameter[nMillis]] begin[{] local_variable[type[GregorianCalendar], aCalendar] call[aCalendar.setTimeInMillis, parameter[member[.nMillis]]] return[member[.aCalendar]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[GregorianCalendar] identifier[getCalendarUTC] operator[SEP] Keyword[final] Keyword[long] identifier[nMillis] operator[SEP] { Keyword[final] identifier[GregorianCalendar] identifier[aCalendar] operator[=] Keyword[new] identifier[GregorianCalendar] operator[SEP] identifier[PDTConfig] operator[SEP] identifier[getUTCTimeZone] operator[SEP] operator[SEP] , identifier[Locale] operator[SEP] identifier[getDefault] operator[SEP] identifier[Locale] operator[SEP] identifier[Category] operator[SEP] identifier[FORMAT] operator[SEP] operator[SEP] operator[SEP] identifier[aCalendar] operator[SEP] identifier[setTimeInMillis] operator[SEP] identifier[nMillis] operator[SEP] operator[SEP] Keyword[return] identifier[aCalendar] operator[SEP] }
void initializeClientUnprotected(String host, int port, String sessionId) throws IOException { if (client != null) { return; } LOG.info("Creating JT client to " + host + ":" + port); long connectTimeout = RemoteJTProxy.getRemotJTTimeout(conf); int rpcTimeout = RemoteJTProxy.getRemoteJTRPCTimeout(conf); remoteJTAddr = new InetSocketAddress(host, port); client = RPC.waitForProtocolProxy( JobSubmissionProtocol.class, JobSubmissionProtocol.versionID, remoteJTAddr, conf, connectTimeout, rpcTimeout ).getProxy(); remoteJTStatus = RemoteJTStatus.SUCCESS; remoteJTHost = host; remoteJTPort = port; remoteSessionId = sessionId; if (remoteJTState != null) { remoteJTState.setSessionId(sessionId); } }
class class_name[name] begin[{] method[initializeClientUnprotected, return_type[void], modifier[default], parameter[host, port, sessionId]] begin[{] if[binary_operation[member[.client], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] call[LOG.info, parameter[binary_operation[binary_operation[binary_operation[literal["Creating JT client to "], +, member[.host]], +, literal[":"]], +, member[.port]]]] local_variable[type[long], connectTimeout] local_variable[type[int], rpcTimeout] assign[member[.remoteJTAddr], ClassCreator(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))] assign[member[.client], call[RPC.waitForProtocolProxy, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JobSubmissionProtocol, sub_type=None)), member[JobSubmissionProtocol.versionID], member[.remoteJTAddr], member[.conf], member[.connectTimeout], member[.rpcTimeout]]]] assign[member[.remoteJTStatus], member[RemoteJTStatus.SUCCESS]] assign[member[.remoteJTHost], member[.host]] assign[member[.remoteJTPort], member[.port]] assign[member[.remoteSessionId], member[.sessionId]] if[binary_operation[member[.remoteJTState], !=, literal[null]]] begin[{] call[remoteJTState.setSessionId, parameter[member[.sessionId]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[initializeClientUnprotected] operator[SEP] identifier[String] identifier[host] , Keyword[int] identifier[port] , identifier[String] identifier[sessionId] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[client] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[host] operator[+] literal[String] operator[+] identifier[port] operator[SEP] operator[SEP] Keyword[long] identifier[connectTimeout] operator[=] identifier[RemoteJTProxy] operator[SEP] identifier[getRemotJTTimeout] operator[SEP] identifier[conf] operator[SEP] operator[SEP] Keyword[int] identifier[rpcTimeout] operator[=] identifier[RemoteJTProxy] operator[SEP] identifier[getRemoteJTRPCTimeout] operator[SEP] identifier[conf] operator[SEP] operator[SEP] identifier[remoteJTAddr] operator[=] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[host] , identifier[port] operator[SEP] operator[SEP] identifier[client] operator[=] identifier[RPC] operator[SEP] identifier[waitForProtocolProxy] operator[SEP] identifier[JobSubmissionProtocol] operator[SEP] Keyword[class] , identifier[JobSubmissionProtocol] operator[SEP] identifier[versionID] , identifier[remoteJTAddr] , identifier[conf] , identifier[connectTimeout] , identifier[rpcTimeout] operator[SEP] operator[SEP] identifier[getProxy] operator[SEP] operator[SEP] operator[SEP] identifier[remoteJTStatus] operator[=] identifier[RemoteJTStatus] operator[SEP] identifier[SUCCESS] operator[SEP] identifier[remoteJTHost] operator[=] identifier[host] operator[SEP] identifier[remoteJTPort] operator[=] identifier[port] operator[SEP] identifier[remoteSessionId] operator[=] identifier[sessionId] operator[SEP] Keyword[if] operator[SEP] identifier[remoteJTState] operator[!=] Other[null] operator[SEP] { identifier[remoteJTState] operator[SEP] identifier[setSessionId] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] } }
public Map<TypeDescription, Class<?>> load(ClassLoader classLoader, Map<TypeDescription, byte[]> types) { Map<String, Class<?>> availableTypes = new HashMap<String, Class<?>>(preregisteredTypes); for (Class<?> type : instrumentation.getInitiatedClasses(classLoader)) { availableTypes.put(TypeDescription.ForLoadedType.getName(type), type); } Map<Class<?>, ClassDefinition> classDefinitions = new ConcurrentHashMap<Class<?>, ClassDefinition>(); Map<TypeDescription, Class<?>> loadedClasses = new HashMap<TypeDescription, Class<?>>(); Map<TypeDescription, byte[]> unloadedClasses = new LinkedHashMap<TypeDescription, byte[]>(); for (Map.Entry<TypeDescription, byte[]> entry : types.entrySet()) { Class<?> type = availableTypes.get(entry.getKey().getName()); if (type != null) { classDefinitions.put(type, new ClassDefinition(type, entry.getValue())); loadedClasses.put(entry.getKey(), type); } else { unloadedClasses.put(entry.getKey(), entry.getValue()); } } try { strategy.apply(instrumentation, classDefinitions); if (!unloadedClasses.isEmpty()) { loadedClasses.putAll((classLoader == null ? bootstrapInjection.make(instrumentation) : new ClassInjector.UsingReflection(classLoader)).inject(unloadedClasses)); } } catch (ClassNotFoundException exception) { throw new IllegalArgumentException("Could not locate classes for redefinition", exception); } catch (UnmodifiableClassException exception) { throw new IllegalStateException("Cannot redefine specified class", exception); } return loadedClasses; }
class class_name[name] begin[{] method[load, return_type[type[Map]], modifier[public], parameter[classLoader, types]] begin[{] local_variable[type[Map], availableTypes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getName, postfix_operators=[], prefix_operators=[], qualifier=TypeDescription.ForLoadedType, selectors=[], type_arguments=None), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=availableTypes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInitiatedClasses, postfix_operators=[], prefix_operators=[], qualifier=instrumentation, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) local_variable[type[Map], classDefinitions] local_variable[type[Map], loadedClasses] local_variable[type[Map], unloadedClasses] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=availableTypes, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=unloadedClasses, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassDefinition, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=classDefinitions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=loadedClasses, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TypeDescription, sub_type=None)), TypeArgument(pattern_type=None, type=BasicType(dimensions=[None], name=byte))], dimensions=None, name=Entry, sub_type=None)))), label=None) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=instrumentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classDefinitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=strategy, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=unloadedClasses, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MemberReference(member=classLoader, 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=ClassInjector, sub_type=ReferenceType(arguments=None, dimensions=None, name=UsingReflection, sub_type=None))), if_true=MethodInvocation(arguments=[MemberReference(member=instrumentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=make, postfix_operators=[], prefix_operators=[], qualifier=bootstrapInjection, selectors=[], type_arguments=None))], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=loadedClasses, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not locate classes for redefinition"), MemberReference(member=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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['ClassNotFoundException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot redefine specified class"), MemberReference(member=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=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['UnmodifiableClassException']))], finally_block=None, label=None, resources=None) return[member[.loadedClasses]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[TypeDescription] , identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[load] operator[SEP] identifier[ClassLoader] identifier[classLoader] , identifier[Map] operator[<] identifier[TypeDescription] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[types] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[availableTypes] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] identifier[preregisteredTypes] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[:] identifier[instrumentation] operator[SEP] identifier[getInitiatedClasses] operator[SEP] identifier[classLoader] operator[SEP] operator[SEP] { identifier[availableTypes] operator[SEP] identifier[put] operator[SEP] identifier[TypeDescription] operator[SEP] identifier[ForLoadedType] operator[SEP] identifier[getName] operator[SEP] identifier[type] operator[SEP] , identifier[type] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[ClassDefinition] operator[>] identifier[classDefinitions] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[ClassDefinition] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[TypeDescription] , identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[loadedClasses] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[TypeDescription] , identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[TypeDescription] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[unloadedClasses] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[TypeDescription] , Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[TypeDescription] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[entry] operator[:] identifier[types] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[availableTypes] operator[SEP] identifier[get] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] { identifier[classDefinitions] operator[SEP] identifier[put] operator[SEP] identifier[type] , Keyword[new] identifier[ClassDefinition] operator[SEP] identifier[type] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[loadedClasses] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[type] operator[SEP] operator[SEP] } Keyword[else] { identifier[unloadedClasses] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[try] { identifier[strategy] operator[SEP] identifier[apply] operator[SEP] identifier[instrumentation] , identifier[classDefinitions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[unloadedClasses] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[loadedClasses] operator[SEP] identifier[putAll] operator[SEP] operator[SEP] identifier[classLoader] operator[==] Other[null] operator[?] identifier[bootstrapInjection] operator[SEP] identifier[make] operator[SEP] identifier[instrumentation] operator[SEP] operator[:] Keyword[new] identifier[ClassInjector] operator[SEP] identifier[UsingReflection] operator[SEP] identifier[classLoader] operator[SEP] operator[SEP] operator[SEP] identifier[inject] operator[SEP] identifier[unloadedClasses] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[exception] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] , identifier[exception] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnmodifiableClassException] identifier[exception] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[exception] operator[SEP] operator[SEP] } Keyword[return] identifier[loadedClasses] operator[SEP] }
private int mapNSTokens(String pat, int startSubstring, int posOfNSSep, int posOfScan) throws javax.xml.transform.TransformerException { String prefix = ""; if ((startSubstring >= 0) && (posOfNSSep >= 0)) { prefix = pat.substring(startSubstring, posOfNSSep); } String uName; if ((null != m_namespaceContext) &&!prefix.equals("*") &&!prefix.equals("xmlns")) { try { if (prefix.length() > 0) uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); else { // Assume last was wildcard. This is not legal according // to the draft. Set the below to true to make namespace // wildcards work. if (false) { addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); return -1; } else { uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); } } } catch (ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); } } else { uName = prefix; } if ((null != uName) && (uName.length() > 0)) { addToTokenQueue(uName); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); } else { // To older XPath code it doesn't matter if // error() is called or errorForDOM3(). m_processor.errorForDOM3(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; /** old code commented out 17-Sep-2004 // error("Could not locate namespace for prefix: "+prefix); // m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, // new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; */ /*** Old code commented out 10-Jan-2001 addToTokenQueue(prefix); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); ***/ } return -1; }
class class_name[name] begin[{] method[mapNSTokens, return_type[type[int]], modifier[private], parameter[pat, startSubstring, posOfNSSep, posOfScan]] begin[{] local_variable[type[String], prefix] if[binary_operation[binary_operation[member[.startSubstring], >=, literal[0]], &&, binary_operation[member[.posOfNSSep], >=, literal[0]]]] begin[{] assign[member[.prefix], call[pat.substring, parameter[member[.startSubstring], member[.posOfNSSep]]]] else begin[{] None end[}] local_variable[type[String], uName] if[binary_operation[binary_operation[binary_operation[literal[null], !=, member[.m_namespaceContext]], &&, call[prefix.equals, parameter[literal["*"]]]], &&, call[prefix.equals, parameter[literal["xmlns"]]]]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=prefix, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=m_namespaceContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PrefixResolver, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=addToTokenQueue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=posOfNSSep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=posOfScan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=pat, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addToTokenQueue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)]))]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=uName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=m_namespaceContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PrefixResolver, sub_type=None))), label=None))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNamespaceForPrefix, postfix_operators=[], prefix_operators=[], qualifier=m_namespaceContext, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cce, types=['ClassCastException']))], finally_block=None, label=None, resources=None) else begin[{] assign[member[.uName], member[.prefix]] end[}] if[binary_operation[binary_operation[literal[null], !=, member[.uName]], &&, binary_operation[call[uName.length, parameter[]], >, literal[0]]]] begin[{] call[.addToTokenQueue, parameter[member[.uName]]] call[.addToTokenQueue, parameter[literal[":"]]] local_variable[type[String], s] if[binary_operation[call[s.length, parameter[]], >, literal[0]]] begin[{] call[.addToTokenQueue, parameter[member[.s]]] else begin[{] None end[}] else begin[{] call[m_processor.errorForDOM3, parameter[member[XPATHErrorResources.ER_PREFIX_MUST_RESOLVE], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] end[}] return[literal[1]] end[}] END[}]
Keyword[private] Keyword[int] identifier[mapNSTokens] operator[SEP] identifier[String] identifier[pat] , Keyword[int] identifier[startSubstring] , Keyword[int] identifier[posOfNSSep] , Keyword[int] identifier[posOfScan] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] { identifier[String] identifier[prefix] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[startSubstring] operator[>=] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[posOfNSSep] operator[>=] Other[0] operator[SEP] operator[SEP] { identifier[prefix] operator[=] identifier[pat] operator[SEP] identifier[substring] operator[SEP] identifier[startSubstring] , identifier[posOfNSSep] operator[SEP] operator[SEP] } identifier[String] identifier[uName] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Other[null] operator[!=] identifier[m_namespaceContext] operator[SEP] operator[&&] operator[!] identifier[prefix] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[prefix] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[prefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[uName] operator[=] operator[SEP] operator[SEP] identifier[PrefixResolver] operator[SEP] identifier[m_namespaceContext] operator[SEP] operator[SEP] identifier[getNamespaceForPrefix] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] Keyword[else] { Keyword[if] operator[SEP] literal[boolean] operator[SEP] { identifier[addToTokenQueue] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[=] identifier[pat] operator[SEP] identifier[substring] operator[SEP] identifier[posOfNSSep] operator[+] Other[1] , identifier[posOfScan] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[addToTokenQueue] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[else] { identifier[uName] operator[=] operator[SEP] operator[SEP] identifier[PrefixResolver] operator[SEP] identifier[m_namespaceContext] operator[SEP] operator[SEP] identifier[getNamespaceForPrefix] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[cce] operator[SEP] { identifier[uName] operator[=] identifier[m_namespaceContext] operator[SEP] identifier[getNamespaceForPrefix] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] } } Keyword[else] { identifier[uName] operator[=] identifier[prefix] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] Other[null] operator[!=] identifier[uName] operator[SEP] operator[&&] operator[SEP] identifier[uName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] { identifier[addToTokenQueue] operator[SEP] identifier[uName] operator[SEP] operator[SEP] identifier[addToTokenQueue] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[=] identifier[pat] operator[SEP] identifier[substring] operator[SEP] identifier[posOfNSSep] operator[+] Other[1] , identifier[posOfScan] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[addToTokenQueue] operator[SEP] identifier[s] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_processor] operator[SEP] identifier[errorForDOM3] operator[SEP] identifier[XPATHErrorResources] operator[SEP] identifier[ER_PREFIX_MUST_RESOLVE] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[prefix] } operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
public static String createNaaccrIdFromItemName(String name) { if (name == null || name.isEmpty()) return ""; // not including 10 (and after) because I feel like X might be a legit occurrence... Map<String, String> romanNumerals = new HashMap<>(); romanNumerals.put("I", "1"); romanNumerals.put("II", "2"); romanNumerals.put("III", "3"); romanNumerals.put("IV", "4"); romanNumerals.put("V", "5"); romanNumerals.put("VI", "6"); romanNumerals.put("VII", "7"); romanNumerals.put("VIII", "8"); romanNumerals.put("IX", "9"); String[] parts = StringUtils.split(name.replaceAll("\\s+|-+|/|_|\\.|&", " ").replaceAll("\\(.+\\)|[\\W&&[^\\s]]", ""), ' '); // special case, if the last two parts are both roman numeral, then put a "to" between them if (parts.length > 2 && romanNumerals.containsKey(parts[parts.length - 1]) && romanNumerals.containsKey(parts[parts.length - 2])) { String[] tmp = new String[parts.length + 1]; System.arraycopy(parts, 0, tmp, 0, parts.length - 1); tmp[tmp.length - 2] = "to"; tmp[tmp.length - 1] = parts[parts.length - 1]; parts = tmp; } StringBuilder buf = new StringBuilder(); buf.append(StringUtils.uncapitalize(parts[0].toLowerCase())); for (int i = 1; i < parts.length; i++) { if (romanNumerals.containsKey(parts[i])) buf.append(romanNumerals.get(parts[i])); else buf.append(StringUtils.capitalize(parts[i].toLowerCase())); } return buf.toString(); }
class class_name[name] begin[{] method[createNaaccrIdFromItemName, return_type[type[String]], modifier[public static], parameter[name]] begin[{] if[binary_operation[binary_operation[member[.name], ==, literal[null]], ||, call[name.isEmpty, parameter[]]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[Map], romanNumerals] call[romanNumerals.put, parameter[literal["I"], literal["1"]]] call[romanNumerals.put, parameter[literal["II"], literal["2"]]] call[romanNumerals.put, parameter[literal["III"], literal["3"]]] call[romanNumerals.put, parameter[literal["IV"], literal["4"]]] call[romanNumerals.put, parameter[literal["V"], literal["5"]]] call[romanNumerals.put, parameter[literal["VI"], literal["6"]]] call[romanNumerals.put, parameter[literal["VII"], literal["7"]]] call[romanNumerals.put, parameter[literal["VIII"], literal["8"]]] call[romanNumerals.put, parameter[literal["IX"], literal["9"]]] local_variable[type[String], parts] if[binary_operation[binary_operation[binary_operation[member[parts.length], >, literal[2]], &&, call[romanNumerals.containsKey, parameter[member[.parts]]]], &&, call[romanNumerals.containsKey, parameter[member[.parts]]]]] begin[{] local_variable[type[String], tmp] call[System.arraycopy, parameter[member[.parts], literal[0], member[.tmp], literal[0], binary_operation[member[parts.length], -, literal[1]]]] assign[member[.tmp], literal["to"]] assign[member[.tmp], member[.parts]] assign[member[.parts], member[.tmp]] else begin[{] None end[}] local_variable[type[StringBuilder], buf] call[buf.append, parameter[call[StringUtils.uncapitalize, parameter[member[.parts]]]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=romanNumerals, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=capitalize, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=romanNumerals, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, 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=parts, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[buf.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[createNaaccrIdFromItemName] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[||] identifier[name] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[romanNumerals] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[StringUtils] operator[SEP] identifier[split] operator[SEP] identifier[name] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[>] Other[2] operator[&&] identifier[romanNumerals] operator[SEP] identifier[containsKey] operator[SEP] identifier[parts] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] operator[&&] identifier[romanNumerals] operator[SEP] identifier[containsKey] operator[SEP] identifier[parts] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[parts] , Other[0] , identifier[tmp] , Other[0] , identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] identifier[tmp] operator[SEP] identifier[length] operator[-] Other[2] operator[SEP] operator[=] literal[String] operator[SEP] identifier[tmp] operator[SEP] identifier[tmp] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[=] identifier[parts] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[tmp] operator[SEP] } identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[StringUtils] operator[SEP] identifier[uncapitalize] operator[SEP] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[parts] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[containsKey] operator[SEP] identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[romanNumerals] operator[SEP] identifier[get] operator[SEP] identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[StringUtils] operator[SEP] identifier[capitalize] operator[SEP] identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void removeAttribute(String name) { if (!_iSess.isValid()) throw new IllegalStateException(); if (_iSess != null) { _iSess.removeAttribute(name); } }
class class_name[name] begin[{] method[removeAttribute, return_type[void], modifier[public], parameter[name]] begin[{] if[call[_iSess.isValid, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[._iSess], !=, literal[null]]] begin[{] call[_iSess.removeAttribute, parameter[member[.name]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeAttribute] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[_iSess] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_iSess] operator[!=] Other[null] operator[SEP] { identifier[_iSess] operator[SEP] identifier[removeAttribute] operator[SEP] identifier[name] operator[SEP] operator[SEP] } }
public static void setLevel(Level outputLevel) { Logger appRooLogger = Logger.getLogger("edu.ucla.sspace"); Handler verboseHandler = new ConsoleHandler(); verboseHandler.setLevel(outputLevel); appRooLogger.addHandler(verboseHandler); appRooLogger.setLevel(outputLevel); appRooLogger.setUseParentHandlers(false); }
class class_name[name] begin[{] method[setLevel, return_type[void], modifier[public static], parameter[outputLevel]] begin[{] local_variable[type[Logger], appRooLogger] local_variable[type[Handler], verboseHandler] call[verboseHandler.setLevel, parameter[member[.outputLevel]]] call[appRooLogger.addHandler, parameter[member[.verboseHandler]]] call[appRooLogger.setLevel, parameter[member[.outputLevel]]] call[appRooLogger.setUseParentHandlers, parameter[literal[false]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setLevel] operator[SEP] identifier[Level] identifier[outputLevel] operator[SEP] { identifier[Logger] identifier[appRooLogger] operator[=] identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Handler] identifier[verboseHandler] operator[=] Keyword[new] identifier[ConsoleHandler] operator[SEP] operator[SEP] operator[SEP] identifier[verboseHandler] operator[SEP] identifier[setLevel] operator[SEP] identifier[outputLevel] operator[SEP] operator[SEP] identifier[appRooLogger] operator[SEP] identifier[addHandler] operator[SEP] identifier[verboseHandler] operator[SEP] operator[SEP] identifier[appRooLogger] operator[SEP] identifier[setLevel] operator[SEP] identifier[outputLevel] operator[SEP] operator[SEP] identifier[appRooLogger] operator[SEP] identifier[setUseParentHandlers] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
protected void registerDefaults() { register(Long.class, new LongConverter()); register(Integer.class, new IntegerConverter()); register(Short.class, new ShortConverter()); register(Byte.class, new ByteConverter()); register(Double.class, new DoubleConverter()); register(Float.class, new FloatConverter()); register(Character.class, new CharacterConverter()); register(Boolean.class, new BooleanConverter()); register(String.class, new StringConverter()); register(URL.class, new UrlConverter()); register(URI.class, new UriConverter()); register(Charset.class, new CharsetConverter()); register(File.class, new FileConverter()); register(Path.class, new PathConverter()); register(Locale.class, new LocaleConverter()); register(Pattern.class, new PatternConverter()); register(Long.TYPE, new LongConverter()); register(Integer.TYPE, new IntegerConverter()); register(Short.TYPE, new ShortConverter()); register(Byte.TYPE, new ByteConverter()); register(Character.TYPE, new CharacterConverter()); register(Double.TYPE, new DoubleConverter()); register(Float.TYPE, new FloatConverter()); register(Boolean.TYPE, new BooleanConverter()); }
class class_name[name] begin[{] method[registerDefaults, return_type[void], modifier[protected], parameter[]] begin[{] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LongConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShortConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DoubleConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FloatConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Character, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CharacterConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BooleanConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UrlConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UriConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Charset, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CharsetConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PathConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Locale, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocaleConverter, sub_type=None))]] call[.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pattern, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PatternConverter, sub_type=None))]] call[.register, parameter[member[Long.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LongConverter, sub_type=None))]] call[.register, parameter[member[Integer.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerConverter, sub_type=None))]] call[.register, parameter[member[Short.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShortConverter, sub_type=None))]] call[.register, parameter[member[Byte.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteConverter, sub_type=None))]] call[.register, parameter[member[Character.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CharacterConverter, sub_type=None))]] call[.register, parameter[member[Double.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DoubleConverter, sub_type=None))]] call[.register, parameter[member[Float.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FloatConverter, sub_type=None))]] call[.register, parameter[member[Boolean.TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BooleanConverter, sub_type=None))]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[registerDefaults] operator[SEP] operator[SEP] { identifier[register] operator[SEP] identifier[Long] operator[SEP] Keyword[class] , Keyword[new] identifier[LongConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] , Keyword[new] identifier[IntegerConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Short] operator[SEP] Keyword[class] , Keyword[new] identifier[ShortConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Byte] operator[SEP] Keyword[class] , Keyword[new] identifier[ByteConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Double] operator[SEP] Keyword[class] , Keyword[new] identifier[DoubleConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Float] operator[SEP] Keyword[class] , Keyword[new] identifier[FloatConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Character] operator[SEP] Keyword[class] , Keyword[new] identifier[CharacterConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] , Keyword[new] identifier[BooleanConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[String] operator[SEP] Keyword[class] , Keyword[new] identifier[StringConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[URL] operator[SEP] Keyword[class] , Keyword[new] identifier[UrlConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[URI] operator[SEP] Keyword[class] , Keyword[new] identifier[UriConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Charset] operator[SEP] Keyword[class] , Keyword[new] identifier[CharsetConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[File] operator[SEP] Keyword[class] , Keyword[new] identifier[FileConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Path] operator[SEP] Keyword[class] , Keyword[new] identifier[PathConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Locale] operator[SEP] Keyword[class] , Keyword[new] identifier[LocaleConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Pattern] operator[SEP] Keyword[class] , Keyword[new] identifier[PatternConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Long] operator[SEP] identifier[TYPE] , Keyword[new] identifier[LongConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Integer] operator[SEP] identifier[TYPE] , Keyword[new] identifier[IntegerConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Short] operator[SEP] identifier[TYPE] , Keyword[new] identifier[ShortConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Byte] operator[SEP] identifier[TYPE] , Keyword[new] identifier[ByteConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Character] operator[SEP] identifier[TYPE] , Keyword[new] identifier[CharacterConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Double] operator[SEP] identifier[TYPE] , Keyword[new] identifier[DoubleConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Float] operator[SEP] identifier[TYPE] , Keyword[new] identifier[FloatConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[Boolean] operator[SEP] identifier[TYPE] , Keyword[new] identifier[BooleanConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String wordSegment(String text){ String ret = text; if (vnSegmenter == null) return ret; ret = vnSegmenter.segmenting(ret); return ret; }
class class_name[name] begin[{] method[wordSegment, return_type[type[String]], modifier[public], parameter[text]] begin[{] local_variable[type[String], ret] if[binary_operation[member[.vnSegmenter], ==, literal[null]]] begin[{] return[member[.ret]] else begin[{] None end[}] assign[member[.ret], call[vnSegmenter.segmenting, parameter[member[.ret]]]] return[member[.ret]] end[}] END[}]
Keyword[public] identifier[String] identifier[wordSegment] operator[SEP] identifier[String] identifier[text] operator[SEP] { identifier[String] identifier[ret] operator[=] identifier[text] operator[SEP] Keyword[if] operator[SEP] identifier[vnSegmenter] operator[==] Other[null] operator[SEP] Keyword[return] identifier[ret] operator[SEP] identifier[ret] operator[=] identifier[vnSegmenter] operator[SEP] identifier[segmenting] operator[SEP] identifier[ret] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public static List<DTCellValue52> makeDataRowList( Object[] oldRow ) { List<DTCellValue52> row = new ArrayList<DTCellValue52>(); //Row numbers are numerical if ( oldRow[ 0 ] instanceof String ) { DTCellValue52 rowDcv = new DTCellValue52( new Integer( (String) oldRow[ 0 ] ) ); row.add( rowDcv ); } else if ( oldRow[ 0 ] instanceof Number ) { DTCellValue52 rowDcv = new DTCellValue52( ( (Number) oldRow[ 0 ] ).intValue() ); row.add( rowDcv ); } else { DTCellValue52 rowDcv = new DTCellValue52( oldRow[ 0 ] ); row.add( rowDcv ); } for ( int iCol = 1; iCol < oldRow.length; iCol++ ) { //The original model was purely String based. Conversion to typed fields //occurs when the Model is re-saved in Guvnor. Ideally the conversion //should occur here but that requires reference to a SuggestionCompletionEngine //which requires RepositoryServices. I did not want to make a dependency between //common IDE classes and the Repository DTCellValue52 dcv = new DTCellValue52( oldRow[ iCol ] ); row.add( dcv ); } return row; }
class class_name[name] begin[{] method[makeDataRowList, return_type[type[List]], modifier[public static], parameter[oldRow]] begin[{] local_variable[type[List], row] if[binary_operation[member[.oldRow], instanceof, type[String]]] begin[{] local_variable[type[DTCellValue52], rowDcv] call[row.add, parameter[member[.rowDcv]]] else begin[{] if[binary_operation[member[.oldRow], instanceof, type[Number]]] begin[{] local_variable[type[DTCellValue52], rowDcv] call[row.add, parameter[member[.rowDcv]]] else begin[{] local_variable[type[DTCellValue52], rowDcv] call[row.add, parameter[member[.rowDcv]]] end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=oldRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=iCol, 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=DTCellValue52, sub_type=None)), name=dcv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DTCellValue52, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dcv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=oldRow, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=iCol)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=iCol, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.row]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[DTCellValue52] operator[>] identifier[makeDataRowList] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[oldRow] operator[SEP] { identifier[List] operator[<] identifier[DTCellValue52] operator[>] identifier[row] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DTCellValue52] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldRow] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[String] operator[SEP] { identifier[DTCellValue52] identifier[rowDcv] operator[=] Keyword[new] identifier[DTCellValue52] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[oldRow] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[add] operator[SEP] identifier[rowDcv] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[oldRow] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Number] operator[SEP] { identifier[DTCellValue52] identifier[rowDcv] operator[=] Keyword[new] identifier[DTCellValue52] operator[SEP] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[oldRow] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[add] operator[SEP] identifier[rowDcv] operator[SEP] operator[SEP] } Keyword[else] { identifier[DTCellValue52] identifier[rowDcv] operator[=] Keyword[new] identifier[DTCellValue52] operator[SEP] identifier[oldRow] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[add] operator[SEP] identifier[rowDcv] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[iCol] operator[=] Other[1] operator[SEP] identifier[iCol] operator[<] identifier[oldRow] operator[SEP] identifier[length] operator[SEP] identifier[iCol] operator[++] operator[SEP] { identifier[DTCellValue52] identifier[dcv] operator[=] Keyword[new] identifier[DTCellValue52] operator[SEP] identifier[oldRow] operator[SEP] identifier[iCol] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[add] operator[SEP] identifier[dcv] operator[SEP] operator[SEP] } Keyword[return] identifier[row] operator[SEP] }
@Override public void contextRootAdded(String contextRoot, VirtualHost virtualHost) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Added contextRoot {0} to virtual host {1}", contextRoot, virtualHost.getName()); } // Check that our app got installed if (contextRoot != null && contextRoot.contains(APIConstants.JMX_CONNECTOR_API_ROOT_PATH) && "default_host".equals(virtualHost.getName())) { registeredContextRoot = contextRoot; if (secureVirtualHost == virtualHost) { createJMXWorkAreaResourceIfChanged(virtualHost); } } }
class class_name[name] begin[{] method[contextRootAdded, return_type[void], modifier[public], parameter[contextRoot, virtualHost]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{] call[Tr.event, parameter[member[.tc], literal["Added contextRoot {0} to virtual host {1}"], member[.contextRoot], call[virtualHost.getName, parameter[]]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.contextRoot], !=, literal[null]], &&, call[contextRoot.contains, parameter[member[APIConstants.JMX_CONNECTOR_API_ROOT_PATH]]]], &&, literal["default_host"]]] begin[{] assign[member[.registeredContextRoot], member[.contextRoot]] if[binary_operation[member[.secureVirtualHost], ==, member[.virtualHost]]] begin[{] call[.createJMXWorkAreaResourceIfChanged, parameter[member[.virtualHost]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[contextRootAdded] operator[SEP] identifier[String] identifier[contextRoot] , identifier[VirtualHost] identifier[virtualHost] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] , identifier[contextRoot] , identifier[virtualHost] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contextRoot] operator[!=] Other[null] operator[&&] identifier[contextRoot] operator[SEP] identifier[contains] operator[SEP] identifier[APIConstants] operator[SEP] identifier[JMX_CONNECTOR_API_ROOT_PATH] operator[SEP] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[virtualHost] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[registeredContextRoot] operator[=] identifier[contextRoot] operator[SEP] Keyword[if] operator[SEP] identifier[secureVirtualHost] operator[==] identifier[virtualHost] operator[SEP] { identifier[createJMXWorkAreaResourceIfChanged] operator[SEP] identifier[virtualHost] operator[SEP] operator[SEP] } } }
public ApplicationListNextOptions withOcpDate(DateTime ocpDate) { if (ocpDate == null) { this.ocpDate = null; } else { this.ocpDate = new DateTimeRfc1123(ocpDate); } return this; }
class class_name[name] begin[{] method[withOcpDate, return_type[type[ApplicationListNextOptions]], modifier[public], parameter[ocpDate]] begin[{] if[binary_operation[member[.ocpDate], ==, literal[null]]] begin[{] assign[THIS[member[None.ocpDate]], literal[null]] else begin[{] assign[THIS[member[None.ocpDate]], ClassCreator(arguments=[MemberReference(member=ocpDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRfc1123, sub_type=None))] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ApplicationListNextOptions] identifier[withOcpDate] operator[SEP] identifier[DateTime] identifier[ocpDate] operator[SEP] { Keyword[if] operator[SEP] identifier[ocpDate] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public Observable<ServiceResponse<DomainInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domainInfo) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } if (domainInfo == null) { throw new IllegalArgumentException("Parameter domainInfo is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(domainInfo); Observable<Response<ResponseBody>> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<DomainInner>() { }.getType()); }
class class_name[name] begin[{] method[createOrUpdateWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, domainName, domainInfo]] begin[{] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.domainName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter domainName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.domainInfo], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter domainInfo is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[Validator.validate, parameter[member[.domainInfo]]] local_variable[type[Observable], observable] return[call[client.getAzureClient, parameter[]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[DomainInner] operator[>] operator[>] identifier[createOrUpdateWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[domainName] , identifier[DomainInner] identifier[domainInfo] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[domainName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[domainInfo] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[domainInfo] operator[SEP] operator[SEP] identifier[Observable] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] operator[>] identifier[observable] operator[=] identifier[service] operator[SEP] identifier[createOrUpdate] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[resourceGroupName] , identifier[domainName] , identifier[domainInfo] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[getAzureClient] operator[SEP] operator[SEP] operator[SEP] identifier[getPutOrPatchResultAsync] operator[SEP] identifier[observable] , Keyword[new] identifier[TypeToken] operator[<] identifier[DomainInner] operator[>] operator[SEP] operator[SEP] { } operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public List<Database> getInternalDatabases() { List<Database> returnList = new ArrayList<>(); for (SortedSet<Database> set : internalDatabases.values()) { returnList.add(set.iterator().next()); } return returnList; }
class class_name[name] begin[{] method[getInternalDatabases, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], returnList] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=returnList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=internalDatabases, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=set)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Database, sub_type=None))], dimensions=[], name=SortedSet, sub_type=None))), label=None) return[member[.returnList]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Database] operator[>] identifier[getInternalDatabases] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Database] operator[>] identifier[returnList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SortedSet] operator[<] identifier[Database] operator[>] identifier[set] operator[:] identifier[internalDatabases] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[returnList] operator[SEP] identifier[add] operator[SEP] identifier[set] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[returnList] operator[SEP] }
private static InsnList popMethodResult(AbstractInsnNode invokeInsnNode) { Validate.notNull(invokeInsnNode); Type returnType = getReturnTypeOfInvocation(invokeInsnNode); InsnList ret = new InsnList(); switch (returnType.getSort()) { case Type.LONG: case Type.DOUBLE: ret.add(new InsnNode(Opcodes.POP2)); break; case Type.VOID: break; case Type.METHOD: throw new IllegalStateException(); // this should never happen default: ret.add(new InsnNode(Opcodes.POP)); break; } return ret; }
class class_name[name] begin[{] method[popMethodResult, return_type[type[InsnList]], modifier[private static], parameter[invokeInsnNode]] begin[{] call[Validate.notNull, parameter[member[.invokeInsnNode]]] local_variable[type[Type], returnType] local_variable[type[InsnList], ret] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=LONG, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=POP2, postfix_operators=[], prefix_operators=[], qualifier=Opcodes, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InsnNode, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=VOID, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=METHOD, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=POP, postfix_operators=[], prefix_operators=[], qualifier=Opcodes, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InsnNode, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getSort, postfix_operators=[], prefix_operators=[], qualifier=returnType, selectors=[], type_arguments=None), label=None) return[member[.ret]] end[}] END[}]
Keyword[private] Keyword[static] identifier[InsnList] identifier[popMethodResult] operator[SEP] identifier[AbstractInsnNode] identifier[invokeInsnNode] operator[SEP] { identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[invokeInsnNode] operator[SEP] operator[SEP] identifier[Type] identifier[returnType] operator[=] identifier[getReturnTypeOfInvocation] operator[SEP] identifier[invokeInsnNode] operator[SEP] operator[SEP] identifier[InsnList] identifier[ret] operator[=] Keyword[new] identifier[InsnList] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[returnType] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[Type] operator[SEP] identifier[LONG] operator[:] Keyword[case] identifier[Type] operator[SEP] identifier[DOUBLE] operator[:] identifier[ret] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[InsnNode] operator[SEP] identifier[Opcodes] operator[SEP] identifier[POP2] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Type] operator[SEP] identifier[VOID] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[Type] operator[SEP] identifier[METHOD] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] identifier[ret] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[InsnNode] operator[SEP] identifier[Opcodes] operator[SEP] identifier[POP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public static EventHandlerWrapper wrapEventHandler(@NonNull String type, String producer, @NonNull Object subscriber, String action) { return new EventHandlerWrapper(type, producer, subscriber, action); }
class class_name[name] begin[{] method[wrapEventHandler, return_type[type[EventHandlerWrapper]], modifier[public static], parameter[type, producer, subscriber, action]] begin[{] return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=producer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subscriber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=action, 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=EventHandlerWrapper, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[EventHandlerWrapper] identifier[wrapEventHandler] operator[SEP] annotation[@] identifier[NonNull] identifier[String] identifier[type] , identifier[String] identifier[producer] , annotation[@] identifier[NonNull] identifier[Object] identifier[subscriber] , identifier[String] identifier[action] operator[SEP] { Keyword[return] Keyword[new] identifier[EventHandlerWrapper] operator[SEP] identifier[type] , identifier[producer] , identifier[subscriber] , identifier[action] operator[SEP] operator[SEP] }
@Nullable private ByteBuf checkForCompletion(GELFMessage gelfMessage) { if (!chunks.isEmpty() && log.isDebugEnabled()) { log.debug("Dumping GELF chunk map [chunks for {} messages]:\n{}", chunks.size(), humanReadableChunkMap()); } final GELFMessageChunk chunk = new GELFMessageChunk(gelfMessage, null); // TODO second parameter final int sequenceCount = chunk.getSequenceCount(); final String messageId = chunk.getId(); ChunkEntry entry = new ChunkEntry(sequenceCount, chunk.getArrival(), messageId); final ChunkEntry existing = chunks.putIfAbsent(messageId, entry); if (existing == null) { // add this chunk entry to the eviction set waitingMessages.inc(); sortedEvictionSet.add(entry); } else { // the entry is already in the eviction set and chunk map entry = existing; } final int sequenceNumber = chunk.getSequenceNumber(); if (!entry.payloadArray.compareAndSet(sequenceNumber, null, chunk)) { log.error("Received duplicate chunk {} for message {} from {}", sequenceNumber, messageId, gelfMessage.getSourceAddress()); duplicateChunks.inc(); return null; } final int chunkWatermark = entry.chunkSlotsWritten.incrementAndGet(); if (chunkWatermark > MAX_CHUNKS) { getAndCleanupEntry(messageId); throw new IllegalStateException("Maximum number of chunks reached, discarding message"); } if (chunkWatermark == sequenceCount) { // message is complete by chunk count, assemble and return it. // it might still be corrupt etc, but we've seen enough chunks // remove before operating on it, to avoid racing too much with the clean up job, some race is inevitable, though. entry = getAndCleanupEntry(messageId); final byte[] allChunks[] = new byte[sequenceCount][]; for (int i = 0; i < entry.payloadArray.length(); i++) { final GELFMessageChunk messageChunk = entry.payloadArray.get(i); if (messageChunk == null) { log.debug("Couldn't read chunk {} of message {}, skipping this chunk.", i, messageId); } else { allChunks[i] = messageChunk.getData(); } } completeMessages.inc(); return Unpooled.wrappedBuffer(allChunks); } // message isn't complete yet, check if we should remove the other parts as well if (isOutdated(entry)) { // chunks are outdated, the oldest came in over 5 seconds ago, clean them all up log.debug("Not all chunks of <{}> arrived within {}ms. Dropping chunks.", messageId, VALIDITY_PERIOD); expireEntry(messageId); } return null; }
class class_name[name] begin[{] method[checkForCompletion, return_type[type[ByteBuf]], modifier[private], parameter[gelfMessage]] begin[{] if[binary_operation[call[chunks.isEmpty, parameter[]], &&, call[log.isDebugEnabled, parameter[]]]] begin[{] call[log.debug, parameter[literal["Dumping GELF chunk map [chunks for {} messages]:\n{}"], call[chunks.size, parameter[]], call[.humanReadableChunkMap, parameter[]]]] else begin[{] None end[}] local_variable[type[GELFMessageChunk], chunk] local_variable[type[int], sequenceCount] local_variable[type[String], messageId] local_variable[type[ChunkEntry], entry] local_variable[type[ChunkEntry], existing] if[binary_operation[member[.existing], ==, literal[null]]] begin[{] call[waitingMessages.inc, parameter[]] call[sortedEvictionSet.add, parameter[member[.entry]]] else begin[{] assign[member[.entry], member[.existing]] end[}] local_variable[type[int], sequenceNumber] if[call[entry.payloadArray.compareAndSet, parameter[member[.sequenceNumber], literal[null], member[.chunk]]]] begin[{] call[log.error, parameter[literal["Received duplicate chunk {} for message {} from {}"], member[.sequenceNumber], member[.messageId], call[gelfMessage.getSourceAddress, parameter[]]]] call[duplicateChunks.inc, parameter[]] return[literal[null]] else begin[{] None end[}] local_variable[type[int], chunkWatermark] if[binary_operation[member[.chunkWatermark], >, member[.MAX_CHUNKS]]] begin[{] call[.getAndCleanupEntry, parameter[member[.messageId]]] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Maximum number of chunks reached, discarding message")], 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[.chunkWatermark], ==, member[.sequenceCount]]] begin[{] assign[member[.entry], call[.getAndCleanupEntry, parameter[member[.messageId]]]] local_variable[type[byte], allChunks] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=entry.payloadArray, selectors=[], type_arguments=None), name=messageChunk)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=GELFMessageChunk, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=messageChunk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=allChunks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=messageChunk, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't read chunk {} of message {}, skipping this chunk."), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=messageId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, 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=entry.payloadArray, 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) call[completeMessages.inc, parameter[]] return[call[Unpooled.wrappedBuffer, parameter[member[.allChunks]]]] else begin[{] None end[}] if[call[.isOutdated, parameter[member[.entry]]]] begin[{] call[log.debug, parameter[literal["Not all chunks of <{}> arrived within {}ms. Dropping chunks."], member[.messageId], member[.VALIDITY_PERIOD]]] call[.expireEntry, parameter[member[.messageId]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[private] identifier[ByteBuf] identifier[checkForCompletion] operator[SEP] identifier[GELFMessage] identifier[gelfMessage] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[chunks] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[chunks] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[humanReadableChunkMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[GELFMessageChunk] identifier[chunk] operator[=] Keyword[new] identifier[GELFMessageChunk] operator[SEP] identifier[gelfMessage] , Other[null] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[sequenceCount] operator[=] identifier[chunk] operator[SEP] identifier[getSequenceCount] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[messageId] operator[=] identifier[chunk] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[ChunkEntry] identifier[entry] operator[=] Keyword[new] identifier[ChunkEntry] operator[SEP] identifier[sequenceCount] , identifier[chunk] operator[SEP] identifier[getArrival] operator[SEP] operator[SEP] , identifier[messageId] operator[SEP] operator[SEP] Keyword[final] identifier[ChunkEntry] identifier[existing] operator[=] identifier[chunks] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[messageId] , identifier[entry] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existing] operator[==] Other[null] operator[SEP] { identifier[waitingMessages] operator[SEP] identifier[inc] operator[SEP] operator[SEP] operator[SEP] identifier[sortedEvictionSet] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] operator[SEP] } Keyword[else] { identifier[entry] operator[=] identifier[existing] operator[SEP] } Keyword[final] Keyword[int] identifier[sequenceNumber] operator[=] identifier[chunk] operator[SEP] identifier[getSequenceNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[entry] operator[SEP] identifier[payloadArray] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[sequenceNumber] , Other[null] , identifier[chunk] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[sequenceNumber] , identifier[messageId] , identifier[gelfMessage] operator[SEP] identifier[getSourceAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[duplicateChunks] operator[SEP] identifier[inc] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[final] Keyword[int] identifier[chunkWatermark] operator[=] identifier[entry] operator[SEP] identifier[chunkSlotsWritten] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[chunkWatermark] operator[>] identifier[MAX_CHUNKS] operator[SEP] { identifier[getAndCleanupEntry] operator[SEP] identifier[messageId] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[chunkWatermark] operator[==] identifier[sequenceCount] operator[SEP] { identifier[entry] operator[=] identifier[getAndCleanupEntry] operator[SEP] identifier[messageId] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[allChunks] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[sequenceCount] 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[entry] operator[SEP] identifier[payloadArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[GELFMessageChunk] identifier[messageChunk] operator[=] identifier[entry] operator[SEP] identifier[payloadArray] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[messageChunk] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[i] , identifier[messageId] operator[SEP] operator[SEP] } Keyword[else] { identifier[allChunks] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[messageChunk] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] } } identifier[completeMessages] operator[SEP] identifier[inc] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Unpooled] operator[SEP] identifier[wrappedBuffer] operator[SEP] identifier[allChunks] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isOutdated] operator[SEP] identifier[entry] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[messageId] , identifier[VALIDITY_PERIOD] operator[SEP] operator[SEP] identifier[expireEntry] operator[SEP] identifier[messageId] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static String format(String format, Object[] args) { StringBuilder answer = new StringBuilder(format.length() + (args.length * 20)); String[] argStrings = new String[args.length]; for (int i = 0; i < args.length; ++i) { if (args[i] == null) argStrings[i] = "<null>"; //$NON-NLS-1$ else argStrings[i] = args[i].toString(); } int lastI = 0; for (int i = format.indexOf('{', 0); i >= 0; i = format.indexOf('{', lastI)) { if (i != 0 && format.charAt(i - 1) == '\\') { // It's escaped, just print and loop. if (i != 1) answer.append(format.substring(lastI, i - 1)); answer.append('{'); lastI = i + 1; } else { // It's a format character. if (i > format.length() - 3) { // Bad format, just print and loop. answer.append(format.substring(lastI, format.length())); lastI = format.length(); } else { int argnum = (byte) Character.digit(format.charAt(i + 1), 10); if (argnum < 0 || format.charAt(i + 2) != '}') { // Bad format, just print and loop. answer.append(format.substring(lastI, i + 1)); lastI = i + 1; } else { // Got a good one! answer.append(format.substring(lastI, i)); if (argnum >= argStrings.length) answer.append("<missing argument>"); //$NON-NLS-1$ else answer.append(argStrings[argnum]); lastI = i + 3; } } } } if (lastI < format.length()) answer.append(format.substring(lastI, format.length())); return answer.toString(); }
class class_name[name] begin[{] method[format, return_type[type[String]], modifier[public static], parameter[format, args]] begin[{] local_variable[type[StringBuilder], answer] local_variable[type[String], argStrings] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=argStrings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=argStrings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<null>")), 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=args, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[int], lastI] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\'), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=-), operator=>), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=digit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=byte)), name=argnum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=argnum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='}'), operator=!=), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=argnum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=argStrings, selectors=[]), operator=>=), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=argStrings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=argnum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<missing argument>")], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{')], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{'), MemberReference(member=lastI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None))]), label=None) if[binary_operation[member[.lastI], <, call[format.length, parameter[]]]] begin[{] call[answer.append, parameter[call[format.substring, parameter[member[.lastI], call[format.length, parameter[]]]]]] else begin[{] None end[}] return[call[answer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[format] operator[SEP] identifier[String] identifier[format] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] { identifier[StringBuilder] identifier[answer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[format] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[*] Other[20] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[argStrings] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[args] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] identifier[argStrings] operator[SEP] identifier[i] operator[SEP] operator[=] literal[String] operator[SEP] Keyword[else] identifier[argStrings] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[lastI] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[format] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , Other[0] operator[SEP] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[=] identifier[format] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[lastI] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[!=] Other[0] operator[&&] identifier[format] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[!=] Other[1] operator[SEP] identifier[answer] operator[SEP] identifier[append] operator[SEP] identifier[format] operator[SEP] identifier[substring] operator[SEP] identifier[lastI] , identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[answer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[lastI] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[i] operator[>] identifier[format] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[3] operator[SEP] { identifier[answer] operator[SEP] identifier[append] operator[SEP] identifier[format] operator[SEP] identifier[substring] operator[SEP] identifier[lastI] , identifier[format] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lastI] operator[=] identifier[format] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[argnum] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[Character] operator[SEP] identifier[digit] operator[SEP] identifier[format] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] , Other[10] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argnum] operator[<] Other[0] operator[||] identifier[format] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[2] operator[SEP] operator[!=] literal[String] operator[SEP] { identifier[answer] operator[SEP] identifier[append] operator[SEP] identifier[format] operator[SEP] identifier[substring] operator[SEP] identifier[lastI] , identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[lastI] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } Keyword[else] { identifier[answer] operator[SEP] identifier[append] operator[SEP] identifier[format] operator[SEP] identifier[substring] operator[SEP] identifier[lastI] , identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argnum] operator[>=] identifier[argStrings] operator[SEP] identifier[length] operator[SEP] identifier[answer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[answer] operator[SEP] identifier[append] operator[SEP] identifier[argStrings] operator[SEP] identifier[argnum] operator[SEP] operator[SEP] operator[SEP] identifier[lastI] operator[=] identifier[i] operator[+] Other[3] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[lastI] operator[<] identifier[format] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[answer] operator[SEP] identifier[append] operator[SEP] identifier[format] operator[SEP] identifier[substring] operator[SEP] identifier[lastI] , identifier[format] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[answer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }