code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private void denyAccess(HttpServletResponse response, String message) throws IOException { StringBuilder sb = new StringBuilder(); sb.append("Fedora: 403 ").append(message.toUpperCase()); response.reset(); response.setStatus(HttpServletResponse.SC_FORBIDDEN); response.setContentType("text/plain"); response.setContentLength(sb.length()); ServletOutputStream out = response.getOutputStream(); out.write(sb.toString().getBytes()); out.flush(); out.close(); }
class class_name[name] begin[{] method[denyAccess, return_type[void], modifier[private], parameter[response, message]] begin[{] local_variable[type[StringBuilder], sb] call[sb.append, parameter[literal["Fedora: 403 "]]] call[response.reset, parameter[]] call[response.setStatus, parameter[member[HttpServletResponse.SC_FORBIDDEN]]] call[response.setContentType, parameter[literal["text/plain"]]] call[response.setContentLength, parameter[call[sb.length, parameter[]]]] local_variable[type[ServletOutputStream], out] call[out.write, parameter[call[sb.toString, parameter[]]]] call[out.flush, parameter[]] call[out.close, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[denyAccess] operator[SEP] identifier[HttpServletResponse] identifier[response] , identifier[String] identifier[message] operator[SEP] Keyword[throws] identifier[IOException] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[message] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_FORBIDDEN] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setContentLength] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ServletOutputStream] identifier[out] operator[=] identifier[response] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<SpellCheck>> spellCheckerWithServiceResponseAsync(String text, SpellCheckerOptionalParameter spellCheckerOptionalParameter) { if (text == null) { throw new IllegalArgumentException("Parameter text is required and cannot be null."); } final String acceptLanguage = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.acceptLanguage() : null; final String pragma = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.pragma() : null; final String userAgent = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.userAgent() : this.client.userAgent(); final String clientId = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.clientId() : null; final String clientIp = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.clientIp() : null; final String location = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.location() : null; final ActionType actionType = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.actionType() : null; final String appName = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.appName() : null; final String countryCode = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.countryCode() : null; final String clientMachineName = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.clientMachineName() : null; final String docId = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.docId() : null; final String market = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.market() : null; final String sessionId = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.sessionId() : null; final String setLang = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.setLang() : null; final String userId = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.userId() : null; final String mode = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.mode() : null; final String preContextText = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.preContextText() : null; final String postContextText = spellCheckerOptionalParameter != null ? spellCheckerOptionalParameter.postContextText() : null; return spellCheckerWithServiceResponseAsync(text, acceptLanguage, pragma, userAgent, clientId, clientIp, location, actionType, appName, countryCode, clientMachineName, docId, market, sessionId, setLang, userId, mode, preContextText, postContextText); }
class class_name[name] begin[{] method[spellCheckerWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[text, spellCheckerOptionalParameter]] begin[{] if[binary_operation[member[.text], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter text 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[}] local_variable[type[String], acceptLanguage] local_variable[type[String], pragma] local_variable[type[String], userAgent] local_variable[type[String], clientId] local_variable[type[String], clientIp] local_variable[type[String], location] local_variable[type[ActionType], actionType] local_variable[type[String], appName] local_variable[type[String], countryCode] local_variable[type[String], clientMachineName] local_variable[type[String], docId] local_variable[type[String], market] local_variable[type[String], sessionId] local_variable[type[String], setLang] local_variable[type[String], userId] local_variable[type[String], mode] local_variable[type[String], preContextText] local_variable[type[String], postContextText] return[call[.spellCheckerWithServiceResponseAsync, parameter[member[.text], member[.acceptLanguage], member[.pragma], member[.userAgent], member[.clientId], member[.clientIp], member[.location], member[.actionType], member[.appName], member[.countryCode], member[.clientMachineName], member[.docId], member[.market], member[.sessionId], member[.setLang], member[.userId], member[.mode], member[.preContextText], member[.postContextText]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[SpellCheck] operator[>] operator[>] identifier[spellCheckerWithServiceResponseAsync] operator[SEP] identifier[String] identifier[text] , identifier[SpellCheckerOptionalParameter] identifier[spellCheckerOptionalParameter] operator[SEP] { Keyword[if] operator[SEP] identifier[text] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[acceptLanguage] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[pragma] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[pragma] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[userAgent] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[:] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[clientId] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[clientId] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[clientIp] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[clientIp] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[location] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[location] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[ActionType] identifier[actionType] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[actionType] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[appName] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[appName] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[countryCode] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[countryCode] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[clientMachineName] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[clientMachineName] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[docId] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[docId] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[market] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[market] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[sessionId] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[setLang] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[setLang] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[userId] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[userId] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[mode] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[mode] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[preContextText] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[preContextText] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[String] identifier[postContextText] operator[=] identifier[spellCheckerOptionalParameter] operator[!=] Other[null] operator[?] identifier[spellCheckerOptionalParameter] operator[SEP] identifier[postContextText] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[return] identifier[spellCheckerWithServiceResponseAsync] operator[SEP] identifier[text] , identifier[acceptLanguage] , identifier[pragma] , identifier[userAgent] , identifier[clientId] , identifier[clientIp] , identifier[location] , identifier[actionType] , identifier[appName] , identifier[countryCode] , identifier[clientMachineName] , identifier[docId] , identifier[market] , identifier[sessionId] , identifier[setLang] , identifier[userId] , identifier[mode] , identifier[preContextText] , identifier[postContextText] operator[SEP] operator[SEP] }
public static Expression distinct(Val<Expression>[] args) { boolean dis = true; if (args.length > 1) { Object o = args[0].object(); if (o instanceof Boolean || o instanceof BigDecimal) { dis = args[0].bool(); } } return new DistinctExpression(dis); }
class class_name[name] begin[{] method[distinct, return_type[type[Expression]], modifier[public static], parameter[args]] begin[{] local_variable[type[boolean], dis] if[binary_operation[member[args.length], >, literal[1]]] begin[{] local_variable[type[Object], o] if[binary_operation[binary_operation[member[.o], instanceof, type[Boolean]], ||, binary_operation[member[.o], instanceof, type[BigDecimal]]]] begin[{] assign[member[.dis], member[.args]] else begin[{] None end[}] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=dis, 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=DistinctExpression, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Expression] identifier[distinct] operator[SEP] identifier[Val] operator[<] identifier[Expression] operator[>] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[boolean] identifier[dis] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] { identifier[Object] identifier[o] operator[=] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Boolean] operator[||] identifier[o] Keyword[instanceof] identifier[BigDecimal] operator[SEP] { identifier[dis] operator[=] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[bool] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[DistinctExpression] operator[SEP] identifier[dis] operator[SEP] operator[SEP] }
@EventListener public void handleCasTicketGrantingTicketCreatedEvent(final CasTicketGrantingTicketCreatedEvent event) { if (this.casEventRepository != null) { val dto = prepareCasEvent(event); dto.setCreationTime(event.getTicketGrantingTicket().getCreationTime().toString()); dto.putEventId(TicketIdSanitizationUtils.sanitize(event.getTicketGrantingTicket().getId())); dto.setPrincipalId(event.getTicketGrantingTicket().getAuthentication().getPrincipal().getId()); this.casEventRepository.save(dto); } }
class class_name[name] begin[{] method[handleCasTicketGrantingTicketCreatedEvent, return_type[void], modifier[public], parameter[event]] begin[{] if[binary_operation[THIS[member[None.casEventRepository]], !=, literal[null]]] begin[{] local_variable[type[val], dto] call[dto.setCreationTime, parameter[call[event.getTicketGrantingTicket, parameter[]]]] call[dto.putEventId, parameter[call[TicketIdSanitizationUtils.sanitize, parameter[call[event.getTicketGrantingTicket, parameter[]]]]]] call[dto.setPrincipalId, parameter[call[event.getTicketGrantingTicket, parameter[]]]] THIS[member[None.casEventRepository]call[None.save, parameter[member[.dto]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[EventListener] Keyword[public] Keyword[void] identifier[handleCasTicketGrantingTicketCreatedEvent] operator[SEP] Keyword[final] identifier[CasTicketGrantingTicketCreatedEvent] identifier[event] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[casEventRepository] operator[!=] Other[null] operator[SEP] { identifier[val] identifier[dto] operator[=] identifier[prepareCasEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[dto] operator[SEP] identifier[setCreationTime] operator[SEP] identifier[event] operator[SEP] identifier[getTicketGrantingTicket] operator[SEP] operator[SEP] operator[SEP] identifier[getCreationTime] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dto] operator[SEP] identifier[putEventId] operator[SEP] identifier[TicketIdSanitizationUtils] operator[SEP] identifier[sanitize] operator[SEP] identifier[event] operator[SEP] identifier[getTicketGrantingTicket] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dto] operator[SEP] identifier[setPrincipalId] operator[SEP] identifier[event] operator[SEP] identifier[getTicketGrantingTicket] operator[SEP] operator[SEP] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] identifier[getPrincipal] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[casEventRepository] operator[SEP] identifier[save] operator[SEP] identifier[dto] operator[SEP] operator[SEP] } }
public <E> List<E> findByQuery(Class<E> entityClass, EntityMetadata metadata, Filter f, Queue filterClausequeue, String... columns) { EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass); List<String> relationNames = entityMetadata.getRelationNames(); // columnFamily has a different meaning for HBase, so it won't be used // here String tableName = entityMetadata.getSchema(); List results = null; FilterList filter = new FilterList(); if (f != null) { filter.addFilter(f); } if (isFindKeyOnly(metadata, columns)) { columns = null; filter.addFilter(new KeyOnlyFilter()); } try { results = fetchEntity(entityClass, null, entityMetadata, relationNames, tableName, results, filter, filterClausequeue, columns); } catch (IOException ioex) { log.error("Error during find by query, Caused by: .", ioex); throw new KunderaException(ioex); } return results != null ? results : new ArrayList(); }
class class_name[name] begin[{] method[findByQuery, return_type[type[List]], modifier[public], parameter[entityClass, metadata, f, filterClausequeue, columns]] begin[{] local_variable[type[EntityMetadata], entityMetadata] local_variable[type[List], relationNames] local_variable[type[String], tableName] local_variable[type[List], results] local_variable[type[FilterList], filter] if[binary_operation[member[.f], !=, literal[null]]] begin[{] call[filter.addFilter, parameter[member[.f]]] else begin[{] None end[}] if[call[.isFindKeyOnly, parameter[member[.metadata], member[.columns]]]] begin[{] assign[member[.columns], literal[null]] call[filter.addFilter, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KeyOnlyFilter, sub_type=None))]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=entityClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=entityMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relationNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filterClausequeue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fetchEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during find by query, Caused by: ."), MemberReference(member=ioex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ioex, 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=KunderaException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioex, types=['IOException']))], finally_block=None, label=None, resources=None) return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None)), if_true=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] operator[<] identifier[E] operator[>] identifier[List] operator[<] identifier[E] operator[>] identifier[findByQuery] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[entityClass] , identifier[EntityMetadata] identifier[metadata] , identifier[Filter] identifier[f] , identifier[Queue] identifier[filterClausequeue] , identifier[String] operator[...] identifier[columns] operator[SEP] { identifier[EntityMetadata] identifier[entityMetadata] operator[=] identifier[KunderaMetadataManager] operator[SEP] identifier[getEntityMetadata] operator[SEP] identifier[kunderaMetadata] , identifier[entityClass] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[relationNames] operator[=] identifier[entityMetadata] operator[SEP] identifier[getRelationNames] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[tableName] operator[=] identifier[entityMetadata] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[SEP] identifier[List] identifier[results] operator[=] Other[null] operator[SEP] identifier[FilterList] identifier[filter] operator[=] Keyword[new] identifier[FilterList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[!=] Other[null] operator[SEP] { identifier[filter] operator[SEP] identifier[addFilter] operator[SEP] identifier[f] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isFindKeyOnly] operator[SEP] identifier[metadata] , identifier[columns] operator[SEP] operator[SEP] { identifier[columns] operator[=] Other[null] operator[SEP] identifier[filter] operator[SEP] identifier[addFilter] operator[SEP] Keyword[new] identifier[KeyOnlyFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[results] operator[=] identifier[fetchEntity] operator[SEP] identifier[entityClass] , Other[null] , identifier[entityMetadata] , identifier[relationNames] , identifier[tableName] , identifier[results] , identifier[filter] , identifier[filterClausequeue] , identifier[columns] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ioex] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[KunderaException] operator[SEP] identifier[ioex] operator[SEP] operator[SEP] } Keyword[return] identifier[results] operator[!=] Other[null] operator[?] identifier[results] operator[:] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] }
@Override public void start() { initLogger(); final String resourceName = StringUtil.replaceChar(JoyPaths.class.getName(), '.', '/') + ".class"; URL url = ClassLoaderUtil.getResourceUrl(resourceName); if (url == null) { throw new JoyException("Failed to resolve app dir, missing: " + resourceName); } final String protocol = url.getProtocol(); if (!protocol.equals("file")) { try { url = new URL(url.getFile()); } catch (MalformedURLException ignore) { } } appDir = url.getFile(); final int ndx = appDir.indexOf("WEB-INF"); appDir = (ndx > 0) ? appDir.substring(0, ndx) : SystemUtil.info().getWorkingDir(); System.setProperty(APP_DIR, appDir); log.info("Application folder: " + appDir); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] call[.initLogger, parameter[]] local_variable[type[String], resourceName] local_variable[type[URL], url] if[binary_operation[member[.url], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to resolve app dir, missing: "), operandr=MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JoyException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], protocol] if[call[protocol.equals, parameter[literal["file"]]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None))), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['MalformedURLException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] assign[member[.appDir], call[url.getFile, parameter[]]] local_variable[type[int], ndx] assign[member[.appDir], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ndx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=MethodInvocation(arguments=[], member=info, postfix_operators=[], prefix_operators=[], qualifier=SystemUtil, selectors=[MethodInvocation(arguments=[], member=getWorkingDir, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=ndx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=appDir, selectors=[], type_arguments=None))] call[System.setProperty, parameter[member[.APP_DIR], member[.appDir]]] call[log.info, parameter[binary_operation[literal["Application folder: "], +, member[.appDir]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] { identifier[initLogger] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[resourceName] operator[=] identifier[StringUtil] operator[SEP] identifier[replaceChar] operator[SEP] identifier[JoyPaths] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[+] literal[String] operator[SEP] identifier[URL] identifier[url] operator[=] identifier[ClassLoaderUtil] operator[SEP] identifier[getResourceUrl] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[JoyException] operator[SEP] literal[String] operator[+] identifier[resourceName] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[protocol] operator[=] identifier[url] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[protocol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[url] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[ignore] operator[SEP] { } } identifier[appDir] operator[=] identifier[url] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[ndx] operator[=] identifier[appDir] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[appDir] operator[=] operator[SEP] identifier[ndx] operator[>] Other[0] operator[SEP] operator[?] identifier[appDir] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[ndx] operator[SEP] operator[:] identifier[SystemUtil] operator[SEP] identifier[info] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkingDir] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] identifier[APP_DIR] , identifier[appDir] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[appDir] operator[SEP] operator[SEP] }
public static boolean isEmpty(List<? extends IBase> theElements) { if (theElements == null) { return true; } for (int i = 0; i < theElements.size(); i++) { IBase next; try { next = theElements.get(i); } catch (ClassCastException e) { List<?> elements = theElements; String s = "Found instance of " + elements.get(i).getClass() + " - Did you set a field value to the incorrect type? Expected " + IBase.class.getName(); throw new ClassCastException(s); } if (next != null && !next.isEmpty()) { return false; } } return true; }
class class_name[name] begin[{] method[isEmpty, return_type[type[boolean]], modifier[public static], parameter[theElements]] begin[{] if[binary_operation[member[.theElements], ==, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=next)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBase, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=theElements, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=theElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=elements)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found instance of "), operandr=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - Did you set a field value to the incorrect type? Expected "), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IBase, sub_type=None)), operator=+), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=s, 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=ClassCastException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=next, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=theElements, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isEmpty] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[IBase] operator[>] identifier[theElements] operator[SEP] { Keyword[if] operator[SEP] identifier[theElements] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[theElements] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[IBase] identifier[next] operator[SEP] Keyword[try] { identifier[next] operator[=] identifier[theElements] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] { identifier[List] operator[<] operator[?] operator[>] identifier[elements] operator[=] identifier[theElements] operator[SEP] identifier[String] identifier[s] operator[=] literal[String] operator[+] identifier[elements] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[IBase] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ClassCastException] operator[SEP] identifier[s] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[next] operator[!=] Other[null] operator[&&] operator[!] identifier[next] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Override public UpdateApplicationResourceLifecycleResult updateApplicationResourceLifecycle(UpdateApplicationResourceLifecycleRequest request) { request = beforeClientExecution(request); return executeUpdateApplicationResourceLifecycle(request); }
class class_name[name] begin[{] method[updateApplicationResourceLifecycle, return_type[type[UpdateApplicationResourceLifecycleResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeUpdateApplicationResourceLifecycle, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[UpdateApplicationResourceLifecycleResult] identifier[updateApplicationResourceLifecycle] operator[SEP] identifier[UpdateApplicationResourceLifecycleRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateApplicationResourceLifecycle] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public boolean isAllowed(File path, boolean write, boolean configReadOnly) throws IOException { try { if (configReadOnly && write) return false; if (config.isRestrictedBrowsing()) { if (null != config.getRestrictedPaths() && null != path) { for (String restricedPath : config.getRestrictedPaths()) { if(path.getCanonicalPath().startsWith(restricedPath)) { return config.isRestrictedBrowsingIsWhitelist(); } } } return !config.isRestrictedBrowsingIsWhitelist(); } } catch (IOException e) { throw new IOException("Could not check if path '" + path.getAbsolutePath() + "' is allowed ", e); } return true; }
class class_name[name] begin[{] method[isAllowed, return_type[type[boolean]], modifier[public], parameter[path, write, configReadOnly]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=configReadOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=write, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isRestrictedBrowsing, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=getRestrictedPaths, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), operator=!=), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[MethodInvocation(arguments=[MemberReference(member=restricedPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isRestrictedBrowsingIsWhitelist, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRestrictedPaths, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=restricedPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=isRestrictedBrowsingIsWhitelist, postfix_operators=[], prefix_operators=['!'], qualifier=config, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not check if path '"), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is allowed "), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isAllowed] operator[SEP] identifier[File] identifier[path] , Keyword[boolean] identifier[write] , Keyword[boolean] identifier[configReadOnly] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { Keyword[if] operator[SEP] identifier[configReadOnly] operator[&&] identifier[write] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[isRestrictedBrowsing] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[config] operator[SEP] identifier[getRestrictedPaths] operator[SEP] operator[SEP] operator[&&] Other[null] operator[!=] identifier[path] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[restricedPath] operator[:] identifier[config] operator[SEP] identifier[getRestrictedPaths] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[restricedPath] operator[SEP] operator[SEP] { Keyword[return] identifier[config] operator[SEP] identifier[isRestrictedBrowsingIsWhitelist] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] operator[!] identifier[config] operator[SEP] identifier[isRestrictedBrowsingIsWhitelist] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[path] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static void premain(String options, Instrumentation instrumentation) { // Load options. Config.loadConfig(options, false); if (Config.X_ENABLED_V) { // Initialize instrumentation instance according to the // given mode. initializeMode(instrumentation); } }
class class_name[name] begin[{] method[premain, return_type[void], modifier[public static], parameter[options, instrumentation]] begin[{] call[Config.loadConfig, parameter[member[.options], literal[false]]] if[member[Config.X_ENABLED_V]] begin[{] call[.initializeMode, parameter[member[.instrumentation]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[premain] operator[SEP] identifier[String] identifier[options] , identifier[Instrumentation] identifier[instrumentation] operator[SEP] { identifier[Config] operator[SEP] identifier[loadConfig] operator[SEP] identifier[options] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Config] operator[SEP] identifier[X_ENABLED_V] operator[SEP] { identifier[initializeMode] operator[SEP] identifier[instrumentation] operator[SEP] operator[SEP] } }
public OvhMailingList domain_mailingList_name_GET(String domain, String name) throws IOException { String qPath = "/email/domain/{domain}/mailingList/{name}"; StringBuilder sb = path(qPath, domain, name); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhMailingList.class); }
class class_name[name] begin[{] method[domain_mailingList_name_GET, return_type[type[OvhMailingList]], modifier[public], parameter[domain, name]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhMailingList, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhMailingList] identifier[domain_mailingList_name_GET] operator[SEP] identifier[String] identifier[domain] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[domain] , identifier[name] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhMailingList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static boolean areBeansEqual( Object bean1, Object bean2 ) { if( bean1 == bean2 ) { return true; } if( bean1 == null || bean2 == null ) { return false; } IType class1 = TypeLoaderAccess.instance().getIntrinsicTypeFromObject( bean1 ); IType class2 = TypeLoaderAccess.instance().getIntrinsicTypeFromObject( bean2 ); if( class1.isAssignableFrom( class2 ) || class2.isAssignableFrom( class1 ) ) { return bean1.equals( bean2 ); } if( CommonServices.getEntityAccess().isDomainInstance( bean1 ) || CommonServices.getEntityAccess().isDomainInstance( bean2 ) ) { return CommonServices.getEntityAccess().areBeansEqual( bean1, bean2 ); } return bean1.equals( bean2 ); }
class class_name[name] begin[{] method[areBeansEqual, return_type[type[boolean]], modifier[public static], parameter[bean1, bean2]] begin[{] if[binary_operation[member[.bean1], ==, member[.bean2]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.bean1], ==, literal[null]], ||, binary_operation[member[.bean2], ==, literal[null]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[IType], class1] local_variable[type[IType], class2] if[binary_operation[call[class1.isAssignableFrom, parameter[member[.class2]]], ||, call[class2.isAssignableFrom, parameter[member[.class1]]]]] begin[{] return[call[bean1.equals, parameter[member[.bean2]]]] else begin[{] None end[}] if[binary_operation[call[CommonServices.getEntityAccess, parameter[]], ||, call[CommonServices.getEntityAccess, parameter[]]]] begin[{] return[call[CommonServices.getEntityAccess, parameter[]]] else begin[{] None end[}] return[call[bean1.equals, parameter[member[.bean2]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[areBeansEqual] operator[SEP] identifier[Object] identifier[bean1] , identifier[Object] identifier[bean2] operator[SEP] { Keyword[if] operator[SEP] identifier[bean1] operator[==] identifier[bean2] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[bean1] operator[==] Other[null] operator[||] identifier[bean2] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[IType] identifier[class1] operator[=] identifier[TypeLoaderAccess] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[getIntrinsicTypeFromObject] operator[SEP] identifier[bean1] operator[SEP] operator[SEP] identifier[IType] identifier[class2] operator[=] identifier[TypeLoaderAccess] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[getIntrinsicTypeFromObject] operator[SEP] identifier[bean2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[class1] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[class2] operator[SEP] operator[||] identifier[class2] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[class1] operator[SEP] operator[SEP] { Keyword[return] identifier[bean1] operator[SEP] identifier[equals] operator[SEP] identifier[bean2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[CommonServices] operator[SEP] identifier[getEntityAccess] operator[SEP] operator[SEP] operator[SEP] identifier[isDomainInstance] operator[SEP] identifier[bean1] operator[SEP] operator[||] identifier[CommonServices] operator[SEP] identifier[getEntityAccess] operator[SEP] operator[SEP] operator[SEP] identifier[isDomainInstance] operator[SEP] identifier[bean2] operator[SEP] operator[SEP] { Keyword[return] identifier[CommonServices] operator[SEP] identifier[getEntityAccess] operator[SEP] operator[SEP] operator[SEP] identifier[areBeansEqual] operator[SEP] identifier[bean1] , identifier[bean2] operator[SEP] operator[SEP] } Keyword[return] identifier[bean1] operator[SEP] identifier[equals] operator[SEP] identifier[bean2] operator[SEP] operator[SEP] }
public static Object growArrayToAtLeast(Object arr, int minLen) { if (arr == null) { throw new IllegalArgumentException(NO_TYPE); } Object old = arr; int oldLen = Array.getLength(arr); int newLen = oldLen + ((oldLen + 1) >> 1); if (newLen < minLen) { newLen = minLen; } arr = Array.newInstance(arr.getClass().getComponentType(), newLen); System.arraycopy(old, 0, arr, 0, oldLen); return arr; }
class class_name[name] begin[{] method[growArrayToAtLeast, return_type[type[Object]], modifier[public static], parameter[arr, minLen]] begin[{] if[binary_operation[member[.arr], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=NO_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Object], old] local_variable[type[int], oldLen] local_variable[type[int], newLen] if[binary_operation[member[.newLen], <, member[.minLen]]] begin[{] assign[member[.newLen], member[.minLen]] else begin[{] None end[}] assign[member[.arr], call[Array.newInstance, parameter[call[arr.getClass, parameter[]], member[.newLen]]]] call[System.arraycopy, parameter[member[.old], literal[0], member[.arr], literal[0], member[.oldLen]]] return[member[.arr]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[growArrayToAtLeast] operator[SEP] identifier[Object] identifier[arr] , Keyword[int] identifier[minLen] operator[SEP] { Keyword[if] operator[SEP] identifier[arr] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[NO_TYPE] operator[SEP] operator[SEP] } identifier[Object] identifier[old] operator[=] identifier[arr] operator[SEP] Keyword[int] identifier[oldLen] operator[=] identifier[Array] operator[SEP] identifier[getLength] operator[SEP] identifier[arr] operator[SEP] operator[SEP] Keyword[int] identifier[newLen] operator[=] identifier[oldLen] operator[+] operator[SEP] operator[SEP] identifier[oldLen] operator[+] Other[1] operator[SEP] operator[>] operator[>] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newLen] operator[<] identifier[minLen] operator[SEP] { identifier[newLen] operator[=] identifier[minLen] operator[SEP] } identifier[arr] operator[=] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[arr] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[newLen] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[old] , Other[0] , identifier[arr] , Other[0] , identifier[oldLen] operator[SEP] operator[SEP] Keyword[return] identifier[arr] operator[SEP] }
protected static boolean addMatchResult(int limit, List results, String pattern, Object value, int[] positions, int len) { int size = results.size(); if (size < limit) { if (positions == null || len == 0) { positions = NO_POSITIONS; } else { int[] original = positions; positions = new int[len]; for (int i=0; i<len; i++) { positions[i] = original[i]; } } results.add(new Result(pattern, value, positions)); return size + 1 < limit; } else { return false; } }
class class_name[name] begin[{] method[addMatchResult, return_type[type[boolean]], modifier[static protected], parameter[limit, results, pattern, value, positions, len]] begin[{] local_variable[type[int], size] if[binary_operation[member[.size], <, member[.limit]]] begin[{] if[binary_operation[binary_operation[member[.positions], ==, literal[null]], ||, binary_operation[member[.len], ==, literal[0]]]] begin[{] assign[member[.positions], member[.NO_POSITIONS]] else begin[{] local_variable[type[int], original] assign[member[.positions], ArrayCreator(dimensions=[MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=positions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=original, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] call[results.add, parameter[ClassCreator(arguments=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=positions, 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=Result, sub_type=None))]] return[binary_operation[binary_operation[member[.size], +, literal[1]], <, member[.limit]]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[boolean] identifier[addMatchResult] operator[SEP] Keyword[int] identifier[limit] , identifier[List] identifier[results] , identifier[String] identifier[pattern] , identifier[Object] identifier[value] , Keyword[int] operator[SEP] operator[SEP] identifier[positions] , Keyword[int] identifier[len] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[results] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[<] identifier[limit] operator[SEP] { Keyword[if] operator[SEP] identifier[positions] operator[==] Other[null] operator[||] identifier[len] operator[==] Other[0] operator[SEP] { identifier[positions] operator[=] identifier[NO_POSITIONS] operator[SEP] } Keyword[else] { Keyword[int] operator[SEP] operator[SEP] identifier[original] operator[=] identifier[positions] operator[SEP] identifier[positions] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[len] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[positions] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[original] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } identifier[results] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Result] operator[SEP] identifier[pattern] , identifier[value] , identifier[positions] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[size] operator[+] Other[1] operator[<] identifier[limit] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public ServiceFuture<SharedAccessAuthorizationRuleResourceInner> createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties, final ServiceCallback<SharedAccessAuthorizationRuleResourceInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties), serviceCallback); }
class class_name[name] begin[{] method[createOrUpdateAuthorizationRuleAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, properties, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.createOrUpdateAuthorizationRuleWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.namespaceName], member[.notificationHubName], member[.authorizationRuleName], member[.properties]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[SharedAccessAuthorizationRuleResourceInner] operator[>] identifier[createOrUpdateAuthorizationRuleAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[namespaceName] , identifier[String] identifier[notificationHubName] , identifier[String] identifier[authorizationRuleName] , identifier[SharedAccessAuthorizationRuleProperties] identifier[properties] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[SharedAccessAuthorizationRuleResourceInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[createOrUpdateAuthorizationRuleWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[namespaceName] , identifier[notificationHubName] , identifier[authorizationRuleName] , identifier[properties] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public Cursor<MultiDataPoint> readMultiDataPoints(Filter filter, Interval interval, DateTimeZone timezone, Rollup rollup, Interpolation interpolation) { checkNotNull(filter); checkNotNull(interval); checkNotNull(timezone); URI uri = null; try { URIBuilder builder = new URIBuilder(String.format("/%s/multi/", API_VERSION)); addFilterToURI(builder, filter); addInterpolationToURI(builder, interpolation); addIntervalToURI(builder, interval); addRollupToURI(builder, rollup); addTimeZoneToURI(builder, timezone); uri = builder.build(); } catch (URISyntaxException e) { String message = String.format("Could not build URI with inputs: filter: %s, interval: %s, rollup: %s, timezone: %s", filter, interval, rollup, timezone); throw new IllegalArgumentException(message, e); } Cursor<MultiDataPoint> cursor = new MultiDataPointCursor(uri, this); return cursor; }
class class_name[name] begin[{] method[readMultiDataPoints, return_type[type[Cursor]], modifier[public], parameter[filter, interval, timezone, rollup, interpolation]] begin[{] call[.checkNotNull, parameter[member[.filter]]] call[.checkNotNull, parameter[member[.interval]]] call[.checkNotNull, parameter[member[.timezone]]] local_variable[type[URI], uri] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/%s/multi/"), MemberReference(member=API_VERSION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URIBuilder, sub_type=None)), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URIBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFilterToURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=interpolation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addInterpolationToURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addIntervalToURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rollup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRollupToURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timezone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addTimeZoneToURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not build URI with inputs: filter: %s, interval: %s, rollup: %s, timezone: %s"), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rollup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timezone, 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=[]), 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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) local_variable[type[Cursor], cursor] return[member[.cursor]] end[}] END[}]
Keyword[public] identifier[Cursor] operator[<] identifier[MultiDataPoint] operator[>] identifier[readMultiDataPoints] operator[SEP] identifier[Filter] identifier[filter] , identifier[Interval] identifier[interval] , identifier[DateTimeZone] identifier[timezone] , identifier[Rollup] identifier[rollup] , identifier[Interpolation] identifier[interpolation] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[interval] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[timezone] operator[SEP] operator[SEP] identifier[URI] identifier[uri] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[URIBuilder] identifier[builder] operator[=] Keyword[new] identifier[URIBuilder] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[API_VERSION] operator[SEP] operator[SEP] operator[SEP] identifier[addFilterToURI] operator[SEP] identifier[builder] , identifier[filter] operator[SEP] operator[SEP] identifier[addInterpolationToURI] operator[SEP] identifier[builder] , identifier[interpolation] operator[SEP] operator[SEP] identifier[addIntervalToURI] operator[SEP] identifier[builder] , identifier[interval] operator[SEP] operator[SEP] identifier[addRollupToURI] operator[SEP] identifier[builder] , identifier[rollup] operator[SEP] operator[SEP] identifier[addTimeZoneToURI] operator[SEP] identifier[builder] , identifier[timezone] operator[SEP] operator[SEP] identifier[uri] operator[=] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { identifier[String] identifier[message] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[filter] , identifier[interval] , identifier[rollup] , identifier[timezone] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[message] , identifier[e] operator[SEP] operator[SEP] } identifier[Cursor] operator[<] identifier[MultiDataPoint] operator[>] identifier[cursor] operator[=] Keyword[new] identifier[MultiDataPointCursor] operator[SEP] identifier[uri] , Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[cursor] operator[SEP] }
public IntTrie compactToTrieWithRowIndexes() { PVecToTrieCompactHandler compactor = new PVecToTrieCompactHandler(); compact(compactor); return compactor.builder.serialize(new DefaultGetFoldedValue( compactor.builder), new DefaultGetFoldingOffset()); }
class class_name[name] begin[{] method[compactToTrieWithRowIndexes, return_type[type[IntTrie]], modifier[public], parameter[]] begin[{] local_variable[type[PVecToTrieCompactHandler], compactor] call[.compact, parameter[member[.compactor]]] return[call[compactor.builder.serialize, parameter[ClassCreator(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=compactor, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultGetFoldedValue, 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=DefaultGetFoldingOffset, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[IntTrie] identifier[compactToTrieWithRowIndexes] operator[SEP] operator[SEP] { identifier[PVecToTrieCompactHandler] identifier[compactor] operator[=] Keyword[new] identifier[PVecToTrieCompactHandler] operator[SEP] operator[SEP] operator[SEP] identifier[compact] operator[SEP] identifier[compactor] operator[SEP] operator[SEP] Keyword[return] identifier[compactor] operator[SEP] identifier[builder] operator[SEP] identifier[serialize] operator[SEP] Keyword[new] identifier[DefaultGetFoldedValue] operator[SEP] identifier[compactor] operator[SEP] identifier[builder] operator[SEP] , Keyword[new] identifier[DefaultGetFoldingOffset] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public I_CmsPrincipal lookupPrincipal(CmsRequestContext context, String principalName) { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); I_CmsPrincipal result = null; try { result = m_driverManager.lookupPrincipal(dbc, CmsOrganizationalUnit.removeLeadingSeparator(principalName)); } finally { dbc.clear(); } return result; }
class class_name[name] begin[{] method[lookupPrincipal, return_type[type[I_CmsPrincipal]], modifier[public], parameter[context, principalName]] begin[{] local_variable[type[CmsDbContext], dbc] local_variable[type[I_CmsPrincipal], result] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=principalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeLeadingSeparator, postfix_operators=[], prefix_operators=[], qualifier=CmsOrganizationalUnit, selectors=[], type_arguments=None)], member=lookupPrincipal, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[I_CmsPrincipal] identifier[lookupPrincipal] operator[SEP] identifier[CmsRequestContext] identifier[context] , identifier[String] identifier[principalName] operator[SEP] { identifier[CmsDbContext] identifier[dbc] operator[=] identifier[m_dbContextFactory] operator[SEP] identifier[getDbContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[I_CmsPrincipal] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[result] operator[=] identifier[m_driverManager] operator[SEP] identifier[lookupPrincipal] operator[SEP] identifier[dbc] , identifier[CmsOrganizationalUnit] operator[SEP] identifier[removeLeadingSeparator] operator[SEP] identifier[principalName] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[dbc] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
protected Boolean _hasPermission(@Nonnull Authentication a, Permission permission) { // ACL entries for this principal takes precedence Boolean b = hasPermission(new PrincipalSid(a),permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission(PrincipalSID:"+a.getPrincipal()+","+permission+")=>"+b); if(b!=null) return b; // after that, we check if the groups this principal belongs to // has any ACL entries. // here we are using GrantedAuthority as a group for(GrantedAuthority ga : a.getAuthorities()) { b = hasPermission(new GrantedAuthoritySid(ga),permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission(GroupSID:"+ga.getAuthority()+","+permission+")=>"+b); if(b!=null) return b; } // permissions granted to 'everyone' and 'anonymous' users are granted to everyone for (Sid sid : AUTOMATIC_SIDS) { b = hasPermission(sid,permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission("+sid+","+permission+")=>"+b); if(b!=null) return b; } return null; }
class class_name[name] begin[{] method[_hasPermission, return_type[type[Boolean]], modifier[protected], parameter[a, permission]] begin[{] local_variable[type[Boolean], b] if[call[LOGGER.isLoggable, parameter[member[.FINER]]]] begin[{] call[LOGGER.finer, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["hasPermission(PrincipalSID:"], +, call[a.getPrincipal, parameter[]]], +, literal[","]], +, member[.permission]], +, literal[")=>"]], +, member[.b]]]] else begin[{] None end[}] if[binary_operation[member[.b], !=, literal[null]]] begin[{] return[member[.b]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=ga, 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=GrantedAuthoritySid, sub_type=None)), MemberReference(member=permission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasPermission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="hasPermission(GroupSID:"), operandr=MethodInvocation(arguments=[], member=getAuthority, postfix_operators=[], prefix_operators=[], qualifier=ga, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=permission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")=>"), operator=+), operandr=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=finer, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAuthorities, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ga)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GrantedAuthority, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=sid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=permission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasPermission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="hasPermission("), operandr=MemberReference(member=sid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=permission, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")=>"), operator=+), operandr=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=finer, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=AUTOMATIC_SIDS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Sid, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[protected] identifier[Boolean] identifier[_hasPermission] operator[SEP] annotation[@] identifier[Nonnull] identifier[Authentication] identifier[a] , identifier[Permission] identifier[permission] operator[SEP] { identifier[Boolean] identifier[b] operator[=] identifier[hasPermission] operator[SEP] Keyword[new] identifier[PrincipalSid] operator[SEP] identifier[a] operator[SEP] , identifier[permission] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isLoggable] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[finer] operator[SEP] literal[String] operator[+] identifier[a] operator[SEP] identifier[getPrincipal] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[permission] operator[+] literal[String] operator[+] identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[b] operator[SEP] Keyword[for] operator[SEP] identifier[GrantedAuthority] identifier[ga] operator[:] identifier[a] operator[SEP] identifier[getAuthorities] operator[SEP] operator[SEP] operator[SEP] { identifier[b] operator[=] identifier[hasPermission] operator[SEP] Keyword[new] identifier[GrantedAuthoritySid] operator[SEP] identifier[ga] operator[SEP] , identifier[permission] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isLoggable] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[finer] operator[SEP] literal[String] operator[+] identifier[ga] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[permission] operator[+] literal[String] operator[+] identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[b] operator[SEP] } Keyword[for] operator[SEP] identifier[Sid] identifier[sid] operator[:] identifier[AUTOMATIC_SIDS] operator[SEP] { identifier[b] operator[=] identifier[hasPermission] operator[SEP] identifier[sid] , identifier[permission] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isLoggable] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[finer] operator[SEP] literal[String] operator[+] identifier[sid] operator[+] literal[String] operator[+] identifier[permission] operator[+] literal[String] operator[+] identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[b] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Fix(SyntaxIssueCodes.USED_RESERVED_KEYWORD) public void fixNoViableAlternativeAtKeyword(final Issue issue, IssueResolutionAcceptor acceptor) { ProtectKeywordModification.accept(this, issue, acceptor); }
class class_name[name] begin[{] method[fixNoViableAlternativeAtKeyword, return_type[void], modifier[public], parameter[issue, acceptor]] begin[{] call[ProtectKeywordModification.accept, parameter[THIS[], member[.issue], member[.acceptor]]] end[}] END[}]
annotation[@] identifier[Fix] operator[SEP] identifier[SyntaxIssueCodes] operator[SEP] identifier[USED_RESERVED_KEYWORD] operator[SEP] Keyword[public] Keyword[void] identifier[fixNoViableAlternativeAtKeyword] operator[SEP] Keyword[final] identifier[Issue] identifier[issue] , identifier[IssueResolutionAcceptor] identifier[acceptor] operator[SEP] { identifier[ProtectKeywordModification] operator[SEP] identifier[accept] operator[SEP] Keyword[this] , identifier[issue] , identifier[acceptor] operator[SEP] operator[SEP] }
public void marshall(AutoScalingThresholds autoScalingThresholds, ProtocolMarshaller protocolMarshaller) { if (autoScalingThresholds == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(autoScalingThresholds.getInstanceCount(), INSTANCECOUNT_BINDING); protocolMarshaller.marshall(autoScalingThresholds.getThresholdsWaitTime(), THRESHOLDSWAITTIME_BINDING); protocolMarshaller.marshall(autoScalingThresholds.getIgnoreMetricsTime(), IGNOREMETRICSTIME_BINDING); protocolMarshaller.marshall(autoScalingThresholds.getCpuThreshold(), CPUTHRESHOLD_BINDING); protocolMarshaller.marshall(autoScalingThresholds.getMemoryThreshold(), MEMORYTHRESHOLD_BINDING); protocolMarshaller.marshall(autoScalingThresholds.getLoadThreshold(), LOADTHRESHOLD_BINDING); protocolMarshaller.marshall(autoScalingThresholds.getAlarms(), ALARMS_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[autoScalingThresholds, protocolMarshaller]] begin[{] if[binary_operation[member[.autoScalingThresholds], ==, 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=getInstanceCount, postfix_operators=[], prefix_operators=[], qualifier=autoScalingThresholds, selectors=[], type_arguments=None), MemberReference(member=INSTANCECOUNT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getThresholdsWaitTime, postfix_operators=[], prefix_operators=[], qualifier=autoScalingThresholds, selectors=[], type_arguments=None), MemberReference(member=THRESHOLDSWAITTIME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIgnoreMetricsTime, postfix_operators=[], prefix_operators=[], qualifier=autoScalingThresholds, selectors=[], type_arguments=None), MemberReference(member=IGNOREMETRICSTIME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCpuThreshold, postfix_operators=[], prefix_operators=[], qualifier=autoScalingThresholds, selectors=[], type_arguments=None), MemberReference(member=CPUTHRESHOLD_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMemoryThreshold, postfix_operators=[], prefix_operators=[], qualifier=autoScalingThresholds, selectors=[], type_arguments=None), MemberReference(member=MEMORYTHRESHOLD_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLoadThreshold, postfix_operators=[], prefix_operators=[], qualifier=autoScalingThresholds, selectors=[], type_arguments=None), MemberReference(member=LOADTHRESHOLD_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAlarms, postfix_operators=[], prefix_operators=[], qualifier=autoScalingThresholds, selectors=[], type_arguments=None), MemberReference(member=ALARMS_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[AutoScalingThresholds] identifier[autoScalingThresholds] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[autoScalingThresholds] 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[autoScalingThresholds] operator[SEP] identifier[getInstanceCount] operator[SEP] operator[SEP] , identifier[INSTANCECOUNT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingThresholds] operator[SEP] identifier[getThresholdsWaitTime] operator[SEP] operator[SEP] , identifier[THRESHOLDSWAITTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingThresholds] operator[SEP] identifier[getIgnoreMetricsTime] operator[SEP] operator[SEP] , identifier[IGNOREMETRICSTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingThresholds] operator[SEP] identifier[getCpuThreshold] operator[SEP] operator[SEP] , identifier[CPUTHRESHOLD_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingThresholds] operator[SEP] identifier[getMemoryThreshold] operator[SEP] operator[SEP] , identifier[MEMORYTHRESHOLD_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingThresholds] operator[SEP] identifier[getLoadThreshold] operator[SEP] operator[SEP] , identifier[LOADTHRESHOLD_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[autoScalingThresholds] operator[SEP] identifier[getAlarms] operator[SEP] operator[SEP] , identifier[ALARMS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static CopyState getCopyState(final HttpURLConnection request) throws URISyntaxException, ParseException { String copyStatusString = request.getHeaderField(Constants.HeaderConstants.COPY_STATUS); if (!Utility.isNullOrEmpty(copyStatusString)) { final CopyState copyState = new CopyState(); copyState.setStatus(CopyStatus.parse(copyStatusString)); copyState.setCopyId(request.getHeaderField(Constants.HeaderConstants.COPY_ID)); copyState.setStatusDescription(request.getHeaderField(Constants.HeaderConstants.COPY_STATUS_DESCRIPTION)); final String copyProgressString = request.getHeaderField(Constants.HeaderConstants.COPY_PROGRESS); if (!Utility.isNullOrEmpty(copyProgressString)) { String[] progressSequence = copyProgressString.split("/"); copyState.setBytesCopied(Long.parseLong(progressSequence[0])); copyState.setTotalBytes(Long.parseLong(progressSequence[1])); } final String copySourceString = request.getHeaderField(Constants.HeaderConstants.COPY_SOURCE); if (!Utility.isNullOrEmpty(copySourceString)) { copyState.setSource(new URI(copySourceString)); } final String copyCompletionTimeString = request.getHeaderField(Constants.HeaderConstants.COPY_COMPLETION_TIME); if (!Utility.isNullOrEmpty(copyCompletionTimeString)) { copyState.setCompletionTime(Utility.parseRFC1123DateFromStringInGMT(copyCompletionTimeString)); } return copyState; } else { return null; } }
class class_name[name] begin[{] method[getCopyState, return_type[type[CopyState]], modifier[public static], parameter[request]] begin[{] local_variable[type[String], copyStatusString] if[call[Utility.isNullOrEmpty, parameter[member[.copyStatusString]]]] begin[{] local_variable[type[CopyState], copyState] call[copyState.setStatus, parameter[call[CopyStatus.parse, parameter[member[.copyStatusString]]]]] call[copyState.setCopyId, parameter[call[request.getHeaderField, parameter[member[Constants.HeaderConstants.COPY_ID]]]]] call[copyState.setStatusDescription, parameter[call[request.getHeaderField, parameter[member[Constants.HeaderConstants.COPY_STATUS_DESCRIPTION]]]]] local_variable[type[String], copyProgressString] if[call[Utility.isNullOrEmpty, parameter[member[.copyProgressString]]]] begin[{] local_variable[type[String], progressSequence] call[copyState.setBytesCopied, parameter[call[Long.parseLong, parameter[member[.progressSequence]]]]] call[copyState.setTotalBytes, parameter[call[Long.parseLong, parameter[member[.progressSequence]]]]] else begin[{] None end[}] local_variable[type[String], copySourceString] if[call[Utility.isNullOrEmpty, parameter[member[.copySourceString]]]] begin[{] call[copyState.setSource, parameter[ClassCreator(arguments=[MemberReference(member=copySourceString, 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=URI, sub_type=None))]] else begin[{] None end[}] local_variable[type[String], copyCompletionTimeString] if[call[Utility.isNullOrEmpty, parameter[member[.copyCompletionTimeString]]]] begin[{] call[copyState.setCompletionTime, parameter[call[Utility.parseRFC1123DateFromStringInGMT, parameter[member[.copyCompletionTimeString]]]]] else begin[{] None end[}] return[member[.copyState]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[CopyState] identifier[getCopyState] operator[SEP] Keyword[final] identifier[HttpURLConnection] identifier[request] operator[SEP] Keyword[throws] identifier[URISyntaxException] , identifier[ParseException] { identifier[String] identifier[copyStatusString] operator[=] identifier[request] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[COPY_STATUS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Utility] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[copyStatusString] operator[SEP] operator[SEP] { Keyword[final] identifier[CopyState] identifier[copyState] operator[=] Keyword[new] identifier[CopyState] operator[SEP] operator[SEP] operator[SEP] identifier[copyState] operator[SEP] identifier[setStatus] operator[SEP] identifier[CopyStatus] operator[SEP] identifier[parse] operator[SEP] identifier[copyStatusString] operator[SEP] operator[SEP] operator[SEP] identifier[copyState] operator[SEP] identifier[setCopyId] operator[SEP] identifier[request] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[COPY_ID] operator[SEP] operator[SEP] operator[SEP] identifier[copyState] operator[SEP] identifier[setStatusDescription] operator[SEP] identifier[request] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[COPY_STATUS_DESCRIPTION] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[copyProgressString] operator[=] identifier[request] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[COPY_PROGRESS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Utility] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[copyProgressString] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[progressSequence] operator[=] identifier[copyProgressString] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[copyState] operator[SEP] identifier[setBytesCopied] operator[SEP] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[progressSequence] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[copyState] operator[SEP] identifier[setTotalBytes] operator[SEP] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[progressSequence] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[copySourceString] operator[=] identifier[request] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[COPY_SOURCE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Utility] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[copySourceString] operator[SEP] operator[SEP] { identifier[copyState] operator[SEP] identifier[setSource] operator[SEP] Keyword[new] identifier[URI] operator[SEP] identifier[copySourceString] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[copyCompletionTimeString] operator[=] identifier[request] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[COPY_COMPLETION_TIME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Utility] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[copyCompletionTimeString] operator[SEP] operator[SEP] { identifier[copyState] operator[SEP] identifier[setCompletionTime] operator[SEP] identifier[Utility] operator[SEP] identifier[parseRFC1123DateFromStringInGMT] operator[SEP] identifier[copyCompletionTimeString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[copyState] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public static JsonToken peekToken(JsonParser par) throws IOException { JsonToken token = par.getCurrentToken(); if (token == null || token == JsonToken.FIELD_NAME) { token = par.nextToken(); } return token; }
class class_name[name] begin[{] method[peekToken, return_type[type[JsonToken]], modifier[public static], parameter[par]] begin[{] local_variable[type[JsonToken], token] if[binary_operation[binary_operation[member[.token], ==, literal[null]], ||, binary_operation[member[.token], ==, member[JsonToken.FIELD_NAME]]]] begin[{] assign[member[.token], call[par.nextToken, parameter[]]] else begin[{] None end[}] return[member[.token]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JsonToken] identifier[peekToken] operator[SEP] identifier[JsonParser] identifier[par] operator[SEP] Keyword[throws] identifier[IOException] { identifier[JsonToken] identifier[token] operator[=] identifier[par] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[==] Other[null] operator[||] identifier[token] operator[==] identifier[JsonToken] operator[SEP] identifier[FIELD_NAME] operator[SEP] { identifier[token] operator[=] identifier[par] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[token] operator[SEP] }
public void setItems(java.util.Collection<Item> items) { if (items == null) { this.items = null; return; } this.items = new java.util.ArrayList<Item>(items); }
class class_name[name] begin[{] method[setItems, return_type[void], modifier[public], parameter[items]] begin[{] if[binary_operation[member[.items], ==, literal[null]]] begin[{] assign[THIS[member[None.items]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.items]], ClassCreator(arguments=[MemberReference(member=items, 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=Item, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setItems] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[Item] operator[>] identifier[items] operator[SEP] { Keyword[if] operator[SEP] identifier[items] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[items] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[items] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[Item] operator[>] operator[SEP] identifier[items] operator[SEP] operator[SEP] }
public B setTitle(String title) { if(title == null) { title = ""; } this.title = title; return self(); }
class class_name[name] begin[{] method[setTitle, return_type[type[B]], modifier[public], parameter[title]] begin[{] if[binary_operation[member[.title], ==, literal[null]]] begin[{] assign[member[.title], literal[""]] else begin[{] None end[}] assign[THIS[member[None.title]], member[.title]] return[call[.self, parameter[]]] end[}] END[}]
Keyword[public] identifier[B] identifier[setTitle] operator[SEP] identifier[String] identifier[title] operator[SEP] { Keyword[if] operator[SEP] identifier[title] operator[==] Other[null] operator[SEP] { identifier[title] operator[=] literal[String] operator[SEP] } Keyword[this] operator[SEP] identifier[title] operator[=] identifier[title] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP] }
public void destroy() { for (Socket socket : sockets) { destroySocket(socket); } sockets.clear(); for (Selector selector : selectors) { context.close(selector); } selectors.clear(); // Only terminate context if we are on the main thread if (isMain()) { context.term(); } }
class class_name[name] begin[{] method[destroy, return_type[void], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=socket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=destroySocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sockets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=socket)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Socket, sub_type=None))), label=None) call[sockets.clear, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=selectors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=selector)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Selector, sub_type=None))), label=None) call[selectors.clear, parameter[]] if[call[.isMain, parameter[]]] begin[{] call[context.term, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[destroy] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Socket] identifier[socket] operator[:] identifier[sockets] operator[SEP] { identifier[destroySocket] operator[SEP] identifier[socket] operator[SEP] operator[SEP] } identifier[sockets] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Selector] identifier[selector] operator[:] identifier[selectors] operator[SEP] { identifier[context] operator[SEP] identifier[close] operator[SEP] identifier[selector] operator[SEP] operator[SEP] } identifier[selectors] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isMain] operator[SEP] operator[SEP] operator[SEP] { identifier[context] operator[SEP] identifier[term] operator[SEP] operator[SEP] operator[SEP] } }
@Override protected int handleGetYearLength(int extendedYear) { int length =0; if (cType == CalculationType.ISLAMIC_CIVIL || cType == CalculationType.ISLAMIC_TBLA || (cType == CalculationType.ISLAMIC_UMALQURA && (extendedYear < UMALQURA_YEAR_START || extendedYear > UMALQURA_YEAR_END) )) { length = 354 + (civilLeapYear(extendedYear) ? 1 : 0); } else if (cType == CalculationType.ISLAMIC) { int month = 12*(extendedYear-1); length = (int)(trueMonthStart(month + 12) - trueMonthStart(month)); } else if (cType == CalculationType.ISLAMIC_UMALQURA) { for(int i=0; i<12; i++) length += handleGetMonthLength(extendedYear, i); } return length; }
class class_name[name] begin[{] method[handleGetYearLength, return_type[type[int]], modifier[protected], parameter[extendedYear]] begin[{] local_variable[type[int], length] if[binary_operation[binary_operation[binary_operation[member[.cType], ==, member[CalculationType.ISLAMIC_CIVIL]], ||, binary_operation[member[.cType], ==, member[CalculationType.ISLAMIC_TBLA]]], ||, binary_operation[binary_operation[member[.cType], ==, member[CalculationType.ISLAMIC_UMALQURA]], &&, binary_operation[binary_operation[member[.extendedYear], <, member[.UMALQURA_YEAR_START]], ||, binary_operation[member[.extendedYear], >, member[.UMALQURA_YEAR_END]]]]]] begin[{] assign[member[.length], binary_operation[literal[354], +, TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=extendedYear, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=civilLeapYear, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]] else begin[{] if[binary_operation[member[.cType], ==, member[CalculationType.ISLAMIC]]] begin[{] local_variable[type[int], month] assign[member[.length], Cast(expression=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=month, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=+)], member=trueMonthStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=month, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trueMonthStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=-), type=BasicType(dimensions=[], name=int))] else begin[{] if[binary_operation[member[.cType], ==, member[CalculationType.ISLAMIC_UMALQURA]]] begin[{] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=extendedYear, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleGetMonthLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] end[}] end[}] return[member[.length]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[int] identifier[handleGetYearLength] operator[SEP] Keyword[int] identifier[extendedYear] operator[SEP] { Keyword[int] identifier[length] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[cType] operator[==] identifier[CalculationType] operator[SEP] identifier[ISLAMIC_CIVIL] operator[||] identifier[cType] operator[==] identifier[CalculationType] operator[SEP] identifier[ISLAMIC_TBLA] operator[||] operator[SEP] identifier[cType] operator[==] identifier[CalculationType] operator[SEP] identifier[ISLAMIC_UMALQURA] operator[&&] operator[SEP] identifier[extendedYear] operator[<] identifier[UMALQURA_YEAR_START] operator[||] identifier[extendedYear] operator[>] identifier[UMALQURA_YEAR_END] operator[SEP] operator[SEP] operator[SEP] { identifier[length] operator[=] Other[354] operator[+] operator[SEP] identifier[civilLeapYear] operator[SEP] identifier[extendedYear] operator[SEP] operator[?] Other[1] operator[:] Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[cType] operator[==] identifier[CalculationType] operator[SEP] identifier[ISLAMIC] operator[SEP] { Keyword[int] identifier[month] operator[=] Other[12] operator[*] operator[SEP] identifier[extendedYear] operator[-] Other[1] operator[SEP] operator[SEP] identifier[length] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[trueMonthStart] operator[SEP] identifier[month] operator[+] Other[12] operator[SEP] operator[-] identifier[trueMonthStart] operator[SEP] identifier[month] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[cType] operator[==] identifier[CalculationType] operator[SEP] identifier[ISLAMIC_UMALQURA] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Other[12] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[length] operator[+=] identifier[handleGetMonthLength] operator[SEP] identifier[extendedYear] , identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[length] operator[SEP] }
public String convertIfcThermalLoadTypeEnumToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertIfcThermalLoadTypeEnumToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertIfcThermalLoadTypeEnumToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private int guessTransactionsLength() { if (transactionBytesValid) return payload.length - HEADER_SIZE; if (transactions == null) return 0; int len = VarInt.sizeOf(transactions.size()); for (Transaction tx : transactions) { // 255 is just a guess at an average tx length len += tx.length == UNKNOWN_LENGTH ? 255 : tx.length; } return len; }
class class_name[name] begin[{] method[guessTransactionsLength, return_type[type[int]], modifier[private], parameter[]] begin[{] if[member[.transactionBytesValid]] begin[{] return[binary_operation[member[payload.length], -, member[.HEADER_SIZE]]] else begin[{] None end[}] if[binary_operation[member[.transactions], ==, literal[null]]] begin[{] return[literal[0]] else begin[{] None end[}] local_variable[type[int], len] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tx, selectors=[]), operandr=MemberReference(member=UNKNOWN_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tx, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=transactions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Transaction, sub_type=None))), label=None) return[member[.len]] end[}] END[}]
Keyword[private] Keyword[int] identifier[guessTransactionsLength] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[transactionBytesValid] operator[SEP] Keyword[return] identifier[payload] operator[SEP] identifier[length] operator[-] identifier[HEADER_SIZE] operator[SEP] Keyword[if] operator[SEP] identifier[transactions] operator[==] Other[null] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[VarInt] operator[SEP] identifier[sizeOf] operator[SEP] identifier[transactions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Transaction] identifier[tx] operator[:] identifier[transactions] operator[SEP] { identifier[len] operator[+=] identifier[tx] operator[SEP] identifier[length] operator[==] identifier[UNKNOWN_LENGTH] operator[?] Other[255] operator[:] identifier[tx] operator[SEP] identifier[length] operator[SEP] } Keyword[return] identifier[len] operator[SEP] }
public Symbol resolveBinaryNameOrIdent(String name) { try { Name flatname = names.fromString(name.replace("/", ".")); return reader.loadClass(flatname); } catch (CompletionFailure ignore) { return resolveIdent(name); } }
class class_name[name] begin[{] method[resolveBinaryNameOrIdent, return_type[type[Symbol]], modifier[public], parameter[name]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)], member=fromString, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), name=flatname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Name, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=flatname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveIdent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['CompletionFailure']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Symbol] identifier[resolveBinaryNameOrIdent] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[try] { identifier[Name] identifier[flatname] operator[=] identifier[names] operator[SEP] identifier[fromString] operator[SEP] identifier[name] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[reader] operator[SEP] identifier[loadClass] operator[SEP] identifier[flatname] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CompletionFailure] identifier[ignore] operator[SEP] { Keyword[return] identifier[resolveIdent] operator[SEP] identifier[name] operator[SEP] operator[SEP] } }
public Hash deleteUser(int userId) throws AuthyException { final Response response = this.post(DELETE_USER_PATH + Integer.toString(userId), null); return instanceFromJson(response.getStatus(), response.getBody()); }
class class_name[name] begin[{] method[deleteUser, return_type[type[Hash]], modifier[public], parameter[userId]] begin[{] local_variable[type[Response], response] return[call[.instanceFromJson, parameter[call[response.getStatus, parameter[]], call[response.getBody, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[Hash] identifier[deleteUser] operator[SEP] Keyword[int] identifier[userId] operator[SEP] Keyword[throws] identifier[AuthyException] { Keyword[final] identifier[Response] identifier[response] operator[=] Keyword[this] operator[SEP] identifier[post] operator[SEP] identifier[DELETE_USER_PATH] operator[+] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[userId] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[instanceFromJson] operator[SEP] identifier[response] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[response] operator[SEP] identifier[getBody] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public EClass getServerSettings() { if (serverSettingsEClass == null) { serverSettingsEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(StorePackage.eNS_URI).getEClassifiers().get(9); } return serverSettingsEClass; }
class class_name[name] begin[{] method[getServerSettings, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.serverSettingsEClass], ==, literal[null]]] begin[{] assign[member[.serverSettingsEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=StorePackage, 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=9)], 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[.serverSettingsEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getServerSettings] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[serverSettingsEClass] operator[==] Other[null] operator[SEP] { identifier[serverSettingsEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[StorePackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[9] operator[SEP] operator[SEP] } Keyword[return] identifier[serverSettingsEClass] operator[SEP] }
public void checkPropertyValueOrTransition(String propertyValueOrTransition, double maxTime) throws QTasteDataException, QTasteTestFailException { long beginTime_ms = System.currentTimeMillis(); long maxTime_ms = Math.round(maxTime * 1000); propertyValueOrTransition = propertyValueOrTransition.toLowerCase(); String[] splitted = propertyValueOrTransition.split(" *: *", 2); if (splitted.length != 2) { throw new QTasteDataException("Invalid syntax"); } String property = splitted[0]; if (property.length() == 0) { throw new QTasteDataException("Invalid syntax"); } String transition = splitted[1]; boolean mustBeAtBegin = transition.matches("^\\[.*"); if (mustBeAtBegin) { transition = transition.replaceFirst("^\\[ *", ""); } boolean mustBeAtEnd = transition.matches(".*\\]$"); if (mustBeAtEnd) { transition = transition.replaceFirst(" *\\]$", ""); } String[] values = transition.split(" *-> *"); if ((values.length != 1) && (values.length != 2)) { throw new QTasteDataException("Invalid syntax"); } String expectedValueOrTransition = propertyValueOrTransition.replaceFirst(".*?: *", ""); long remainingTime_ms = maxTime_ms - (System.currentTimeMillis() - beginTime_ms); checkPropertyValueOrTransition(property, values, mustBeAtBegin, mustBeAtEnd, remainingTime_ms, expectedValueOrTransition); }
class class_name[name] begin[{] method[checkPropertyValueOrTransition, return_type[void], modifier[public], parameter[propertyValueOrTransition, maxTime]] begin[{] local_variable[type[long], beginTime_ms] local_variable[type[long], maxTime_ms] assign[member[.propertyValueOrTransition], call[propertyValueOrTransition.toLowerCase, parameter[]]] local_variable[type[String], splitted] if[binary_operation[member[splitted.length], !=, literal[2]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid syntax")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QTasteDataException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], property] if[binary_operation[call[property.length, parameter[]], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid syntax")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QTasteDataException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], transition] local_variable[type[boolean], mustBeAtBegin] if[member[.mustBeAtBegin]] begin[{] assign[member[.transition], call[transition.replaceFirst, parameter[literal["^\\[ *"], literal[""]]]] else begin[{] None end[}] local_variable[type[boolean], mustBeAtEnd] if[member[.mustBeAtEnd]] begin[{] assign[member[.transition], call[transition.replaceFirst, parameter[literal[" *\\]$"], literal[""]]]] else begin[{] None end[}] local_variable[type[String], values] if[binary_operation[binary_operation[member[values.length], !=, literal[1]], &&, binary_operation[member[values.length], !=, literal[2]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid syntax")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QTasteDataException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], expectedValueOrTransition] local_variable[type[long], remainingTime_ms] call[.checkPropertyValueOrTransition, parameter[member[.property], member[.values], member[.mustBeAtBegin], member[.mustBeAtEnd], member[.remainingTime_ms], member[.expectedValueOrTransition]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[checkPropertyValueOrTransition] operator[SEP] identifier[String] identifier[propertyValueOrTransition] , Keyword[double] identifier[maxTime] operator[SEP] Keyword[throws] identifier[QTasteDataException] , identifier[QTasteTestFailException] { Keyword[long] identifier[beginTime_ms] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[maxTime_ms] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[maxTime] operator[*] Other[1000] operator[SEP] operator[SEP] identifier[propertyValueOrTransition] operator[=] identifier[propertyValueOrTransition] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[splitted] operator[=] identifier[propertyValueOrTransition] operator[SEP] identifier[split] operator[SEP] literal[String] , Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[splitted] operator[SEP] identifier[length] operator[!=] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[QTasteDataException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[property] operator[=] identifier[splitted] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[QTasteDataException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[transition] operator[=] identifier[splitted] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[boolean] identifier[mustBeAtBegin] operator[=] identifier[transition] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mustBeAtBegin] operator[SEP] { identifier[transition] operator[=] identifier[transition] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[boolean] identifier[mustBeAtEnd] operator[=] identifier[transition] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mustBeAtEnd] operator[SEP] { identifier[transition] operator[=] identifier[transition] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[transition] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[!=] Other[1] operator[SEP] operator[&&] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[!=] Other[2] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[QTasteDataException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[expectedValueOrTransition] operator[=] identifier[propertyValueOrTransition] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[long] identifier[remainingTime_ms] operator[=] identifier[maxTime_ms] operator[-] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[beginTime_ms] operator[SEP] operator[SEP] identifier[checkPropertyValueOrTransition] operator[SEP] identifier[property] , identifier[values] , identifier[mustBeAtBegin] , identifier[mustBeAtEnd] , identifier[remainingTime_ms] , identifier[expectedValueOrTransition] operator[SEP] operator[SEP] }
@Override protected View createOverlayView() { LinearLayout ll = new LinearLayout(getContext()); ll.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT)); ll.setGravity(Gravity.CENTER); View progressBar = createProgressBar(); ll.addView(progressBar); return ll; }
class class_name[name] begin[{] method[createOverlayView, return_type[type[View]], modifier[protected], parameter[]] begin[{] local_variable[type[LinearLayout], ll] call[ll.setLayoutParams, parameter[ClassCreator(arguments=[MemberReference(member=MATCH_PARENT, postfix_operators=[], prefix_operators=[], qualifier=FrameLayout.LayoutParams, selectors=[]), MemberReference(member=MATCH_PARENT, postfix_operators=[], prefix_operators=[], qualifier=FrameLayout.LayoutParams, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FrameLayout, sub_type=ReferenceType(arguments=None, dimensions=None, name=LayoutParams, sub_type=None)))]] call[ll.setGravity, parameter[member[Gravity.CENTER]]] local_variable[type[View], progressBar] call[ll.addView, parameter[member[.progressBar]]] return[member[.ll]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[View] identifier[createOverlayView] operator[SEP] operator[SEP] { identifier[LinearLayout] identifier[ll] operator[=] Keyword[new] identifier[LinearLayout] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ll] operator[SEP] identifier[setLayoutParams] operator[SEP] Keyword[new] identifier[FrameLayout] operator[SEP] identifier[LayoutParams] operator[SEP] identifier[FrameLayout] operator[SEP] identifier[LayoutParams] operator[SEP] identifier[MATCH_PARENT] , identifier[FrameLayout] operator[SEP] identifier[LayoutParams] operator[SEP] identifier[MATCH_PARENT] operator[SEP] operator[SEP] operator[SEP] identifier[ll] operator[SEP] identifier[setGravity] operator[SEP] identifier[Gravity] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] identifier[View] identifier[progressBar] operator[=] identifier[createProgressBar] operator[SEP] operator[SEP] operator[SEP] identifier[ll] operator[SEP] identifier[addView] operator[SEP] identifier[progressBar] operator[SEP] operator[SEP] Keyword[return] identifier[ll] operator[SEP] }
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "quantityType") public JAXBElement<StringOrRefType> createQuantityType(StringOrRefType value) { return new JAXBElement<StringOrRefType>(_QuantityType_QNAME, StringOrRefType.class, null, value); }
class class_name[name] begin[{] method[createQuantityType, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_QuantityType_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringOrRefType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StringOrRefType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[StringOrRefType] operator[>] identifier[createQuantityType] operator[SEP] identifier[StringOrRefType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[StringOrRefType] operator[>] operator[SEP] identifier[_QuantityType_QNAME] , identifier[StringOrRefType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
@Override public void restoreState(final FacesContext context, final Object state) { if (state == null) { return; } final Object values[] = (Object[]) state; super.restoreState(context, values[0]); final Object restoredSubmittedValues = values[1]; final Object restoredLocalValues = values[2]; final Object restoredInvalidUpdates = values[3]; final Object restoredColMappings = values[4]; final Object restoredSortedList = values[5]; final Object restoredRowMap = values[6]; final Object restoredRowNumbers = values[7]; if (restoredSubmittedValues == null) { submittedValues.clear(); } else { submittedValues = (Map<SheetRowColIndex, String>) restoredSubmittedValues; } if (restoredLocalValues == null) { localValues.clear(); } else { localValues = (Map<SheetRowColIndex, Object>) restoredLocalValues; } if (restoredInvalidUpdates == null) { getInvalidUpdates().clear(); } else { invalidUpdates = (List<SheetInvalidUpdate>) restoredInvalidUpdates; } if (restoredColMappings == null) { columnMapping = null; } else { columnMapping = (Map<Integer, Integer>) restoredColMappings; } if (restoredSortedList == null) { getFilteredValue().clear(); } else { setFilteredValue((List<Object>) restoredSortedList); } if (restoredRowMap == null) { rowMap = null; } else { rowMap = (Map<String, Object>) restoredRowMap; } if (restoredRowNumbers == null) { rowNumbers = null; } else { rowNumbers = (Map<String, Integer>) restoredRowNumbers; } }
class class_name[name] begin[{] method[restoreState, return_type[void], modifier[public], parameter[context, state]] begin[{] if[binary_operation[member[.state], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Object], values] SuperMethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=restoreState, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) local_variable[type[Object], restoredSubmittedValues] local_variable[type[Object], restoredLocalValues] local_variable[type[Object], restoredInvalidUpdates] local_variable[type[Object], restoredColMappings] local_variable[type[Object], restoredSortedList] local_variable[type[Object], restoredRowMap] local_variable[type[Object], restoredRowNumbers] if[binary_operation[member[.restoredSubmittedValues], ==, literal[null]]] begin[{] call[submittedValues.clear, parameter[]] else begin[{] assign[member[.submittedValues], Cast(expression=MemberReference(member=restoredSubmittedValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SheetRowColIndex, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Map, sub_type=None))] end[}] if[binary_operation[member[.restoredLocalValues], ==, literal[null]]] begin[{] call[localValues.clear, parameter[]] else begin[{] assign[member[.localValues], Cast(expression=MemberReference(member=restoredLocalValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SheetRowColIndex, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))] end[}] if[binary_operation[member[.restoredInvalidUpdates], ==, literal[null]]] begin[{] call[.getInvalidUpdates, parameter[]] else begin[{] assign[member[.invalidUpdates], Cast(expression=MemberReference(member=restoredInvalidUpdates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SheetInvalidUpdate, sub_type=None))], dimensions=[], name=List, sub_type=None))] end[}] if[binary_operation[member[.restoredColMappings], ==, literal[null]]] begin[{] assign[member[.columnMapping], literal[null]] else begin[{] assign[member[.columnMapping], Cast(expression=MemberReference(member=restoredColMappings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=Map, sub_type=None))] end[}] if[binary_operation[member[.restoredSortedList], ==, literal[null]]] begin[{] call[.getFilteredValue, parameter[]] else begin[{] call[.setFilteredValue, parameter[Cast(expression=MemberReference(member=restoredSortedList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None))]] end[}] if[binary_operation[member[.restoredRowMap], ==, literal[null]]] begin[{] assign[member[.rowMap], literal[null]] else begin[{] assign[member[.rowMap], Cast(expression=MemberReference(member=restoredRowMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))] end[}] if[binary_operation[member[.restoredRowNumbers], ==, literal[null]]] begin[{] assign[member[.rowNumbers], literal[null]] else begin[{] assign[member[.rowNumbers], Cast(expression=MemberReference(member=restoredRowNumbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=Map, sub_type=None))] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[restoreState] operator[SEP] Keyword[final] identifier[FacesContext] identifier[context] , Keyword[final] identifier[Object] identifier[state] operator[SEP] { Keyword[if] operator[SEP] identifier[state] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] identifier[Object] identifier[values] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] Keyword[super] operator[SEP] identifier[restoreState] operator[SEP] identifier[context] , identifier[values] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[restoredSubmittedValues] operator[=] identifier[values] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[restoredLocalValues] operator[=] identifier[values] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[restoredInvalidUpdates] operator[=] identifier[values] operator[SEP] Other[3] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[restoredColMappings] operator[=] identifier[values] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[restoredSortedList] operator[=] identifier[values] operator[SEP] Other[5] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[restoredRowMap] operator[=] identifier[values] operator[SEP] Other[6] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[restoredRowNumbers] operator[=] identifier[values] operator[SEP] Other[7] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[restoredSubmittedValues] operator[==] Other[null] operator[SEP] { identifier[submittedValues] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[submittedValues] operator[=] operator[SEP] identifier[Map] operator[<] identifier[SheetRowColIndex] , identifier[String] operator[>] operator[SEP] identifier[restoredSubmittedValues] operator[SEP] } Keyword[if] operator[SEP] identifier[restoredLocalValues] operator[==] Other[null] operator[SEP] { identifier[localValues] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[localValues] operator[=] operator[SEP] identifier[Map] operator[<] identifier[SheetRowColIndex] , identifier[Object] operator[>] operator[SEP] identifier[restoredLocalValues] operator[SEP] } Keyword[if] operator[SEP] identifier[restoredInvalidUpdates] operator[==] Other[null] operator[SEP] { identifier[getInvalidUpdates] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[invalidUpdates] operator[=] operator[SEP] identifier[List] operator[<] identifier[SheetInvalidUpdate] operator[>] operator[SEP] identifier[restoredInvalidUpdates] operator[SEP] } Keyword[if] operator[SEP] identifier[restoredColMappings] operator[==] Other[null] operator[SEP] { identifier[columnMapping] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[columnMapping] operator[=] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] operator[SEP] identifier[restoredColMappings] operator[SEP] } Keyword[if] operator[SEP] identifier[restoredSortedList] operator[==] Other[null] operator[SEP] { identifier[getFilteredValue] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[setFilteredValue] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] operator[SEP] identifier[restoredSortedList] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[restoredRowMap] operator[==] Other[null] operator[SEP] { identifier[rowMap] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[rowMap] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[restoredRowMap] operator[SEP] } Keyword[if] operator[SEP] identifier[restoredRowNumbers] operator[==] Other[null] operator[SEP] { identifier[rowNumbers] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[rowNumbers] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] operator[SEP] identifier[restoredRowNumbers] operator[SEP] } }
public void setFNMCnt(Integer newFNMCnt) { Integer oldFNMCnt = fnmCnt; fnmCnt = newFNMCnt; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.FNIRG__FNM_CNT, oldFNMCnt, fnmCnt)); }
class class_name[name] begin[{] method[setFNMCnt, return_type[void], modifier[public], parameter[newFNMCnt]] begin[{] local_variable[type[Integer], oldFNMCnt] assign[member[.fnmCnt], member[.newFNMCnt]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=FNIRG__FNM_CNT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldFNMCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fnmCnt, 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=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFNMCnt] operator[SEP] identifier[Integer] identifier[newFNMCnt] operator[SEP] { identifier[Integer] identifier[oldFNMCnt] operator[=] identifier[fnmCnt] operator[SEP] identifier[fnmCnt] operator[=] identifier[newFNMCnt] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[FNIRG__FNM_CNT] , identifier[oldFNMCnt] , identifier[fnmCnt] operator[SEP] operator[SEP] operator[SEP] }
public static ContentMatcher getInstance(String xmlFileName) { ContentMatcher cm = new ContentMatcher(); // Load the pattern definitions from an XML file try { cm.loadXMLPatternDefinitions(cm.getClass().getResourceAsStream(xmlFileName)); } catch (JDOMException | IOException ex) { throw new IllegalArgumentException("Failed to initialize the ContentMatcher object using: " + xmlFileName, ex); } return cm; }
class class_name[name] begin[{] method[getInstance, return_type[type[ContentMatcher]], modifier[public static], parameter[xmlFileName]] begin[{] local_variable[type[ContentMatcher], cm] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[MethodInvocation(arguments=[MemberReference(member=xmlFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResourceAsStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=loadXMLPatternDefinitions, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to initialize the ContentMatcher object using: "), operandr=MemberReference(member=xmlFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['JDOMException', 'IOException']))], finally_block=None, label=None, resources=None) return[member[.cm]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ContentMatcher] identifier[getInstance] operator[SEP] identifier[String] identifier[xmlFileName] operator[SEP] { identifier[ContentMatcher] identifier[cm] operator[=] Keyword[new] identifier[ContentMatcher] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[cm] operator[SEP] identifier[loadXMLPatternDefinitions] operator[SEP] identifier[cm] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[xmlFileName] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JDOMException] operator[|] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[xmlFileName] , identifier[ex] operator[SEP] operator[SEP] } Keyword[return] identifier[cm] operator[SEP] }
public ADDRESST unregisterParticipant(ADDRESST address, EventListener entity) { synchronized (mutex()) { removeListener(address); this.participants.remove(entity.getID(), address); } return address; }
class class_name[name] begin[{] method[unregisterParticipant, return_type[type[ADDRESST]], modifier[public], parameter[address, entity]] begin[{] SYNCHRONIZED[call[.mutex, parameter[]]] BEGIN[{] call[.removeListener, parameter[member[.address]]] THIS[member[None.participants]call[None.remove, parameter[call[entity.getID, parameter[]], member[.address]]]] END[}] return[member[.address]] end[}] END[}]
Keyword[public] identifier[ADDRESST] identifier[unregisterParticipant] operator[SEP] identifier[ADDRESST] identifier[address] , identifier[EventListener] identifier[entity] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[mutex] operator[SEP] operator[SEP] operator[SEP] { identifier[removeListener] operator[SEP] identifier[address] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[participants] operator[SEP] identifier[remove] operator[SEP] identifier[entity] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[address] operator[SEP] operator[SEP] } Keyword[return] identifier[address] operator[SEP] }
@Override public ArrayList<String> calcTypeaheadMatches(String filter, int limit) { // Get HDFS configuration Configuration conf = PersistHdfs.CONF; // Hack around s3:// // filter = convertS3toS3N(filter); // Handle S3N bare buckets - s3n://bucketname should be suffixed by '/' // or underlying Jets3n will throw NPE. filter name should be s3n://bucketname/ if (isBareS3NBucketWithoutTrailingSlash(filter)) { filter += "/"; } // Output matches ArrayList<String> array = new ArrayList<String>(); { // Filter out partials which are known to print out useless stack traces. String s = filter.toLowerCase(); if ("hdfs:".equals(s)) return array; if ("maprfs:".equals(s)) return array; } try { Path p = new Path(filter); Path expand = p; if( !filter.endsWith("/") ) expand = p.getParent(); FileSystem fs = FileSystem.get(p.toUri(), conf); for( FileStatus file : fs.listStatus(expand) ) { Path fp = file.getPath(); if( fp.toString().startsWith(p.toString()) ) { array.add(fp.toString()); } if( array.size() == limit) break; } } catch (Exception e) { Log.trace(e); } catch (Throwable t) { Log.warn(t); } return array; }
class class_name[name] begin[{] method[calcTypeaheadMatches, return_type[type[ArrayList]], modifier[public], parameter[filter, limit]] begin[{] local_variable[type[Configuration], conf] if[call[.isBareS3NBucketWithoutTrailingSlash, parameter[member[.filter]]]] begin[{] assign[member[.filter], literal["/"]] else begin[{] None end[}] local_variable[type[ArrayList], array] local_variable[type[String], s] if[literal["hdfs:"]] begin[{] return[member[.array]] else begin[{] None end[}] if[literal["maprfs:"]] begin[{] return[member[.array]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=filter, 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=Path, sub_type=None)), name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=expand)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=endsWith, postfix_operators=[], prefix_operators=['!'], qualifier=filter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=expand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toUri, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=FileSystem, selectors=[], type_arguments=None), name=fs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileSystem, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), name=fp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=fp, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=fp, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[], type_arguments=None), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=expand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listStatus, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileStatus, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) return[member[.array]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[calcTypeaheadMatches] operator[SEP] identifier[String] identifier[filter] , Keyword[int] identifier[limit] operator[SEP] { identifier[Configuration] identifier[conf] operator[=] identifier[PersistHdfs] operator[SEP] identifier[CONF] operator[SEP] Keyword[if] operator[SEP] identifier[isBareS3NBucketWithoutTrailingSlash] operator[SEP] identifier[filter] operator[SEP] operator[SEP] { identifier[filter] operator[+=] literal[String] operator[SEP] } identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[array] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[s] operator[=] identifier[filter] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[return] identifier[array] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[return] identifier[array] operator[SEP] } Keyword[try] { identifier[Path] identifier[p] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[Path] identifier[expand] operator[=] identifier[p] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[filter] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[expand] operator[=] identifier[p] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[FileSystem] identifier[fs] operator[=] identifier[FileSystem] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] , identifier[conf] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FileStatus] identifier[file] operator[:] identifier[fs] operator[SEP] identifier[listStatus] operator[SEP] identifier[expand] operator[SEP] operator[SEP] { identifier[Path] identifier[fp] operator[=] identifier[file] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fp] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[p] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[array] operator[SEP] identifier[add] operator[SEP] identifier[fp] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[array] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[limit] operator[SEP] Keyword[break] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[trace] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[Log] operator[SEP] identifier[warn] operator[SEP] identifier[t] operator[SEP] operator[SEP] } Keyword[return] identifier[array] operator[SEP] }
public static byte[] readResourceBytes(String resourceName) { InputStream is = Util.class.getResourceAsStream(resourceName); try { return bytes(is); } catch (IOException e) { throw new RuntimeException(e); } finally { closeQuietly(is); } }
class class_name[name] begin[{] method[readResourceBytes, return_type[type[byte]], modifier[public static], parameter[resourceName]] begin[{] local_variable[type[InputStream], is] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[readResourceBytes] operator[SEP] identifier[String] identifier[resourceName] operator[SEP] { identifier[InputStream] identifier[is] operator[=] identifier[Util] operator[SEP] Keyword[class] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[bytes] operator[SEP] identifier[is] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeQuietly] operator[SEP] identifier[is] operator[SEP] operator[SEP] } }
public List<VirtualMachineImageResourceInner> listSkus(String location, String publisherName, String offer) { return listSkusWithServiceResponseAsync(location, publisherName, offer).toBlocking().single().body(); }
class class_name[name] begin[{] method[listSkus, return_type[type[List]], modifier[public], parameter[location, publisherName, offer]] begin[{] return[call[.listSkusWithServiceResponseAsync, parameter[member[.location], member[.publisherName], member[.offer]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[VirtualMachineImageResourceInner] operator[>] identifier[listSkus] operator[SEP] identifier[String] identifier[location] , identifier[String] identifier[publisherName] , identifier[String] identifier[offer] operator[SEP] { Keyword[return] identifier[listSkusWithServiceResponseAsync] operator[SEP] identifier[location] , identifier[publisherName] , identifier[offer] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public void addBadValueError(final String type, final JSONValue val) throws ValidationException { addError(StringFormatter.format(MessageConstants.MESSAGES.invalidValueForType(), type, val)); }
class class_name[name] begin[{] method[addBadValueError, return_type[void], modifier[public], parameter[type, val]] begin[{] call[.addError, parameter[call[StringFormatter.format, parameter[call[MessageConstants.MESSAGES.invalidValueForType, parameter[]], member[.type], member[.val]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addBadValueError] operator[SEP] Keyword[final] identifier[String] identifier[type] , Keyword[final] identifier[JSONValue] identifier[val] operator[SEP] Keyword[throws] identifier[ValidationException] { identifier[addError] operator[SEP] identifier[StringFormatter] operator[SEP] identifier[format] operator[SEP] identifier[MessageConstants] operator[SEP] identifier[MESSAGES] operator[SEP] identifier[invalidValueForType] operator[SEP] operator[SEP] , identifier[type] , identifier[val] operator[SEP] operator[SEP] operator[SEP] }
private void addNamespace(String prefix, String uri) { prefixToURI.put(prefix, uri); uriToPrefix.put(uri, prefix); }
class class_name[name] begin[{] method[addNamespace, return_type[void], modifier[private], parameter[prefix, uri]] begin[{] call[prefixToURI.put, parameter[member[.prefix], member[.uri]]] call[uriToPrefix.put, parameter[member[.uri], member[.prefix]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addNamespace] operator[SEP] identifier[String] identifier[prefix] , identifier[String] identifier[uri] operator[SEP] { identifier[prefixToURI] operator[SEP] identifier[put] operator[SEP] identifier[prefix] , identifier[uri] operator[SEP] operator[SEP] identifier[uriToPrefix] operator[SEP] identifier[put] operator[SEP] identifier[uri] , identifier[prefix] operator[SEP] operator[SEP] }
public void setNonStrokingColor (final int c, final int m, final int y, final int k) throws IOException { if (_isOutside255Interval (c) || _isOutside255Interval (m) || _isOutside255Interval (y) || _isOutside255Interval (k)) { throw new IllegalArgumentException ("Parameters must be within 0..255, but are (" + c + "," + m + "," + y + "," + k + ")"); } setNonStrokingColor (c / 255f, m / 255f, y / 255f, k / 255f); }
class class_name[name] begin[{] method[setNonStrokingColor, return_type[void], modifier[public], parameter[c, m, y, k]] begin[{] if[binary_operation[binary_operation[binary_operation[call[._isOutside255Interval, parameter[member[.c]]], ||, call[._isOutside255Interval, parameter[member[.m]]]], ||, call[._isOutside255Interval, parameter[member[.y]]]], ||, call[._isOutside255Interval, parameter[member[.k]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameters must be within 0..255, but are ("), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[.setNonStrokingColor, parameter[binary_operation[member[.c], /, literal[255f]], binary_operation[member[.m], /, literal[255f]], binary_operation[member[.y], /, literal[255f]], binary_operation[member[.k], /, literal[255f]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setNonStrokingColor] operator[SEP] Keyword[final] Keyword[int] identifier[c] , Keyword[final] Keyword[int] identifier[m] , Keyword[final] Keyword[int] identifier[y] , Keyword[final] Keyword[int] identifier[k] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[_isOutside255Interval] operator[SEP] identifier[c] operator[SEP] operator[||] identifier[_isOutside255Interval] operator[SEP] identifier[m] operator[SEP] operator[||] identifier[_isOutside255Interval] operator[SEP] identifier[y] operator[SEP] operator[||] identifier[_isOutside255Interval] operator[SEP] identifier[k] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[c] operator[+] literal[String] operator[+] identifier[m] operator[+] literal[String] operator[+] identifier[y] operator[+] literal[String] operator[+] identifier[k] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[setNonStrokingColor] operator[SEP] identifier[c] operator[/] literal[Float] , identifier[m] operator[/] literal[Float] , identifier[y] operator[/] literal[Float] , identifier[k] operator[/] literal[Float] operator[SEP] operator[SEP] }
@Override public void visitCode(Code obj) { stack.resetForMethodEntry(this); changedAttributes.clear(); savedAttributes.clear(); super.visitCode(obj); for (Integer pc : changedAttributes.values()) { bugReporter.reportBug(new BugInstance(this, BugType.SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT.name(), NORMAL_PRIORITY).addClass(this) .addMethod(this).addSourceLine(this, pc.intValue())); } }
class class_name[name] begin[{] method[visitCode, return_type[void], modifier[public], parameter[obj]] begin[{] call[stack.resetForMethodEntry, parameter[THIS[]]] call[changedAttributes.clear, parameter[]] call[savedAttributes.clear, parameter[]] SuperMethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitCode, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=BugType.SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT, selectors=[], type_arguments=None), MemberReference(member=NORMAL_PRIORITY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[], member=intValue, postfix_operators=[], prefix_operators=[], qualifier=pc, selectors=[], type_arguments=None)], member=addSourceLine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BugInstance, sub_type=None))], member=reportBug, postfix_operators=[], prefix_operators=[], qualifier=bugReporter, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=changedAttributes, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitCode] operator[SEP] identifier[Code] identifier[obj] operator[SEP] { identifier[stack] operator[SEP] identifier[resetForMethodEntry] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[changedAttributes] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[savedAttributes] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[visitCode] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[pc] operator[:] identifier[changedAttributes] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[bugReporter] operator[SEP] identifier[reportBug] operator[SEP] Keyword[new] identifier[BugInstance] operator[SEP] Keyword[this] , identifier[BugType] operator[SEP] identifier[SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[NORMAL_PRIORITY] operator[SEP] operator[SEP] identifier[addClass] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[addMethod] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[addSourceLine] operator[SEP] Keyword[this] , identifier[pc] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static Set<Long> gatherLongPropertyFromJsonNodes(Iterable<JsonNode> jsonNodes, String propertyName) { Set<Long> result = new HashSet<Long>(); // Using a Set to filter out doubles for (JsonNode node : jsonNodes) { if (node.has(propertyName)) { Long propertyValue = node.get(propertyName).asLong(); if (propertyValue > 0) { // Just to be safe result.add(propertyValue); } } } return result; }
class class_name[name] begin[{] method[gatherLongPropertyFromJsonNodes, return_type[type[Set]], modifier[public static], parameter[jsonNodes, propertyName]] begin[{] local_variable[type[Set], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=has, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MethodInvocation(arguments=[], member=asLong, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=propertyValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=propertyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=propertyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=jsonNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonNode, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Long] operator[>] identifier[gatherLongPropertyFromJsonNodes] operator[SEP] identifier[Iterable] operator[<] identifier[JsonNode] operator[>] identifier[jsonNodes] , identifier[String] identifier[propertyName] operator[SEP] { identifier[Set] operator[<] identifier[Long] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Long] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[JsonNode] identifier[node] operator[:] identifier[jsonNodes] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[has] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] { identifier[Long] identifier[propertyValue] operator[=] identifier[node] operator[SEP] identifier[get] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] identifier[asLong] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propertyValue] operator[>] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[propertyValue] operator[SEP] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] }
private void validateServiceInstanceMetadataQuery(ServiceInstanceQuery query) throws ServiceException{ if (query == null) { throw new ServiceException(ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR, ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR.getMessageTemplate(), "service instance query"); } for(QueryCriterion criterion : query.getCriteria()){ if(criterion instanceof ContainQueryCriterion || criterion instanceof NotContainQueryCriterion){ throw new ServiceException(ErrorCode.QUERY_CRITERION_ILLEGAL_IN_QUERY); } } }
class class_name[name] begin[{] method[validateServiceInstanceMetadataQuery, return_type[void], modifier[private], parameter[query]] begin[{] if[binary_operation[member[.query], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[]), MethodInvocation(arguments=[], member=getMessageTemplate, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="service instance query")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=criterion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ContainQueryCriterion, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=criterion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=NotContainQueryCriterion, sub_type=None), operator=instanceof), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=QUERY_CRITERION_ILLEGAL_IN_QUERY, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCriteria, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=criterion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryCriterion, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[validateServiceInstanceMetadataQuery] operator[SEP] identifier[ServiceInstanceQuery] identifier[query] operator[SEP] Keyword[throws] identifier[ServiceException] { Keyword[if] operator[SEP] identifier[query] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ServiceException] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR] , identifier[ErrorCode] operator[SEP] identifier[SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR] operator[SEP] identifier[getMessageTemplate] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[QueryCriterion] identifier[criterion] operator[:] identifier[query] operator[SEP] identifier[getCriteria] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[criterion] Keyword[instanceof] identifier[ContainQueryCriterion] operator[||] identifier[criterion] Keyword[instanceof] identifier[NotContainQueryCriterion] operator[SEP] { Keyword[throw] Keyword[new] identifier[ServiceException] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[QUERY_CRITERION_ILLEGAL_IN_QUERY] operator[SEP] operator[SEP] } } }
public Formula implication(final Formula left, final Formula right) { if (left.type() == FALSE || right.type() == TRUE) return this.verum(); if (left.type() == TRUE) return right; if (right.type() == FALSE) return this.not(left); if (left.equals(right)) return this.verum(); final Pair<Formula, Formula> key = new Pair<>(left, right); Implication implication = this.implications.get(key); if (implication == null) { implication = new Implication(left, right, this); this.implications.put(key, implication); } return implication; }
class class_name[name] begin[{] method[implication, return_type[type[Formula]], modifier[public], parameter[left, right]] begin[{] if[binary_operation[binary_operation[call[left.type, parameter[]], ==, member[.FALSE]], ||, binary_operation[call[right.type, parameter[]], ==, member[.TRUE]]]] begin[{] return[THIS[call[None.verum, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[left.type, parameter[]], ==, member[.TRUE]]] begin[{] return[member[.right]] else begin[{] None end[}] if[binary_operation[call[right.type, parameter[]], ==, member[.FALSE]]] begin[{] return[THIS[call[None.not, parameter[member[.left]]]]] else begin[{] None end[}] if[call[left.equals, parameter[member[.right]]]] begin[{] return[THIS[call[None.verum, parameter[]]]] else begin[{] None end[}] local_variable[type[Pair], key] local_variable[type[Implication], implication] if[binary_operation[member[.implication], ==, literal[null]]] begin[{] assign[member[.implication], ClassCreator(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Implication, sub_type=None))] THIS[member[None.implications]call[None.put, parameter[member[.key], member[.implication]]]] else begin[{] None end[}] return[member[.implication]] end[}] END[}]
Keyword[public] identifier[Formula] identifier[implication] operator[SEP] Keyword[final] identifier[Formula] identifier[left] , Keyword[final] identifier[Formula] identifier[right] operator[SEP] { Keyword[if] operator[SEP] identifier[left] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[FALSE] operator[||] identifier[right] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[TRUE] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[verum] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[left] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[TRUE] operator[SEP] Keyword[return] identifier[right] operator[SEP] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[FALSE] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[not] operator[SEP] identifier[left] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[left] operator[SEP] identifier[equals] operator[SEP] identifier[right] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[verum] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Pair] operator[<] identifier[Formula] , identifier[Formula] operator[>] identifier[key] operator[=] Keyword[new] identifier[Pair] operator[<] operator[>] operator[SEP] identifier[left] , identifier[right] operator[SEP] operator[SEP] identifier[Implication] identifier[implication] operator[=] Keyword[this] operator[SEP] identifier[implications] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[implication] operator[==] Other[null] operator[SEP] { identifier[implication] operator[=] Keyword[new] identifier[Implication] operator[SEP] identifier[left] , identifier[right] , Keyword[this] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[implications] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[implication] operator[SEP] operator[SEP] } Keyword[return] identifier[implication] operator[SEP] }
public void setup(Matrix m, int[] initialAssignments, int numClusters) { // Save the meta data we need to maintain. assignments = initialAssignments; matrix = new ArrayList<DoubleVector>(m.rows()); for (int i = 0; i < m.rows(); ++i) matrix.add(m.getRowVector(i)); // Initialize the cluster information. centroids = new DoubleVector[numClusters]; clusterSizes = new int[numClusters]; costs = new double[numClusters]; // Initialize the clusters. for (int c = 0; c < numClusters; ++c) centroids[c] = new DenseVector(m.columns()); // Form the cluster composite vectors, i.e. unscaled centroids. for (int i = 0; i < m.rows(); ++i) { int assignment = initialAssignments[i]; VectorMath.add(centroids[assignment], matrix.get(i)); clusterSizes[assignment]++; } // Compute the cost of each centroid. for (int c = 0; c < numClusters; ++c) centroids[c] = new DenseDynamicMagnitudeVector( centroids[c].toArray()); subSetup(m); SparseDoubleVector empty = new CompactSparseVector(m.columns()); for (int c = 0; c < numClusters; ++c) if (clusterSizes[c] != 0) costs[c] = getOldCentroidScore(empty, c, clusterSizes[c]); }
class class_name[name] begin[{] method[setup, return_type[void], modifier[public], parameter[m, initialAssignments, numClusters]] begin[{] assign[member[.assignments], member[.initialAssignments]] assign[member[.matrix], ClassCreator(arguments=[MethodInvocation(arguments=[], member=rows, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DoubleVector, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRowVector, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=rows, postfix_operators=[], prefix_operators=[], qualifier=m, 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) assign[member[.centroids], ArrayCreator(dimensions=[MemberReference(member=numClusters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DoubleVector, sub_type=None))] assign[member[.clusterSizes], ArrayCreator(dimensions=[MemberReference(member=numClusters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] assign[member[.costs], ArrayCreator(dimensions=[MemberReference(member=numClusters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=centroids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=columns, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DenseVector, sub_type=None))), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numClusters, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=initialAssignments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=assignment)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=centroids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=assignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=VectorMath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=clusterSizes, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=assignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=rows, postfix_operators=[], prefix_operators=[], qualifier=m, 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) ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=centroids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=centroids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DenseDynamicMagnitudeVector, sub_type=None))), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numClusters, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) call[.subSetup, parameter[member[.m]]] local_variable[type[SparseDoubleVector], empty] ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=clusterSizes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, 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=costs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=empty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clusterSizes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getOldCentroidScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numClusters, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setup] operator[SEP] identifier[Matrix] identifier[m] , Keyword[int] operator[SEP] operator[SEP] identifier[initialAssignments] , Keyword[int] identifier[numClusters] operator[SEP] { identifier[assignments] operator[=] identifier[initialAssignments] operator[SEP] identifier[matrix] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DoubleVector] operator[>] operator[SEP] identifier[m] operator[SEP] identifier[rows] 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[m] operator[SEP] identifier[rows] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] identifier[matrix] operator[SEP] identifier[add] operator[SEP] identifier[m] operator[SEP] identifier[getRowVector] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[centroids] operator[=] Keyword[new] identifier[DoubleVector] operator[SEP] identifier[numClusters] operator[SEP] operator[SEP] identifier[clusterSizes] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[numClusters] operator[SEP] operator[SEP] identifier[costs] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numClusters] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[numClusters] operator[SEP] operator[++] identifier[c] operator[SEP] identifier[centroids] operator[SEP] identifier[c] operator[SEP] operator[=] Keyword[new] identifier[DenseVector] operator[SEP] identifier[m] operator[SEP] identifier[columns] 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[m] operator[SEP] identifier[rows] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[int] identifier[assignment] operator[=] identifier[initialAssignments] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[VectorMath] operator[SEP] identifier[add] operator[SEP] identifier[centroids] operator[SEP] identifier[assignment] operator[SEP] , identifier[matrix] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[clusterSizes] operator[SEP] identifier[assignment] operator[SEP] operator[++] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[numClusters] operator[SEP] operator[++] identifier[c] operator[SEP] identifier[centroids] operator[SEP] identifier[c] operator[SEP] operator[=] Keyword[new] identifier[DenseDynamicMagnitudeVector] operator[SEP] identifier[centroids] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[subSetup] operator[SEP] identifier[m] operator[SEP] operator[SEP] identifier[SparseDoubleVector] identifier[empty] operator[=] Keyword[new] identifier[CompactSparseVector] operator[SEP] identifier[m] operator[SEP] identifier[columns] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[numClusters] operator[SEP] operator[++] identifier[c] operator[SEP] Keyword[if] operator[SEP] identifier[clusterSizes] operator[SEP] identifier[c] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[costs] operator[SEP] identifier[c] operator[SEP] operator[=] identifier[getOldCentroidScore] operator[SEP] identifier[empty] , identifier[c] , identifier[clusterSizes] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] }
public <TKey, TValue> LinkedHashMap<TKey, TValue> toMap(Function<? super Cursor, TKey> keyTransform, Function<? super Cursor, TValue> valueTransform) { try { LinkedHashMap<TKey, TValue> result = new LinkedHashMap<>(getCount(), 1); for (moveToFirst(); !isAfterLast(); moveToNext()) { final TKey key = keyTransform.apply(this); final TValue value = valueTransform.apply(this); final TValue previousValue = result.put(key, value); Preconditions.checkArgument(previousValue == null, "Duplicate key %s found on position %s", key, getPosition()); } return result; } finally { close(); } }
class class_name[name] begin[{] method[toMap, return_type[type[LinkedHashMap]], modifier[public], parameter[keyTransform, valueTransform]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashMap, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TKey, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TValue, sub_type=None))], dimensions=[], name=LinkedHashMap, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=keyTransform, selectors=[], type_arguments=None), name=key)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TKey, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=valueTransform, selectors=[], type_arguments=None), name=value)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TValue, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=previousValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TValue, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=previousValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Duplicate key %s found on position %s"), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=checkArgument, postfix_operators=[], prefix_operators=[], qualifier=Preconditions, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=isAfterLast, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), init=[MethodInvocation(arguments=[], member=moveToFirst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], update=[MethodInvocation(arguments=[], member=moveToNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)]), label=None), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] operator[<] identifier[TKey] , identifier[TValue] operator[>] identifier[LinkedHashMap] operator[<] identifier[TKey] , identifier[TValue] operator[>] identifier[toMap] operator[SEP] identifier[Function] operator[<] operator[?] Keyword[super] identifier[Cursor] , identifier[TKey] operator[>] identifier[keyTransform] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[Cursor] , identifier[TValue] operator[>] identifier[valueTransform] operator[SEP] { Keyword[try] { identifier[LinkedHashMap] operator[<] identifier[TKey] , identifier[TValue] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] , Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[moveToFirst] operator[SEP] operator[SEP] operator[SEP] operator[!] identifier[isAfterLast] operator[SEP] operator[SEP] operator[SEP] identifier[moveToNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[TKey] identifier[key] operator[=] identifier[keyTransform] operator[SEP] identifier[apply] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[final] identifier[TValue] identifier[value] operator[=] identifier[valueTransform] operator[SEP] identifier[apply] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[final] identifier[TValue] identifier[previousValue] operator[=] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[previousValue] operator[==] Other[null] , literal[String] , identifier[key] , identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] } Keyword[finally] { identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { boolean isAvailable = false; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (extNS != null) isAvailable = extNS.isFunctionAvailable(funcName); } return isAvailable; }
class class_name[name] begin[{] method[functionAvailable, return_type[type[boolean]], modifier[public], parameter[ns, funcName]] begin[{] local_variable[type[boolean], isAvailable] if[binary_operation[literal[null], !=, member[.ns]]] begin[{] local_variable[type[ExtensionHandler], extNS] if[binary_operation[member[.extNS], !=, literal[null]]] begin[{] assign[member[.isAvailable], call[extNS.isFunctionAvailable, parameter[member[.funcName]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.isAvailable]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[functionAvailable] operator[SEP] identifier[String] identifier[ns] , identifier[String] identifier[funcName] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] { Keyword[boolean] identifier[isAvailable] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[ns] operator[SEP] { identifier[ExtensionHandler] identifier[extNS] operator[=] operator[SEP] identifier[ExtensionHandler] operator[SEP] identifier[m_extensionFunctionNamespaces] operator[SEP] identifier[get] operator[SEP] identifier[ns] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extNS] operator[!=] Other[null] operator[SEP] identifier[isAvailable] operator[=] identifier[extNS] operator[SEP] identifier[isFunctionAvailable] operator[SEP] identifier[funcName] operator[SEP] operator[SEP] } Keyword[return] identifier[isAvailable] operator[SEP] }
public @Nullable ScriptType getScriptType() { if (ScriptPattern.isP2PKH(this)) return ScriptType.P2PKH; if (ScriptPattern.isP2PK(this)) return ScriptType.P2PK; if (ScriptPattern.isP2SH(this)) return ScriptType.P2SH; if (ScriptPattern.isP2WPKH(this)) return ScriptType.P2WPKH; if (ScriptPattern.isP2WSH(this)) return ScriptType.P2WSH; return null; }
class class_name[name] begin[{] method[getScriptType, return_type[type[ScriptType]], modifier[public], parameter[]] begin[{] if[call[ScriptPattern.isP2PKH, parameter[THIS[]]]] begin[{] return[member[ScriptType.P2PKH]] else begin[{] None end[}] if[call[ScriptPattern.isP2PK, parameter[THIS[]]]] begin[{] return[member[ScriptType.P2PK]] else begin[{] None end[}] if[call[ScriptPattern.isP2SH, parameter[THIS[]]]] begin[{] return[member[ScriptType.P2SH]] else begin[{] None end[}] if[call[ScriptPattern.isP2WPKH, parameter[THIS[]]]] begin[{] return[member[ScriptType.P2WPKH]] else begin[{] None end[}] if[call[ScriptPattern.isP2WSH, parameter[THIS[]]]] begin[{] return[member[ScriptType.P2WSH]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] annotation[@] identifier[Nullable] identifier[ScriptType] identifier[getScriptType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ScriptPattern] operator[SEP] identifier[isP2PKH] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[ScriptType] operator[SEP] identifier[P2PKH] operator[SEP] Keyword[if] operator[SEP] identifier[ScriptPattern] operator[SEP] identifier[isP2PK] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[ScriptType] operator[SEP] identifier[P2PK] operator[SEP] Keyword[if] operator[SEP] identifier[ScriptPattern] operator[SEP] identifier[isP2SH] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[ScriptType] operator[SEP] identifier[P2SH] operator[SEP] Keyword[if] operator[SEP] identifier[ScriptPattern] operator[SEP] identifier[isP2WPKH] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[ScriptType] operator[SEP] identifier[P2WPKH] operator[SEP] Keyword[if] operator[SEP] identifier[ScriptPattern] operator[SEP] identifier[isP2WSH] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[ScriptType] operator[SEP] identifier[P2WSH] operator[SEP] Keyword[return] Other[null] operator[SEP] }
@Override public FilterSupportStatus isFilterSupported( FilterAdapterContext context, FamilyFilter filter) { ByteArrayComparable comparator = filter.getComparator(); if (!(comparator instanceof RegexStringComparator) && !(comparator instanceof BinaryComparator)) { return FilterSupportStatus.newNotSupported(comparator.getClass().getName() + " comparator is not supported"); } if (filter.getOperator() != CompareFilter.CompareOp.EQUAL) { return FilterSupportStatus.newNotSupported(filter.getOperator() + " operator is not supported"); } return FilterSupportStatus.SUPPORTED; }
class class_name[name] begin[{] method[isFilterSupported, return_type[type[FilterSupportStatus]], modifier[public], parameter[context, filter]] begin[{] local_variable[type[ByteArrayComparable], comparator] if[binary_operation[binary_operation[member[.comparator], instanceof, type[RegexStringComparator]], &&, binary_operation[member[.comparator], instanceof, type[BinaryComparator]]]] begin[{] return[call[FilterSupportStatus.newNotSupported, parameter[binary_operation[call[comparator.getClass, parameter[]], +, literal[" comparator is not supported"]]]]] else begin[{] None end[}] if[binary_operation[call[filter.getOperator, parameter[]], !=, member[CompareFilter.CompareOp.EQUAL]]] begin[{] return[call[FilterSupportStatus.newNotSupported, parameter[binary_operation[call[filter.getOperator, parameter[]], +, literal[" operator is not supported"]]]]] else begin[{] None end[}] return[member[FilterSupportStatus.SUPPORTED]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[FilterSupportStatus] identifier[isFilterSupported] operator[SEP] identifier[FilterAdapterContext] identifier[context] , identifier[FamilyFilter] identifier[filter] operator[SEP] { identifier[ByteArrayComparable] identifier[comparator] operator[=] identifier[filter] operator[SEP] identifier[getComparator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[comparator] Keyword[instanceof] identifier[RegexStringComparator] operator[SEP] operator[&&] operator[!] operator[SEP] identifier[comparator] Keyword[instanceof] identifier[BinaryComparator] operator[SEP] operator[SEP] { Keyword[return] identifier[FilterSupportStatus] operator[SEP] identifier[newNotSupported] operator[SEP] identifier[comparator] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[!=] identifier[CompareFilter] operator[SEP] identifier[CompareOp] operator[SEP] identifier[EQUAL] operator[SEP] { Keyword[return] identifier[FilterSupportStatus] operator[SEP] identifier[newNotSupported] operator[SEP] identifier[filter] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[FilterSupportStatus] operator[SEP] identifier[SUPPORTED] operator[SEP] }
@Override public Map<String, AbstractPolicy> getPolicies(EvaluationCtx eval, PolicyFinder policyFinder) throws PolicyIndexException { long a = 0; long b = 0; long total = 0; Map<String, AbstractPolicy> documents = new HashMap<String, AbstractPolicy>(); XmlQueryExpression qe = null; XmlQueryContext context = null; try { // Get the query (query gets prepared if necesary) a = System.nanoTime(); Map<String, Collection<AttributeBean>> attributeMap = getAttributeMap(eval); context = m_dbXmlManager.manager.createQueryContext(); context.setDefaultCollection(m_dbXmlManager.CONTAINER); for (String prefix : namespaces.keySet()) { context.setNamespace(prefix, namespaces.get(prefix)); } // not clear why this is needed.... but it is used in hashing the queries int resourceComponentCount = 0; Map<String, String> variables = getXpathVariables(attributeMap); for (String variable : variables.keySet()) { context.setVariableValue(variable, new XmlValue(variables.get(variable))); if (variable.equals(XACML_RESOURCE_ID)) { resourceComponentCount++; } } qe = getQuery(attributeMap, context, resourceComponentCount); } catch (XmlException xe) { throw new PolicyIndexException("Error while constructing query", xe); } catch (URISyntaxException e) { throw new PolicyIndexException("Error while constructing query", e); } DbXmlManager.readLock.lock(); try { b = System.nanoTime(); total += b - a; if (log.isDebugEnabled()) { log.debug("Query prep. time: " + (b - a) + "ns"); } // execute the query a = System.nanoTime(); XmlResults results = qe.execute(context); b = System.nanoTime(); total += b - a; if (log.isDebugEnabled()) { log.debug("Query exec. time: " + (b - a) + "ns"); } // process results while (results.hasNext()) { XmlValue value = results.next(); byte[] content = value.asDocument().getContent(); if (content.length > 0) { documents.put(value.asDocument().getName(), handleDocument(m_policyReader.readPolicy(content),policyFinder)); } else { throw new PolicyIndexException("Zero-length result found"); } } results.delete(); } catch (XmlException xe) { log.error("Error getting query results." + xe.getMessage()); throw new PolicyIndexException("Error getting query results." + xe.getMessage(), xe); } catch (ParsingException pe) { log.error("Error getting query results." + pe.getMessage()); throw new PolicyIndexException("Error getting query results." + pe.getMessage(), pe); } finally { DbXmlManager.readLock.unlock(); } if (log.isDebugEnabled()) { log.debug("Total exec. time: " + total + "ns"); } return documents; }
class class_name[name] begin[{] method[getPolicies, return_type[type[Map]], modifier[public], parameter[eval, policyFinder]] begin[{] local_variable[type[long], a] local_variable[type[long], b] local_variable[type[long], total] local_variable[type[Map], documents] local_variable[type[XmlQueryExpression], qe] local_variable[type[XmlQueryContext], context] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=nanoTime, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=eval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributeMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=attributeMap)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AttributeBean, sub_type=None))], dimensions=[], name=Collection, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=createQueryContext, postfix_operators=[], prefix_operators=[], qualifier=m_dbXmlManager.manager, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CONTAINER, postfix_operators=[], prefix_operators=[], qualifier=m_dbXmlManager, selectors=[])], member=setDefaultCollection, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None)], member=setNamespace, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prefix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=resourceComponentCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=attributeMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getXpathVariables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=variables)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=variable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=variable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=variables, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XmlValue, sub_type=None))], member=setVariableValue, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=XACML_RESOURCE_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=variable, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=resourceComponentCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=variables, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=variable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=qe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceComponentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while constructing query"), MemberReference(member=xe, 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=PolicyIndexException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=xe, types=['XmlException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while constructing query"), 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=PolicyIndexException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) call[DbXmlManager.readLock.lock, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=nanoTime, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query prep. time: "), operandr=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ns"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=nanoTime, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=qe, selectors=[], type_arguments=None), name=results)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XmlResults, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=nanoTime, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query exec. time: "), operandr=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ns"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)])), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XmlValue, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=asDocument, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[MethodInvocation(arguments=[], member=getContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=content)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Zero-length result found")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PolicyIndexException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=asDocument, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readPolicy, postfix_operators=[], prefix_operators=[], qualifier=m_policyReader, selectors=[], type_arguments=None), MemberReference(member=policyFinder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleDocument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=documents, selectors=[], type_arguments=None), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error getting query results."), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=xe, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error getting query results."), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=xe, selectors=[], type_arguments=None), operator=+), MemberReference(member=xe, 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=PolicyIndexException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=xe, types=['XmlException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error getting query results."), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=pe, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error getting query results."), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=pe, selectors=[], type_arguments=None), operator=+), MemberReference(member=pe, 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=PolicyIndexException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=pe, types=['ParsingException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=DbXmlManager.readLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[binary_operation[literal["Total exec. time: "], +, member[.total]], +, literal["ns"]]]] else begin[{] None end[}] return[member[.documents]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[AbstractPolicy] operator[>] identifier[getPolicies] operator[SEP] identifier[EvaluationCtx] identifier[eval] , identifier[PolicyFinder] identifier[policyFinder] operator[SEP] Keyword[throws] identifier[PolicyIndexException] { Keyword[long] identifier[a] operator[=] Other[0] operator[SEP] Keyword[long] identifier[b] operator[=] Other[0] operator[SEP] Keyword[long] identifier[total] operator[=] Other[0] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[AbstractPolicy] operator[>] identifier[documents] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[AbstractPolicy] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[XmlQueryExpression] identifier[qe] operator[=] Other[null] operator[SEP] identifier[XmlQueryContext] identifier[context] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[a] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[AttributeBean] operator[>] operator[>] identifier[attributeMap] operator[=] identifier[getAttributeMap] operator[SEP] identifier[eval] operator[SEP] operator[SEP] identifier[context] operator[=] identifier[m_dbXmlManager] operator[SEP] identifier[manager] operator[SEP] identifier[createQueryContext] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setDefaultCollection] operator[SEP] identifier[m_dbXmlManager] operator[SEP] identifier[CONTAINER] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[prefix] operator[:] identifier[namespaces] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[context] operator[SEP] identifier[setNamespace] operator[SEP] identifier[prefix] , identifier[namespaces] operator[SEP] identifier[get] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[resourceComponentCount] operator[=] Other[0] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[variables] operator[=] identifier[getXpathVariables] operator[SEP] identifier[attributeMap] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[variable] operator[:] identifier[variables] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[context] operator[SEP] identifier[setVariableValue] operator[SEP] identifier[variable] , Keyword[new] identifier[XmlValue] operator[SEP] identifier[variables] operator[SEP] identifier[get] operator[SEP] identifier[variable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[variable] operator[SEP] identifier[equals] operator[SEP] identifier[XACML_RESOURCE_ID] operator[SEP] operator[SEP] { identifier[resourceComponentCount] operator[++] operator[SEP] } } identifier[qe] operator[=] identifier[getQuery] operator[SEP] identifier[attributeMap] , identifier[context] , identifier[resourceComponentCount] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[XmlException] identifier[xe] operator[SEP] { Keyword[throw] Keyword[new] identifier[PolicyIndexException] operator[SEP] literal[String] , identifier[xe] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[PolicyIndexException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[DbXmlManager] operator[SEP] identifier[readLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[b] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] identifier[total] operator[+=] identifier[b] operator[-] identifier[a] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] operator[SEP] identifier[b] operator[-] identifier[a] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[a] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] identifier[XmlResults] identifier[results] operator[=] identifier[qe] operator[SEP] identifier[execute] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] identifier[total] operator[+=] identifier[b] operator[-] identifier[a] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] operator[SEP] identifier[b] operator[-] identifier[a] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[results] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[XmlValue] identifier[value] operator[=] identifier[results] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[content] operator[=] identifier[value] operator[SEP] identifier[asDocument] operator[SEP] operator[SEP] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[content] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[documents] operator[SEP] identifier[put] operator[SEP] identifier[value] operator[SEP] identifier[asDocument] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[handleDocument] operator[SEP] identifier[m_policyReader] operator[SEP] identifier[readPolicy] operator[SEP] identifier[content] operator[SEP] , identifier[policyFinder] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[PolicyIndexException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[results] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[XmlException] identifier[xe] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[xe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[PolicyIndexException] operator[SEP] literal[String] operator[+] identifier[xe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[xe] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParsingException] identifier[pe] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[pe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[PolicyIndexException] operator[SEP] literal[String] operator[+] identifier[pe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[pe] operator[SEP] operator[SEP] } Keyword[finally] { identifier[DbXmlManager] operator[SEP] identifier[readLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[total] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[documents] operator[SEP] }
private static int js_lastIndexOf(String target, Object[] args) { String search = ScriptRuntime.toString(args, 0); double end = ScriptRuntime.toNumber(args, 1); if (end != end || end > target.length()) end = target.length(); else if (end < 0) end = 0; return target.lastIndexOf(search, (int)end); }
class class_name[name] begin[{] method[js_lastIndexOf, return_type[type[int]], modifier[private static], parameter[target, args]] begin[{] local_variable[type[String], search] local_variable[type[double], end] if[binary_operation[binary_operation[member[.end], !=, member[.end]], ||, binary_operation[member[.end], >, call[target.length, parameter[]]]]] begin[{] assign[member[.end], call[target.length, parameter[]]] else begin[{] if[binary_operation[member[.end], <, literal[0]]] begin[{] assign[member[.end], literal[0]] else begin[{] None end[}] end[}] return[call[target.lastIndexOf, parameter[member[.search], Cast(expression=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[js_lastIndexOf] operator[SEP] identifier[String] identifier[target] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] { identifier[String] identifier[search] operator[=] identifier[ScriptRuntime] operator[SEP] identifier[toString] operator[SEP] identifier[args] , Other[0] operator[SEP] operator[SEP] Keyword[double] identifier[end] operator[=] identifier[ScriptRuntime] operator[SEP] identifier[toNumber] operator[SEP] identifier[args] , Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[!=] identifier[end] operator[||] identifier[end] operator[>] identifier[target] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[end] operator[=] identifier[target] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[end] operator[<] Other[0] operator[SEP] identifier[end] operator[=] Other[0] operator[SEP] Keyword[return] identifier[target] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[search] , operator[SEP] Keyword[int] operator[SEP] identifier[end] operator[SEP] operator[SEP] }
public static Set<Collection<Node>> requiredNodePart(Model mo, JSONObject o, String id) throws JSONConverterException { Set<Collection<Node>> nodes = new HashSet<>(); Object x = o.get(id); if (!(x instanceof JSONArray)) { throw new JSONConverterException("Set of identifiers sets expected at key '" + id + "'"); } for (Object obj : (JSONArray) x) { nodes.add(nodesFromJSON(mo, (JSONArray) obj)); } return nodes; }
class class_name[name] begin[{] method[requiredNodePart, return_type[type[Set]], modifier[public static], parameter[mo, o, id]] begin[{] local_variable[type[Set], nodes] local_variable[type[Object], x] if[binary_operation[member[.x], instanceof, type[JSONArray]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Set of identifiers sets expected at key '"), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONConverterException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=mo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None))], member=nodesFromJSON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.nodes]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Collection] operator[<] identifier[Node] operator[>] operator[>] identifier[requiredNodePart] operator[SEP] identifier[Model] identifier[mo] , identifier[JSONObject] identifier[o] , identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[JSONConverterException] { identifier[Set] operator[<] identifier[Collection] operator[<] identifier[Node] operator[>] operator[>] identifier[nodes] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[x] operator[=] identifier[o] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[x] Keyword[instanceof] identifier[JSONArray] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[JSONConverterException] operator[SEP] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Object] identifier[obj] operator[:] operator[SEP] identifier[JSONArray] operator[SEP] identifier[x] operator[SEP] { identifier[nodes] operator[SEP] identifier[add] operator[SEP] identifier[nodesFromJSON] operator[SEP] identifier[mo] , operator[SEP] identifier[JSONArray] operator[SEP] identifier[obj] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[nodes] operator[SEP] }
private String installPhp() { log.debug("Installing PHP v", new Object[]{getEntity().getPhpVersion()}); if (getEntity().getPhpVersion().equals("5.4")) { return instalPhp54v(); } else { return installPhpSuggestedVersionByDefault(); } }
class class_name[name] begin[{] method[installPhp, return_type[type[String]], modifier[private], parameter[]] begin[{] call[log.debug, parameter[literal["Installing PHP v"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getPhpVersion, 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))]] if[call[.getEntity, parameter[]]] begin[{] return[call[.instalPhp54v, parameter[]]] else begin[{] return[call[.installPhpSuggestedVersionByDefault, parameter[]]] end[}] end[}] END[}]
Keyword[private] identifier[String] identifier[installPhp] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[getPhpVersion] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[getPhpVersion] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[instalPhp54v] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[installPhpSuggestedVersionByDefault] operator[SEP] operator[SEP] operator[SEP] } }
public Response post(Object object) { assertNotEmpty(object, "object"); HttpResponse response = null; try { URI uri = buildUri(getDBUri()).build(); response = post(uri, getGson().toJson(object)); return getResponse(response); } finally { close(response); } }
class class_name[name] begin[{] method[post, return_type[type[Response]], modifier[public], parameter[object]] begin[{] call[.assertNotEmpty, parameter[member[.object], literal["object"]]] local_variable[type[HttpResponse], response] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDBUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=buildUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getGson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toJson, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=post, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Response] identifier[post] operator[SEP] identifier[Object] identifier[object] operator[SEP] { identifier[assertNotEmpty] operator[SEP] identifier[object] , literal[String] operator[SEP] operator[SEP] identifier[HttpResponse] identifier[response] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[URI] identifier[uri] operator[=] identifier[buildUri] operator[SEP] identifier[getDBUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] identifier[post] operator[SEP] identifier[uri] , identifier[getGson] operator[SEP] operator[SEP] operator[SEP] identifier[toJson] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] } Keyword[finally] { identifier[close] operator[SEP] identifier[response] operator[SEP] operator[SEP] } }
public List<String> getHelp() { List<String> out = new ArrayList<>(); if (helpAppVersion != null) { out.add(helpAppVersion); } if (helpAppExample != null) { out.add(helpAppExample); } if (helpAppVersion != null || helpAppExample != null) { out.add(""); // new line } // find longest option to format all other options by this one int max = 0; for (CommandOption option: options) { String command = option.toCommandString(); max = Math.max(max, command.length()); } for (CommandOption option: options) { String info = option.toCommandString(); int spaces = max - info.length() + 1; String delimiter = new String(new char[spaces]).replace("\0", " "); // returns 'spaces' long empty string info = info + delimiter + option.getDescription(); out.add(info); } return out; }
class class_name[name] begin[{] method[getHelp, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], out] if[binary_operation[member[.helpAppVersion], !=, literal[null]]] begin[{] call[out.add, parameter[member[.helpAppVersion]]] else begin[{] None end[}] if[binary_operation[member[.helpAppExample], !=, literal[null]]] begin[{] call[out.add, parameter[member[.helpAppExample]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.helpAppVersion], !=, literal[null]], ||, binary_operation[member[.helpAppExample], !=, literal[null]]]] begin[{] call[out.add, parameter[literal[""]]] else begin[{] None end[}] local_variable[type[int], max] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toCommandString, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), name=command)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[], type_arguments=None)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=option)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommandOption, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toCommandString, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), name=info)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[], type_arguments=None), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=spaces)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ArrayCreator(dimensions=[MemberReference(member=spaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\0"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=delimiter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=delimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MethodInvocation(arguments=[], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=option)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommandOption, sub_type=None))), label=None) return[member[.out]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getHelp] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[out] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[helpAppVersion] operator[!=] Other[null] operator[SEP] { identifier[out] operator[SEP] identifier[add] operator[SEP] identifier[helpAppVersion] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[helpAppExample] operator[!=] Other[null] operator[SEP] { identifier[out] operator[SEP] identifier[add] operator[SEP] identifier[helpAppExample] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[helpAppVersion] operator[!=] Other[null] operator[||] identifier[helpAppExample] operator[!=] Other[null] operator[SEP] { identifier[out] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[max] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[CommandOption] identifier[option] operator[:] identifier[options] operator[SEP] { identifier[String] identifier[command] operator[=] identifier[option] operator[SEP] identifier[toCommandString] operator[SEP] operator[SEP] operator[SEP] identifier[max] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[max] , identifier[command] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[CommandOption] identifier[option] operator[:] identifier[options] operator[SEP] { identifier[String] identifier[info] operator[=] identifier[option] operator[SEP] identifier[toCommandString] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[spaces] operator[=] identifier[max] operator[-] identifier[info] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] identifier[String] identifier[delimiter] operator[=] Keyword[new] identifier[String] operator[SEP] Keyword[new] Keyword[char] operator[SEP] identifier[spaces] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[info] operator[=] identifier[info] operator[+] identifier[delimiter] operator[+] identifier[option] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[add] operator[SEP] identifier[info] operator[SEP] operator[SEP] } Keyword[return] identifier[out] operator[SEP] }
private void stop(Attributes attributes) throws SVGParseException { debug("<stop>"); if (currentElement == null) throw new SVGParseException("Invalid document. Root element must be <svg>"); if (!(currentElement instanceof SVG.GradientElement)) throw new SVGParseException("Invalid document. <stop> elements are only valid inside <linearGradient> or <radialGradient> elements."); SVG.Stop obj = new SVG.Stop(); obj.document = svgDocument; obj.parent = currentElement; parseAttributesCore(obj, attributes); parseAttributesStyle(obj, attributes); parseAttributesStop(obj, attributes); currentElement.addChild(obj); currentElement = obj; }
class class_name[name] begin[{] method[stop, return_type[void], modifier[private], parameter[attributes]] begin[{] call[.debug, parameter[literal["<stop>"]]] if[binary_operation[member[.currentElement], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid document. Root element must be <svg>")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SVGParseException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.currentElement], instanceof, type[SVG]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid document. <stop> elements are only valid inside <linearGradient> or <radialGradient> elements.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SVGParseException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[SVG], obj] assign[member[obj.document], member[.svgDocument]] assign[member[obj.parent], member[.currentElement]] call[.parseAttributesCore, parameter[member[.obj], member[.attributes]]] call[.parseAttributesStyle, parameter[member[.obj], member[.attributes]]] call[.parseAttributesStop, parameter[member[.obj], member[.attributes]]] call[currentElement.addChild, parameter[member[.obj]]] assign[member[.currentElement], member[.obj]] end[}] END[}]
Keyword[private] Keyword[void] identifier[stop] operator[SEP] identifier[Attributes] identifier[attributes] operator[SEP] Keyword[throws] identifier[SVGParseException] { identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentElement] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[SVGParseException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[currentElement] Keyword[instanceof] identifier[SVG] operator[SEP] identifier[GradientElement] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SVGParseException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[SVG] operator[SEP] identifier[Stop] identifier[obj] operator[=] Keyword[new] identifier[SVG] operator[SEP] identifier[Stop] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[document] operator[=] identifier[svgDocument] operator[SEP] identifier[obj] operator[SEP] identifier[parent] operator[=] identifier[currentElement] operator[SEP] identifier[parseAttributesCore] operator[SEP] identifier[obj] , identifier[attributes] operator[SEP] operator[SEP] identifier[parseAttributesStyle] operator[SEP] identifier[obj] , identifier[attributes] operator[SEP] operator[SEP] identifier[parseAttributesStop] operator[SEP] identifier[obj] , identifier[attributes] operator[SEP] operator[SEP] identifier[currentElement] operator[SEP] identifier[addChild] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[currentElement] operator[=] identifier[obj] operator[SEP] }
protected void adoptSubWidgets(Element root) { GQuery children = $(root).children(); for (Element child : children.elements()) { Widget w = $(child).widget(); if (w != null) { doAdopt(w); } else { adoptSubWidgets(child); } } }
class class_name[name] begin[{] method[adoptSubWidgets, return_type[void], modifier[protected], parameter[root]] begin[{] local_variable[type[GQuery], children] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=$, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=widget, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=w)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=adoptSubWidgets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doAdopt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=elements, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[adoptSubWidgets] operator[SEP] identifier[Element] identifier[root] operator[SEP] { identifier[GQuery] identifier[children] operator[=] identifier[$] operator[SEP] identifier[root] operator[SEP] operator[SEP] identifier[children] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Element] identifier[child] operator[:] identifier[children] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] { identifier[Widget] identifier[w] operator[=] identifier[$] operator[SEP] identifier[child] operator[SEP] operator[SEP] identifier[widget] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[w] operator[!=] Other[null] operator[SEP] { identifier[doAdopt] operator[SEP] identifier[w] operator[SEP] operator[SEP] } Keyword[else] { identifier[adoptSubWidgets] operator[SEP] identifier[child] operator[SEP] operator[SEP] } } }
public void setImageService( com.liferay.portal.kernel.service.ImageService imageService) { this.imageService = imageService; }
class class_name[name] begin[{] method[setImageService, return_type[void], modifier[public], parameter[imageService]] begin[{] assign[THIS[member[None.imageService]], member[.imageService]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setImageService] operator[SEP] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[portal] operator[SEP] identifier[kernel] operator[SEP] identifier[service] operator[SEP] identifier[ImageService] identifier[imageService] operator[SEP] { Keyword[this] operator[SEP] identifier[imageService] operator[=] identifier[imageService] operator[SEP] }
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "exp") public JAXBElement<ElementaryFunctionsType> createExp(ElementaryFunctionsType value) { return new JAXBElement<ElementaryFunctionsType>(_Exp_QNAME, ElementaryFunctionsType.class, null, value); }
class class_name[name] begin[{] method[createExp, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Exp_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ElementaryFunctionsType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ElementaryFunctionsType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[ElementaryFunctionsType] operator[>] identifier[createExp] operator[SEP] identifier[ElementaryFunctionsType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[ElementaryFunctionsType] operator[>] operator[SEP] identifier[_Exp_QNAME] , identifier[ElementaryFunctionsType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
@Deprecated @Override public GenericQueueMessage<ID, DATA> qOriginalTimestamp(Date timestamp) { setTimestamp(timestamp); return this; }
class class_name[name] begin[{] method[qOriginalTimestamp, return_type[type[GenericQueueMessage]], modifier[public], parameter[timestamp]] begin[{] call[.setTimestamp, parameter[member[.timestamp]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Deprecated] annotation[@] identifier[Override] Keyword[public] identifier[GenericQueueMessage] operator[<] identifier[ID] , identifier[DATA] operator[>] identifier[qOriginalTimestamp] operator[SEP] identifier[Date] identifier[timestamp] operator[SEP] { identifier[setTimestamp] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Close public void close() { DatastoreConnection con = getDatastoreConnections().poll(); if (con != null) { logger.info("Closing dictionary: {}", this); con.close(); } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[DatastoreConnection], con] if[binary_operation[member[.con], !=, literal[null]]] begin[{] call[logger.info, parameter[literal["Closing dictionary: {}"], THIS[]]] call[con.close, parameter[]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Close] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] { identifier[DatastoreConnection] identifier[con] operator[=] identifier[getDatastoreConnections] operator[SEP] operator[SEP] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[con] operator[!=] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[con] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
void formatWeekday(StringBuilder b, ZonedDateTime d, int width, FieldVariants weekdays) { int weekday = d.getDayOfWeek().getValue() % 7; switch (width) { case 6: b.append(weekdays.short_[weekday]); break; case 5: b.append(weekdays.narrow[weekday]); break; case 4: b.append(weekdays.wide[weekday]); break; case 3: case 2: case 1: b.append(weekdays.abbreviated[weekday]); break; } }
class class_name[name] begin[{] method[formatWeekday, return_type[void], modifier[default], parameter[b, d, width, weekdays]] begin[{] local_variable[type[int], weekday] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=short_, postfix_operators=[], prefix_operators=[], qualifier=weekdays, selectors=[ArraySelector(index=MemberReference(member=weekday, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=narrow, postfix_operators=[], prefix_operators=[], qualifier=weekdays, selectors=[ArraySelector(index=MemberReference(member=weekday, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=wide, postfix_operators=[], prefix_operators=[], qualifier=weekdays, selectors=[ArraySelector(index=MemberReference(member=weekday, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=abbreviated, postfix_operators=[], prefix_operators=[], qualifier=weekdays, selectors=[ArraySelector(index=MemberReference(member=weekday, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[void] identifier[formatWeekday] operator[SEP] identifier[StringBuilder] identifier[b] , identifier[ZonedDateTime] identifier[d] , Keyword[int] identifier[width] , identifier[FieldVariants] identifier[weekdays] operator[SEP] { Keyword[int] identifier[weekday] operator[=] identifier[d] operator[SEP] identifier[getDayOfWeek] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[%] Other[7] operator[SEP] Keyword[switch] operator[SEP] identifier[width] operator[SEP] { Keyword[case] Other[6] operator[:] identifier[b] operator[SEP] identifier[append] operator[SEP] identifier[weekdays] operator[SEP] identifier[short_] operator[SEP] identifier[weekday] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[5] operator[:] identifier[b] operator[SEP] identifier[append] operator[SEP] identifier[weekdays] operator[SEP] identifier[narrow] operator[SEP] identifier[weekday] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] identifier[b] operator[SEP] identifier[append] operator[SEP] identifier[weekdays] operator[SEP] identifier[wide] operator[SEP] identifier[weekday] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] Keyword[case] Other[2] operator[:] Keyword[case] Other[1] operator[:] identifier[b] operator[SEP] identifier[append] operator[SEP] identifier[weekdays] operator[SEP] identifier[abbreviated] operator[SEP] identifier[weekday] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } }
public boolean addSubPanels(Container parent, int options) { if (parent == null) parent = m_parent; String strScreen = this.getProperty(Params.SCREEN); JBasePanel baseScreen = (JBasePanel)ClassServiceUtility.getClassService().makeObjectFromClassName(strScreen); if (baseScreen != null) { FieldList record = null; baseScreen.init(this, record); // test return this.changeSubScreen(parent, baseScreen, null, options); // You must manually push the history command } else Util.getLogger().warning("Screen class not found " + strScreen); return false; // Nothing happened }
class class_name[name] begin[{] method[addSubPanels, return_type[type[boolean]], modifier[public], parameter[parent, options]] begin[{] if[binary_operation[member[.parent], ==, literal[null]]] begin[{] assign[member[.parent], member[.m_parent]] else begin[{] None end[}] local_variable[type[String], strScreen] local_variable[type[JBasePanel], baseScreen] if[binary_operation[member[.baseScreen], !=, literal[null]]] begin[{] local_variable[type[FieldList], record] call[baseScreen.init, parameter[THIS[], member[.record]]] return[THIS[call[None.changeSubScreen, parameter[member[.parent], member[.baseScreen], literal[null], member[.options]]]]] else begin[{] call[Util.getLogger, parameter[]] end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[addSubPanels] operator[SEP] identifier[Container] identifier[parent] , Keyword[int] identifier[options] operator[SEP] { Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] identifier[parent] operator[=] identifier[m_parent] operator[SEP] identifier[String] identifier[strScreen] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[Params] operator[SEP] identifier[SCREEN] operator[SEP] operator[SEP] identifier[JBasePanel] identifier[baseScreen] operator[=] operator[SEP] identifier[JBasePanel] operator[SEP] identifier[ClassServiceUtility] operator[SEP] identifier[getClassService] operator[SEP] operator[SEP] operator[SEP] identifier[makeObjectFromClassName] operator[SEP] identifier[strScreen] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[baseScreen] operator[!=] Other[null] operator[SEP] { identifier[FieldList] identifier[record] operator[=] Other[null] operator[SEP] identifier[baseScreen] operator[SEP] identifier[init] operator[SEP] Keyword[this] , identifier[record] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[changeSubScreen] operator[SEP] identifier[parent] , identifier[baseScreen] , Other[null] , identifier[options] operator[SEP] operator[SEP] } Keyword[else] identifier[Util] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[+] identifier[strScreen] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
private <T> Provider<T> createProvider(Key<T> key) { Class<T> type = (Class<T>) key.rawClass(); if (Provider.class.equals(type)) { TypeRef subType = TypeRef.of(key.type()).to(Provider.class).param(0); Key<Object> subkey = Key.of(subType.type(), key.annotationTypes()); return (Provider) new ProviderProvider(key, -10, provider(subkey)); } else if (Optional.class.equals(type)) { TypeRef subType = TypeRef.of(key.type()).to(Optional.class).param(0); Key<Object> subkey = Key.of(subType.type(), key.annotationTypes()); return (Provider) new ProviderOptional(key, -10, provider(subkey)); } else if (type.isInterface() || Modifier.isAbstract(type.getModifiers())) { return new ProviderNull(key, -10000, new InjectScopeSingleton()); } int priority = -10; // auto-provider is factory InjectScope<T> scope = findScope(type); BindingAmp<T> binding = new ProviderConstructor<>(this, key, priority, scope, type); binding.bind(); return binding.provider(); }
class class_name[name] begin[{] method[createProvider, return_type[type[Provider]], modifier[private], parameter[key]] begin[{] local_variable[type[Class], type] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Provider, sub_type=None))] begin[{] local_variable[type[TypeRef], subType] local_variable[type[Key], subkey] return[Cast(expression=ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=10), MethodInvocation(arguments=[MemberReference(member=subkey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProviderProvider, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Provider, sub_type=None))] else begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Optional, sub_type=None))] begin[{] local_variable[type[TypeRef], subType] local_variable[type[Key], subkey] return[Cast(expression=ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=10), MethodInvocation(arguments=[MemberReference(member=subkey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProviderOptional, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Provider, sub_type=None))] else begin[{] if[binary_operation[call[type.isInterface, parameter[]], ||, call[Modifier.isAbstract, parameter[call[type.getModifiers, parameter[]]]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=10000), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InjectScopeSingleton, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProviderNull, sub_type=None))] else begin[{] None end[}] end[}] end[}] local_variable[type[int], priority] local_variable[type[InjectScope], scope] local_variable[type[BindingAmp], binding] call[binding.bind, parameter[]] return[call[binding.provider, parameter[]]] end[}] END[}]
Keyword[private] operator[<] identifier[T] operator[>] identifier[Provider] operator[<] identifier[T] operator[>] identifier[createProvider] operator[SEP] identifier[Key] operator[<] identifier[T] operator[>] identifier[key] operator[SEP] { identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[=] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] operator[SEP] identifier[key] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Provider] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[TypeRef] identifier[subType] operator[=] identifier[TypeRef] operator[SEP] identifier[of] operator[SEP] identifier[key] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] identifier[Provider] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[param] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Key] operator[<] identifier[Object] operator[>] identifier[subkey] operator[=] identifier[Key] operator[SEP] identifier[of] operator[SEP] identifier[subType] operator[SEP] identifier[type] operator[SEP] operator[SEP] , identifier[key] operator[SEP] identifier[annotationTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Provider] operator[SEP] Keyword[new] identifier[ProviderProvider] operator[SEP] identifier[key] , operator[-] Other[10] , identifier[provider] operator[SEP] identifier[subkey] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Optional] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[TypeRef] identifier[subType] operator[=] identifier[TypeRef] operator[SEP] identifier[of] operator[SEP] identifier[key] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] identifier[Optional] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[param] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Key] operator[<] identifier[Object] operator[>] identifier[subkey] operator[=] identifier[Key] operator[SEP] identifier[of] operator[SEP] identifier[subType] operator[SEP] identifier[type] operator[SEP] operator[SEP] , identifier[key] operator[SEP] identifier[annotationTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Provider] operator[SEP] Keyword[new] identifier[ProviderOptional] operator[SEP] identifier[key] , operator[-] Other[10] , identifier[provider] operator[SEP] identifier[subkey] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[||] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[type] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[ProviderNull] operator[SEP] identifier[key] , operator[-] Other[10000] , Keyword[new] identifier[InjectScopeSingleton] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[priority] operator[=] operator[-] Other[10] operator[SEP] identifier[InjectScope] operator[<] identifier[T] operator[>] identifier[scope] operator[=] identifier[findScope] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[BindingAmp] operator[<] identifier[T] operator[>] identifier[binding] operator[=] Keyword[new] identifier[ProviderConstructor] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[key] , identifier[priority] , identifier[scope] , identifier[type] operator[SEP] operator[SEP] identifier[binding] operator[SEP] identifier[bind] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[binding] operator[SEP] identifier[provider] operator[SEP] operator[SEP] operator[SEP] }
private Path getOrGenerateSchemaFile(Schema schema) throws IOException { Preconditions.checkNotNull(schema, "Avro Schema should not be null"); String hashedSchema = Hashing.sha256().hashString(schema.toString(), StandardCharsets.UTF_8).toString(); if (!this.schemaPaths.containsKey(hashedSchema)) { Path schemaFilePath = new Path(this.schemaDir, String.valueOf(System.currentTimeMillis() + ".avsc")); AvroUtils.writeSchemaToFile(schema, schemaFilePath, fs, true); this.schemaPaths.put(hashedSchema, schemaFilePath); } return this.schemaPaths.get(hashedSchema); }
class class_name[name] begin[{] method[getOrGenerateSchemaFile, return_type[type[Path]], modifier[private], parameter[schema]] begin[{] call[Preconditions.checkNotNull, parameter[member[.schema], literal["Avro Schema should not be null"]]] local_variable[type[String], hashedSchema] if[THIS[member[None.schemaPaths]call[None.containsKey, parameter[member[.hashedSchema]]]]] begin[{] local_variable[type[Path], schemaFilePath] call[AvroUtils.writeSchemaToFile, parameter[member[.schema], member[.schemaFilePath], member[.fs], literal[true]]] THIS[member[None.schemaPaths]call[None.put, parameter[member[.hashedSchema], member[.schemaFilePath]]]] else begin[{] None end[}] return[THIS[member[None.schemaPaths]call[None.get, parameter[member[.hashedSchema]]]]] end[}] END[}]
Keyword[private] identifier[Path] identifier[getOrGenerateSchemaFile] operator[SEP] identifier[Schema] identifier[schema] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[schema] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[hashedSchema] operator[=] identifier[Hashing] operator[SEP] identifier[sha256] operator[SEP] operator[SEP] operator[SEP] identifier[hashString] operator[SEP] identifier[schema] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[schemaPaths] operator[SEP] identifier[containsKey] operator[SEP] identifier[hashedSchema] operator[SEP] operator[SEP] { identifier[Path] identifier[schemaFilePath] operator[=] Keyword[new] identifier[Path] operator[SEP] Keyword[this] operator[SEP] identifier[schemaDir] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[AvroUtils] operator[SEP] identifier[writeSchemaToFile] operator[SEP] identifier[schema] , identifier[schemaFilePath] , identifier[fs] , literal[boolean] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[schemaPaths] operator[SEP] identifier[put] operator[SEP] identifier[hashedSchema] , identifier[schemaFilePath] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[schemaPaths] operator[SEP] identifier[get] operator[SEP] identifier[hashedSchema] operator[SEP] operator[SEP] }
boolean saveOptions() { //Enable history? boolean enabled = ((ComboBoxVersionsBean)m_numberVersions.getValue()).getValue() != CmsFileHistoryApp.NUMBER_VERSIONS_DISABLED; //Maximal count of versions for current resources. int versions = ((ComboBoxVersionsBean)m_numberVersions.getValue()).getValue(); //Maximal count of versions for deleted resources. int versionsDeleted = versions; if (m_mode.getValue().equals(CmsFileHistoryApp.MODE_DISABLED)) { versionsDeleted = 0; } if (m_mode.getValue().equals(CmsFileHistoryApp.MODE_WITHOUTVERSIONS)) { versionsDeleted = 1; } if (m_mode.getValue().equals(CmsFileHistoryApp.MODE_WITHVERSIONS) && (versions == CmsFileHistoryApp.NUMBER_VERSIONS_DISABLED)) { return false; } OpenCms.getSystemInfo().setVersionHistorySettings(enabled, versions, versionsDeleted); OpenCms.writeConfiguration(CmsSystemConfiguration.class); return true; }
class class_name[name] begin[{] method[saveOptions, return_type[type[boolean]], modifier[default], parameter[]] begin[{] local_variable[type[boolean], enabled] local_variable[type[int], versions] local_variable[type[int], versionsDeleted] if[call[m_mode.getValue, parameter[]]] begin[{] assign[member[.versionsDeleted], literal[0]] else begin[{] None end[}] if[call[m_mode.getValue, parameter[]]] begin[{] assign[member[.versionsDeleted], literal[1]] else begin[{] None end[}] if[binary_operation[call[m_mode.getValue, parameter[]], &&, binary_operation[member[.versions], ==, member[CmsFileHistoryApp.NUMBER_VERSIONS_DISABLED]]]] begin[{] return[literal[false]] else begin[{] None end[}] call[OpenCms.getSystemInfo, parameter[]] call[OpenCms.writeConfiguration, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsSystemConfiguration, sub_type=None))]] return[literal[true]] end[}] END[}]
Keyword[boolean] identifier[saveOptions] operator[SEP] operator[SEP] { Keyword[boolean] identifier[enabled] operator[=] operator[SEP] operator[SEP] identifier[ComboBoxVersionsBean] operator[SEP] identifier[m_numberVersions] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] identifier[CmsFileHistoryApp] operator[SEP] identifier[NUMBER_VERSIONS_DISABLED] operator[SEP] Keyword[int] identifier[versions] operator[=] operator[SEP] operator[SEP] identifier[ComboBoxVersionsBean] operator[SEP] identifier[m_numberVersions] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[versionsDeleted] operator[=] identifier[versions] operator[SEP] Keyword[if] operator[SEP] identifier[m_mode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CmsFileHistoryApp] operator[SEP] identifier[MODE_DISABLED] operator[SEP] operator[SEP] { identifier[versionsDeleted] operator[=] Other[0] operator[SEP] } Keyword[if] operator[SEP] identifier[m_mode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CmsFileHistoryApp] operator[SEP] identifier[MODE_WITHOUTVERSIONS] operator[SEP] operator[SEP] { identifier[versionsDeleted] operator[=] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[m_mode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CmsFileHistoryApp] operator[SEP] identifier[MODE_WITHVERSIONS] operator[SEP] operator[&&] operator[SEP] identifier[versions] operator[==] identifier[CmsFileHistoryApp] operator[SEP] identifier[NUMBER_VERSIONS_DISABLED] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[OpenCms] operator[SEP] identifier[getSystemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[setVersionHistorySettings] operator[SEP] identifier[enabled] , identifier[versions] , identifier[versionsDeleted] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[writeConfiguration] operator[SEP] identifier[CmsSystemConfiguration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public long getLong() { long v = 0; v |= ((getByte() & 0xFFL) << 56); v |= ((getByte() & 0xFFL) << 48); v |= ((getByte() & 0xFFL) << 40); v |= ((getByte() & 0xFFL) << 32); v |= ((getByte() & 0xFFL) << 24); v |= ((getByte() & 0xFFL) << 16); v |= ((getByte() & 0xFFL) << 8); v |= (getByte() & 0xFFL); return v; }
class class_name[name] begin[{] method[getLong, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[long], v] assign[member[.v], binary_operation[binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]], <<, literal[56]]] assign[member[.v], binary_operation[binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]], <<, literal[48]]] assign[member[.v], binary_operation[binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]], <<, literal[40]]] assign[member[.v], binary_operation[binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]], <<, literal[32]]] assign[member[.v], binary_operation[binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]], <<, literal[24]]] assign[member[.v], binary_operation[binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]], <<, literal[16]]] assign[member[.v], binary_operation[binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]], <<, literal[8]]] assign[member[.v], binary_operation[call[.getByte, parameter[]], &, literal[0xFFL]]] return[member[.v]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getLong] operator[SEP] operator[SEP] { Keyword[long] identifier[v] operator[=] Other[0] operator[SEP] identifier[v] operator[|=] operator[SEP] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[56] operator[SEP] operator[SEP] identifier[v] operator[|=] operator[SEP] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[48] operator[SEP] operator[SEP] identifier[v] operator[|=] operator[SEP] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[40] operator[SEP] operator[SEP] identifier[v] operator[|=] operator[SEP] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[32] operator[SEP] operator[SEP] identifier[v] operator[|=] operator[SEP] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[24] operator[SEP] operator[SEP] identifier[v] operator[|=] operator[SEP] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[SEP] identifier[v] operator[|=] operator[SEP] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[SEP] identifier[v] operator[|=] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[return] identifier[v] operator[SEP] }
public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<T>> maxAllBy(Function<? super T, ? extends U> function) { return maxAllBy(function, naturalOrder()); }
class class_name[name] begin[{] method[maxAllBy, return_type[type[Collector]], modifier[public static], parameter[function]] begin[{] return[call[.maxAllBy, parameter[member[.function], call[.naturalOrder, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[U] Keyword[extends] identifier[Comparable] operator[<] operator[?] Keyword[super] identifier[U] operator[>] operator[>] identifier[Collector] operator[<] identifier[T] , operator[?] , identifier[Seq] operator[<] identifier[T] operator[>] operator[>] identifier[maxAllBy] operator[SEP] identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[U] operator[>] identifier[function] operator[SEP] { Keyword[return] identifier[maxAllBy] operator[SEP] identifier[function] , identifier[naturalOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setOVLname(String newOVLname) { String oldOVLname = ovLname; ovLname = newOVLname; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.MMORG__OV_LNAME, oldOVLname, ovLname)); }
class class_name[name] begin[{] method[setOVLname, return_type[void], modifier[public], parameter[newOVLname]] begin[{] local_variable[type[String], oldOVLname] assign[member[.ovLname], member[.newOVLname]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=MMORG__OV_LNAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldOVLname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ovLname, 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=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setOVLname] operator[SEP] identifier[String] identifier[newOVLname] operator[SEP] { identifier[String] identifier[oldOVLname] operator[=] identifier[ovLname] operator[SEP] identifier[ovLname] operator[=] identifier[newOVLname] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[MMORG__OV_LNAME] , identifier[oldOVLname] , identifier[ovLname] operator[SEP] operator[SEP] operator[SEP] }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public void setGebiete(LageGebiet.Gebiete value) { this.gebiete = value; }
class class_name[name] begin[{] method[setGebiete, return_type[void], modifier[public], parameter[value]] begin[{] assign[THIS[member[None.gebiete]], member[.value]] end[}] END[}]
annotation[@] identifier[Generated] operator[SEP] identifier[value] operator[=] literal[String] , identifier[date] operator[=] literal[String] , identifier[comments] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[setGebiete] operator[SEP] identifier[LageGebiet] operator[SEP] identifier[Gebiete] identifier[value] operator[SEP] { Keyword[this] operator[SEP] identifier[gebiete] operator[=] identifier[value] operator[SEP] }
@Override public Map<URI, MatchResult> findOperationsClassifiedBySome(Set<URI> modelReferences) { return findServicesClassifiedBySome(modelReferences, LogicConceptMatchType.Subsume); }
class class_name[name] begin[{] method[findOperationsClassifiedBySome, return_type[type[Map]], modifier[public], parameter[modelReferences]] begin[{] return[call[.findServicesClassifiedBySome, parameter[member[.modelReferences], member[LogicConceptMatchType.Subsume]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[URI] , identifier[MatchResult] operator[>] identifier[findOperationsClassifiedBySome] operator[SEP] identifier[Set] operator[<] identifier[URI] operator[>] identifier[modelReferences] operator[SEP] { Keyword[return] identifier[findServicesClassifiedBySome] operator[SEP] identifier[modelReferences] , identifier[LogicConceptMatchType] operator[SEP] identifier[Subsume] operator[SEP] operator[SEP] }
public static ServiceName moduleSpecServiceName(ModuleIdentifier identifier) { if (!isDynamicModule(identifier)) { throw ServerLogger.ROOT_LOGGER.missingModulePrefix(identifier, MODULE_PREFIX); } return MODULE_SPEC_SERVICE_PREFIX.append(identifier.getName()).append(identifier.getSlot()); }
class class_name[name] begin[{] method[moduleSpecServiceName, return_type[type[ServiceName]], modifier[public static], parameter[identifier]] begin[{] if[call[.isDynamicModule, parameter[member[.identifier]]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=identifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MODULE_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=missingModulePrefix, postfix_operators=[], prefix_operators=[], qualifier=ServerLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] return[call[MODULE_SPEC_SERVICE_PREFIX.append, parameter[call[identifier.getName, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ServiceName] identifier[moduleSpecServiceName] operator[SEP] identifier[ModuleIdentifier] identifier[identifier] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isDynamicModule] operator[SEP] identifier[identifier] operator[SEP] operator[SEP] { Keyword[throw] identifier[ServerLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[missingModulePrefix] operator[SEP] identifier[identifier] , identifier[MODULE_PREFIX] operator[SEP] operator[SEP] } Keyword[return] identifier[MODULE_SPEC_SERVICE_PREFIX] operator[SEP] identifier[append] operator[SEP] identifier[identifier] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[identifier] operator[SEP] identifier[getSlot] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public OvhTask billingAccount_fax_serviceName_settings_sendFax_POST(String billingAccount, String serviceName, Date dateSchedule, String pdfUrl, String[] recipients) throws IOException { String qPath = "/telephony/{billingAccount}/fax/{serviceName}/settings/sendFax"; StringBuilder sb = path(qPath, billingAccount, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "dateSchedule", dateSchedule); addBody(o, "pdfUrl", pdfUrl); addBody(o, "recipients", recipients); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhTask.class); }
class class_name[name] begin[{] method[billingAccount_fax_serviceName_settings_sendFax_POST, return_type[type[OvhTask]], modifier[public], parameter[billingAccount, serviceName, dateSchedule, pdfUrl, recipients]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["dateSchedule"], member[.dateSchedule]]] call[.addBody, parameter[member[.o], literal["pdfUrl"], member[.pdfUrl]]] call[.addBody, parameter[member[.o], literal["recipients"], member[.recipients]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhTask, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhTask] identifier[billingAccount_fax_serviceName_settings_sendFax_POST] operator[SEP] identifier[String] identifier[billingAccount] , identifier[String] identifier[serviceName] , identifier[Date] identifier[dateSchedule] , identifier[String] identifier[pdfUrl] , identifier[String] operator[SEP] operator[SEP] identifier[recipients] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[billingAccount] , identifier[serviceName] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[dateSchedule] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[pdfUrl] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[recipients] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhTask] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public MonetaryAmountFactory getAmountFactory(MonetaryAmountFactoryQuery query) { Collection<MonetaryAmountFactory<?>> factories = getAmountFactories(query); if (factories.isEmpty()) { return null; } return factories.iterator().next(); }
class class_name[name] begin[{] method[getAmountFactory, return_type[type[MonetaryAmountFactory]], modifier[public], parameter[query]] begin[{] local_variable[type[Collection], factories] if[call[factories.isEmpty, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[factories.iterator, parameter[]]] end[}] END[}]
Keyword[public] identifier[MonetaryAmountFactory] identifier[getAmountFactory] operator[SEP] identifier[MonetaryAmountFactoryQuery] identifier[query] operator[SEP] { identifier[Collection] operator[<] identifier[MonetaryAmountFactory] operator[<] operator[?] operator[>] operator[>] identifier[factories] operator[=] identifier[getAmountFactories] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[factories] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[factories] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("deprecation") private void addLocalFiles(Path jobFileDir, String jobFileList, Configuration conf) throws IOException { DistributedCache.createSymlink(conf); for (String jobFile : SPLITTER.split(jobFileList)) { Path srcJobFile = new Path(jobFile); // DistributedCache requires absolute path, so we need to use makeQualified. Path destJobFile = new Path(this.fs.makeQualified(jobFileDir), srcJobFile.getName()); // Copy the file from local file system to HDFS this.fs.copyFromLocalFile(srcJobFile, destJobFile); // Create a URI that is in the form path#symlink URI destFileUri = URI.create(destJobFile.toUri().getPath() + "#" + destJobFile.getName()); LOG.info(String.format("Adding %s to DistributedCache", destFileUri)); // Finally add the file to DistributedCache with a symlink named after the file name DistributedCache.addCacheFile(destFileUri, conf); } }
class class_name[name] begin[{] method[addLocalFiles, return_type[void], modifier[private], parameter[jobFileDir, jobFileList, conf]] begin[{] call[DistributedCache.createSymlink, parameter[member[.conf]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=jobFile, 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=Path, sub_type=None)), name=srcJobFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=fs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=jobFileDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeQualified, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=srcJobFile, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), name=destJobFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=fs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=srcJobFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destJobFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyFromLocalFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=toUri, postfix_operators=[], prefix_operators=[], qualifier=destJobFile, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=destJobFile, selectors=[], type_arguments=None), operator=+)], member=create, postfix_operators=[], prefix_operators=[], qualifier=URI, selectors=[], type_arguments=None), name=destFileUri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding %s to DistributedCache"), MemberReference(member=destFileUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=destFileUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addCacheFile, postfix_operators=[], prefix_operators=[], qualifier=DistributedCache, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=jobFileList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=SPLITTER, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=jobFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[addLocalFiles] operator[SEP] identifier[Path] identifier[jobFileDir] , identifier[String] identifier[jobFileList] , identifier[Configuration] identifier[conf] operator[SEP] Keyword[throws] identifier[IOException] { identifier[DistributedCache] operator[SEP] identifier[createSymlink] operator[SEP] identifier[conf] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[jobFile] operator[:] identifier[SPLITTER] operator[SEP] identifier[split] operator[SEP] identifier[jobFileList] operator[SEP] operator[SEP] { identifier[Path] identifier[srcJobFile] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[jobFile] operator[SEP] operator[SEP] identifier[Path] identifier[destJobFile] operator[=] Keyword[new] identifier[Path] operator[SEP] Keyword[this] operator[SEP] identifier[fs] operator[SEP] identifier[makeQualified] operator[SEP] identifier[jobFileDir] operator[SEP] , identifier[srcJobFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[fs] operator[SEP] identifier[copyFromLocalFile] operator[SEP] identifier[srcJobFile] , identifier[destJobFile] operator[SEP] operator[SEP] identifier[URI] identifier[destFileUri] operator[=] identifier[URI] operator[SEP] identifier[create] operator[SEP] identifier[destJobFile] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[destJobFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[destFileUri] operator[SEP] operator[SEP] operator[SEP] identifier[DistributedCache] operator[SEP] identifier[addCacheFile] operator[SEP] identifier[destFileUri] , identifier[conf] operator[SEP] operator[SEP] } }
public void commit() { for (Iterator i = listeners.iterator(); i.hasNext();) { ((CommitTriggerListener) i.next()).commit(); } }
class class_name[name] begin[{] method[commit, return_type[void], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommitTriggerListener, sub_type=None)), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=listeners, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[commit] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Iterator] identifier[i] operator[=] identifier[listeners] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { operator[SEP] operator[SEP] identifier[CommitTriggerListener] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } }
public V get(Map<?, V> map){ for (Object k : keys){ V v = map.get(k); if (v != null){ return v; } } return null; }
class class_name[name] begin[{] method[get, return_type[type[V]], modifier[public], parameter[map]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=k)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[V] identifier[get] operator[SEP] identifier[Map] operator[<] operator[?] , identifier[V] operator[>] identifier[map] operator[SEP] { Keyword[for] operator[SEP] identifier[Object] identifier[k] operator[:] identifier[keys] operator[SEP] { identifier[V] identifier[v] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[v] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); sessionTracker.getSession().onActivityResult(this.getActivity(), requestCode, resultCode, data); }
class class_name[name] begin[{] method[onActivityResult, return_type[void], modifier[public], parameter[requestCode, resultCode, data]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=requestCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resultCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onActivityResult, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[sessionTracker.getSession, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onActivityResult] operator[SEP] Keyword[int] identifier[requestCode] , Keyword[int] identifier[resultCode] , identifier[Intent] identifier[data] operator[SEP] { Keyword[super] operator[SEP] identifier[onActivityResult] operator[SEP] identifier[requestCode] , identifier[resultCode] , identifier[data] operator[SEP] operator[SEP] identifier[sessionTracker] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[onActivityResult] operator[SEP] Keyword[this] operator[SEP] identifier[getActivity] operator[SEP] operator[SEP] , identifier[requestCode] , identifier[resultCode] , identifier[data] operator[SEP] operator[SEP] }
public static void transferFile(File src, File dest) throws Exception { // 删除文件 // LOGGER.info("start to remove download file: " + "" // + dest.getAbsolutePath()); if (dest.exists()) { dest.delete(); } // 转移临时下载文件至下载文件夹 FileUtils.copyFile(src, dest); }
class class_name[name] begin[{] method[transferFile, return_type[void], modifier[public static], parameter[src, dest]] begin[{] if[call[dest.exists, parameter[]]] begin[{] call[dest.delete, parameter[]] else begin[{] None end[}] call[FileUtils.copyFile, parameter[member[.src], member[.dest]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[transferFile] operator[SEP] identifier[File] identifier[src] , identifier[File] identifier[dest] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[dest] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[dest] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] } identifier[FileUtils] operator[SEP] identifier[copyFile] operator[SEP] identifier[src] , identifier[dest] operator[SEP] operator[SEP] }
private int maptype1_quantvals() { int vals = (int) (Math.floor(Math.pow(entries, 1. / dim))); // the above *should* be reliable, but we'll not assume that FP is // ever reliable when bitstream sync is at stake; verify via integer // means that vals really is the greatest value of dim for which // vals^b->bim <= b->entries // treat the above as an initial guess while (true) { int acc = 1; int acc1 = 1; for (int i = 0; i < dim; i++) { acc *= vals; acc1 *= vals + 1; } if (acc <= entries && acc1 > entries) { return (vals); } else { if (acc > entries) { vals--; } else { vals++; } } } }
class class_name[name] begin[{] method[maptype1_quantvals, return_type[type[int]], modifier[private], parameter[]] begin[{] local_variable[type[int], vals] while[literal[true]] begin[{] local_variable[type[int], acc] local_variable[type[int], acc1] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=acc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=MemberReference(member=vals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=acc1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=BinaryOperation(operandl=MemberReference(member=vals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[binary_operation[member[.acc], <=, member[.entries]], &&, binary_operation[member[.acc1], >, member[.entries]]]] begin[{] return[member[.vals]] else begin[{] if[binary_operation[member[.acc], >, member[.entries]]] begin[{] member[.vals] else begin[{] member[.vals] end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[int] identifier[maptype1_quantvals] operator[SEP] operator[SEP] { Keyword[int] identifier[vals] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[entries] , literal[Float] operator[/] identifier[dim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[acc] operator[=] Other[1] operator[SEP] Keyword[int] identifier[acc1] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dim] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[acc] operator[*=] identifier[vals] operator[SEP] identifier[acc1] operator[*=] identifier[vals] operator[+] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[acc] operator[<=] identifier[entries] operator[&&] identifier[acc1] operator[>] identifier[entries] operator[SEP] { Keyword[return] operator[SEP] identifier[vals] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[acc] operator[>] identifier[entries] operator[SEP] { identifier[vals] operator[--] operator[SEP] } Keyword[else] { identifier[vals] operator[++] operator[SEP] } } } }
public synchronized String[] getExcludedDirectories() { slowScan(); String[] directories = new String[dirsExcluded.size()]; dirsExcluded.copyInto(directories); return directories; }
class class_name[name] begin[{] method[getExcludedDirectories, return_type[type[String]], modifier[synchronized public], parameter[]] begin[{] call[.slowScan, parameter[]] local_variable[type[String], directories] call[dirsExcluded.copyInto, parameter[member[.directories]]] return[member[.directories]] end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[String] operator[SEP] operator[SEP] identifier[getExcludedDirectories] operator[SEP] operator[SEP] { identifier[slowScan] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[directories] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[dirsExcluded] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dirsExcluded] operator[SEP] identifier[copyInto] operator[SEP] identifier[directories] operator[SEP] operator[SEP] Keyword[return] identifier[directories] operator[SEP] }
public static short[] unshuffleShortArray(byte[] input) throws IOException { short[] output = new short[input.length / 2]; int numProcessed = impl.unshuffle(input, 0, 2, input.length, output, 0); assert(numProcessed == input.length); return output; }
class class_name[name] begin[{] method[unshuffleShortArray, return_type[type[short]], modifier[public static], parameter[input]] begin[{] local_variable[type[short], output] local_variable[type[int], numProcessed] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=numProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator===), label=None, value=None) return[member[.output]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[short] operator[SEP] operator[SEP] identifier[unshuffleShortArray] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[input] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[short] operator[SEP] operator[SEP] identifier[output] operator[=] Keyword[new] Keyword[short] operator[SEP] identifier[input] operator[SEP] identifier[length] operator[/] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[numProcessed] operator[=] identifier[impl] operator[SEP] identifier[unshuffle] operator[SEP] identifier[input] , Other[0] , Other[2] , identifier[input] operator[SEP] identifier[length] , identifier[output] , Other[0] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[numProcessed] operator[==] identifier[input] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP] }
public static <T> ArgumentProcessor<T> forType(Class<? extends T> beanType) { return newInstance(beanType, new GnuParser()); }
class class_name[name] begin[{] method[forType, return_type[type[ArgumentProcessor]], modifier[public static], parameter[beanType]] begin[{] return[call[.newInstance, parameter[member[.beanType], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GnuParser, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[ArgumentProcessor] operator[<] identifier[T] operator[>] identifier[forType] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[beanType] operator[SEP] { Keyword[return] identifier[newInstance] operator[SEP] identifier[beanType] , Keyword[new] identifier[GnuParser] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public HtmlElementWriter attribute(String name, String value) { attributes.put(name, value); return this; }
class class_name[name] begin[{] method[attribute, return_type[type[HtmlElementWriter]], modifier[public], parameter[name, value]] begin[{] call[attributes.put, parameter[member[.name], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[HtmlElementWriter] identifier[attribute] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] operator[SEP] { identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public Launcher decorateLauncher(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException, RunnerAbortedException { return launcher; }
class class_name[name] begin[{] method[decorateLauncher, return_type[type[Launcher]], modifier[public], parameter[build, launcher, listener]] begin[{] return[member[.launcher]] end[}] END[}]
Keyword[public] identifier[Launcher] identifier[decorateLauncher] operator[SEP] identifier[AbstractBuild] identifier[build] , identifier[Launcher] identifier[launcher] , identifier[BuildListener] identifier[listener] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] , identifier[RunnerAbortedException] { Keyword[return] identifier[launcher] operator[SEP] }
@SuppressWarnings("rawtypes") private void doPostConstruct(Class clazz, List<LifecycleCallback> postConstructs, Object instance) throws InjectionException { if (!metadataComplete && clazz.getSuperclass() != null) { doPostConstruct(clazz.getSuperclass(), postConstructs, instance); } String classname = clazz.getName(); String methodName = getMethodNameFromDD(postConstructs, classname); if (methodName != null) { invokeMethod(clazz, methodName, instance); } else if (!metadataComplete) { Method method = getAnnotatedPostConstructMethod(clazz); if (method != null) { invokeMethod(clazz, method.getName(), instance); } } }
class class_name[name] begin[{] method[doPostConstruct, return_type[void], modifier[private], parameter[clazz, postConstructs, instance]] begin[{] if[binary_operation[member[.metadataComplete], &&, binary_operation[call[clazz.getSuperclass, parameter[]], !=, literal[null]]]] begin[{] call[.doPostConstruct, parameter[call[clazz.getSuperclass, parameter[]], member[.postConstructs], member[.instance]]] else begin[{] None end[}] local_variable[type[String], classname] local_variable[type[String], methodName] if[binary_operation[member[.methodName], !=, literal[null]]] begin[{] call[.invokeMethod, parameter[member[.clazz], member[.methodName], member[.instance]]] else begin[{] if[member[.metadataComplete]] begin[{] local_variable[type[Method], method] if[binary_operation[member[.method], !=, literal[null]]] begin[{] call[.invokeMethod, parameter[member[.clazz], call[method.getName, parameter[]], member[.instance]]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[doPostConstruct] operator[SEP] identifier[Class] identifier[clazz] , identifier[List] operator[<] identifier[LifecycleCallback] operator[>] identifier[postConstructs] , identifier[Object] identifier[instance] operator[SEP] Keyword[throws] identifier[InjectionException] { Keyword[if] operator[SEP] operator[!] identifier[metadataComplete] operator[&&] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[doPostConstruct] operator[SEP] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] , identifier[postConstructs] , identifier[instance] operator[SEP] operator[SEP] } identifier[String] identifier[classname] operator[=] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[methodName] operator[=] identifier[getMethodNameFromDD] operator[SEP] identifier[postConstructs] , identifier[classname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[methodName] operator[!=] Other[null] operator[SEP] { identifier[invokeMethod] operator[SEP] identifier[clazz] , identifier[methodName] , identifier[instance] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[metadataComplete] operator[SEP] { identifier[Method] identifier[method] operator[=] identifier[getAnnotatedPostConstructMethod] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[!=] Other[null] operator[SEP] { identifier[invokeMethod] operator[SEP] identifier[clazz] , identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[instance] operator[SEP] operator[SEP] } } }
public static CPDefinitionLink findByCP_T_Last(long CProductId, String type, OrderByComparator<CPDefinitionLink> orderByComparator) throws com.liferay.commerce.product.exception.NoSuchCPDefinitionLinkException { return getPersistence() .findByCP_T_Last(CProductId, type, orderByComparator); }
class class_name[name] begin[{] method[findByCP_T_Last, return_type[type[CPDefinitionLink]], modifier[public static], parameter[CProductId, type, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPDefinitionLink] identifier[findByCP_T_Last] operator[SEP] Keyword[long] identifier[CProductId] , identifier[String] identifier[type] , identifier[OrderByComparator] operator[<] identifier[CPDefinitionLink] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchCPDefinitionLinkException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByCP_T_Last] operator[SEP] identifier[CProductId] , identifier[type] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public static Object create(Class superclass, Class interfaces[], Callback callback) { Enhancer e = new Enhancer(); e.setSuperclass(superclass); e.setInterfaces(interfaces); e.setCallback(callback); return e.create(); }
class class_name[name] begin[{] method[create, return_type[type[Object]], modifier[public static], parameter[superclass, interfaces, callback]] begin[{] local_variable[type[Enhancer], e] call[e.setSuperclass, parameter[member[.superclass]]] call[e.setInterfaces, parameter[member[.interfaces]]] call[e.setCallback, parameter[member[.callback]]] return[call[e.create, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[create] operator[SEP] identifier[Class] identifier[superclass] , identifier[Class] identifier[interfaces] operator[SEP] operator[SEP] , identifier[Callback] identifier[callback] operator[SEP] { identifier[Enhancer] identifier[e] operator[=] Keyword[new] identifier[Enhancer] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setSuperclass] operator[SEP] identifier[superclass] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setInterfaces] operator[SEP] identifier[interfaces] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setCallback] operator[SEP] identifier[callback] operator[SEP] operator[SEP] Keyword[return] identifier[e] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] }
Object readResolve() { if (favorites != null) { data = Maps.newConcurrentMap(); for (String job : favorites) { data.put(job, true); } favorites = null; } return this; }
class class_name[name] begin[{] method[readResolve, return_type[type[Object]], modifier[default], parameter[]] begin[{] if[binary_operation[member[.favorites], !=, literal[null]]] begin[{] assign[member[.data], call[Maps.newConcurrentMap, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=put, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=favorites, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=job)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) assign[member[.favorites], literal[null]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
identifier[Object] identifier[readResolve] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[favorites] operator[!=] Other[null] operator[SEP] { identifier[data] operator[=] identifier[Maps] operator[SEP] identifier[newConcurrentMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[job] operator[:] identifier[favorites] operator[SEP] { identifier[data] operator[SEP] identifier[put] operator[SEP] identifier[job] , literal[boolean] operator[SEP] operator[SEP] } identifier[favorites] operator[=] Other[null] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public <T> ServerBuilder channelOption(ChannelOption<T> option, T value) { requireNonNull(option, "option"); checkArgument(!PROHIBITED_SOCKET_OPTIONS.contains(option), "prohibited socket option: %s", option); option.validate(value); channelOptions.put(option, value); return this; }
class class_name[name] begin[{] method[channelOption, return_type[type[ServerBuilder]], modifier[public], parameter[option, value]] begin[{] call[.requireNonNull, parameter[member[.option], literal["option"]]] call[.checkArgument, parameter[call[PROHIBITED_SOCKET_OPTIONS.contains, parameter[member[.option]]], literal["prohibited socket option: %s"], member[.option]]] call[option.validate, parameter[member[.value]]] call[channelOptions.put, parameter[member[.option], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[ServerBuilder] identifier[channelOption] operator[SEP] identifier[ChannelOption] operator[<] identifier[T] operator[>] identifier[option] , identifier[T] identifier[value] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[option] , literal[String] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] operator[!] identifier[PROHIBITED_SOCKET_OPTIONS] operator[SEP] identifier[contains] operator[SEP] identifier[option] operator[SEP] , literal[String] , identifier[option] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[validate] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[channelOptions] operator[SEP] identifier[put] operator[SEP] identifier[option] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "DICTIONARY__DICTIONARYMEMBER_0") public org.openprovenance.prov.model.QualifiedName getDictionary() { return dictionary; }
class class_name[name] begin[{] method[getDictionary, return_type[type[org]], modifier[public], parameter[]] begin[{] return[member[.dictionary]] end[}] END[}]
annotation[@] identifier[ManyToOne] operator[SEP] identifier[targetEntity] operator[=] identifier[org] operator[SEP] identifier[openprovenance] operator[SEP] identifier[prov] operator[SEP] identifier[sql] operator[SEP] identifier[QualifiedName] operator[SEP] Keyword[class] , identifier[cascade] operator[=] { identifier[CascadeType] operator[SEP] identifier[ALL] } operator[SEP] annotation[@] identifier[JoinColumn] operator[SEP] identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[org] operator[SEP] identifier[openprovenance] operator[SEP] identifier[prov] operator[SEP] identifier[model] operator[SEP] identifier[QualifiedName] identifier[getDictionary] operator[SEP] operator[SEP] { Keyword[return] identifier[dictionary] operator[SEP] }
private static void subscribeIfNotDone(EventCallBackStruct eventCallBackStruct, String callbackKey) throws DevFailed{ eventCallBackStruct.consumer.subscribe_event( eventCallBackStruct.device, eventCallBackStruct.attr_name, eventCallBackStruct.event_type, eventCallBackStruct.callback, eventCallBackStruct.max_size, eventCallBackStruct.filters, false); failed_event_callback_map.remove(callbackKey); }
class class_name[name] begin[{] method[subscribeIfNotDone, return_type[void], modifier[private static], parameter[eventCallBackStruct, callbackKey]] begin[{] call[eventCallBackStruct.consumer.subscribe_event, parameter[member[eventCallBackStruct.device], member[eventCallBackStruct.attr_name], member[eventCallBackStruct.event_type], member[eventCallBackStruct.callback], member[eventCallBackStruct.max_size], member[eventCallBackStruct.filters], literal[false]]] call[failed_event_callback_map.remove, parameter[member[.callbackKey]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[subscribeIfNotDone] operator[SEP] identifier[EventCallBackStruct] identifier[eventCallBackStruct] , identifier[String] identifier[callbackKey] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[eventCallBackStruct] operator[SEP] identifier[consumer] operator[SEP] identifier[subscribe_event] operator[SEP] identifier[eventCallBackStruct] operator[SEP] identifier[device] , identifier[eventCallBackStruct] operator[SEP] identifier[attr_name] , identifier[eventCallBackStruct] operator[SEP] identifier[event_type] , identifier[eventCallBackStruct] operator[SEP] identifier[callback] , identifier[eventCallBackStruct] operator[SEP] identifier[max_size] , identifier[eventCallBackStruct] operator[SEP] identifier[filters] , literal[boolean] operator[SEP] operator[SEP] identifier[failed_event_callback_map] operator[SEP] identifier[remove] operator[SEP] identifier[callbackKey] operator[SEP] operator[SEP] }
public void setValues() { for (Map.Entry<String, ArrayValueMap.ArrayValue> entry : keyMap.entrySet()) { @SuppressWarnings("unchecked") Map<String, Object> destinationMap = (Map<String, Object>) destination; destinationMap.put(entry.getKey(), entry.getValue().toArray()); } for (Map.Entry<Field, ArrayValueMap.ArrayValue> entry : fieldMap.entrySet()) { FieldInfo.setFieldValue(entry.getKey(), destination, entry.getValue().toArray()); } }
class class_name[name] begin[{] method[setValues, return_type[void], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), name=destinationMap)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), 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=[MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=destinationMap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=keyMap, 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=None, dimensions=[], name=ArrayValueMap, sub_type=ReferenceType(arguments=None, dimensions=None, name=ArrayValue, sub_type=None)))], dimensions=None, name=Entry, sub_type=None)))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFieldValue, postfix_operators=[], prefix_operators=[], qualifier=FieldInfo, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=fieldMap, 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=Field, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ArrayValueMap, sub_type=ReferenceType(arguments=None, dimensions=None, name=ArrayValue, sub_type=None)))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setValues] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ArrayValueMap] operator[SEP] identifier[ArrayValue] operator[>] identifier[entry] operator[:] identifier[keyMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[destinationMap] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[destination] operator[SEP] identifier[destinationMap] 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] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Field] , identifier[ArrayValueMap] operator[SEP] identifier[ArrayValue] operator[>] identifier[entry] operator[:] identifier[fieldMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[FieldInfo] operator[SEP] identifier[setFieldValue] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[destination] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public final String readLine() throws IOException { StringBuilder line = new StringBuilder(80); // Typical line length boolean foundTerminator = false; int unreadPosition = 0; while (true) { int nextByte = read(); switch (nextByte) { case -1: return line.length() != 0 ? line.toString() : null; case (byte) '\r': if (foundTerminator) { seekInternal(unreadPosition); return line.toString(); } foundTerminator = true; /* Have to be able to peek ahead one byte */ unreadPosition = getPosition(); break; case (byte) '\n': return line.toString(); default: if (foundTerminator) { seekInternal(unreadPosition); return line.toString(); } line.append((char) nextByte); } } }
class class_name[name] begin[{] method[readLine, return_type[type[String]], modifier[final public], parameter[]] begin[{] local_variable[type[StringBuilder], line] local_variable[type[boolean], foundTerminator] local_variable[type[int], unreadPosition] while[literal[true]] begin[{] local_variable[type[int], nextByte] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None)]), SwitchStatementCase(case=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r'), type=BasicType(dimensions=[], name=byte))], statements=[IfStatement(condition=MemberReference(member=foundTerminator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=unreadPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=seekInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=foundTerminator, 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=unreadPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), type=BasicType(dimensions=[], name=byte))], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=MemberReference(member=foundTerminator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=unreadPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=seekInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=nextByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=append, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=nextByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[final] identifier[String] identifier[readLine] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[StringBuilder] identifier[line] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[80] operator[SEP] operator[SEP] Keyword[boolean] identifier[foundTerminator] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[unreadPosition] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[nextByte] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[nextByte] operator[SEP] { Keyword[case] operator[-] Other[1] operator[:] Keyword[return] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[?] identifier[line] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[case] operator[SEP] Keyword[byte] operator[SEP] literal[String] operator[:] Keyword[if] operator[SEP] identifier[foundTerminator] operator[SEP] { identifier[seekInternal] operator[SEP] identifier[unreadPosition] operator[SEP] operator[SEP] Keyword[return] identifier[line] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[foundTerminator] operator[=] literal[boolean] operator[SEP] identifier[unreadPosition] operator[=] identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] operator[SEP] Keyword[byte] operator[SEP] literal[String] operator[:] Keyword[return] identifier[line] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[foundTerminator] operator[SEP] { identifier[seekInternal] operator[SEP] identifier[unreadPosition] operator[SEP] operator[SEP] Keyword[return] identifier[line] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[line] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[nextByte] operator[SEP] operator[SEP] } } }
public String[] getAsStringArray(byte b) { String s = get(b); if (s == null) return null; else return s.split(lineSeparator+""); }
class class_name[name] begin[{] method[getAsStringArray, return_type[type[String]], modifier[public], parameter[b]] begin[{] local_variable[type[String], s] if[binary_operation[member[.s], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] return[call[s.split, parameter[binary_operation[member[.lineSeparator], +, literal[""]]]]] end[}] end[}] END[}]
Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getAsStringArray] operator[SEP] Keyword[byte] identifier[b] operator[SEP] { identifier[String] identifier[s] operator[=] identifier[get] operator[SEP] identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[else] Keyword[return] identifier[s] operator[SEP] identifier[split] operator[SEP] identifier[lineSeparator] operator[+] literal[String] operator[SEP] operator[SEP] }