code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private InputStream locateStreamWithContextFolder(final String uri, final String contextFolder) throws IOException, FileNotFoundException { if (getWildcardStreamLocator().hasWildcard(uri)) { final String fullPath = WroUtil.getFullPath(uri); final String realPath = contextFolder + fullPath; return getWildcardStreamLocator().locateStream(uri, new File(realPath)); } final String uriWithoutPrefix = uri.replaceFirst(PREFIX, EMPTY); final File file = new File(contextFolder, uriWithoutPrefix); LOG.debug("Opening file: " + file.getPath()); return new FileInputStream(file); }
class class_name[name] begin[{] method[locateStreamWithContextFolder, return_type[type[InputStream]], modifier[private], parameter[uri, contextFolder]] begin[{] if[call[.getWildcardStreamLocator, parameter[]]] begin[{] local_variable[type[String], fullPath] local_variable[type[String], realPath] return[call[.getWildcardStreamLocator, parameter[]]] else begin[{] None end[}] local_variable[type[String], uriWithoutPrefix] local_variable[type[File], file] call[LOG.debug, parameter[binary_operation[literal["Opening file: "], +, call[file.getPath, parameter[]]]]] return[ClassCreator(arguments=[MemberReference(member=file, 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=FileInputStream, sub_type=None))] end[}] END[}]
Keyword[private] identifier[InputStream] identifier[locateStreamWithContextFolder] operator[SEP] Keyword[final] identifier[String] identifier[uri] , Keyword[final] identifier[String] identifier[contextFolder] operator[SEP] Keyword[throws] identifier[IOException] , identifier[FileNotFoundException] { Keyword[if] operator[SEP] identifier[getWildcardStreamLocator] operator[SEP] operator[SEP] operator[SEP] identifier[hasWildcard] operator[SEP] identifier[uri] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[fullPath] operator[=] identifier[WroUtil] operator[SEP] identifier[getFullPath] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[realPath] operator[=] identifier[contextFolder] operator[+] identifier[fullPath] operator[SEP] Keyword[return] identifier[getWildcardStreamLocator] operator[SEP] operator[SEP] operator[SEP] identifier[locateStream] operator[SEP] identifier[uri] , Keyword[new] identifier[File] operator[SEP] identifier[realPath] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[uriWithoutPrefix] operator[=] identifier[uri] operator[SEP] identifier[replaceFirst] operator[SEP] identifier[PREFIX] , identifier[EMPTY] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[contextFolder] , identifier[uriWithoutPrefix] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] }
public static DateString jodaToCalciteDateString(final DateTime dateTime, final DateTimeZone timeZone) { return new DateString(CALCITE_DATE_PRINTER.print(dateTime.withZone(timeZone))); }
class class_name[name] begin[{] method[jodaToCalciteDateString, return_type[type[DateString]], modifier[public static], parameter[dateTime, timeZone]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=timeZone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withZone, postfix_operators=[], prefix_operators=[], qualifier=dateTime, selectors=[], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=CALCITE_DATE_PRINTER, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateString, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[DateString] identifier[jodaToCalciteDateString] operator[SEP] Keyword[final] identifier[DateTime] identifier[dateTime] , Keyword[final] identifier[DateTimeZone] identifier[timeZone] operator[SEP] { Keyword[return] Keyword[new] identifier[DateString] operator[SEP] identifier[CALCITE_DATE_PRINTER] operator[SEP] identifier[print] operator[SEP] identifier[dateTime] operator[SEP] identifier[withZone] operator[SEP] identifier[timeZone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static I2CBus getInstance(int busNumber) throws UnsupportedBusNumberException, IOException { return provider.getBus(busNumber, DEFAULT_LOCKAQUIRE_TIMEOUT, DEFAULT_LOCKAQUIRE_TIMEOUT_UNITS); }
class class_name[name] begin[{] method[getInstance, return_type[type[I2CBus]], modifier[public static], parameter[busNumber]] begin[{] return[call[provider.getBus, parameter[member[.busNumber], member[.DEFAULT_LOCKAQUIRE_TIMEOUT], member[.DEFAULT_LOCKAQUIRE_TIMEOUT_UNITS]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[I2CBus] identifier[getInstance] operator[SEP] Keyword[int] identifier[busNumber] operator[SEP] Keyword[throws] identifier[UnsupportedBusNumberException] , identifier[IOException] { Keyword[return] identifier[provider] operator[SEP] identifier[getBus] operator[SEP] identifier[busNumber] , identifier[DEFAULT_LOCKAQUIRE_TIMEOUT] , identifier[DEFAULT_LOCKAQUIRE_TIMEOUT_UNITS] operator[SEP] operator[SEP] }
private boolean isSchemaDefinitionInPublishList(CmsUUID publishHistoryId) { if (m_cms == null) { // CmsObject not available, assume there may be a schema definition in the publish history return true; } try { List<CmsPublishedResource> publishedResources = m_cms.readPublishedResources(publishHistoryId); for (CmsPublishedResource cmsPublishedResource : publishedResources) { String resourceRootPath = cmsPublishedResource.getRootPath(); String resourceRootPathLowerCase = resourceRootPath.toLowerCase(); if (resourceRootPathLowerCase.endsWith(".xsd") || resourceRootPathLowerCase.endsWith(".dtd") || m_cacheTemporary.containsKey(getCacheKey(resourceRootPath, true))) { return true; } } } catch (CmsException e) { // error reading published Resources. LOG.warn(e.getMessage(), e); } return false; }
class class_name[name] begin[{] method[isSchemaDefinitionInPublishList, return_type[type[boolean]], modifier[private], parameter[publishHistoryId]] begin[{] if[binary_operation[member[.m_cms], ==, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=publishHistoryId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readPublishedResources, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), name=publishedResources)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsPublishedResource, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=cmsPublishedResource, selectors=[], type_arguments=None), name=resourceRootPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=resourceRootPath, selectors=[], type_arguments=None), name=resourceRootPathLowerCase)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".xsd")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=resourceRootPathLowerCase, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".dtd")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=resourceRootPathLowerCase, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=resourceRootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getCacheKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=m_cacheTemporary, 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=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=publishedResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cmsPublishedResource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsPublishedResource, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, 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=e, types=['CmsException']))], finally_block=None, label=None, resources=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isSchemaDefinitionInPublishList] operator[SEP] identifier[CmsUUID] identifier[publishHistoryId] operator[SEP] { Keyword[if] operator[SEP] identifier[m_cms] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[try] { identifier[List] operator[<] identifier[CmsPublishedResource] operator[>] identifier[publishedResources] operator[=] identifier[m_cms] operator[SEP] identifier[readPublishedResources] operator[SEP] identifier[publishHistoryId] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsPublishedResource] identifier[cmsPublishedResource] operator[:] identifier[publishedResources] operator[SEP] { identifier[String] identifier[resourceRootPath] operator[=] identifier[cmsPublishedResource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[resourceRootPathLowerCase] operator[=] identifier[resourceRootPath] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceRootPathLowerCase] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[resourceRootPathLowerCase] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[m_cacheTemporary] operator[SEP] identifier[containsKey] operator[SEP] identifier[getCacheKey] operator[SEP] identifier[resourceRootPath] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private String getSha1(String name, String version) { if (dotHexCachePath == null || name == null || version == null){ logger.warn("Can't calculate SHA1, missing information: .hex-cache = {}, name = {}, version = {}", dotHexCachePath, name, version); return null; } File tarFile = new File(dotHexCachePath + fileSeparator + name + Constants.DASH + version + TAR_EXTENSION); try { return ChecksumUtils.calculateSHA1(tarFile); } catch (IOException e) { logger.warn("Failed calculating SHA1 of {}. Make sure HEX is installed", tarFile.getPath()); logger.debug("Error: {}", e.getStackTrace()); return null; } }
class class_name[name] begin[{] method[getSha1, return_type[type[String]], modifier[private], parameter[name, version]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.dotHexCachePath], ==, literal[null]], ||, binary_operation[member[.name], ==, literal[null]]], ||, binary_operation[member[.version], ==, literal[null]]]] begin[{] call[logger.warn, parameter[literal["Can't calculate SHA1, missing information: .hex-cache = {}, name = {}, version = {}"], member[.dotHexCachePath], member[.name], member[.version]]] return[literal[null]] else begin[{] None end[}] local_variable[type[File], tarFile] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=tarFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=calculateSHA1, postfix_operators=[], prefix_operators=[], qualifier=ChecksumUtils, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed calculating SHA1 of {}. Make sure HEX is installed"), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=tarFile, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error: {}"), MethodInvocation(arguments=[], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[String] identifier[getSha1] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[version] operator[SEP] { Keyword[if] operator[SEP] identifier[dotHexCachePath] operator[==] Other[null] operator[||] identifier[name] operator[==] Other[null] operator[||] identifier[version] operator[==] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[dotHexCachePath] , identifier[name] , identifier[version] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[File] identifier[tarFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[dotHexCachePath] operator[+] identifier[fileSeparator] operator[+] identifier[name] operator[+] identifier[Constants] operator[SEP] identifier[DASH] operator[+] identifier[version] operator[+] identifier[TAR_EXTENSION] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[ChecksumUtils] operator[SEP] identifier[calculateSHA1] operator[SEP] identifier[tarFile] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[tarFile] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getStackTrace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
private int insertName(final String pName) throws TTException { final String string = (pName == null ? "" : pName); final int nameKey = NamePageHash.generateHashForString(string); NodeMetaPageFactory.MetaKey key = new NodeMetaPageFactory.MetaKey(nameKey); NodeMetaPageFactory.MetaValue value = new NodeMetaPageFactory.MetaValue(string); getPageWtx().getMetaBucket().put(key, value); return nameKey; }
class class_name[name] begin[{] method[insertName, return_type[type[int]], modifier[private], parameter[pName]] begin[{] local_variable[type[String], string] local_variable[type[int], nameKey] local_variable[type[NodeMetaPageFactory], key] local_variable[type[NodeMetaPageFactory], value] call[.getPageWtx, parameter[]] return[member[.nameKey]] end[}] END[}]
Keyword[private] Keyword[int] identifier[insertName] operator[SEP] Keyword[final] identifier[String] identifier[pName] operator[SEP] Keyword[throws] identifier[TTException] { Keyword[final] identifier[String] identifier[string] operator[=] operator[SEP] identifier[pName] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[pName] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[nameKey] operator[=] identifier[NamePageHash] operator[SEP] identifier[generateHashForString] operator[SEP] identifier[string] operator[SEP] operator[SEP] identifier[NodeMetaPageFactory] operator[SEP] identifier[MetaKey] identifier[key] operator[=] Keyword[new] identifier[NodeMetaPageFactory] operator[SEP] identifier[MetaKey] operator[SEP] identifier[nameKey] operator[SEP] operator[SEP] identifier[NodeMetaPageFactory] operator[SEP] identifier[MetaValue] identifier[value] operator[=] Keyword[new] identifier[NodeMetaPageFactory] operator[SEP] identifier[MetaValue] operator[SEP] identifier[string] operator[SEP] operator[SEP] identifier[getPageWtx] operator[SEP] operator[SEP] operator[SEP] identifier[getMetaBucket] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[nameKey] operator[SEP] }
@Override public synchronized String register(ServletConfig config) throws PortletContainerException { ServletContext servletContext = config.getServletContext(); String contextPath = servletContext.getContextPath(); if (!portletContexts.containsKey(contextPath)) { PortletApplicationDefinition portletApp = this.getPortletAppDD(servletContext, contextPath, contextPath); DriverPortletContext portletContext = new DriverPortletContextImpl( servletContext, portletApp, requestDispatcherService); portletContext.setAttribute( PlatformApiBroker.PORTLET_CONTEXT_ATTRIBUTE_NAME, platformApiBroker); portletContexts.put(contextPath, portletContext); fireRegistered(portletContext); if (logger.isInfoEnabled()) { logger.info("Registered portlet application for context '" + contextPath + "'"); logger.info( "Registering " + portletApp.getPortlets().size() + " portlets for context " + portletContext.getApplicationName()); } // TODO have the portlet servlet provide the portlet's classloader as parameter to this // method // This approach is needed as all pluto callbacks in uPortal have an aspect that // switches the thread classloader back // to uPortal's classloader. ClassLoader classLoader = ThreadContextClassLoaderAspect.getPreviousClassLoader(); if (classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); } classLoaders.put(portletApp.getName(), classLoader); for (PortletDefinition portlet : portletApp.getPortlets()) { String appName = portletContext.getApplicationName(); if (appName == null) { throw new PortletContainerException( "Portlet application name should not be null."); } portletConfigs.put( portletContext.getApplicationName() + "/" + portlet.getPortletName(), new DriverPortletConfigImpl(portletContext, portlet)); } } else { if (logger.isInfoEnabled()) { logger.info( "Portlet application for context '" + contextPath + "' already registered."); } } return contextPath; }
class class_name[name] begin[{] method[register, return_type[type[String]], modifier[synchronized public], parameter[config]] begin[{] local_variable[type[ServletContext], servletContext] local_variable[type[String], contextPath] if[call[portletContexts.containsKey, parameter[member[.contextPath]]]] begin[{] local_variable[type[PortletApplicationDefinition], portletApp] local_variable[type[DriverPortletContext], portletContext] call[portletContext.setAttribute, parameter[member[PlatformApiBroker.PORTLET_CONTEXT_ATTRIBUTE_NAME], member[.platformApiBroker]]] call[portletContexts.put, parameter[member[.contextPath], member[.portletContext]]] call[.fireRegistered, parameter[member[.portletContext]]] if[call[logger.isInfoEnabled, parameter[]]] begin[{] call[logger.info, parameter[binary_operation[binary_operation[literal["Registered portlet application for context '"], +, member[.contextPath]], +, literal["'"]]]] call[logger.info, parameter[binary_operation[binary_operation[binary_operation[literal["Registering "], +, call[portletApp.getPortlets, parameter[]]], +, literal[" portlets for context "]], +, call[portletContext.getApplicationName, parameter[]]]]] else begin[{] None end[}] local_variable[type[ClassLoader], classLoader] if[binary_operation[member[.classLoader], ==, literal[null]]] begin[{] assign[member[.classLoader], call[Thread.currentThread, parameter[]]] else begin[{] None end[}] call[classLoaders.put, parameter[call[portletApp.getName, parameter[]], member[.classLoader]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getApplicationName, postfix_operators=[], prefix_operators=[], qualifier=portletContext, selectors=[], type_arguments=None), name=appName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=appName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Portlet application name should not be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PortletContainerException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getApplicationName, postfix_operators=[], prefix_operators=[], qualifier=portletContext, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MethodInvocation(arguments=[], member=getPortletName, postfix_operators=[], prefix_operators=[], qualifier=portlet, selectors=[], type_arguments=None), operator=+), ClassCreator(arguments=[MemberReference(member=portletContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portlet, 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=DriverPortletConfigImpl, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=portletConfigs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPortlets, postfix_operators=[], prefix_operators=[], qualifier=portletApp, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=portlet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PortletDefinition, sub_type=None))), label=None) else begin[{] if[call[logger.isInfoEnabled, parameter[]]] begin[{] call[logger.info, parameter[binary_operation[binary_operation[literal["Portlet application for context '"], +, member[.contextPath]], +, literal["' already registered."]]]] else begin[{] None end[}] end[}] return[member[.contextPath]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] identifier[String] identifier[register] operator[SEP] identifier[ServletConfig] identifier[config] operator[SEP] Keyword[throws] identifier[PortletContainerException] { identifier[ServletContext] identifier[servletContext] operator[=] identifier[config] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[contextPath] operator[=] identifier[servletContext] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[portletContexts] operator[SEP] identifier[containsKey] operator[SEP] identifier[contextPath] operator[SEP] operator[SEP] { identifier[PortletApplicationDefinition] identifier[portletApp] operator[=] Keyword[this] operator[SEP] identifier[getPortletAppDD] operator[SEP] identifier[servletContext] , identifier[contextPath] , identifier[contextPath] operator[SEP] operator[SEP] identifier[DriverPortletContext] identifier[portletContext] operator[=] Keyword[new] identifier[DriverPortletContextImpl] operator[SEP] identifier[servletContext] , identifier[portletApp] , identifier[requestDispatcherService] operator[SEP] operator[SEP] identifier[portletContext] operator[SEP] identifier[setAttribute] operator[SEP] identifier[PlatformApiBroker] operator[SEP] identifier[PORTLET_CONTEXT_ATTRIBUTE_NAME] , identifier[platformApiBroker] operator[SEP] operator[SEP] identifier[portletContexts] operator[SEP] identifier[put] operator[SEP] identifier[contextPath] , identifier[portletContext] operator[SEP] operator[SEP] identifier[fireRegistered] operator[SEP] identifier[portletContext] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[contextPath] operator[+] literal[String] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[portletApp] operator[SEP] identifier[getPortlets] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[portletContext] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ClassLoader] identifier[classLoader] operator[=] identifier[ThreadContextClassLoaderAspect] operator[SEP] identifier[getPreviousClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classLoader] operator[==] Other[null] operator[SEP] { identifier[classLoader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] } identifier[classLoaders] operator[SEP] identifier[put] operator[SEP] identifier[portletApp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[classLoader] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PortletDefinition] identifier[portlet] operator[:] identifier[portletApp] operator[SEP] identifier[getPortlets] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[appName] operator[=] identifier[portletContext] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[appName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[PortletContainerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[portletConfigs] operator[SEP] identifier[put] operator[SEP] identifier[portletContext] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[portlet] operator[SEP] identifier[getPortletName] operator[SEP] operator[SEP] , Keyword[new] identifier[DriverPortletConfigImpl] operator[SEP] identifier[portletContext] , identifier[portlet] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[contextPath] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[contextPath] operator[SEP] }
protected ResultSet findWorkspacePropertiesOnValueStorage() throws SQLException { if (findWorkspacePropertiesOnValueStorage == null) { findWorkspacePropertiesOnValueStorage = dbConnection.prepareStatement(FIND_WORKSPACE_PROPERTIES_ON_VALUE_STORAGE); } return findWorkspacePropertiesOnValueStorage.executeQuery(); }
class class_name[name] begin[{] method[findWorkspacePropertiesOnValueStorage, return_type[type[ResultSet]], modifier[protected], parameter[]] begin[{] if[binary_operation[member[.findWorkspacePropertiesOnValueStorage], ==, literal[null]]] begin[{] assign[member[.findWorkspacePropertiesOnValueStorage], call[dbConnection.prepareStatement, parameter[member[.FIND_WORKSPACE_PROPERTIES_ON_VALUE_STORAGE]]]] else begin[{] None end[}] return[call[findWorkspacePropertiesOnValueStorage.executeQuery, parameter[]]] end[}] END[}]
Keyword[protected] identifier[ResultSet] identifier[findWorkspacePropertiesOnValueStorage] operator[SEP] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[if] operator[SEP] identifier[findWorkspacePropertiesOnValueStorage] operator[==] Other[null] operator[SEP] { identifier[findWorkspacePropertiesOnValueStorage] operator[=] identifier[dbConnection] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[FIND_WORKSPACE_PROPERTIES_ON_VALUE_STORAGE] operator[SEP] operator[SEP] } Keyword[return] identifier[findWorkspacePropertiesOnValueStorage] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] }
public LinkedHashMap<String,S> process() throws IOException, CompoundNotFoundException { LinkedHashMap<String,S> result = process(-1); close(); return result; }
class class_name[name] begin[{] method[process, return_type[type[LinkedHashMap]], modifier[public], parameter[]] begin[{] local_variable[type[LinkedHashMap], result] call[.close, parameter[]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[S] operator[>] identifier[process] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[CompoundNotFoundException] { identifier[LinkedHashMap] operator[<] identifier[String] , identifier[S] operator[>] identifier[result] operator[=] identifier[process] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static <C> SLF4JLogTemplate<C> toSLF4J(String loggerName, String levelName) { return toSLF4J(loggerName, levelName, null); }
class class_name[name] begin[{] method[toSLF4J, return_type[type[SLF4JLogTemplate]], modifier[public static], parameter[loggerName, levelName]] begin[{] return[call[.toSLF4J, parameter[member[.loggerName], member[.levelName], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[C] operator[>] identifier[SLF4JLogTemplate] operator[<] identifier[C] operator[>] identifier[toSLF4J] operator[SEP] identifier[String] identifier[loggerName] , identifier[String] identifier[levelName] operator[SEP] { Keyword[return] identifier[toSLF4J] operator[SEP] identifier[loggerName] , identifier[levelName] , Other[null] operator[SEP] operator[SEP] }
public static Cipher getCipher(String algorithm) throws GeneralSecurityException { return PROVIDER != null ? Cipher.getInstance(algorithm, PROVIDER) : Cipher.getInstance(algorithm); }
class class_name[name] begin[{] method[getCipher, return_type[type[Cipher]], modifier[public static], parameter[algorithm]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=PROVIDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PROVIDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Cipher] identifier[getCipher] operator[SEP] identifier[String] identifier[algorithm] operator[SEP] Keyword[throws] identifier[GeneralSecurityException] { Keyword[return] identifier[PROVIDER] operator[!=] Other[null] operator[?] identifier[Cipher] operator[SEP] identifier[getInstance] operator[SEP] identifier[algorithm] , identifier[PROVIDER] operator[SEP] operator[:] identifier[Cipher] operator[SEP] identifier[getInstance] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] }
public Optional<DataDirEntry> maybeGetDataDirEntry(DataDirectoryKey key) { return Optional.fromNullable(dataDirectory.get(key)); }
class class_name[name] begin[{] method[maybeGetDataDirEntry, return_type[type[Optional]], modifier[public], parameter[key]] begin[{] return[call[Optional.fromNullable, parameter[call[dataDirectory.get, parameter[member[.key]]]]]] end[}] END[}]
Keyword[public] identifier[Optional] operator[<] identifier[DataDirEntry] operator[>] identifier[maybeGetDataDirEntry] operator[SEP] identifier[DataDirectoryKey] identifier[key] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[fromNullable] operator[SEP] identifier[dataDirectory] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SarlPackage.SARL_ARTIFACT__EXTENDS: return getExtends(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SARL_ARTIFACT__EXTENDS, postfix_operators=[], prefix_operators=[], qualifier=SarlPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getExtends, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[SarlPackage] operator[SEP] identifier[SARL_ARTIFACT__EXTENDS] operator[:] Keyword[return] identifier[getExtends] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { logger.debug("Inject ApplicationContext: {} into SpringContextsUtil", applicationContext); SpringContextsUtil.applicationContext = applicationContext; }
class class_name[name] begin[{] method[setApplicationContext, return_type[void], modifier[public], parameter[applicationContext]] begin[{] call[logger.debug, parameter[literal["Inject ApplicationContext: {} into SpringContextsUtil"], member[.applicationContext]]] assign[member[SpringContextsUtil.applicationContext], member[.applicationContext]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setApplicationContext] operator[SEP] identifier[ApplicationContext] identifier[applicationContext] operator[SEP] Keyword[throws] identifier[BeansException] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[applicationContext] operator[SEP] operator[SEP] identifier[SpringContextsUtil] operator[SEP] identifier[applicationContext] operator[=] identifier[applicationContext] operator[SEP] }
private String readMethodHttpMethod(final Method actionMethod) { for (Class<? extends Annotation> methodAnnotation : METHOD_ANNOTATIONS) { if (actionMethod.getAnnotation(methodAnnotation) != null) { return methodAnnotation.getSimpleName(); } } return null; }
class class_name[name] begin[{] method[readMethodHttpMethod, return_type[type[String]], modifier[private], parameter[actionMethod]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=methodAnnotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=actionMethod, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=methodAnnotation, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=METHOD_ANNOTATIONS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=methodAnnotation)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] identifier[String] identifier[readMethodHttpMethod] operator[SEP] Keyword[final] identifier[Method] identifier[actionMethod] operator[SEP] { Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[methodAnnotation] operator[:] identifier[METHOD_ANNOTATIONS] operator[SEP] { Keyword[if] operator[SEP] identifier[actionMethod] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[methodAnnotation] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[methodAnnotation] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public final TableSink<T> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes) { final TableSinkBase<T> configuredSink = this.copy(); configuredSink.fieldNames = Optional.of(fieldNames); configuredSink.fieldTypes = Optional.of(fieldTypes); return configuredSink; }
class class_name[name] begin[{] method[configure, return_type[type[TableSink]], modifier[final public], parameter[fieldNames, fieldTypes]] begin[{] local_variable[type[TableSinkBase], configuredSink] assign[member[configuredSink.fieldNames], call[Optional.of, parameter[member[.fieldNames]]]] assign[member[configuredSink.fieldTypes], call[Optional.of, parameter[member[.fieldTypes]]]] return[member[.configuredSink]] end[}] END[}]
Keyword[public] Keyword[final] identifier[TableSink] operator[<] identifier[T] operator[>] identifier[configure] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[fieldNames] , identifier[TypeInformation] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[fieldTypes] operator[SEP] { Keyword[final] identifier[TableSinkBase] operator[<] identifier[T] operator[>] identifier[configuredSink] operator[=] Keyword[this] operator[SEP] identifier[copy] operator[SEP] operator[SEP] operator[SEP] identifier[configuredSink] operator[SEP] identifier[fieldNames] operator[=] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[fieldNames] operator[SEP] operator[SEP] identifier[configuredSink] operator[SEP] identifier[fieldTypes] operator[=] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[fieldTypes] operator[SEP] operator[SEP] Keyword[return] identifier[configuredSink] operator[SEP] }
private static boolean isValidConfigNode(final boolean sslEnabled, final NodeInfo nodeInfo) { if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.CONFIG)) { return true; } else if (nodeInfo.services().containsKey(ServiceType.CONFIG)) { return true; } return false; }
class class_name[name] begin[{] method[isValidConfigNode, return_type[type[boolean]], modifier[private static], parameter[sslEnabled, nodeInfo]] begin[{] if[binary_operation[member[.sslEnabled], &&, call[nodeInfo.sslServices, parameter[]]]] begin[{] return[literal[true]] else begin[{] if[call[nodeInfo.services, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isValidConfigNode] operator[SEP] Keyword[final] Keyword[boolean] identifier[sslEnabled] , Keyword[final] identifier[NodeInfo] identifier[nodeInfo] operator[SEP] { Keyword[if] operator[SEP] identifier[sslEnabled] operator[&&] identifier[nodeInfo] operator[SEP] identifier[sslServices] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[ServiceType] operator[SEP] identifier[CONFIG] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[nodeInfo] operator[SEP] identifier[services] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[ServiceType] operator[SEP] identifier[CONFIG] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private static StringBuilder buildAbsoluteFinalFile(String file, String basePath, File destinationFolder, boolean isFlatten) { StringBuilder retval = new StringBuilder( destinationFolder.getAbsolutePath()); PathUtils.addEndingSlashIfNeeded(retval); if (!isFlatten) { // delete output directory from basePath String relativePath = file.replace(basePath, ""); retval.append(relativePath); } else { // skip location file String relativePath = new File(file).getName(); retval.append(relativePath); } return retval; }
class class_name[name] begin[{] method[buildAbsoluteFinalFile, return_type[type[StringBuilder]], modifier[private static], parameter[file, basePath, destinationFolder, isFlatten]] begin[{] local_variable[type[StringBuilder], retval] call[PathUtils.addEndingSlashIfNeeded, parameter[member[.retval]]] if[member[.isFlatten]] begin[{] local_variable[type[String], relativePath] call[retval.append, parameter[member[.relativePath]]] else begin[{] local_variable[type[String], relativePath] call[retval.append, parameter[member[.relativePath]]] end[}] return[member[.retval]] end[}] END[}]
Keyword[private] Keyword[static] identifier[StringBuilder] identifier[buildAbsoluteFinalFile] operator[SEP] identifier[String] identifier[file] , identifier[String] identifier[basePath] , identifier[File] identifier[destinationFolder] , Keyword[boolean] identifier[isFlatten] operator[SEP] { identifier[StringBuilder] identifier[retval] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[destinationFolder] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[PathUtils] operator[SEP] identifier[addEndingSlashIfNeeded] operator[SEP] identifier[retval] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isFlatten] operator[SEP] { identifier[String] identifier[relativePath] operator[=] identifier[file] operator[SEP] identifier[replace] operator[SEP] identifier[basePath] , literal[String] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[append] operator[SEP] identifier[relativePath] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[relativePath] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[append] operator[SEP] identifier[relativePath] operator[SEP] operator[SEP] } Keyword[return] identifier[retval] operator[SEP] }
@Override public void execute(FunctionContext<Object> functionContext) { try { String[] args = (String[])functionContext.getArguments(); if(args == null || args.length == 0) throw new IllegalArgumentException("region argument required"); String regionName = args[0]; if(regionName == null || regionName.length() == 0) throw new IllegalArgumentException("region name argument required"); Region<Serializable,Object> region = CacheFactory.getAnyInstance().getRegion(regionName); if(region == null) throw new IllegalArgumentException("region:"+regionName+" not found"); functionContext.getResultSender().lastResult(buildCheckSumMap(region)); } catch (Exception e) { String stack = Debugger.stackTrace(e); LogManager.getLogger(getClass()).error(stack); throw new FunctionException(stack); } }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[functionContext]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getArguments, postfix_operators=[], prefix_operators=[], qualifier=functionContext, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), name=args)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="region argument required")], 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)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), name=regionName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=regionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=regionName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="region name argument required")], 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)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAnyInstance, postfix_operators=[], prefix_operators=[], qualifier=CacheFactory, selectors=[MethodInvocation(arguments=[MemberReference(member=regionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRegion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=region)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Serializable, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Region, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=region, 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=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="region:"), operandr=MemberReference(member=regionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not found"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getResultSender, postfix_operators=[], prefix_operators=[], qualifier=functionContext, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=region, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildCheckSumMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=lastResult, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stackTrace, postfix_operators=[], prefix_operators=[], qualifier=Debugger, selectors=[], type_arguments=None), name=stack)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=LogManager, selectors=[MethodInvocation(arguments=[MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=stack, 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=FunctionException, 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[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[FunctionContext] operator[<] identifier[Object] operator[>] identifier[functionContext] operator[SEP] { Keyword[try] { identifier[String] operator[SEP] operator[SEP] identifier[args] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] identifier[functionContext] operator[SEP] identifier[getArguments] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[args] operator[==] Other[null] operator[||] identifier[args] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[regionName] operator[=] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[regionName] operator[==] Other[null] operator[||] identifier[regionName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Region] operator[<] identifier[Serializable] , identifier[Object] operator[>] identifier[region] operator[=] identifier[CacheFactory] operator[SEP] identifier[getAnyInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getRegion] operator[SEP] identifier[regionName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[region] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[regionName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[functionContext] operator[SEP] identifier[getResultSender] operator[SEP] operator[SEP] operator[SEP] identifier[lastResult] operator[SEP] identifier[buildCheckSumMap] operator[SEP] identifier[region] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[String] identifier[stack] operator[=] identifier[Debugger] operator[SEP] identifier[stackTrace] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[LogManager] operator[SEP] identifier[getLogger] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[stack] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[FunctionException] operator[SEP] identifier[stack] operator[SEP] operator[SEP] } }
public Observable<MediaServiceInner> updateAsync(String resourceGroupName, String mediaServiceName, MediaServiceInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, mediaServiceName, parameters).map(new Func1<ServiceResponse<MediaServiceInner>, MediaServiceInner>() { @Override public MediaServiceInner call(ServiceResponse<MediaServiceInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[updateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, mediaServiceName, parameters]] begin[{] return[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.mediaServiceName], member[.parameters]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[MediaServiceInner] operator[>] identifier[updateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[mediaServiceName] , identifier[MediaServiceInner] identifier[parameters] operator[SEP] { Keyword[return] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[mediaServiceName] , identifier[parameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[MediaServiceInner] operator[>] , identifier[MediaServiceInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[MediaServiceInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[MediaServiceInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void reset() { tick = 0; first = true; tracker.reset(); keyToWorld.reset(); currToKey.reset(); currToWorld.reset(); worldToCurrCam3D.reset(); }
class class_name[name] begin[{] method[reset, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.tick], literal[0]] assign[member[.first], literal[true]] call[tracker.reset, parameter[]] call[keyToWorld.reset, parameter[]] call[currToKey.reset, parameter[]] call[currToWorld.reset, parameter[]] call[worldToCurrCam3D.reset, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[reset] operator[SEP] operator[SEP] { identifier[tick] operator[=] Other[0] operator[SEP] identifier[first] operator[=] literal[boolean] operator[SEP] identifier[tracker] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[keyToWorld] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[currToKey] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[currToWorld] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[worldToCurrCam3D] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] }
public static <T> AbstractQueueJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) { return new AbstractQueueJsonDeserializer<T>( deserializer ); }
class class_name[name] begin[{] method[newInstance, return_type[type[AbstractQueueJsonDeserializer]], modifier[public static], parameter[deserializer]] begin[{] return[ClassCreator(arguments=[MemberReference(member=deserializer, 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=T, sub_type=None))], dimensions=None, name=AbstractQueueJsonDeserializer, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[AbstractQueueJsonDeserializer] operator[<] identifier[T] operator[>] identifier[newInstance] operator[SEP] identifier[JsonDeserializer] operator[<] identifier[T] operator[>] identifier[deserializer] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractQueueJsonDeserializer] operator[<] identifier[T] operator[>] operator[SEP] identifier[deserializer] operator[SEP] operator[SEP] }
public static Object shiftSignedRight(Object arg1, Object arg2) throws NoSuchMethodException { int code1 = typeCode(arg1); int code2 = typeCode(arg2); if (code1 <= INT) { int val1 = unboxCharOrInt(arg1, code1); if (code2 <= INT) { int val2 = unboxCharOrInt(arg2, code2); return boxToInteger(val1 >> val2); } if (code2 <= LONG) { long val2 = unboxCharOrLong(arg2, code2); return boxToInteger(val1 >> val2); } } if (code1 <= LONG) { long val1 = unboxCharOrLong(arg1, code1); if (code2 <= INT) { int val2 = unboxCharOrInt(arg2, code2); return boxToLong(val1 >> val2); } if (code2 <= LONG) { long val2 = unboxCharOrLong(arg2, code2); return boxToLong(val1 >> val2); } } throw new NoSuchMethodException(); }
class class_name[name] begin[{] method[shiftSignedRight, return_type[type[Object]], modifier[public static], parameter[arg1, arg2]] begin[{] local_variable[type[int], code1] local_variable[type[int], code2] if[binary_operation[member[.code1], <=, member[.INT]]] begin[{] local_variable[type[int], val1] if[binary_operation[member[.code2], <=, member[.INT]]] begin[{] local_variable[type[int], val2] return[call[.boxToInteger, parameter[binary_operation[member[.val1], >>, member[.val2]]]]] else begin[{] None end[}] if[binary_operation[member[.code2], <=, member[.LONG]]] begin[{] local_variable[type[long], val2] return[call[.boxToInteger, parameter[binary_operation[member[.val1], >>, member[.val2]]]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.code1], <=, member[.LONG]]] begin[{] local_variable[type[long], val1] if[binary_operation[member[.code2], <=, member[.INT]]] begin[{] local_variable[type[int], val2] return[call[.boxToLong, parameter[binary_operation[member[.val1], >>, member[.val2]]]]] else begin[{] None end[}] if[binary_operation[member[.code2], <=, member[.LONG]]] begin[{] local_variable[type[long], val2] return[call[.boxToLong, parameter[binary_operation[member[.val1], >>, member[.val2]]]]] else begin[{] None end[}] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchMethodException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[shiftSignedRight] operator[SEP] identifier[Object] identifier[arg1] , identifier[Object] identifier[arg2] operator[SEP] Keyword[throws] identifier[NoSuchMethodException] { Keyword[int] identifier[code1] operator[=] identifier[typeCode] operator[SEP] identifier[arg1] operator[SEP] operator[SEP] Keyword[int] identifier[code2] operator[=] identifier[typeCode] operator[SEP] identifier[arg2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[code1] operator[<=] identifier[INT] operator[SEP] { Keyword[int] identifier[val1] operator[=] identifier[unboxCharOrInt] operator[SEP] identifier[arg1] , identifier[code1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[code2] operator[<=] identifier[INT] operator[SEP] { Keyword[int] identifier[val2] operator[=] identifier[unboxCharOrInt] operator[SEP] identifier[arg2] , identifier[code2] operator[SEP] operator[SEP] Keyword[return] identifier[boxToInteger] operator[SEP] identifier[val1] operator[>] operator[>] identifier[val2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[code2] operator[<=] identifier[LONG] operator[SEP] { Keyword[long] identifier[val2] operator[=] identifier[unboxCharOrLong] operator[SEP] identifier[arg2] , identifier[code2] operator[SEP] operator[SEP] Keyword[return] identifier[boxToInteger] operator[SEP] identifier[val1] operator[>] operator[>] identifier[val2] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[code1] operator[<=] identifier[LONG] operator[SEP] { Keyword[long] identifier[val1] operator[=] identifier[unboxCharOrLong] operator[SEP] identifier[arg1] , identifier[code1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[code2] operator[<=] identifier[INT] operator[SEP] { Keyword[int] identifier[val2] operator[=] identifier[unboxCharOrInt] operator[SEP] identifier[arg2] , identifier[code2] operator[SEP] operator[SEP] Keyword[return] identifier[boxToLong] operator[SEP] identifier[val1] operator[>] operator[>] identifier[val2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[code2] operator[<=] identifier[LONG] operator[SEP] { Keyword[long] identifier[val2] operator[=] identifier[unboxCharOrLong] operator[SEP] identifier[arg2] , identifier[code2] operator[SEP] operator[SEP] Keyword[return] identifier[boxToLong] operator[SEP] identifier[val1] operator[>] operator[>] identifier[val2] operator[SEP] operator[SEP] } } Keyword[throw] Keyword[new] identifier[NoSuchMethodException] operator[SEP] operator[SEP] operator[SEP] }
public static void main(String argv[]) { StringUtils.startupShutdownMessage(HourGlass.class, argv, LOG); try { HourGlass hourGlass = new HourGlass(new Configuration()); hourGlass.run(); } catch (Throwable e) { LOG.fatal(StringUtils.stringifyException(e)); System.exit(-1); } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[argv]] begin[{] call[StringUtils.startupShutdownMessage, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HourGlass, sub_type=None)), member[.argv], member[.LOG]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Configuration, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HourGlass, sub_type=None)), name=hourGlass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HourGlass, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=hourGlass, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stringifyException, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], member=fatal, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] identifier[argv] operator[SEP] operator[SEP] operator[SEP] { identifier[StringUtils] operator[SEP] identifier[startupShutdownMessage] operator[SEP] identifier[HourGlass] operator[SEP] Keyword[class] , identifier[argv] , identifier[LOG] operator[SEP] operator[SEP] Keyword[try] { identifier[HourGlass] identifier[hourGlass] operator[=] Keyword[new] identifier[HourGlass] operator[SEP] Keyword[new] identifier[Configuration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[hourGlass] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[fatal] operator[SEP] identifier[StringUtils] operator[SEP] identifier[stringifyException] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } }
@Scheduled(fixedRateString = "${hystrix.stream.queue.sendRate:${hystrix.stream.queue.send-rate:500}}") public void sendMetrics() { ArrayList<String> metrics = new ArrayList<>(); this.jsonMetrics.drainTo(metrics); if (!metrics.isEmpty()) { if (log.isTraceEnabled()) { log.trace("sending stream metrics size: " + metrics.size()); } for (String json : metrics) { // TODO: batch all metrics to one message try { // TODO: remove the explicit content type when s-c-stream can handle // that for us this.outboundChannel.send(MessageBuilder.withPayload(json) .setHeader(MessageHeaders.CONTENT_TYPE, this.properties.getContentType()) .build()); } catch (Exception ex) { if (log.isTraceEnabled()) { log.trace("failed sending stream metrics: " + ex.getMessage()); } } } } }
class class_name[name] begin[{] method[sendMetrics, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[ArrayList], metrics] THIS[member[None.jsonMetrics]call[None.drainTo, parameter[member[.metrics]]]] if[call[metrics.isEmpty, parameter[]]] begin[{] if[call[log.isTraceEnabled, parameter[]]] begin[{] call[log.trace, parameter[binary_operation[literal["sending stream metrics size: "], +, call[metrics.size, parameter[]]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outboundChannel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=json, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withPayload, postfix_operators=[], prefix_operators=[], qualifier=MessageBuilder, selectors=[MethodInvocation(arguments=[MemberReference(member=CONTENT_TYPE, postfix_operators=[], prefix_operators=[], qualifier=MessageHeaders, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=properties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getContentType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=setHeader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=send, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed sending stream metrics: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), operator=+)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=metrics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=json)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Scheduled] operator[SEP] identifier[fixedRateString] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[sendMetrics] operator[SEP] operator[SEP] { identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[metrics] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[jsonMetrics] operator[SEP] identifier[drainTo] operator[SEP] identifier[metrics] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[metrics] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[metrics] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[json] operator[:] identifier[metrics] operator[SEP] { Keyword[try] { Keyword[this] operator[SEP] identifier[outboundChannel] operator[SEP] identifier[send] operator[SEP] identifier[MessageBuilder] operator[SEP] identifier[withPayload] operator[SEP] identifier[json] operator[SEP] operator[SEP] identifier[setHeader] operator[SEP] identifier[MessageHeaders] operator[SEP] identifier[CONTENT_TYPE] , Keyword[this] operator[SEP] identifier[properties] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } }
public void clear() { min = Double.POSITIVE_INFINITY; max = -Double.POSITIVE_INFINITY; negatives = 0; positives = 0; zeros = 0; sum0 = 0; sum1 = 0; sum2 = 0; sumLog = 0; }
class class_name[name] begin[{] method[clear, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.min], member[Double.POSITIVE_INFINITY]] assign[member[.max], member[Double.POSITIVE_INFINITY]] assign[member[.negatives], literal[0]] assign[member[.positives], literal[0]] assign[member[.zeros], literal[0]] assign[member[.sum0], literal[0]] assign[member[.sum1], literal[0]] assign[member[.sum2], literal[0]] assign[member[.sumLog], literal[0]] end[}] END[}]
Keyword[public] Keyword[void] identifier[clear] operator[SEP] operator[SEP] { identifier[min] operator[=] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP] identifier[max] operator[=] operator[-] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP] identifier[negatives] operator[=] Other[0] operator[SEP] identifier[positives] operator[=] Other[0] operator[SEP] identifier[zeros] operator[=] Other[0] operator[SEP] identifier[sum0] operator[=] Other[0] operator[SEP] identifier[sum1] operator[=] Other[0] operator[SEP] identifier[sum2] operator[=] Other[0] operator[SEP] identifier[sumLog] operator[=] Other[0] operator[SEP] }
public void setSparseComponent(int component, int index, double value) { if (component >= pointers.length) { increaseSizeTo(component + 1); } double[] sparseInfo = new double[2]; sparseInfo[0] = index; sparseInfo[1] = value; pointers[component] = sparseInfo; sparse[component] = true; copyOnWrite[component] = false; }
class class_name[name] begin[{] method[setSparseComponent, return_type[void], modifier[public], parameter[component, index, value]] begin[{] if[binary_operation[member[.component], >=, member[pointers.length]]] begin[{] call[.increaseSizeTo, parameter[binary_operation[member[.component], +, literal[1]]]] else begin[{] None end[}] local_variable[type[double], sparseInfo] assign[member[.sparseInfo], member[.index]] assign[member[.sparseInfo], member[.value]] assign[member[.pointers], member[.sparseInfo]] assign[member[.sparse], literal[true]] assign[member[.copyOnWrite], literal[false]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSparseComponent] operator[SEP] Keyword[int] identifier[component] , Keyword[int] identifier[index] , Keyword[double] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[component] operator[>=] identifier[pointers] operator[SEP] identifier[length] operator[SEP] { identifier[increaseSizeTo] operator[SEP] identifier[component] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[double] operator[SEP] operator[SEP] identifier[sparseInfo] operator[=] Keyword[new] Keyword[double] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[sparseInfo] operator[SEP] Other[0] operator[SEP] operator[=] identifier[index] operator[SEP] identifier[sparseInfo] operator[SEP] Other[1] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[pointers] operator[SEP] identifier[component] operator[SEP] operator[=] identifier[sparseInfo] operator[SEP] identifier[sparse] operator[SEP] identifier[component] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[copyOnWrite] operator[SEP] identifier[component] operator[SEP] operator[=] literal[boolean] operator[SEP] }
public ColumnVector solve(ColumnVector b, boolean improve) throws MatrixException { // Validate b's size. if (b.nRows != nRows) { throw new MatrixException( MatrixException.INVALID_DIMENSIONS); } decompose(); // Solve Ly = b for y by forward substitution. // Solve Ux = y for x by back substitution. ColumnVector y = forwardSubstitution(b); ColumnVector x = backSubstitution(y); // Improve and return x. if (improve) improve(b, x); return x; }
class class_name[name] begin[{] method[solve, return_type[type[ColumnVector]], modifier[public], parameter[b, improve]] begin[{] if[binary_operation[member[b.nRows], !=, member[.nRows]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_DIMENSIONS, postfix_operators=[], prefix_operators=[], qualifier=MatrixException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MatrixException, sub_type=None)), label=None) else begin[{] None end[}] call[.decompose, parameter[]] local_variable[type[ColumnVector], y] local_variable[type[ColumnVector], x] if[member[.improve]] begin[{] call[.improve, parameter[member[.b], member[.x]]] else begin[{] None end[}] return[member[.x]] end[}] END[}]
Keyword[public] identifier[ColumnVector] identifier[solve] operator[SEP] identifier[ColumnVector] identifier[b] , Keyword[boolean] identifier[improve] operator[SEP] Keyword[throws] identifier[MatrixException] { Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[nRows] operator[!=] identifier[nRows] operator[SEP] { Keyword[throw] Keyword[new] identifier[MatrixException] operator[SEP] identifier[MatrixException] operator[SEP] identifier[INVALID_DIMENSIONS] operator[SEP] operator[SEP] } identifier[decompose] operator[SEP] operator[SEP] operator[SEP] identifier[ColumnVector] identifier[y] operator[=] identifier[forwardSubstitution] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[ColumnVector] identifier[x] operator[=] identifier[backSubstitution] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[improve] operator[SEP] identifier[improve] operator[SEP] identifier[b] , identifier[x] operator[SEP] operator[SEP] Keyword[return] identifier[x] operator[SEP] }
public void setSubDomainSettings(java.util.Collection<SubDomainSetting> subDomainSettings) { if (subDomainSettings == null) { this.subDomainSettings = null; return; } this.subDomainSettings = new java.util.ArrayList<SubDomainSetting>(subDomainSettings); }
class class_name[name] begin[{] method[setSubDomainSettings, return_type[void], modifier[public], parameter[subDomainSettings]] begin[{] if[binary_operation[member[.subDomainSettings], ==, literal[null]]] begin[{] assign[THIS[member[None.subDomainSettings]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.subDomainSettings]], ClassCreator(arguments=[MemberReference(member=subDomainSettings, 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=SubDomainSetting, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSubDomainSettings] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[SubDomainSetting] operator[>] identifier[subDomainSettings] operator[SEP] { Keyword[if] operator[SEP] identifier[subDomainSettings] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[subDomainSettings] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[subDomainSettings] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[SubDomainSetting] operator[>] operator[SEP] identifier[subDomainSettings] operator[SEP] operator[SEP] }
public boolean isPureTranslation() { if (isPureCrystalTranslation()) return true; if (SpaceGroup.deltaComp(matTransform.m00,1,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m01,0,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m02,0,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m10,0,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m11,1,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m12,0,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m20,0,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m21,0,SpaceGroup.DELTA) && SpaceGroup.deltaComp(matTransform.m22,1,SpaceGroup.DELTA) && ( Math.abs(matTransform.m03-0.0)>SpaceGroup.DELTA || Math.abs(matTransform.m13-0.0)>SpaceGroup.DELTA || Math.abs(matTransform.m23-0.0)>SpaceGroup.DELTA)) { return true; } return false; }
class class_name[name] begin[{] method[isPureTranslation, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[call[.isPureCrystalTranslation, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[SpaceGroup.deltaComp, parameter[member[matTransform.m00], literal[1], member[SpaceGroup.DELTA]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m01], literal[0], member[SpaceGroup.DELTA]]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m02], literal[0], member[SpaceGroup.DELTA]]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m10], literal[0], member[SpaceGroup.DELTA]]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m11], literal[1], member[SpaceGroup.DELTA]]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m12], literal[0], member[SpaceGroup.DELTA]]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m20], literal[0], member[SpaceGroup.DELTA]]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m21], literal[0], member[SpaceGroup.DELTA]]]], &&, call[SpaceGroup.deltaComp, parameter[member[matTransform.m22], literal[1], member[SpaceGroup.DELTA]]]], &&, binary_operation[binary_operation[binary_operation[call[Math.abs, parameter[binary_operation[member[matTransform.m03], -, literal[0.0]]]], >, member[SpaceGroup.DELTA]], ||, binary_operation[call[Math.abs, parameter[binary_operation[member[matTransform.m13], -, literal[0.0]]]], >, member[SpaceGroup.DELTA]]], ||, binary_operation[call[Math.abs, parameter[binary_operation[member[matTransform.m23], -, literal[0.0]]]], >, member[SpaceGroup.DELTA]]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isPureTranslation] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isPureCrystalTranslation] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m00] , Other[1] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m01] , Other[0] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m02] , Other[0] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m10] , Other[0] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m11] , Other[1] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m12] , Other[0] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m20] , Other[0] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m21] , Other[0] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] identifier[SpaceGroup] operator[SEP] identifier[deltaComp] operator[SEP] identifier[matTransform] operator[SEP] identifier[m22] , Other[1] , identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[&&] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[matTransform] operator[SEP] identifier[m03] operator[-] literal[Float] operator[SEP] operator[>] identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[||] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[matTransform] operator[SEP] identifier[m13] operator[-] literal[Float] operator[SEP] operator[>] identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[||] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[matTransform] operator[SEP] identifier[m23] operator[-] literal[Float] operator[SEP] operator[>] identifier[SpaceGroup] operator[SEP] identifier[DELTA] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Override public StorageProviderCredentials getStorageProviderCredentials(String subdomain, String storeId) throws AccountCredentialsNotFoundException, StorageProviderCredentialsNotFoundException { AccountInfo account = accountRepo.findBySubdomain(subdomain); Long id = Long.valueOf(storeId); if (account == null) { throw new AccountCredentialsNotFoundException("no account found for subdomain " + subdomain); } else { StorageProviderAccount provider = account.getPrimaryStorageProviderAccount(); if (provider.getId().equals(id)) { return createStorageProviderCredentials(storeId, provider, true); } else { for (StorageProviderAccount sp : account.getSecondaryStorageProviderAccounts()) { if (sp.getId().equals(id)) { return createStorageProviderCredentials(storeId, sp, false); } } } } throw new StorageProviderCredentialsNotFoundException( "No storage provider on subdomain " + subdomain + " with storeId " + storeId + " found."); }
class class_name[name] begin[{] method[getStorageProviderCredentials, return_type[type[StorageProviderCredentials]], modifier[public], parameter[subdomain, storeId]] begin[{] local_variable[type[AccountInfo], account] local_variable[type[Long], id] if[binary_operation[member[.account], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no account found for subdomain "), operandr=MemberReference(member=subdomain, 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=AccountCredentialsNotFoundException, sub_type=None)), label=None) else begin[{] local_variable[type[StorageProviderAccount], provider] if[call[provider.getId, parameter[]]] begin[{] return[call[.createStorageProviderCredentials, parameter[member[.storeId], member[.provider], literal[true]]]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=sp, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=storeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=createStorageProviderCredentials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSecondaryStorageProviderAccounts, postfix_operators=[], prefix_operators=[], qualifier=account, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorageProviderAccount, sub_type=None))), label=None) end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No storage provider on subdomain "), operandr=MemberReference(member=subdomain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with storeId "), operator=+), operandr=MemberReference(member=storeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" found."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StorageProviderCredentialsNotFoundException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[StorageProviderCredentials] identifier[getStorageProviderCredentials] operator[SEP] identifier[String] identifier[subdomain] , identifier[String] identifier[storeId] operator[SEP] Keyword[throws] identifier[AccountCredentialsNotFoundException] , identifier[StorageProviderCredentialsNotFoundException] { identifier[AccountInfo] identifier[account] operator[=] identifier[accountRepo] operator[SEP] identifier[findBySubdomain] operator[SEP] identifier[subdomain] operator[SEP] operator[SEP] identifier[Long] identifier[id] operator[=] identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[storeId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[account] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[AccountCredentialsNotFoundException] operator[SEP] literal[String] operator[+] identifier[subdomain] operator[SEP] operator[SEP] } Keyword[else] { identifier[StorageProviderAccount] identifier[provider] operator[=] identifier[account] operator[SEP] identifier[getPrimaryStorageProviderAccount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[provider] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[id] operator[SEP] operator[SEP] { Keyword[return] identifier[createStorageProviderCredentials] operator[SEP] identifier[storeId] , identifier[provider] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[StorageProviderAccount] identifier[sp] operator[:] identifier[account] operator[SEP] identifier[getSecondaryStorageProviderAccounts] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[sp] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[id] operator[SEP] operator[SEP] { Keyword[return] identifier[createStorageProviderCredentials] operator[SEP] identifier[storeId] , identifier[sp] , literal[boolean] operator[SEP] operator[SEP] } } } } Keyword[throw] Keyword[new] identifier[StorageProviderCredentialsNotFoundException] operator[SEP] literal[String] operator[+] identifier[subdomain] operator[+] literal[String] operator[+] identifier[storeId] operator[+] literal[String] operator[SEP] operator[SEP] }
@Override public Collection<Attack> findAttacks(final SearchCriteria criteria) { if (criteria == null) { throw new IllegalArgumentException("criteria must be non-null"); } Collection<Attack> matches = new ArrayList<>(); try { RiakSet set = client.execute( new FetchSet.Builder(attacks) .build() ).getDatatype(); for(BinaryValue binaryValue: set.view()) { Attack attack = gson.fromJson(binaryValue.toStringUtf8(), Attack.class); if (isMatchingAttack(criteria, attack)) { matches.add(attack); } } } catch (ExecutionException e) { logger.error("Fetching attacks from RiakDB failed", e); e.printStackTrace(); } catch (InterruptedException e) { logger.error("Fetching attacks from RiakDB was interrupted", e); e.printStackTrace(); } return matches; }
class class_name[name] begin[{] method[findAttacks, return_type[type[Collection]], modifier[public], parameter[criteria]] begin[{] if[binary_operation[member[.criteria], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="criteria must be non-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[Collection], matches] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=attacks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FetchSet, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))], member=execute, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[MethodInvocation(arguments=[], member=getDatatype, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=set)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RiakSet, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toStringUtf8, postfix_operators=[], prefix_operators=[], qualifier=binaryValue, selectors=[], type_arguments=None), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attack, sub_type=None))], member=fromJson, postfix_operators=[], prefix_operators=[], qualifier=gson, selectors=[], type_arguments=None), name=attack)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attack, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=criteria, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isMatchingAttack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=attack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=matches, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=view, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=binaryValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BinaryValue, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fetching attacks from RiakDB failed"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ExecutionException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fetching attacks from RiakDB was interrupted"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) return[member[.matches]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[Attack] operator[>] identifier[findAttacks] operator[SEP] Keyword[final] identifier[SearchCriteria] identifier[criteria] operator[SEP] { Keyword[if] operator[SEP] identifier[criteria] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Collection] operator[<] identifier[Attack] operator[>] identifier[matches] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[RiakSet] identifier[set] operator[=] identifier[client] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[FetchSet] operator[SEP] identifier[Builder] operator[SEP] identifier[attacks] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getDatatype] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BinaryValue] identifier[binaryValue] operator[:] identifier[set] operator[SEP] identifier[view] operator[SEP] operator[SEP] operator[SEP] { identifier[Attack] identifier[attack] operator[=] identifier[gson] operator[SEP] identifier[fromJson] operator[SEP] identifier[binaryValue] operator[SEP] identifier[toStringUtf8] operator[SEP] operator[SEP] , identifier[Attack] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isMatchingAttack] operator[SEP] identifier[criteria] , identifier[attack] operator[SEP] operator[SEP] { identifier[matches] operator[SEP] identifier[add] operator[SEP] identifier[attack] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[ExecutionException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[matches] operator[SEP] }
private int incrementIndex(int index, int maxIndex) { int newIndex = index + 1; if (newIndex >= elements.length) { newIndex = maxIndex; } return newIndex; }
class class_name[name] begin[{] method[incrementIndex, return_type[type[int]], modifier[private], parameter[index, maxIndex]] begin[{] local_variable[type[int], newIndex] if[binary_operation[member[.newIndex], >=, member[elements.length]]] begin[{] assign[member[.newIndex], member[.maxIndex]] else begin[{] None end[}] return[member[.newIndex]] end[}] END[}]
Keyword[private] Keyword[int] identifier[incrementIndex] operator[SEP] Keyword[int] identifier[index] , Keyword[int] identifier[maxIndex] operator[SEP] { Keyword[int] identifier[newIndex] operator[=] identifier[index] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[newIndex] operator[>=] identifier[elements] operator[SEP] identifier[length] operator[SEP] { identifier[newIndex] operator[=] identifier[maxIndex] operator[SEP] } Keyword[return] identifier[newIndex] operator[SEP] }
private CmsObject initCms(CmsObject cms) { try { cms = OpenCms.initCmsObject(cms); } catch (CmsException e) { LOG.error("Unable to init CmsObject"); } cms.getRequestContext().setSiteRoot(""); return cms; }
class class_name[name] begin[{] method[initCms, return_type[type[CmsObject]], modifier[private], parameter[cms]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCmsObject, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to init CmsObject")], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) call[cms.getRequestContext, parameter[]] return[member[.cms]] end[}] END[}]
Keyword[private] identifier[CmsObject] identifier[initCms] operator[SEP] identifier[CmsObject] identifier[cms] operator[SEP] { Keyword[try] { identifier[cms] operator[=] identifier[OpenCms] operator[SEP] identifier[initCmsObject] operator[SEP] identifier[cms] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[setSiteRoot] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[cms] operator[SEP] }
public Criteria gte(Object o) { this.criteriaType = RelationalOperator.GTE; this.right = ValueNode.toValueNode(o); return this; }
class class_name[name] begin[{] method[gte, return_type[type[Criteria]], modifier[public], parameter[o]] begin[{] assign[THIS[member[None.criteriaType]], member[RelationalOperator.GTE]] assign[THIS[member[None.right]], call[ValueNode.toValueNode, parameter[member[.o]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Criteria] identifier[gte] operator[SEP] identifier[Object] identifier[o] operator[SEP] { Keyword[this] operator[SEP] identifier[criteriaType] operator[=] identifier[RelationalOperator] operator[SEP] identifier[GTE] operator[SEP] Keyword[this] operator[SEP] identifier[right] operator[=] identifier[ValueNode] operator[SEP] identifier[toValueNode] operator[SEP] identifier[o] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public String writeXML(Date lastModified) { XMLOutputter fmt = new XMLOutputter(Format.getPrettyFormat()); return fmt.outputString(writeDocument(lastModified)); }
class class_name[name] begin[{] method[writeXML, return_type[type[String]], modifier[public], parameter[lastModified]] begin[{] local_variable[type[XMLOutputter], fmt] return[call[fmt.outputString, parameter[call[.writeDocument, parameter[member[.lastModified]]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[writeXML] operator[SEP] identifier[Date] identifier[lastModified] operator[SEP] { identifier[XMLOutputter] identifier[fmt] operator[=] Keyword[new] identifier[XMLOutputter] operator[SEP] identifier[Format] operator[SEP] identifier[getPrettyFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fmt] operator[SEP] identifier[outputString] operator[SEP] identifier[writeDocument] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] }
@Override public List<Monitor<?>> getMonitors() { List<Monitor<?>> monitors = monitor.getMonitors(); List<Monitor<?>> wrappedMonitors = new ArrayList<>(monitors.size()); for (Monitor<?> m : monitors) { wrappedMonitors.add(Monitors.wrap(tags, m)); } return Collections.unmodifiableList(wrappedMonitors); }
class class_name[name] begin[{] method[getMonitors, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], monitors] local_variable[type[List], wrappedMonitors] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=tags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=Monitors, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=wrappedMonitors, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=monitors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Monitor, sub_type=None))), label=None) return[call[Collections.unmodifiableList, parameter[member[.wrappedMonitors]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[Monitor] operator[<] operator[?] operator[>] operator[>] identifier[getMonitors] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Monitor] operator[<] operator[?] operator[>] operator[>] identifier[monitors] operator[=] identifier[monitor] operator[SEP] identifier[getMonitors] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Monitor] operator[<] operator[?] operator[>] operator[>] identifier[wrappedMonitors] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[monitors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Monitor] operator[<] operator[?] operator[>] identifier[m] operator[:] identifier[monitors] operator[SEP] { identifier[wrappedMonitors] operator[SEP] identifier[add] operator[SEP] identifier[Monitors] operator[SEP] identifier[wrap] operator[SEP] identifier[tags] , identifier[m] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[wrappedMonitors] operator[SEP] operator[SEP] }
public static byte[] toByteArray(final HttpEntity entity) throws IOException { if (entity == null) { throw new IllegalArgumentException("HTTP entity may not be null"); } InputStream instream = entity.getContent(); if (instream == null) { return null; } try { if (entity.getContentLength() > Integer.MAX_VALUE) { throw new IllegalArgumentException("HTTP entity too large to be buffered in memory"); } int i = (int)entity.getContentLength(); if (i < 0) { i = 4096; } ByteArrayBuffer buffer = new ByteArrayBuffer(i); byte[] tmp = new byte[4096]; int l; while((l = instream.read(tmp)) != -1) { buffer.append(tmp, 0, l); } return buffer.toByteArray(); } finally { instream.close(); } }
class class_name[name] begin[{] method[toByteArray, return_type[type[byte]], modifier[public static], parameter[entity]] begin[{] if[binary_operation[member[.entity], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HTTP entity may not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[InputStream], instream] if[binary_operation[member[.instream], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HTTP entity too large to be buffered in memory")], 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)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=i, 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=ByteArrayBuffer, sub_type=None)), name=buffer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayBuffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=tmp)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=instream, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=instream, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[toByteArray] operator[SEP] Keyword[final] identifier[HttpEntity] identifier[entity] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[entity] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[InputStream] identifier[instream] operator[=] identifier[entity] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instream] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[entity] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[>] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[i] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[entity] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] Other[0] operator[SEP] { identifier[i] operator[=] Other[4096] operator[SEP] } identifier[ByteArrayBuffer] identifier[buffer] operator[=] Keyword[new] identifier[ByteArrayBuffer] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[4096] operator[SEP] operator[SEP] Keyword[int] identifier[l] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[instream] operator[SEP] identifier[read] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[tmp] , Other[0] , identifier[l] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[instream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public GameSessionPlacement withPlayerLatencies(PlayerLatency... playerLatencies) { if (this.playerLatencies == null) { setPlayerLatencies(new java.util.ArrayList<PlayerLatency>(playerLatencies.length)); } for (PlayerLatency ele : playerLatencies) { this.playerLatencies.add(ele); } return this; }
class class_name[name] begin[{] method[withPlayerLatencies, return_type[type[GameSessionPlacement]], modifier[public], parameter[playerLatencies]] begin[{] if[binary_operation[THIS[member[None.playerLatencies]], ==, literal[null]]] begin[{] call[.setPlayerLatencies, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=playerLatencies, 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=PlayerLatency, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=playerLatencies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=playerLatencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PlayerLatency, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[GameSessionPlacement] identifier[withPlayerLatencies] operator[SEP] identifier[PlayerLatency] operator[...] identifier[playerLatencies] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[playerLatencies] operator[==] Other[null] operator[SEP] { identifier[setPlayerLatencies] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[PlayerLatency] operator[>] operator[SEP] identifier[playerLatencies] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[PlayerLatency] identifier[ele] operator[:] identifier[playerLatencies] operator[SEP] { Keyword[this] operator[SEP] identifier[playerLatencies] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected final PrcAccDocWithSubaccRetrieve lazyGetPrcAccDocWithSubaccRetrieve( final Map<String, Object> pAddParam) throws Exception { @SuppressWarnings("unchecked") PrcAccDocWithSubaccRetrieve<RS, IDoc> proc = (PrcAccDocWithSubaccRetrieve<RS, IDoc>) this.processorsMap .get(PrcAccDocWithSubaccRetrieve.class.getSimpleName()); if (proc == null) { proc = new PrcAccDocWithSubaccRetrieve<RS, IDoc>(); proc.setSrvAccEntry(getSrvAccEntry()); @SuppressWarnings("unchecked") IEntityProcessor<IDoc, Long> delegate = (IEntityProcessor<IDoc, Long>) lazyGetPrcAccEntityWithSubaccRetrieve(pAddParam); proc.setPrcAccEntityWithSubaccRetrieve(delegate); //assigning fully initialized object: this.processorsMap .put(PrcAccDocWithSubaccRetrieve.class.getSimpleName(), proc); } return proc; }
class class_name[name] begin[{] method[lazyGetPrcAccDocWithSubaccRetrieve, return_type[type[PrcAccDocWithSubaccRetrieve]], modifier[final protected], parameter[pAddParam]] begin[{] local_variable[type[PrcAccDocWithSubaccRetrieve], proc] if[binary_operation[member[.proc], ==, literal[null]]] begin[{] assign[member[.proc], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RS, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IDoc, sub_type=None))], dimensions=None, name=PrcAccDocWithSubaccRetrieve, sub_type=None))] call[proc.setSrvAccEntry, parameter[call[.getSrvAccEntry, parameter[]]]] local_variable[type[IEntityProcessor], delegate] call[proc.setPrcAccEntityWithSubaccRetrieve, parameter[member[.delegate]]] THIS[member[None.processorsMap]call[None.put, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcAccDocWithSubaccRetrieve, sub_type=None)), member[.proc]]]] else begin[{] None end[}] return[member[.proc]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[PrcAccDocWithSubaccRetrieve] identifier[lazyGetPrcAccDocWithSubaccRetrieve] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pAddParam] operator[SEP] Keyword[throws] identifier[Exception] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[PrcAccDocWithSubaccRetrieve] operator[<] identifier[RS] , identifier[IDoc] operator[>] identifier[proc] operator[=] operator[SEP] identifier[PrcAccDocWithSubaccRetrieve] operator[<] identifier[RS] , identifier[IDoc] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[get] operator[SEP] identifier[PrcAccDocWithSubaccRetrieve] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proc] operator[==] Other[null] operator[SEP] { identifier[proc] operator[=] Keyword[new] identifier[PrcAccDocWithSubaccRetrieve] operator[<] identifier[RS] , identifier[IDoc] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvAccEntry] operator[SEP] identifier[getSrvAccEntry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[IEntityProcessor] operator[<] identifier[IDoc] , identifier[Long] operator[>] identifier[delegate] operator[=] operator[SEP] identifier[IEntityProcessor] operator[<] identifier[IDoc] , identifier[Long] operator[>] operator[SEP] identifier[lazyGetPrcAccEntityWithSubaccRetrieve] operator[SEP] identifier[pAddParam] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setPrcAccEntityWithSubaccRetrieve] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[put] operator[SEP] identifier[PrcAccDocWithSubaccRetrieve] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[proc] operator[SEP] operator[SEP] } Keyword[return] identifier[proc] operator[SEP] }
public ApplicationSummary get(String applicationId, ApplicationGetOptions applicationGetOptions) { return getWithServiceResponseAsync(applicationId, applicationGetOptions).toBlocking().single().body(); }
class class_name[name] begin[{] method[get, return_type[type[ApplicationSummary]], modifier[public], parameter[applicationId, applicationGetOptions]] begin[{] return[call[.getWithServiceResponseAsync, parameter[member[.applicationId], member[.applicationGetOptions]]]] end[}] END[}]
Keyword[public] identifier[ApplicationSummary] identifier[get] operator[SEP] identifier[String] identifier[applicationId] , identifier[ApplicationGetOptions] identifier[applicationGetOptions] operator[SEP] { Keyword[return] identifier[getWithServiceResponseAsync] operator[SEP] identifier[applicationId] , identifier[applicationGetOptions] 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] }
private void parsePackets(Thread thread) { try { while (!done) { if (reset) { startStream(); LOGGER.debug("Started xmlstream..."); reset = false; continue; } Element doc = innerReader.parseDocument().getRootElement(); if (doc == null) { connection.disconnect(); LOGGER.debug("End of xmlstream."); continue; } Packet packet = null; LOGGER.debug("Processing packet " + doc.asXML()); packet = parseFromPlugins(doc, packet); if (packet == null) { packet = parseFromCore(doc); } if (packet != null) { processPacket(packet); } } } catch (Exception e) { if (!done && !connection.isSocketClosed()) { connection.notifyConnectionError(e); if (!connection.isConnected()) { releaseConnectionIDLock(); } } } }
class class_name[name] begin[{] method[parsePackets, return_type[void], modifier[private], parameter[thread]] begin[{] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=reset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=startStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Started xmlstream...")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=parseDocument, postfix_operators=[], prefix_operators=[], qualifier=innerReader, selectors=[MethodInvocation(arguments=[], member=getRootElement, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=doc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="End of xmlstream.")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=packet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Packet, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Processing packet "), operandr=MethodInvocation(arguments=[], member=asXML, postfix_operators=[], prefix_operators=[], qualifier=doc, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=packet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=packet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFromPlugins, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=packet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=packet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFromCore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=packet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=packet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processPacket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), condition=MemberReference(member=done, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=done, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isSocketClosed, postfix_operators=[], prefix_operators=['!'], qualifier=connection, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=notifyConnectionError, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isConnected, postfix_operators=[], prefix_operators=['!'], qualifier=connection, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=releaseConnectionIDLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[parsePackets] operator[SEP] identifier[Thread] identifier[thread] operator[SEP] { Keyword[try] { Keyword[while] operator[SEP] operator[!] identifier[done] operator[SEP] { Keyword[if] operator[SEP] identifier[reset] operator[SEP] { identifier[startStream] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[reset] operator[=] literal[boolean] operator[SEP] Keyword[continue] operator[SEP] } identifier[Element] identifier[doc] operator[=] identifier[innerReader] operator[SEP] identifier[parseDocument] operator[SEP] operator[SEP] operator[SEP] identifier[getRootElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[doc] operator[==] Other[null] operator[SEP] { identifier[connection] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[Packet] identifier[packet] operator[=] Other[null] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[doc] operator[SEP] identifier[asXML] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[packet] operator[=] identifier[parseFromPlugins] operator[SEP] identifier[doc] , identifier[packet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[packet] operator[==] Other[null] operator[SEP] { identifier[packet] operator[=] identifier[parseFromCore] operator[SEP] identifier[doc] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[packet] operator[!=] Other[null] operator[SEP] { identifier[processPacket] operator[SEP] identifier[packet] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[done] operator[&&] operator[!] identifier[connection] operator[SEP] identifier[isSocketClosed] operator[SEP] operator[SEP] operator[SEP] { identifier[connection] operator[SEP] identifier[notifyConnectionError] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[connection] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] { identifier[releaseConnectionIDLock] operator[SEP] operator[SEP] operator[SEP] } } } }
private boolean iterateGroup(ValueIterator.Element result, int limit) { if (m_groupIndex_ < 0) { m_groupIndex_ = m_name_.getGroup(m_current_); } while (m_groupIndex_ < m_name_.m_groupcount_ && m_current_ < limit) { // iterate till the last group or the last codepoint int startMSB = UCharacterName.getCodepointMSB(m_current_); int gMSB = m_name_.getGroupMSB(m_groupIndex_); // can be -1 if (startMSB == gMSB) { if (startMSB == UCharacterName.getCodepointMSB(limit - 1)) { // if start and limit - 1 are in the same group, then enumerate // only in that one return iterateSingleGroup(result, limit); } // enumerate characters in the partial start group // if (m_name_.getGroupOffset(m_current_) != 0) { if (!iterateSingleGroup(result, UCharacterName.getGroupLimit(gMSB))) { return false; } ++ m_groupIndex_; // continue with the next group } else if (startMSB > gMSB) { // make sure that we start enumerating with the first group // after start m_groupIndex_ ++; } else { int gMIN = UCharacterName.getGroupMin(gMSB); if (gMIN > limit) { gMIN = limit; } if (m_choice_ == UCharacterNameChoice.EXTENDED_CHAR_NAME) { if (!iterateExtended(result, gMIN)) { return false; } } m_current_ = gMIN; } } return true; }
class class_name[name] begin[{] method[iterateGroup, return_type[type[boolean]], modifier[private], parameter[result, limit]] begin[{] if[binary_operation[member[.m_groupIndex_], <, literal[0]]] begin[{] assign[member[.m_groupIndex_], call[m_name_.getGroup, parameter[member[.m_current_]]]] else begin[{] None end[}] while[binary_operation[binary_operation[member[.m_groupIndex_], <, member[m_name_.m_groupcount_]], &&, binary_operation[member[.m_current_], <, member[.limit]]]] begin[{] local_variable[type[int], startMSB] local_variable[type[int], gMSB] if[binary_operation[member[.startMSB], ==, member[.gMSB]]] begin[{] if[binary_operation[member[.startMSB], ==, call[UCharacterName.getCodepointMSB, parameter[binary_operation[member[.limit], -, literal[1]]]]]] begin[{] return[call[.iterateSingleGroup, parameter[member[.result], member[.limit]]]] else begin[{] None end[}] if[call[.iterateSingleGroup, parameter[member[.result], call[UCharacterName.getGroupLimit, parameter[member[.gMSB]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] member[.m_groupIndex_] else begin[{] if[binary_operation[member[.startMSB], >, member[.gMSB]]] begin[{] member[.m_groupIndex_] else begin[{] local_variable[type[int], gMIN] if[binary_operation[member[.gMIN], >, member[.limit]]] begin[{] assign[member[.gMIN], member[.limit]] else begin[{] None end[}] if[binary_operation[member[.m_choice_], ==, member[UCharacterNameChoice.EXTENDED_CHAR_NAME]]] begin[{] if[call[.iterateExtended, parameter[member[.result], member[.gMIN]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.m_current_], member[.gMIN]] end[}] end[}] end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[iterateGroup] operator[SEP] identifier[ValueIterator] operator[SEP] identifier[Element] identifier[result] , Keyword[int] identifier[limit] operator[SEP] { Keyword[if] operator[SEP] identifier[m_groupIndex_] operator[<] Other[0] operator[SEP] { identifier[m_groupIndex_] operator[=] identifier[m_name_] operator[SEP] identifier[getGroup] operator[SEP] identifier[m_current_] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[m_groupIndex_] operator[<] identifier[m_name_] operator[SEP] identifier[m_groupcount_] operator[&&] identifier[m_current_] operator[<] identifier[limit] operator[SEP] { Keyword[int] identifier[startMSB] operator[=] identifier[UCharacterName] operator[SEP] identifier[getCodepointMSB] operator[SEP] identifier[m_current_] operator[SEP] operator[SEP] Keyword[int] identifier[gMSB] operator[=] identifier[m_name_] operator[SEP] identifier[getGroupMSB] operator[SEP] identifier[m_groupIndex_] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startMSB] operator[==] identifier[gMSB] operator[SEP] { Keyword[if] operator[SEP] identifier[startMSB] operator[==] identifier[UCharacterName] operator[SEP] identifier[getCodepointMSB] operator[SEP] identifier[limit] operator[-] Other[1] operator[SEP] operator[SEP] { Keyword[return] identifier[iterateSingleGroup] operator[SEP] identifier[result] , identifier[limit] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[iterateSingleGroup] operator[SEP] identifier[result] , identifier[UCharacterName] operator[SEP] identifier[getGroupLimit] operator[SEP] identifier[gMSB] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } operator[++] identifier[m_groupIndex_] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[startMSB] operator[>] identifier[gMSB] operator[SEP] { identifier[m_groupIndex_] operator[++] operator[SEP] } Keyword[else] { Keyword[int] identifier[gMIN] operator[=] identifier[UCharacterName] operator[SEP] identifier[getGroupMin] operator[SEP] identifier[gMSB] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gMIN] operator[>] identifier[limit] operator[SEP] { identifier[gMIN] operator[=] identifier[limit] operator[SEP] } Keyword[if] operator[SEP] identifier[m_choice_] operator[==] identifier[UCharacterNameChoice] operator[SEP] identifier[EXTENDED_CHAR_NAME] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[iterateExtended] operator[SEP] identifier[result] , identifier[gMIN] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } identifier[m_current_] operator[=] identifier[gMIN] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Nonnull public static GenericodeValidator <com.helger.genericode.v10.CodeListDocument> gc10CodeList () { return new GenericodeValidator<> (EGenericodeDocumentType.GC10_CODE_LIST); }
class class_name[name] begin[{] method[gc10CodeList, return_type[type[GenericodeValidator]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[MemberReference(member=GC10_CODE_LIST, postfix_operators=[], prefix_operators=[], qualifier=EGenericodeDocumentType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=GenericodeValidator, sub_type=None))] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[GenericodeValidator] operator[<] identifier[com] operator[SEP] identifier[helger] operator[SEP] identifier[genericode] operator[SEP] identifier[v10] operator[SEP] identifier[CodeListDocument] operator[>] identifier[gc10CodeList] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[GenericodeValidator] operator[<] operator[>] operator[SEP] identifier[EGenericodeDocumentType] operator[SEP] identifier[GC10_CODE_LIST] operator[SEP] operator[SEP] }
public static IChunk[] getLargestAverageWordLengthChunks(IChunk[] chunks) { double largetAverage = chunks[0].getAverageWordsLength(); int j; //find the largest average word length for ( j = 1; j < chunks.length; j++ ) { if ( chunks[j].getAverageWordsLength() > largetAverage ) { largetAverage = chunks[j].getAverageWordsLength(); } } //get the items that the average word length equals to //the max's. ArrayList<IChunk> chunkArr = new ArrayList<IChunk>(chunks.length); for ( j = 0; j < chunks.length; j++ ) { if ( chunks[j].getAverageWordsLength() == largetAverage) { chunkArr.add(chunks[j]); } } IChunk[] lchunk = new IChunk[chunkArr.size()]; chunkArr.toArray(lchunk); chunkArr.clear(); return lchunk; }
class class_name[name] begin[{] method[getLargestAverageWordLengthChunks, return_type[type[IChunk]], modifier[public static], parameter[chunks]] begin[{] local_variable[type[double], largetAverage] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=chunks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getAverageWordsLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MemberReference(member=largetAverage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=largetAverage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=chunks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getAverageWordsLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=chunks, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[ArrayList], chunkArr] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=chunks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getAverageWordsLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MemberReference(member=largetAverage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=chunks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=chunkArr, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=chunks, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[IChunk], lchunk] call[chunkArr.toArray, parameter[member[.lchunk]]] call[chunkArr.clear, parameter[]] return[member[.lchunk]] end[}] END[}]
Keyword[public] Keyword[static] identifier[IChunk] operator[SEP] operator[SEP] identifier[getLargestAverageWordLengthChunks] operator[SEP] identifier[IChunk] operator[SEP] operator[SEP] identifier[chunks] operator[SEP] { Keyword[double] identifier[largetAverage] operator[=] identifier[chunks] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getAverageWordsLength] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] Other[1] operator[SEP] identifier[j] operator[<] identifier[chunks] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[chunks] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getAverageWordsLength] operator[SEP] operator[SEP] operator[>] identifier[largetAverage] operator[SEP] { identifier[largetAverage] operator[=] identifier[chunks] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getAverageWordsLength] operator[SEP] operator[SEP] operator[SEP] } } identifier[ArrayList] operator[<] identifier[IChunk] operator[>] identifier[chunkArr] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[IChunk] operator[>] operator[SEP] identifier[chunks] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[chunks] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[chunks] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getAverageWordsLength] operator[SEP] operator[SEP] operator[==] identifier[largetAverage] operator[SEP] { identifier[chunkArr] operator[SEP] identifier[add] operator[SEP] identifier[chunks] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] } } identifier[IChunk] operator[SEP] operator[SEP] identifier[lchunk] operator[=] Keyword[new] identifier[IChunk] operator[SEP] identifier[chunkArr] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[chunkArr] operator[SEP] identifier[toArray] operator[SEP] identifier[lchunk] operator[SEP] operator[SEP] identifier[chunkArr] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[lchunk] operator[SEP] }
public String getInitialRemoteAddr() { // https://code.google.com/p/sipservlets/issues/detail?id=255 includes both ACK Support without tx and packet // source ip address if(getMethod().equalsIgnoreCase(Request.ACK)) { if(logger.isTraceEnabled()) { logger.trace("ACK request trying to return the Via address as we don't have a transaction"); } // replaced because wasn't giving correct info for ACK if(message == null || ((SIPRequest)message).getPeerPacketSourceAddress() == null) { return null; } return ((SIPRequest)message).getPeerPacketSourceAddress().getHostAddress(); } else if (message != null && message instanceof SIPRequest && ((SIPRequest)message).getPeerPacketSourceAddress() != null ) { //https://github.com/Mobicents/jain-sip/issues/42 //take advantage of new message methods to extract addr from msg return ((SIPRequest)message).getPeerPacketSourceAddress().getHostAddress(); } else if(getTransaction() != null) { if(logger.isTraceEnabled()) { logger.trace("transaction not null, returning packet source ip address"); } if(((SIPTransaction)getTransaction()).getPeerPacketSourceAddress() != null) { return ((SIPTransaction)getTransaction()).getPeerPacketSourceAddress().getHostAddress(); } else { return ((SIPTransaction)getTransaction()).getPeerAddress(); } } else { if(logger.isTraceEnabled()) { logger.trace("transaction null, returning top via ip address"); } ViaHeader via = (ViaHeader) message.getHeader(ViaHeader.NAME); if(via == null || // https://github.com/Mobicents/sip-servlets/issues/47 // check if the via is container generated, if it is then it means // this is an outgoing request or response and thus should return null !sipFactoryImpl.getSipApplicationDispatcher().isViaHeaderExternal(via) ) { return null; } else { return via.getHost(); } } }
class class_name[name] begin[{] method[getInitialRemoteAddr, return_type[type[String]], modifier[public], parameter[]] begin[{] if[call[.getMethod, parameter[]]] begin[{] if[call[logger.isTraceEnabled, parameter[]]] begin[{] call[logger.trace, parameter[literal["ACK request trying to return the Via address as we don't have a transaction"]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.message], ==, literal[null]], ||, binary_operation[Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SIPRequest, sub_type=None)), ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SIPRequest, sub_type=None))] else begin[{] if[binary_operation[binary_operation[binary_operation[member[.message], !=, literal[null]], &&, binary_operation[member[.message], instanceof, type[SIPRequest]]], &&, binary_operation[Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SIPRequest, sub_type=None)), !=, literal[null]]]] begin[{] return[Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SIPRequest, sub_type=None))] else begin[{] if[binary_operation[call[.getTransaction, parameter[]], !=, literal[null]]] begin[{] if[call[logger.isTraceEnabled, parameter[]]] begin[{] call[logger.trace, parameter[literal["transaction not null, returning packet source ip address"]]] else begin[{] None end[}] if[binary_operation[Cast(expression=MethodInvocation(arguments=[], member=getTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SIPTransaction, sub_type=None)), !=, literal[null]]] begin[{] return[Cast(expression=MethodInvocation(arguments=[], member=getTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SIPTransaction, sub_type=None))] else begin[{] return[Cast(expression=MethodInvocation(arguments=[], member=getTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SIPTransaction, sub_type=None))] end[}] else begin[{] if[call[logger.isTraceEnabled, parameter[]]] begin[{] call[logger.trace, parameter[literal["transaction null, returning top via ip address"]]] else begin[{] None end[}] local_variable[type[ViaHeader], via] if[binary_operation[binary_operation[member[.via], ==, literal[null]], ||, call[sipFactoryImpl.getSipApplicationDispatcher, parameter[]]]] begin[{] return[literal[null]] else begin[{] return[call[via.getHost, parameter[]]] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[public] identifier[String] identifier[getInitialRemoteAddr] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[Request] operator[SEP] identifier[ACK] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[||] operator[SEP] operator[SEP] identifier[SIPRequest] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[getPeerPacketSourceAddress] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] operator[SEP] operator[SEP] identifier[SIPRequest] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[getPeerPacketSourceAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[message] operator[!=] Other[null] operator[&&] identifier[message] Keyword[instanceof] identifier[SIPRequest] operator[&&] operator[SEP] operator[SEP] identifier[SIPRequest] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[getPeerPacketSourceAddress] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[SIPRequest] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[getPeerPacketSourceAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[SIPTransaction] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getPeerPacketSourceAddress] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[SIPTransaction] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getPeerPacketSourceAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] operator[SEP] identifier[SIPTransaction] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getPeerAddress] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ViaHeader] identifier[via] operator[=] operator[SEP] identifier[ViaHeader] operator[SEP] identifier[message] operator[SEP] identifier[getHeader] operator[SEP] identifier[ViaHeader] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[via] operator[==] Other[null] operator[||] operator[!] identifier[sipFactoryImpl] operator[SEP] identifier[getSipApplicationDispatcher] operator[SEP] operator[SEP] operator[SEP] identifier[isViaHeaderExternal] operator[SEP] identifier[via] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[return] identifier[via] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] } } }
public static base_response unset(nitro_service client, lbwlm resource, String[] args) throws Exception{ lbwlm unsetresource = new lbwlm(); unsetresource.wlmname = resource.wlmname; return unsetresource.unset_resource(client,args); }
class class_name[name] begin[{] method[unset, return_type[type[base_response]], modifier[public static], parameter[client, resource, args]] begin[{] local_variable[type[lbwlm], unsetresource] assign[member[unsetresource.wlmname], member[resource.wlmname]] return[call[unsetresource.unset_resource, parameter[member[.client], member[.args]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[base_response] identifier[unset] operator[SEP] identifier[nitro_service] identifier[client] , identifier[lbwlm] identifier[resource] , identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[lbwlm] identifier[unsetresource] operator[=] Keyword[new] identifier[lbwlm] operator[SEP] operator[SEP] operator[SEP] identifier[unsetresource] operator[SEP] identifier[wlmname] operator[=] identifier[resource] operator[SEP] identifier[wlmname] operator[SEP] Keyword[return] identifier[unsetresource] operator[SEP] identifier[unset_resource] operator[SEP] identifier[client] , identifier[args] operator[SEP] operator[SEP] }
@Trivial @Modified protected void modified(ComponentContext context) { Dictionary<String, ?> props = context.getProperties(); final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "modified", props); String contextSvcName = (String) props.get(JNDI_NAME); if (contextSvcName == null) contextSvcName = (String) props.get(CONFIG_ID); ContextServiceImpl[] listeners; lock.writeLock().lock(); try { listeners = modificationListeners.toArray(new ContextServiceImpl[modificationListeners.size()]); modificationListeners.clear(); componentContext = context; properties = props; name = contextSvcName; threadContextConfigurations = null; } finally { lock.writeLock().unlock(); } for (ContextServiceImpl listener : listeners) listener.baseInstanceModified(); if (trace && tc.isEntryEnabled()) Tr.exit(this, tc, "modified"); }
class class_name[name] begin[{] method[modified, return_type[void], modifier[protected], parameter[context]] begin[{] local_variable[type[Dictionary], props] local_variable[type[boolean], trace] if[binary_operation[member[.trace], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[THIS[], member[.tc], literal["modified"], member[.props]]] else begin[{] None end[}] local_variable[type[String], contextSvcName] if[binary_operation[member[.contextSvcName], ==, literal[null]]] begin[{] assign[member[.contextSvcName], Cast(expression=MethodInvocation(arguments=[MemberReference(member=CONFIG_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))] else begin[{] None end[}] local_variable[type[ContextServiceImpl], listeners] call[lock.writeLock, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=listeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=modificationListeners, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ContextServiceImpl, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=modificationListeners, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=modificationListeners, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=componentContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=contextSvcName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=threadContextConfigurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[], member=baseInstanceModified, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=listeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ContextServiceImpl, sub_type=None))), label=None) if[binary_operation[member[.trace], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[THIS[], member[.tc], literal["modified"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Trivial] annotation[@] identifier[Modified] Keyword[protected] Keyword[void] identifier[modified] operator[SEP] identifier[ComponentContext] identifier[context] operator[SEP] { identifier[Dictionary] operator[<] identifier[String] , operator[?] operator[>] identifier[props] operator[=] identifier[context] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[trace] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[props] operator[SEP] operator[SEP] identifier[String] identifier[contextSvcName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[props] operator[SEP] identifier[get] operator[SEP] identifier[JNDI_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contextSvcName] operator[==] Other[null] operator[SEP] identifier[contextSvcName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[props] operator[SEP] identifier[get] operator[SEP] identifier[CONFIG_ID] operator[SEP] operator[SEP] identifier[ContextServiceImpl] operator[SEP] operator[SEP] identifier[listeners] operator[SEP] identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[listeners] operator[=] identifier[modificationListeners] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[ContextServiceImpl] operator[SEP] identifier[modificationListeners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[modificationListeners] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[componentContext] operator[=] identifier[context] operator[SEP] identifier[properties] operator[=] identifier[props] operator[SEP] identifier[name] operator[=] identifier[contextSvcName] operator[SEP] identifier[threadContextConfigurations] operator[=] Other[null] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ContextServiceImpl] identifier[listener] operator[:] identifier[listeners] operator[SEP] identifier[listener] operator[SEP] identifier[baseInstanceModified] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private void generateLimitElement(XmlElement element) { XmlElement ifLimitNotNullElement = new XmlElement("if"); ifLimitNotNullElement.addAttribute(new Attribute("test", "rows != null")); XmlElement ifOffsetNotNullElement = new XmlElement("if"); ifOffsetNotNullElement.addAttribute(new Attribute("test", "offset != null")); ifOffsetNotNullElement.addElement(new TextElement("limit ${offset}, ${rows}")); ifLimitNotNullElement.addElement(ifOffsetNotNullElement); XmlElement ifOffsetNullElement = new XmlElement("if"); ifOffsetNullElement.addAttribute(new Attribute("test", "offset == null")); ifOffsetNullElement.addElement(new TextElement("limit ${rows}")); ifLimitNotNullElement.addElement(ifOffsetNullElement); element.addElement(ifLimitNotNullElement); }
class class_name[name] begin[{] method[generateLimitElement, return_type[void], modifier[private], parameter[element]] begin[{] local_variable[type[XmlElement], ifLimitNotNullElement] call[ifLimitNotNullElement.addAttribute, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="test"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rows != null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] local_variable[type[XmlElement], ifOffsetNotNullElement] call[ifOffsetNotNullElement.addAttribute, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="test"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="offset != null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[ifOffsetNotNullElement.addElement, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="limit ${offset}, ${rows}")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TextElement, sub_type=None))]] call[ifLimitNotNullElement.addElement, parameter[member[.ifOffsetNotNullElement]]] local_variable[type[XmlElement], ifOffsetNullElement] call[ifOffsetNullElement.addAttribute, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="test"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="offset == null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[ifOffsetNullElement.addElement, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="limit ${rows}")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TextElement, sub_type=None))]] call[ifLimitNotNullElement.addElement, parameter[member[.ifOffsetNullElement]]] call[element.addElement, parameter[member[.ifLimitNotNullElement]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[generateLimitElement] operator[SEP] identifier[XmlElement] identifier[element] operator[SEP] { identifier[XmlElement] identifier[ifLimitNotNullElement] operator[=] Keyword[new] identifier[XmlElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ifLimitNotNullElement] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[XmlElement] identifier[ifOffsetNotNullElement] operator[=] Keyword[new] identifier[XmlElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ifOffsetNotNullElement] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ifOffsetNotNullElement] operator[SEP] identifier[addElement] operator[SEP] Keyword[new] identifier[TextElement] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ifLimitNotNullElement] operator[SEP] identifier[addElement] operator[SEP] identifier[ifOffsetNotNullElement] operator[SEP] operator[SEP] identifier[XmlElement] identifier[ifOffsetNullElement] operator[=] Keyword[new] identifier[XmlElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ifOffsetNullElement] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ifOffsetNullElement] operator[SEP] identifier[addElement] operator[SEP] Keyword[new] identifier[TextElement] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ifLimitNotNullElement] operator[SEP] identifier[addElement] operator[SEP] identifier[ifOffsetNullElement] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[addElement] operator[SEP] identifier[ifLimitNotNullElement] operator[SEP] operator[SEP] }
private boolean isExceptionAffected(final String exceptionMessage) { if (exceptionMessage != null) { for (String affectedMessage : EXCEPTION_MESSAGE_WHITELIST) { if (exceptionMessage.contains(affectedMessage)) { return true; } } } return false; }
class class_name[name] begin[{] method[isExceptionAffected, return_type[type[boolean]], modifier[private], parameter[exceptionMessage]] begin[{] if[binary_operation[member[.exceptionMessage], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=affectedMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=exceptionMessage, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=EXCEPTION_MESSAGE_WHITELIST, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=affectedMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isExceptionAffected] operator[SEP] Keyword[final] identifier[String] identifier[exceptionMessage] operator[SEP] { Keyword[if] operator[SEP] identifier[exceptionMessage] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[affectedMessage] operator[:] identifier[EXCEPTION_MESSAGE_WHITELIST] operator[SEP] { Keyword[if] operator[SEP] identifier[exceptionMessage] operator[SEP] identifier[contains] operator[SEP] identifier[affectedMessage] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
public static final int getSQLType(final String typeName) { String trimmedTypeName = typeName.trim().toLowerCase(Locale.US); final Integer n = pgGenericTypeNameToSQLTypeMap.get(trimmedTypeName); if (n == null) { // look up the alias trimmedTypeName = pgGenericTypeNameAliasMap.get(trimmedTypeName); if (trimmedTypeName != null) { return pgGenericTypeNameToSQLTypeMap.get(trimmedTypeName); } return Types.OTHER; } else { return n; } }
class class_name[name] begin[{] method[getSQLType, return_type[type[int]], modifier[final public static], parameter[typeName]] begin[{] local_variable[type[String], trimmedTypeName] local_variable[type[Integer], n] if[binary_operation[member[.n], ==, literal[null]]] begin[{] assign[member[.trimmedTypeName], call[pgGenericTypeNameAliasMap.get, parameter[member[.trimmedTypeName]]]] if[binary_operation[member[.trimmedTypeName], !=, literal[null]]] begin[{] return[call[pgGenericTypeNameToSQLTypeMap.get, parameter[member[.trimmedTypeName]]]] else begin[{] None end[}] return[member[Types.OTHER]] else begin[{] return[member[.n]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[int] identifier[getSQLType] operator[SEP] Keyword[final] identifier[String] identifier[typeName] operator[SEP] { identifier[String] identifier[trimmedTypeName] operator[=] identifier[typeName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[US] operator[SEP] operator[SEP] Keyword[final] identifier[Integer] identifier[n] operator[=] identifier[pgGenericTypeNameToSQLTypeMap] operator[SEP] identifier[get] operator[SEP] identifier[trimmedTypeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[null] operator[SEP] { identifier[trimmedTypeName] operator[=] identifier[pgGenericTypeNameAliasMap] operator[SEP] identifier[get] operator[SEP] identifier[trimmedTypeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trimmedTypeName] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[pgGenericTypeNameToSQLTypeMap] operator[SEP] identifier[get] operator[SEP] identifier[trimmedTypeName] operator[SEP] operator[SEP] } Keyword[return] identifier[Types] operator[SEP] identifier[OTHER] operator[SEP] } Keyword[else] { Keyword[return] identifier[n] operator[SEP] } }
public ByteBufMono aggregate() { return Mono.using(alloc::compositeBuffer, b -> this.reduce(b, (prev, next) -> { if (prev.refCnt() > 0) { return prev.addComponent(true, next.retain()); } else { return prev; } }) .filter(ByteBuf::isReadable), b -> { if (b.refCnt() > 0) { b.release(); } }) .as(ByteBufMono::new); }
class class_name[name] begin[{] method[aggregate, return_type[type[ByteBufMono]], modifier[public], parameter[]] begin[{] return[call[Mono.using, parameter[MethodReference(expression=MemberReference(member=alloc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=compositeBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), LambdaExpression(body=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=refCnt, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MethodInvocation(arguments=[], member=retain, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[], type_arguments=None)], member=addComponent, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[], type_arguments=None), label=None)]))], parameters=[InferredFormalParameter(name=prev), InferredFormalParameter(name=next)])], member=reduce, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=ByteBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=isReadable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=filter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), parameters=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=refCnt, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=release, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None)]))], parameters=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]] end[}] END[}]
Keyword[public] identifier[ByteBufMono] identifier[aggregate] operator[SEP] operator[SEP] { Keyword[return] identifier[Mono] operator[SEP] identifier[using] operator[SEP] identifier[alloc] operator[::] identifier[compositeBuffer] , identifier[b] operator[->] Keyword[this] operator[SEP] identifier[reduce] operator[SEP] identifier[b] , operator[SEP] identifier[prev] , identifier[next] operator[SEP] operator[->] { Keyword[if] operator[SEP] identifier[prev] operator[SEP] identifier[refCnt] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] identifier[prev] operator[SEP] identifier[addComponent] operator[SEP] literal[boolean] , identifier[next] operator[SEP] identifier[retain] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[prev] operator[SEP] } } operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[ByteBuf] operator[::] identifier[isReadable] operator[SEP] , identifier[b] operator[->] { Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[refCnt] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[b] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[as] operator[SEP] identifier[ByteBufMono] operator[::] Keyword[new] operator[SEP] operator[SEP] }
public static void lockFileForOnlyProcess(String lockName) { File file = new File(System.getProperty("java.io.tmpdir"), lockName + ".lock"); try { FileOutputStream output = new FileOutputStream(file); FileLock fileLock = output.getChannel().tryLock(); if (fileLock == null) { logger.warn("文件:'" + file + "'已经被lock,进程已经启动,系统将退出"); System.exit(1); } PrintStream printStream = new PrintStream(output); printStream.println(getPid()); printStream.flush(); jvmFile.add(fileLock); logger.info("成功lock文件:'" + file + "',用以避免程序被多次启动,pid:" + getPid()); } catch (IOException e) { logger.warn("获得文件lock时异常:'" + file + "',系统退出", e); System.exit(2); } }
class class_name[name] begin[{] method[lockFileForOnlyProcess, return_type[void], modifier[public static], parameter[lockName]] begin[{] local_variable[type[File], file] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)), name=output)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[MethodInvocation(arguments=[], member=tryLock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=fileLock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileLock, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fileLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="文件:'"), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'已经被lock,进程已经启动,系统将退出"), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=output, 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=PrintStream, sub_type=None)), name=printStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PrintStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=printStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=printStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=jvmFile, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="成功lock文件:'"), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="',用以避免程序被多次启动,pid:"), operator=+), operandr=MethodInvocation(arguments=[], member=getPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="获得文件lock时异常:'"), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="',系统退出"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[lockFileForOnlyProcess] operator[SEP] identifier[String] identifier[lockName] operator[SEP] { identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] , identifier[lockName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[FileOutputStream] identifier[output] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[FileLock] identifier[fileLock] operator[=] identifier[output] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] identifier[tryLock] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileLock] operator[==] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[PrintStream] identifier[printStream] operator[=] Keyword[new] identifier[PrintStream] operator[SEP] identifier[output] operator[SEP] operator[SEP] identifier[printStream] operator[SEP] identifier[println] operator[SEP] identifier[getPid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[printStream] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[jvmFile] operator[SEP] identifier[add] operator[SEP] identifier[fileLock] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[+] identifier[getPid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[2] operator[SEP] operator[SEP] } }
@Override public Object getRowKey(final List<Integer> row) { return getBacking().getRowKey(getRowIndex(row)); }
class class_name[name] begin[{] method[getRowKey, return_type[type[Object]], modifier[public], parameter[row]] begin[{] return[call[.getBacking, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getRowKey] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Integer] operator[>] identifier[row] operator[SEP] { Keyword[return] identifier[getBacking] operator[SEP] operator[SEP] operator[SEP] identifier[getRowKey] operator[SEP] identifier[getRowIndex] operator[SEP] identifier[row] operator[SEP] operator[SEP] operator[SEP] }
@Override // override for Javadoc and performance public boolean isEqual(ChronoLocalDate other) { if (other instanceof LocalDate) { return compareTo0((LocalDate) other) == 0; } return ChronoLocalDate.super.isEqual(other); }
class class_name[name] begin[{] method[isEqual, return_type[type[boolean]], modifier[public], parameter[other]] begin[{] if[binary_operation[member[.other], instanceof, type[LocalDate]]] begin[{] return[binary_operation[call[.compareTo0, parameter[Cast(expression=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocalDate, sub_type=None))]], ==, literal[0]]] else begin[{] None end[}] return[member[.ChronoLocalDate]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isEqual] operator[SEP] identifier[ChronoLocalDate] identifier[other] operator[SEP] { Keyword[if] operator[SEP] identifier[other] Keyword[instanceof] identifier[LocalDate] operator[SEP] { Keyword[return] identifier[compareTo0] operator[SEP] operator[SEP] identifier[LocalDate] operator[SEP] identifier[other] operator[SEP] operator[==] Other[0] operator[SEP] } Keyword[return] identifier[ChronoLocalDate] operator[SEP] Keyword[super] operator[SEP] identifier[isEqual] operator[SEP] identifier[other] operator[SEP] operator[SEP] }
public @NotNull QueryBuilder append(@NotNull String sql, Object... args) { return append(sql, asList(args)); }
class class_name[name] begin[{] method[append, return_type[type[QueryBuilder]], modifier[public], parameter[sql, args]] begin[{] return[call[.append, parameter[member[.sql], call[.asList, parameter[member[.args]]]]]] end[}] END[}]
Keyword[public] annotation[@] identifier[NotNull] identifier[QueryBuilder] identifier[append] operator[SEP] annotation[@] identifier[NotNull] identifier[String] identifier[sql] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[append] operator[SEP] identifier[sql] , identifier[asList] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] }
private Account prepareAccountForUpdate(final Account account, final MultivaluedMap<String, String> data, UserIdentityContext userIdentityContext) { Account.Builder accBuilder = Account.builder(); //copy full incoming account, and let override happen //in a separate instance later accBuilder.copy(account); if (data.containsKey("Status")) { Account.Status newStatus = Account.Status.getValueOf(data.getFirst("Status").toLowerCase()); accBuilder.setStatus(newStatus); } if (data.containsKey("FriendlyName")) { accBuilder.setFriendlyName(data.getFirst("FriendlyName")); } if (data.containsKey("Password")) { // if this is a reset-password operation, we also need to set the account status to active if (account.getStatus() == Account.Status.UNINITIALIZED) { accBuilder.setStatus(Account.Status.ACTIVE); } String password = data.getFirst("Password"); PasswordValidator validator = PasswordValidatorFactory.createDefault(); if (!validator.isStrongEnough(password)) { CustomReasonPhraseType stat = new CustomReasonPhraseType(Response.Status.BAD_REQUEST, "Password too weak"); throw new WebApplicationException(status(stat).build()); } final String hash = new Md5Hash(data.getFirst("Password")).toString(); accBuilder.setAuthToken(hash); } if (data.containsKey("Role")) { // Only allow role change for administrators. Multitenancy checks will take care of restricting the modification scope to sub-accounts. if (userIdentityContext.getEffectiveAccountRoles().contains(permissionEvaluator.getAdministratorRole())) { accBuilder.setRole(data.getFirst("Role")); } else { CustomReasonPhraseType stat = new CustomReasonPhraseType(Response.Status.FORBIDDEN, "Only Administrator allowed"); throw new WebApplicationException(status(stat).build()); } } return accBuilder.build(); }
class class_name[name] begin[{] method[prepareAccountForUpdate, return_type[type[Account]], modifier[private], parameter[account, data, userIdentityContext]] begin[{] local_variable[type[Account], accBuilder] call[accBuilder.copy, parameter[member[.account]]] if[call[data.containsKey, parameter[literal["Status"]]]] begin[{] local_variable[type[Account], newStatus] call[accBuilder.setStatus, parameter[member[.newStatus]]] else begin[{] None end[}] if[call[data.containsKey, parameter[literal["FriendlyName"]]]] begin[{] call[accBuilder.setFriendlyName, parameter[call[data.getFirst, parameter[literal["FriendlyName"]]]]] else begin[{] None end[}] if[call[data.containsKey, parameter[literal["Password"]]]] begin[{] if[binary_operation[call[account.getStatus, parameter[]], ==, member[Account.Status.UNINITIALIZED]]] begin[{] call[accBuilder.setStatus, parameter[member[Account.Status.ACTIVE]]] else begin[{] None end[}] local_variable[type[String], password] local_variable[type[PasswordValidator], validator] if[call[validator.isStrongEnough, parameter[member[.password]]]] begin[{] local_variable[type[CustomReasonPhraseType], stat] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=status, 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)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WebApplicationException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], hash] call[accBuilder.setAuthToken, parameter[member[.hash]]] else begin[{] None end[}] if[call[data.containsKey, parameter[literal["Role"]]]] begin[{] if[call[userIdentityContext.getEffectiveAccountRoles, parameter[]]] begin[{] call[accBuilder.setRole, parameter[call[data.getFirst, parameter[literal["Role"]]]]] else begin[{] local_variable[type[CustomReasonPhraseType], stat] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=status, 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)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WebApplicationException, sub_type=None)), label=None) end[}] else begin[{] None end[}] return[call[accBuilder.build, parameter[]]] end[}] END[}]
Keyword[private] identifier[Account] identifier[prepareAccountForUpdate] operator[SEP] Keyword[final] identifier[Account] identifier[account] , Keyword[final] identifier[MultivaluedMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[data] , identifier[UserIdentityContext] identifier[userIdentityContext] operator[SEP] { identifier[Account] operator[SEP] identifier[Builder] identifier[accBuilder] operator[=] identifier[Account] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[accBuilder] operator[SEP] identifier[copy] operator[SEP] identifier[account] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Account] operator[SEP] identifier[Status] identifier[newStatus] operator[=] identifier[Account] operator[SEP] identifier[Status] operator[SEP] identifier[getValueOf] operator[SEP] identifier[data] operator[SEP] identifier[getFirst] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[accBuilder] operator[SEP] identifier[setStatus] operator[SEP] identifier[newStatus] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[accBuilder] operator[SEP] identifier[setFriendlyName] operator[SEP] identifier[data] operator[SEP] identifier[getFirst] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[account] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[Account] operator[SEP] identifier[Status] operator[SEP] identifier[UNINITIALIZED] operator[SEP] { identifier[accBuilder] operator[SEP] identifier[setStatus] operator[SEP] identifier[Account] operator[SEP] identifier[Status] operator[SEP] identifier[ACTIVE] operator[SEP] operator[SEP] } identifier[String] identifier[password] operator[=] identifier[data] operator[SEP] identifier[getFirst] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PasswordValidator] identifier[validator] operator[=] identifier[PasswordValidatorFactory] operator[SEP] identifier[createDefault] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[validator] operator[SEP] identifier[isStrongEnough] operator[SEP] identifier[password] operator[SEP] operator[SEP] { identifier[CustomReasonPhraseType] identifier[stat] operator[=] Keyword[new] identifier[CustomReasonPhraseType] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[BAD_REQUEST] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[WebApplicationException] operator[SEP] identifier[status] operator[SEP] identifier[stat] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[hash] operator[=] Keyword[new] identifier[Md5Hash] operator[SEP] identifier[data] operator[SEP] identifier[getFirst] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[accBuilder] operator[SEP] identifier[setAuthToken] operator[SEP] identifier[hash] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[userIdentityContext] operator[SEP] identifier[getEffectiveAccountRoles] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[permissionEvaluator] operator[SEP] identifier[getAdministratorRole] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[accBuilder] operator[SEP] identifier[setRole] operator[SEP] identifier[data] operator[SEP] identifier[getFirst] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[CustomReasonPhraseType] identifier[stat] operator[=] Keyword[new] identifier[CustomReasonPhraseType] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[FORBIDDEN] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[WebApplicationException] operator[SEP] identifier[status] operator[SEP] identifier[stat] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[accBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
@Subscribe public void onEnd(AggregatedQuitEvent e) { try { writeHints(hintsFile, hints); } catch (IOException exception) { outer.log("Could not write back the hints file.", exception, Project.MSG_ERR); } }
class class_name[name] begin[{] method[onEnd, return_type[void], modifier[public], parameter[e]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hintsFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeHints, 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="Could not write back the hints file."), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MSG_ERR, postfix_operators=[], prefix_operators=[], qualifier=Project, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=outer, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Subscribe] Keyword[public] Keyword[void] identifier[onEnd] operator[SEP] identifier[AggregatedQuitEvent] identifier[e] operator[SEP] { Keyword[try] { identifier[writeHints] operator[SEP] identifier[hintsFile] , identifier[hints] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[exception] operator[SEP] { identifier[outer] operator[SEP] identifier[log] operator[SEP] literal[String] , identifier[exception] , identifier[Project] operator[SEP] identifier[MSG_ERR] operator[SEP] operator[SEP] } }
protected void lazyor(final ImmutableRoaringBitmap x2) { int pos1 = 0, pos2 = 0; int length1 = highLowContainer.size(); final int length2 = x2.highLowContainer.size(); main: if (pos1 < length1 && pos2 < length2) { short s1 = highLowContainer.getKeyAtIndex(pos1); short s2 = x2.highLowContainer.getKeyAtIndex(pos2); while (true) { if (s1 == s2) { getMappeableRoaringArray().setContainerAtIndex(pos1, highLowContainer .getContainerAtIndex(pos1).lazyIOR(x2.highLowContainer.getContainerAtIndex(pos2))); pos1++; pos2++; if ((pos1 == length1) || (pos2 == length2)) { break main; } s1 = highLowContainer.getKeyAtIndex(pos1); s2 = x2.highLowContainer.getKeyAtIndex(pos2); } else if (Util.compareUnsigned(s1, s2) < 0) { // s1 < s2 pos1++; if (pos1 == length1) { break main; } s1 = highLowContainer.getKeyAtIndex(pos1); } else { // s1 > s2 getMappeableRoaringArray().insertNewKeyValueAt(pos1, s2, x2.highLowContainer.getContainerAtIndex(pos2).clone()); pos1++; length1++; pos2++; if (pos2 == length2) { break main; } s2 = x2.highLowContainer.getKeyAtIndex(pos2); } } } if (pos1 == length1) { getMappeableRoaringArray().appendCopy(x2.highLowContainer, pos2, length2); } }
class class_name[name] begin[{] method[lazyor, return_type[void], modifier[protected], parameter[x2]] begin[{] local_variable[type[int], pos1] local_variable[type[int], length1] local_variable[type[int], length2] if[binary_operation[binary_operation[member[.pos1], <, member[.length1]], &&, binary_operation[member[.pos2], <, member[.length2]]]] begin[{] local_variable[type[short], s1] local_variable[type[short], s2] while[literal[true]] begin[{] if[binary_operation[member[.s1], ==, member[.s2]]] begin[{] call[.getMappeableRoaringArray, parameter[]] member[.pos1] member[.pos2] if[binary_operation[binary_operation[member[.pos1], ==, member[.length1]], ||, binary_operation[member[.pos2], ==, member[.length2]]]] begin[{] BreakStatement(goto=main, label=None) else begin[{] None end[}] assign[member[.s1], call[highLowContainer.getKeyAtIndex, parameter[member[.pos1]]]] assign[member[.s2], call[x2.highLowContainer.getKeyAtIndex, parameter[member[.pos2]]]] else begin[{] if[binary_operation[call[Util.compareUnsigned, parameter[member[.s1], member[.s2]]], <, literal[0]]] begin[{] member[.pos1] if[binary_operation[member[.pos1], ==, member[.length1]]] begin[{] BreakStatement(goto=main, label=None) else begin[{] None end[}] assign[member[.s1], call[highLowContainer.getKeyAtIndex, parameter[member[.pos1]]]] else begin[{] call[.getMappeableRoaringArray, parameter[]] member[.pos1] member[.length1] member[.pos2] if[binary_operation[member[.pos2], ==, member[.length2]]] begin[{] BreakStatement(goto=main, label=None) else begin[{] None end[}] assign[member[.s2], call[x2.highLowContainer.getKeyAtIndex, parameter[member[.pos2]]]] end[}] end[}] end[}] else begin[{] None end[}] if[binary_operation[member[.pos1], ==, member[.length1]]] begin[{] call[.getMappeableRoaringArray, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[lazyor] operator[SEP] Keyword[final] identifier[ImmutableRoaringBitmap] identifier[x2] operator[SEP] { Keyword[int] identifier[pos1] operator[=] Other[0] , identifier[pos2] operator[=] Other[0] operator[SEP] Keyword[int] identifier[length1] operator[=] identifier[highLowContainer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[length2] operator[=] identifier[x2] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[main] operator[:] Keyword[if] operator[SEP] identifier[pos1] operator[<] identifier[length1] operator[&&] identifier[pos2] operator[<] identifier[length2] operator[SEP] { Keyword[short] identifier[s1] operator[=] identifier[highLowContainer] operator[SEP] identifier[getKeyAtIndex] operator[SEP] identifier[pos1] operator[SEP] operator[SEP] Keyword[short] identifier[s2] operator[=] identifier[x2] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getKeyAtIndex] operator[SEP] identifier[pos2] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[s1] operator[==] identifier[s2] operator[SEP] { identifier[getMappeableRoaringArray] operator[SEP] operator[SEP] operator[SEP] identifier[setContainerAtIndex] operator[SEP] identifier[pos1] , identifier[highLowContainer] operator[SEP] identifier[getContainerAtIndex] operator[SEP] identifier[pos1] operator[SEP] operator[SEP] identifier[lazyIOR] operator[SEP] identifier[x2] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getContainerAtIndex] operator[SEP] identifier[pos2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pos1] operator[++] operator[SEP] identifier[pos2] operator[++] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[pos1] operator[==] identifier[length1] operator[SEP] operator[||] operator[SEP] identifier[pos2] operator[==] identifier[length2] operator[SEP] operator[SEP] { Keyword[break] identifier[main] operator[SEP] } identifier[s1] operator[=] identifier[highLowContainer] operator[SEP] identifier[getKeyAtIndex] operator[SEP] identifier[pos1] operator[SEP] operator[SEP] identifier[s2] operator[=] identifier[x2] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getKeyAtIndex] operator[SEP] identifier[pos2] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Util] operator[SEP] identifier[compareUnsigned] operator[SEP] identifier[s1] , identifier[s2] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[pos1] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[pos1] operator[==] identifier[length1] operator[SEP] { Keyword[break] identifier[main] operator[SEP] } identifier[s1] operator[=] identifier[highLowContainer] operator[SEP] identifier[getKeyAtIndex] operator[SEP] identifier[pos1] operator[SEP] operator[SEP] } Keyword[else] { identifier[getMappeableRoaringArray] operator[SEP] operator[SEP] operator[SEP] identifier[insertNewKeyValueAt] operator[SEP] identifier[pos1] , identifier[s2] , identifier[x2] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getContainerAtIndex] operator[SEP] identifier[pos2] operator[SEP] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pos1] operator[++] operator[SEP] identifier[length1] operator[++] operator[SEP] identifier[pos2] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[pos2] operator[==] identifier[length2] operator[SEP] { Keyword[break] identifier[main] operator[SEP] } identifier[s2] operator[=] identifier[x2] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getKeyAtIndex] operator[SEP] identifier[pos2] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[pos1] operator[==] identifier[length1] operator[SEP] { identifier[getMappeableRoaringArray] operator[SEP] operator[SEP] operator[SEP] identifier[appendCopy] operator[SEP] identifier[x2] operator[SEP] identifier[highLowContainer] , identifier[pos2] , identifier[length2] operator[SEP] operator[SEP] } }
@SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"}) private <T> T fetch(final String id) { checkNotNull(id); checkArgument(!id.isEmpty()); final T ret = (T) idMap.get(id); if (ret == null) { throw new EREException(String.format("Lookup failed for id %s.", id)); } return ret; }
class class_name[name] begin[{] method[fetch, return_type[type[T]], modifier[private], parameter[id]] begin[{] call[.checkNotNull, parameter[member[.id]]] call[.checkArgument, parameter[call[id.isEmpty, parameter[]]]] local_variable[type[T], ret] if[binary_operation[member[.ret], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Lookup failed for id %s."), MemberReference(member=id, 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=EREException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.ret]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[private] operator[<] identifier[T] operator[>] identifier[T] identifier[fetch] operator[SEP] Keyword[final] identifier[String] identifier[id] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] operator[!] identifier[id] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[T] identifier[ret] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[idMap] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[EREException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[id] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
@Override public final void setReverseRoutingPath(List<SIDestinationAddress> value) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setReverseRoutingPath", value); /* It is OK to pass in null for the List */ if (value != null) { for (int i = 0; i < value.size(); i++) { /* It is not valid to have a null entry in the List */ if (value.get(i) == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setReverseRoutingPath", "NullPointerException"); throw new NullPointerException(); } /* All values must be instances of SIDestinationAddress */ if (!(value.get(i) instanceof SIDestinationAddress)) { IllegalArgumentException e = new IllegalArgumentException(value.toString()); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setReverseRoutingPath", e); throw e; } } } setRRP(value); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setReverseRoutingPath"); }
class class_name[name] begin[{] method[setReverseRoutingPath, return_type[void], modifier[final public], parameter[value]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["setReverseRoutingPath"], member[.value]]] else begin[{] None end[}] if[binary_operation[member[.value], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setReverseRoutingPath"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NullPointerException")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=SIDestinationAddress, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IllegalArgumentException, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setReverseRoutingPath"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=value, 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) else begin[{] None end[}] call[.setRRP, parameter[member[.value]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["setReverseRoutingPath"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[setReverseRoutingPath] operator[SEP] identifier[List] operator[<] identifier[SIDestinationAddress] operator[>] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[value] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[value] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[SIDestinationAddress] operator[SEP] operator[SEP] { identifier[IllegalArgumentException] identifier[e] operator[=] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } } } identifier[setRRP] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public void setAggregatedSourceStatusList(java.util.Collection<AggregatedSourceStatus> aggregatedSourceStatusList) { if (aggregatedSourceStatusList == null) { this.aggregatedSourceStatusList = null; return; } this.aggregatedSourceStatusList = new com.amazonaws.internal.SdkInternalList<AggregatedSourceStatus>(aggregatedSourceStatusList); }
class class_name[name] begin[{] method[setAggregatedSourceStatusList, return_type[void], modifier[public], parameter[aggregatedSourceStatusList]] begin[{] if[binary_operation[member[.aggregatedSourceStatusList], ==, literal[null]]] begin[{] assign[THIS[member[None.aggregatedSourceStatusList]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.aggregatedSourceStatusList]], ClassCreator(arguments=[MemberReference(member=aggregatedSourceStatusList, 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=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AggregatedSourceStatus, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAggregatedSourceStatusList] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[AggregatedSourceStatus] operator[>] identifier[aggregatedSourceStatusList] operator[SEP] { Keyword[if] operator[SEP] identifier[aggregatedSourceStatusList] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[aggregatedSourceStatusList] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[aggregatedSourceStatusList] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[AggregatedSourceStatus] operator[>] operator[SEP] identifier[aggregatedSourceStatusList] operator[SEP] operator[SEP] }
public String getPublishButton() { String publishButton = OpenCms.getWorkplaceManager().getDefaultUserSettings().getPublishButtonAppearance(); if (CmsDefaultUserSettings.PUBLISHBUTTON_SHOW_NEVER.equals(publishButton)) { return ""; } int buttonStyle = getSettings().getUserSettings().getWorkplaceButtonStyle(); if (CmsDefaultUserSettings.PUBLISHBUTTON_SHOW_AUTO.equals(publishButton)) { if (getCms().isManagerOfProject()) { return button( "../../workplace/commons/publish_project.jsp", "body", "publish.png", Messages.GUI_BUTTON_PUBLISH_0, buttonStyle); } else { return ""; } } if (getCms().isManagerOfProject()) { return (button( "../../workplace/commons/publish_project.jsp", "body", "publish.png", Messages.GUI_BUTTON_PUBLISH_0, buttonStyle)); } else { return (button(null, null, "publish_in.png", Messages.GUI_BUTTON_PUBLISH_0, buttonStyle)); } }
class class_name[name] begin[{] method[getPublishButton, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], publishButton] if[call[CmsDefaultUserSettings.PUBLISHBUTTON_SHOW_NEVER.equals, parameter[member[.publishButton]]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[int], buttonStyle] if[call[CmsDefaultUserSettings.PUBLISHBUTTON_SHOW_AUTO.equals, parameter[member[.publishButton]]]] begin[{] if[call[.getCms, parameter[]]] begin[{] return[call[.button, parameter[literal["../../workplace/commons/publish_project.jsp"], literal["body"], literal["publish.png"], member[Messages.GUI_BUTTON_PUBLISH_0], member[.buttonStyle]]]] else begin[{] return[literal[""]] end[}] else begin[{] None end[}] if[call[.getCms, parameter[]]] begin[{] return[call[.button, parameter[literal["../../workplace/commons/publish_project.jsp"], literal["body"], literal["publish.png"], member[Messages.GUI_BUTTON_PUBLISH_0], member[.buttonStyle]]]] else begin[{] return[call[.button, parameter[literal[null], literal[null], literal["publish_in.png"], member[Messages.GUI_BUTTON_PUBLISH_0], member[.buttonStyle]]]] end[}] end[}] END[}]
Keyword[public] identifier[String] identifier[getPublishButton] operator[SEP] operator[SEP] { identifier[String] identifier[publishButton] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultUserSettings] operator[SEP] operator[SEP] operator[SEP] identifier[getPublishButtonAppearance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CmsDefaultUserSettings] operator[SEP] identifier[PUBLISHBUTTON_SHOW_NEVER] operator[SEP] identifier[equals] operator[SEP] identifier[publishButton] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[int] identifier[buttonStyle] operator[=] identifier[getSettings] operator[SEP] operator[SEP] operator[SEP] identifier[getUserSettings] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceButtonStyle] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CmsDefaultUserSettings] operator[SEP] identifier[PUBLISHBUTTON_SHOW_AUTO] operator[SEP] identifier[equals] operator[SEP] identifier[publishButton] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[isManagerOfProject] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[button] operator[SEP] literal[String] , literal[String] , literal[String] , identifier[Messages] operator[SEP] identifier[GUI_BUTTON_PUBLISH_0] , identifier[buttonStyle] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] literal[String] operator[SEP] } } Keyword[if] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[isManagerOfProject] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[button] operator[SEP] literal[String] , literal[String] , literal[String] , identifier[Messages] operator[SEP] identifier[GUI_BUTTON_PUBLISH_0] , identifier[buttonStyle] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] identifier[button] operator[SEP] Other[null] , Other[null] , literal[String] , identifier[Messages] operator[SEP] identifier[GUI_BUTTON_PUBLISH_0] , identifier[buttonStyle] operator[SEP] operator[SEP] operator[SEP] } }
private boolean missingAllele(String alleleString) { return !((alleleString != null) && !alleleString.replace("not specified", "") .replace("NS", "") .replace("NA", "") .replace("na", "") .replace("NULL", "") .replace("null", "") .replace(".", "").isEmpty()); }
class class_name[name] begin[{] method[missingAllele, return_type[type[boolean]], modifier[private], parameter[alleleString]] begin[{] return[binary_operation[binary_operation[member[.alleleString], !=, literal[null]], &&, call[alleleString.replace, parameter[literal["not specified"], literal[""]]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[missingAllele] operator[SEP] identifier[String] identifier[alleleString] operator[SEP] { Keyword[return] operator[!] operator[SEP] operator[SEP] identifier[alleleString] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[alleleString] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(DescribeIdentityRequest describeIdentityRequest, ProtocolMarshaller protocolMarshaller) { if (describeIdentityRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeIdentityRequest.getIdentityId(), IDENTITYID_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[describeIdentityRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeIdentityRequest], ==, 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=getIdentityId, postfix_operators=[], prefix_operators=[], qualifier=describeIdentityRequest, selectors=[], type_arguments=None), MemberReference(member=IDENTITYID_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[DescribeIdentityRequest] identifier[describeIdentityRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeIdentityRequest] 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[describeIdentityRequest] operator[SEP] identifier[getIdentityId] operator[SEP] operator[SEP] , identifier[IDENTITYID_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 int incrementCount (K key, int amount) { int[] val = get(key); if (val == null) { put(key, val = new int[1]); } val[0] += amount; return val[0]; /* Alternate implementation, less hashing on the first increment but more garbage created * every other time. (this whole method would be more optimal if this class were * rewritten) * int[] newVal = new int[] { amount }; int[] oldVal = put(key, newVal); if (oldVal != null) { newVal[0] += oldVal[0]; return oldVal[0]; } return 0; */ }
class class_name[name] begin[{] method[incrementCount, return_type[type[int]], modifier[public], parameter[key, amount]] begin[{] local_variable[type[int], val] if[binary_operation[member[.val], ==, literal[null]]] begin[{] call[.put, parameter[member[.key], assign[member[.val], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]]] else begin[{] None end[}] assign[member[.val], member[.amount]] return[member[.val]] end[}] END[}]
Keyword[public] Keyword[int] identifier[incrementCount] operator[SEP] identifier[K] identifier[key] , Keyword[int] identifier[amount] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[val] operator[=] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] { identifier[put] operator[SEP] identifier[key] , identifier[val] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } identifier[val] operator[SEP] Other[0] operator[SEP] operator[+=] identifier[amount] operator[SEP] Keyword[return] identifier[val] operator[SEP] Other[0] operator[SEP] operator[SEP] }
@Implementation protected static void nativeWriteSampleData( long nativeObject, int trackIndex, @NonNull ByteBuffer byteBuf, int offset, int size, long presentationTimeUs, @MediaCodec.BufferFlag int flags) { int toWrite = size - offset; byte[] bytes = new byte[toWrite]; byteBuf.get(bytes, 0, toWrite); try { getStream(nativeObject).write(bytes); } catch (IOException e) { throw new RuntimeException("Unable to write to temporary file.", e); } }
class class_name[name] begin[{] method[nativeWriteSampleData, return_type[void], modifier[static protected], parameter[nativeObject, trackIndex, byteBuf, offset, size, presentationTimeUs, flags]] begin[{] local_variable[type[int], toWrite] local_variable[type[byte], bytes] call[byteBuf.get, parameter[member[.bytes], literal[0], member[.toWrite]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nativeObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to write to temporary file."), 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=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Implementation] Keyword[protected] Keyword[static] Keyword[void] identifier[nativeWriteSampleData] operator[SEP] Keyword[long] identifier[nativeObject] , Keyword[int] identifier[trackIndex] , annotation[@] identifier[NonNull] identifier[ByteBuffer] identifier[byteBuf] , Keyword[int] identifier[offset] , Keyword[int] identifier[size] , Keyword[long] identifier[presentationTimeUs] , annotation[@] identifier[MediaCodec] operator[SEP] identifier[BufferFlag] Keyword[int] identifier[flags] operator[SEP] { Keyword[int] identifier[toWrite] operator[=] identifier[size] operator[-] identifier[offset] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[toWrite] operator[SEP] operator[SEP] identifier[byteBuf] operator[SEP] identifier[get] operator[SEP] identifier[bytes] , Other[0] , identifier[toWrite] operator[SEP] operator[SEP] Keyword[try] { identifier[getStream] operator[SEP] identifier[nativeObject] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static List<Field> findAllFields(Class<?> type) { List<Field> fields = new LinkedList<>(); if (type != null) { addAll(fields, type.getDeclaredFields()); if (type.getSuperclass() != null) { fields.addAll(findAllFields(type.getSuperclass())); } } return fields; }
class class_name[name] begin[{] method[findAllFields, return_type[type[List]], modifier[public static], parameter[type]] begin[{] local_variable[type[List], fields] if[binary_operation[member[.type], !=, literal[null]]] begin[{] call[.addAll, parameter[member[.fields], call[type.getDeclaredFields, parameter[]]]] if[binary_operation[call[type.getSuperclass, parameter[]], !=, literal[null]]] begin[{] call[fields.addAll, parameter[call[.findAllFields, parameter[call[type.getSuperclass, parameter[]]]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.fields]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Field] operator[>] identifier[findAllFields] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] { identifier[List] operator[<] identifier[Field] operator[>] identifier[fields] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] { identifier[addAll] operator[SEP] identifier[fields] , identifier[type] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[fields] operator[SEP] identifier[addAll] operator[SEP] identifier[findAllFields] operator[SEP] identifier[type] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[fields] operator[SEP] }
public Places getPlacesForContacts(JinxConstants.PlaceTypeId placeTypeId, String placeId, String woeId, Integer threshold, JinxConstants.Contacts contacts, Date minimumUploadDate, Date maximumUploadDate, Date minimumTakenDate, Date maximumTakenDate) throws JinxException { JinxUtils.validateParams(placeTypeId); if (JinxUtils.isNullOrEmpty(placeId)) { JinxUtils.validateParams(woeId); } Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.places.placesForContacts"); params.put("place_type_id", placeTypeId.getTypeId().toString()); if (JinxUtils.isNullOrEmpty(placeId)) { params.put("woe_id", woeId); } else { params.put("place_id", placeId); } if (threshold != null) { params.put("threshold", threshold.toString()); } if (contacts != null) { params.put("contacts", contacts.toString()); } if (minimumUploadDate != null) { params.put("min_upload_date", JinxUtils.formatDateAsUnixTimestamp(minimumUploadDate)); } if (maximumUploadDate != null) { params.put("max_upload_date", JinxUtils.formatDateAsUnixTimestamp(maximumUploadDate)); } if (minimumTakenDate != null) { params.put("min_taken_date", JinxUtils.formatDateAsMySqlTimestamp(minimumTakenDate)); } if (maximumTakenDate != null) { params.put("max_taken_date", JinxUtils.formatDateAsMySqlTimestamp(maximumTakenDate)); } return jinx.flickrGet(params, Places.class); }
class class_name[name] begin[{] method[getPlacesForContacts, return_type[type[Places]], modifier[public], parameter[placeTypeId, placeId, woeId, threshold, contacts, minimumUploadDate, maximumUploadDate, minimumTakenDate, maximumTakenDate]] begin[{] call[JinxUtils.validateParams, parameter[member[.placeTypeId]]] if[call[JinxUtils.isNullOrEmpty, parameter[member[.placeId]]]] begin[{] call[JinxUtils.validateParams, parameter[member[.woeId]]] else begin[{] None end[}] local_variable[type[Map], params] call[params.put, parameter[literal["method"], literal["flickr.places.placesForContacts"]]] call[params.put, parameter[literal["place_type_id"], call[placeTypeId.getTypeId, parameter[]]]] if[call[JinxUtils.isNullOrEmpty, parameter[member[.placeId]]]] begin[{] call[params.put, parameter[literal["woe_id"], member[.woeId]]] else begin[{] call[params.put, parameter[literal["place_id"], member[.placeId]]] end[}] if[binary_operation[member[.threshold], !=, literal[null]]] begin[{] call[params.put, parameter[literal["threshold"], call[threshold.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.contacts], !=, literal[null]]] begin[{] call[params.put, parameter[literal["contacts"], call[contacts.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.minimumUploadDate], !=, literal[null]]] begin[{] call[params.put, parameter[literal["min_upload_date"], call[JinxUtils.formatDateAsUnixTimestamp, parameter[member[.minimumUploadDate]]]]] else begin[{] None end[}] if[binary_operation[member[.maximumUploadDate], !=, literal[null]]] begin[{] call[params.put, parameter[literal["max_upload_date"], call[JinxUtils.formatDateAsUnixTimestamp, parameter[member[.maximumUploadDate]]]]] else begin[{] None end[}] if[binary_operation[member[.minimumTakenDate], !=, literal[null]]] begin[{] call[params.put, parameter[literal["min_taken_date"], call[JinxUtils.formatDateAsMySqlTimestamp, parameter[member[.minimumTakenDate]]]]] else begin[{] None end[}] if[binary_operation[member[.maximumTakenDate], !=, literal[null]]] begin[{] call[params.put, parameter[literal["max_taken_date"], call[JinxUtils.formatDateAsMySqlTimestamp, parameter[member[.maximumTakenDate]]]]] else begin[{] None end[}] return[call[jinx.flickrGet, parameter[member[.params], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Places, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Places] identifier[getPlacesForContacts] operator[SEP] identifier[JinxConstants] operator[SEP] identifier[PlaceTypeId] identifier[placeTypeId] , identifier[String] identifier[placeId] , identifier[String] identifier[woeId] , identifier[Integer] identifier[threshold] , identifier[JinxConstants] operator[SEP] identifier[Contacts] identifier[contacts] , identifier[Date] identifier[minimumUploadDate] , identifier[Date] identifier[maximumUploadDate] , identifier[Date] identifier[minimumTakenDate] , identifier[Date] identifier[maximumTakenDate] operator[SEP] Keyword[throws] identifier[JinxException] { identifier[JinxUtils] operator[SEP] identifier[validateParams] operator[SEP] identifier[placeTypeId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[JinxUtils] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[placeId] operator[SEP] operator[SEP] { identifier[JinxUtils] operator[SEP] identifier[validateParams] operator[SEP] identifier[woeId] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[placeTypeId] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[JinxUtils] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[placeId] operator[SEP] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[woeId] operator[SEP] operator[SEP] } Keyword[else] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[placeId] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[threshold] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[threshold] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contacts] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[contacts] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[minimumUploadDate] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[JinxUtils] operator[SEP] identifier[formatDateAsUnixTimestamp] operator[SEP] identifier[minimumUploadDate] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[maximumUploadDate] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[JinxUtils] operator[SEP] identifier[formatDateAsUnixTimestamp] operator[SEP] identifier[maximumUploadDate] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[minimumTakenDate] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[JinxUtils] operator[SEP] identifier[formatDateAsMySqlTimestamp] operator[SEP] identifier[minimumTakenDate] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[maximumTakenDate] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[JinxUtils] operator[SEP] identifier[formatDateAsMySqlTimestamp] operator[SEP] identifier[maximumTakenDate] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[jinx] operator[SEP] identifier[flickrGet] operator[SEP] identifier[params] , identifier[Places] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void writeObject (ObjectOutputStream out) throws IOException { int ecount = size(); out.writeInt(ecount); for (Map.Entry<K, V> entry : entrySet()) { out.writeObject(entry.getKey()); out.writeObject(entry.getValue()); } }
class class_name[name] begin[{] method[writeObject, return_type[void], modifier[public], parameter[out]] begin[{] local_variable[type[int], ecount] call[out.writeInt, parameter[member[.ecount]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=, 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[writeObject] operator[SEP] identifier[ObjectOutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[ecount] operator[=] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[ecount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[:] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[writeObject] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeObject] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public String convertIfcObjectiveEnumToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertIfcObjectiveEnumToString, 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[convertIfcObjectiveEnumToString] 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 static boolean canSkipEscaping( ImmutableList<SoyJavaPrintDirective> directives, @Nullable ContentKind kind) { if (kind == null) { return false; } for (SoyJavaPrintDirective directive : directives) { if (!(directive instanceof ShortCircuitable) || !((ShortCircuitable) directive).isNoopForKind(kind)) { return false; } } return true; }
class class_name[name] begin[{] method[canSkipEscaping, return_type[type[boolean]], modifier[private static], parameter[directives, kind]] begin[{] if[binary_operation[member[.kind], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=directive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ShortCircuitable, sub_type=None), operator=instanceof), operandr=Cast(expression=MemberReference(member=directive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ShortCircuitable, sub_type=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=EnhancedForControl(iterable=MemberReference(member=directives, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=directive)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SoyJavaPrintDirective, sub_type=None))), label=None) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[canSkipEscaping] operator[SEP] identifier[ImmutableList] operator[<] identifier[SoyJavaPrintDirective] operator[>] identifier[directives] , annotation[@] identifier[Nullable] identifier[ContentKind] identifier[kind] operator[SEP] { Keyword[if] operator[SEP] identifier[kind] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[SoyJavaPrintDirective] identifier[directive] operator[:] identifier[directives] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[directive] Keyword[instanceof] identifier[ShortCircuitable] operator[SEP] operator[||] operator[!] operator[SEP] operator[SEP] identifier[ShortCircuitable] operator[SEP] identifier[directive] operator[SEP] operator[SEP] identifier[isNoopForKind] operator[SEP] identifier[kind] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static Boolean toBooleanObject(final Integer value, final Integer trueValue, final Integer falseValue, final Integer nullValue) { if (value == null) { if (trueValue == null) { return Boolean.TRUE; } if (falseValue == null) { return Boolean.FALSE; } if (nullValue == null) { return null; } } else if (value.equals(trueValue)) { return Boolean.TRUE; } else if (value.equals(falseValue)) { return Boolean.FALSE; } else if (value.equals(nullValue)) { return null; } // no match throw new IllegalArgumentException("The Integer did not match any specified value"); }
class class_name[name] begin[{] method[toBooleanObject, return_type[type[Boolean]], modifier[public static], parameter[value, trueValue, falseValue, nullValue]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] if[binary_operation[member[.trueValue], ==, literal[null]]] begin[{] return[member[Boolean.TRUE]] else begin[{] None end[}] if[binary_operation[member[.falseValue], ==, literal[null]]] begin[{] return[member[Boolean.FALSE]] else begin[{] None end[}] if[binary_operation[member[.nullValue], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] else begin[{] if[call[value.equals, parameter[member[.trueValue]]]] begin[{] return[member[Boolean.TRUE]] else begin[{] if[call[value.equals, parameter[member[.falseValue]]]] begin[{] return[member[Boolean.FALSE]] else begin[{] if[call[value.equals, parameter[member[.nullValue]]]] begin[{] return[literal[null]] else begin[{] None end[}] end[}] end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The Integer did not match any specified value")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Boolean] identifier[toBooleanObject] operator[SEP] Keyword[final] identifier[Integer] identifier[value] , Keyword[final] identifier[Integer] identifier[trueValue] , Keyword[final] identifier[Integer] identifier[falseValue] , Keyword[final] identifier[Integer] identifier[nullValue] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[trueValue] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] } Keyword[if] operator[SEP] identifier[falseValue] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] } Keyword[if] operator[SEP] identifier[nullValue] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[trueValue] operator[SEP] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[falseValue] operator[SEP] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[nullValue] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public Matrix4d getRepeatTransform(int x, int y){ Matrix4d transform = new Matrix4d(); transform.setIdentity(); int[] iCounts = getAxisCounts(x); int[] jCounts = getAxisCounts(y); int[] counts = new int[iCounts.length]; for (int k = 0; k < iCounts.length; k++) counts[k] = iCounts[k] - jCounts[k]; for(int t = counts.length-1; t>=0; t--) { if(counts[t] == 0) continue; if (counts[t] > 0) { Matrix4d axis = new Matrix4d(axes.get(t).getOperator()); for(int i=0;i<counts[t];i++) transform.mul(axis); } else if (counts[t] < 0) { Matrix4d axis = new Matrix4d(axes.get(t).getOperator()); axis.invert(); for(int i=0;i<counts[t];i++) transform.mul(axis); } } return transform; }
class class_name[name] begin[{] method[getRepeatTransform, return_type[type[Matrix4d]], modifier[public], parameter[x, y]] begin[{] local_variable[type[Matrix4d], transform] call[transform.setIdentity, parameter[]] local_variable[type[int], iCounts] local_variable[type[int], jCounts] local_variable[type[int], counts] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=counts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=iCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=jCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=iCounts, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=counts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, 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=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=counts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=counts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=axes, selectors=[MethodInvocation(arguments=[], member=getOperator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Matrix4d, sub_type=None)), name=axis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matrix4d, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=invert, postfix_operators=[], prefix_operators=[], qualifier=axis, selectors=[], type_arguments=None), label=None), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=axis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mul, postfix_operators=[], prefix_operators=[], qualifier=transform, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=counts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, 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)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=axes, selectors=[MethodInvocation(arguments=[], member=getOperator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Matrix4d, sub_type=None)), name=axis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matrix4d, sub_type=None)), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=axis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mul, postfix_operators=[], prefix_operators=[], qualifier=transform, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=counts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, 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)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=counts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=t)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=t, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.transform]] end[}] END[}]
Keyword[public] identifier[Matrix4d] identifier[getRepeatTransform] operator[SEP] Keyword[int] identifier[x] , Keyword[int] identifier[y] operator[SEP] { identifier[Matrix4d] identifier[transform] operator[=] Keyword[new] identifier[Matrix4d] operator[SEP] operator[SEP] operator[SEP] identifier[transform] operator[SEP] identifier[setIdentity] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[iCounts] operator[=] identifier[getAxisCounts] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[jCounts] operator[=] identifier[getAxisCounts] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[counts] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[iCounts] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[iCounts] operator[SEP] identifier[length] operator[SEP] identifier[k] operator[++] operator[SEP] identifier[counts] operator[SEP] identifier[k] operator[SEP] operator[=] identifier[iCounts] operator[SEP] identifier[k] operator[SEP] operator[-] identifier[jCounts] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[t] operator[=] identifier[counts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[t] operator[>=] Other[0] operator[SEP] identifier[t] operator[--] operator[SEP] { Keyword[if] operator[SEP] identifier[counts] operator[SEP] identifier[t] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[counts] operator[SEP] identifier[t] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Matrix4d] identifier[axis] operator[=] Keyword[new] identifier[Matrix4d] operator[SEP] identifier[axes] operator[SEP] identifier[get] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[getOperator] 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[counts] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[transform] operator[SEP] identifier[mul] operator[SEP] identifier[axis] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[counts] operator[SEP] identifier[t] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[Matrix4d] identifier[axis] operator[=] Keyword[new] identifier[Matrix4d] operator[SEP] identifier[axes] operator[SEP] identifier[get] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[axis] operator[SEP] identifier[invert] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[counts] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[transform] operator[SEP] identifier[mul] operator[SEP] identifier[axis] operator[SEP] operator[SEP] } } Keyword[return] identifier[transform] operator[SEP] }
public java.util.Map getParameterMap() { //321485 if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"getParameterMap", ""); } if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){ checkRequestObjectInUse(); } // if the parameters haven't been parsed, parse them parseParameters(); // return the map return (Map) SRTServletRequestThreadData.getInstance().getParameters(); }
class class_name[name] begin[{] method[getParameterMap, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{] call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["getParameterMap"], literal[""]]] else begin[{] None end[}] if[member[WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE]] begin[{] call[.checkRequestObjectInUse, parameter[]] else begin[{] None end[}] call[.parseParameters, parameter[]] return[Cast(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SRTServletRequestThreadData, selectors=[MethodInvocation(arguments=[], member=getParameters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] identifier[getParameterMap] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[WCCustomProperties] operator[SEP] identifier[CHECK_REQUEST_OBJECT_IN_USE] operator[SEP] { identifier[checkRequestObjectInUse] operator[SEP] operator[SEP] operator[SEP] } identifier[parseParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Map] operator[SEP] identifier[SRTServletRequestThreadData] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isLegal(int ch) { if (ch < MIN_VALUE) { return false; } if (ch < Character.MIN_SURROGATE) { return true; } if (ch <= Character.MAX_SURROGATE) { return false; } if (UCharacterUtility.isNonCharacter(ch)) { return false; } return (ch <= MAX_VALUE); }
class class_name[name] begin[{] method[isLegal, return_type[type[boolean]], modifier[public static], parameter[ch]] begin[{] if[binary_operation[member[.ch], <, member[.MIN_VALUE]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.ch], <, member[Character.MIN_SURROGATE]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[member[.ch], <=, member[Character.MAX_SURROGATE]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[UCharacterUtility.isNonCharacter, parameter[member[.ch]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[binary_operation[member[.ch], <=, member[.MAX_VALUE]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isLegal] operator[SEP] Keyword[int] identifier[ch] operator[SEP] { Keyword[if] operator[SEP] identifier[ch] operator[<] identifier[MIN_VALUE] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[ch] operator[<] identifier[Character] operator[SEP] identifier[MIN_SURROGATE] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[ch] operator[<=] identifier[Character] operator[SEP] identifier[MAX_SURROGATE] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[UCharacterUtility] operator[SEP] identifier[isNonCharacter] operator[SEP] identifier[ch] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] operator[SEP] identifier[ch] operator[<=] identifier[MAX_VALUE] operator[SEP] operator[SEP] }
private LinkedHashMap<HypergraphNode<Variable>, Integer> orderingFromTentativeNewLocations(final LinkedHashMap<HypergraphNode<Variable>, Double> newLocations) { final LinkedHashMap<HypergraphNode<Variable>, Integer> ordering = new LinkedHashMap<>(); final List<Map.Entry<HypergraphNode<Variable>, Double>> list = new ArrayList<>(newLocations.entrySet()); Collections.sort(list, COMPARATOR); int count = 0; for (final Map.Entry<HypergraphNode<Variable>, Double> entry : list) ordering.put(entry.getKey(), count++); return ordering; } /** * The abortion criteria for the FORCE algorithm. * @param lastOrdering the ordering of the last step * @param currentOrdering the ordering of the current step * @return {@code true} if the algorithm should proceed, {@code false} if it should stop */ private boolean shouldProceed(final Map<HypergraphNode<Variable>, Integer> lastOrdering, final Map<HypergraphNode<Variable>, Integer> currentOrdering) { return !lastOrdering.equals(currentOrdering); }
class class_name[name] begin[{] method[orderingFromTentativeNewLocations, return_type[type[LinkedHashMap]], modifier[private], parameter[newLocations]] begin[{] local_variable[type[LinkedHashMap], ordering] local_variable[type[List], list] call[Collections.sort, parameter[member[.list], member[.COMPARATOR]]] local_variable[type[int], count] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=count, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=ordering, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None))], dimensions=[], name=HypergraphNode, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.ordering]] end[}] method[shouldProceed, return_type[type[boolean]], modifier[private], parameter[lastOrdering, currentOrdering]] begin[{] return[call[lastOrdering.equals, parameter[member[.currentOrdering]]]] end[}] END[}]
Keyword[private] identifier[LinkedHashMap] operator[<] identifier[HypergraphNode] operator[<] identifier[Variable] operator[>] , identifier[Integer] operator[>] identifier[orderingFromTentativeNewLocations] operator[SEP] Keyword[final] identifier[LinkedHashMap] operator[<] identifier[HypergraphNode] operator[<] identifier[Variable] operator[>] , identifier[Double] operator[>] identifier[newLocations] operator[SEP] { Keyword[final] identifier[LinkedHashMap] operator[<] identifier[HypergraphNode] operator[<] identifier[Variable] operator[>] , identifier[Integer] operator[>] identifier[ordering] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[HypergraphNode] operator[<] identifier[Variable] operator[>] , identifier[Double] operator[>] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[newLocations] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[list] , identifier[COMPARATOR] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[HypergraphNode] operator[<] identifier[Variable] operator[>] , identifier[Double] operator[>] identifier[entry] operator[:] identifier[list] operator[SEP] identifier[ordering] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[count] operator[++] operator[SEP] operator[SEP] Keyword[return] identifier[ordering] operator[SEP] } Keyword[private] Keyword[boolean] identifier[shouldProceed] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[HypergraphNode] operator[<] identifier[Variable] operator[>] , identifier[Integer] operator[>] identifier[lastOrdering] , Keyword[final] identifier[Map] operator[<] identifier[HypergraphNode] operator[<] identifier[Variable] operator[>] , identifier[Integer] operator[>] identifier[currentOrdering] operator[SEP] { Keyword[return] operator[!] identifier[lastOrdering] operator[SEP] identifier[equals] operator[SEP] identifier[currentOrdering] operator[SEP] operator[SEP] }
void printXMLAttributes(DapNode node, CEConstraint ce, int flags) throws IOException { if((flags & PERLINE) != 0) printer.indent(2); // Print name first, if non-null and !NONAME // Note that the short name needs to use // entity escaping (which is done by printXMLattribute), // but backslash escaping is not required. String name = node.getShortName(); if(name != null && (flags & NONAME) == 0) { name = node.getShortName(); printXMLAttribute("name", name, flags); } switch (node.getSort()) { case DATASET: DapDataset dataset = (DapDataset) node; printXMLAttribute("dapVersion", dataset.getDapVersion(), flags); printXMLAttribute("dmrVersion", dataset.getDMRVersion(), flags); // boilerplate printXMLAttribute("xmlns", "http://xml.opendap.org/ns/DAP/4.0#", flags); printXMLAttribute("xmlns:dap", "http://xml.opendap.org/ns/DAP/4.0#", flags); break; case DIMENSION: DapDimension orig = (DapDimension) node; if(orig.isShared()) {//not Anonymous // name will have already been printed // Now, we need to get the size as defined by the constraint DapDimension actual = this.ce.getRedefDim(orig); if(actual == null) actual = orig; long size = actual.getSize(); printXMLAttribute("size", Long.toString(size), flags); } break; case ENUMERATION: printXMLAttribute("basetype", ((DapEnumeration) node).getBaseType().getTypeName(), flags); break; case VARIABLE: DapVariable var = (DapVariable) node; DapType basetype = var.getBaseType(); if(basetype.isEnumType()) { printXMLAttribute("enum", basetype.getTypeName(), flags); } break; case ATTRIBUTE: DapAttribute attr = (DapAttribute) node; basetype = attr.getBaseType(); printXMLAttribute("type", basetype.getTypeName(), flags); if(attr.getBaseType().isEnumType()) { printXMLAttribute("enum", basetype.getTypeName(), flags); } break; default: break; // node either has no attributes or name only } //switch if(!this.testing) printReserved(node); if((flags & PERLINE) != 0) { printer.outdent(2); } }
class class_name[name] begin[{] method[printXMLAttributes, return_type[void], modifier[default], parameter[node, ce, flags]] begin[{] if[binary_operation[binary_operation[member[.flags], &, member[.PERLINE]], !=, literal[0]]] begin[{] call[printer.indent, parameter[literal[2]]] else begin[{] None end[}] local_variable[type[String], name] if[binary_operation[binary_operation[member[.name], !=, literal[null]], &&, binary_operation[binary_operation[member[.flags], &, member[.NONAME]], ==, literal[0]]]] begin[{] assign[member[.name], call[node.getShortName, parameter[]]] call[.printXMLAttribute, parameter[literal["name"], member[.name], member[.flags]]] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['DATASET'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DapDataset, sub_type=None)), name=dataset)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DapDataset, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dapVersion"), MethodInvocation(arguments=[], member=getDapVersion, postfix_operators=[], prefix_operators=[], qualifier=dataset, selectors=[], type_arguments=None), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dmrVersion"), MethodInvocation(arguments=[], member=getDMRVersion, postfix_operators=[], prefix_operators=[], qualifier=dataset, selectors=[], type_arguments=None), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="xmlns"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="http://xml.opendap.org/ns/DAP/4.0#"), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="xmlns:dap"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="http://xml.opendap.org/ns/DAP/4.0#"), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['DIMENSION'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DapDimension, sub_type=None)), name=orig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DapDimension, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isShared, postfix_operators=[], prefix_operators=[], qualifier=orig, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=ce, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=orig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRedefDim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=actual)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DapDimension, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=orig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=actual, selectors=[], type_arguments=None), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="size"), MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ENUMERATION'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="basetype"), Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DapEnumeration, sub_type=None)), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['VARIABLE'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DapVariable, sub_type=None)), name=var)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DapVariable, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBaseType, postfix_operators=[], prefix_operators=[], qualifier=var, selectors=[], type_arguments=None), name=basetype)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DapType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEnumType, postfix_operators=[], prefix_operators=[], qualifier=basetype, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="enum"), MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=basetype, selectors=[], type_arguments=None), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ATTRIBUTE'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DapAttribute, sub_type=None)), name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DapAttribute, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=basetype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getBaseType, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type"), MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=basetype, selectors=[], type_arguments=None), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getBaseType, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[MethodInvocation(arguments=[], member=isEnumType, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="enum"), MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=basetype, selectors=[], type_arguments=None), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printXMLAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getSort, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None) if[THIS[member[None.testing]]] begin[{] call[.printReserved, parameter[member[.node]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.flags], &, member[.PERLINE]], !=, literal[0]]] begin[{] call[printer.outdent, parameter[literal[2]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[printXMLAttributes] operator[SEP] identifier[DapNode] identifier[node] , identifier[CEConstraint] identifier[ce] , Keyword[int] identifier[flags] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[PERLINE] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[printer] operator[SEP] identifier[indent] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[node] operator[SEP] identifier[getShortName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[&&] operator[SEP] identifier[flags] operator[&] identifier[NONAME] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[name] operator[=] identifier[node] operator[SEP] identifier[getShortName] operator[SEP] operator[SEP] operator[SEP] identifier[printXMLAttribute] operator[SEP] literal[String] , identifier[name] , identifier[flags] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[node] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[DATASET] operator[:] identifier[DapDataset] identifier[dataset] operator[=] operator[SEP] identifier[DapDataset] operator[SEP] identifier[node] operator[SEP] identifier[printXMLAttribute] operator[SEP] literal[String] , identifier[dataset] operator[SEP] identifier[getDapVersion] operator[SEP] operator[SEP] , identifier[flags] operator[SEP] operator[SEP] identifier[printXMLAttribute] operator[SEP] literal[String] , identifier[dataset] operator[SEP] identifier[getDMRVersion] operator[SEP] operator[SEP] , identifier[flags] operator[SEP] operator[SEP] identifier[printXMLAttribute] operator[SEP] literal[String] , literal[String] , identifier[flags] operator[SEP] operator[SEP] identifier[printXMLAttribute] operator[SEP] literal[String] , literal[String] , identifier[flags] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[DIMENSION] operator[:] identifier[DapDimension] identifier[orig] operator[=] operator[SEP] identifier[DapDimension] operator[SEP] identifier[node] operator[SEP] Keyword[if] operator[SEP] identifier[orig] operator[SEP] identifier[isShared] operator[SEP] operator[SEP] operator[SEP] { identifier[DapDimension] identifier[actual] operator[=] Keyword[this] operator[SEP] identifier[ce] operator[SEP] identifier[getRedefDim] operator[SEP] identifier[orig] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actual] operator[==] Other[null] operator[SEP] identifier[actual] operator[=] identifier[orig] operator[SEP] Keyword[long] identifier[size] operator[=] identifier[actual] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] identifier[printXMLAttribute] operator[SEP] literal[String] , identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[size] operator[SEP] , identifier[flags] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] identifier[ENUMERATION] operator[:] identifier[printXMLAttribute] operator[SEP] literal[String] , operator[SEP] operator[SEP] identifier[DapEnumeration] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[getBaseType] operator[SEP] operator[SEP] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] , identifier[flags] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[VARIABLE] operator[:] identifier[DapVariable] identifier[var] operator[=] operator[SEP] identifier[DapVariable] operator[SEP] identifier[node] operator[SEP] identifier[DapType] identifier[basetype] operator[=] identifier[var] operator[SEP] identifier[getBaseType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[basetype] operator[SEP] identifier[isEnumType] operator[SEP] operator[SEP] operator[SEP] { identifier[printXMLAttribute] operator[SEP] literal[String] , identifier[basetype] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] , identifier[flags] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] identifier[ATTRIBUTE] operator[:] identifier[DapAttribute] identifier[attr] operator[=] operator[SEP] identifier[DapAttribute] operator[SEP] identifier[node] operator[SEP] identifier[basetype] operator[=] identifier[attr] operator[SEP] identifier[getBaseType] operator[SEP] operator[SEP] operator[SEP] identifier[printXMLAttribute] operator[SEP] literal[String] , identifier[basetype] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] , identifier[flags] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[SEP] identifier[getBaseType] operator[SEP] operator[SEP] operator[SEP] identifier[isEnumType] operator[SEP] operator[SEP] operator[SEP] { identifier[printXMLAttribute] operator[SEP] literal[String] , identifier[basetype] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] , identifier[flags] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[testing] operator[SEP] identifier[printReserved] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[PERLINE] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[printer] operator[SEP] identifier[outdent] operator[SEP] Other[2] operator[SEP] operator[SEP] } }
public static void horizontal(Kernel1D_S32 kernel, GrayU8 src, GrayI8 dst ) { InputSanityCheck.checkSameShape(src, dst); boolean processed = BOverrideConvolveImageNormalized.invokeNativeHorizontal(kernel,src,dst); if( !processed ) { if( kernel.width >= src.width ) { ConvolveNormalizedNaive_SB.horizontal(kernel, src, dst); } else { ConvolveImageNoBorder.horizontal(kernel, src, dst, kernel.computeSum()); ConvolveNormalized_JustBorder_SB.horizontal(kernel, src, dst); } } }
class class_name[name] begin[{] method[horizontal, return_type[void], modifier[public static], parameter[kernel, src, dst]] begin[{] call[InputSanityCheck.checkSameShape, parameter[member[.src], member[.dst]]] local_variable[type[boolean], processed] if[member[.processed]] begin[{] if[binary_operation[member[kernel.width], >=, member[src.width]]] begin[{] call[ConvolveNormalizedNaive_SB.horizontal, parameter[member[.kernel], member[.src], member[.dst]]] else begin[{] call[ConvolveImageNoBorder.horizontal, parameter[member[.kernel], member[.src], member[.dst], call[kernel.computeSum, parameter[]]]] call[ConvolveNormalized_JustBorder_SB.horizontal, parameter[member[.kernel], member[.src], member[.dst]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[horizontal] operator[SEP] identifier[Kernel1D_S32] identifier[kernel] , identifier[GrayU8] identifier[src] , identifier[GrayI8] identifier[dst] operator[SEP] { identifier[InputSanityCheck] operator[SEP] identifier[checkSameShape] operator[SEP] identifier[src] , identifier[dst] operator[SEP] operator[SEP] Keyword[boolean] identifier[processed] operator[=] identifier[BOverrideConvolveImageNormalized] operator[SEP] identifier[invokeNativeHorizontal] operator[SEP] identifier[kernel] , identifier[src] , identifier[dst] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[processed] operator[SEP] { Keyword[if] operator[SEP] identifier[kernel] operator[SEP] identifier[width] operator[>=] identifier[src] operator[SEP] identifier[width] operator[SEP] { identifier[ConvolveNormalizedNaive_SB] operator[SEP] identifier[horizontal] operator[SEP] identifier[kernel] , identifier[src] , identifier[dst] operator[SEP] operator[SEP] } Keyword[else] { identifier[ConvolveImageNoBorder] operator[SEP] identifier[horizontal] operator[SEP] identifier[kernel] , identifier[src] , identifier[dst] , identifier[kernel] operator[SEP] identifier[computeSum] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ConvolveNormalized_JustBorder_SB] operator[SEP] identifier[horizontal] operator[SEP] identifier[kernel] , identifier[src] , identifier[dst] operator[SEP] operator[SEP] } } }
public CMatrixRMaj readCDRM(int numRows, int numCols) throws IOException { CMatrixRMaj A = new CMatrixRMaj(numRows,numCols); int wordsCol = numCols*2; for( int i = 0; i < numRows; i++ ) { List<String> words = extractWords(); if( words == null ) throw new IOException("Too few rows found. expected "+numRows+" actual "+i); if( words.size() != wordsCol ) throw new IOException("Unexpected number of words in column. Found "+words.size()+" expected "+wordsCol); for( int j = 0; j < wordsCol; j += 2 ) { float real = Float.parseFloat(words.get(j)); float imaginary = Float.parseFloat(words.get(j+1)); A.set(i, j, real, imaginary); } } return A; }
class class_name[name] begin[{] method[readCDRM, return_type[type[CMatrixRMaj]], modifier[public], parameter[numRows, numCols]] begin[{] local_variable[type[CMatrixRMaj], A] local_variable[type[int], wordsCol] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=extractWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=words)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=words, 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=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Too few rows found. expected "), operandr=MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" actual "), operator=+), operandr=MemberReference(member=i, 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=IOException, sub_type=None)), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None), operandr=MemberReference(member=wordsCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected number of words in column. Found "), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" expected "), operator=+), operandr=MemberReference(member=wordsCol, 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=IOException, sub_type=None)), label=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None)], member=parseFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None), name=real)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None)], member=parseFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None), name=imaginary)], modifiers=set(), type=BasicType(dimensions=[], name=float)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=imaginary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=A, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=wordsCol, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.A]] end[}] END[}]
Keyword[public] identifier[CMatrixRMaj] identifier[readCDRM] operator[SEP] Keyword[int] identifier[numRows] , Keyword[int] identifier[numCols] operator[SEP] Keyword[throws] identifier[IOException] { identifier[CMatrixRMaj] identifier[A] operator[=] Keyword[new] identifier[CMatrixRMaj] operator[SEP] identifier[numRows] , identifier[numCols] operator[SEP] operator[SEP] Keyword[int] identifier[wordsCol] operator[=] identifier[numCols] operator[*] Other[2] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numRows] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[words] operator[=] identifier[extractWords] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[words] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[numRows] operator[+] literal[String] operator[+] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[words] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[wordsCol] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[words] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[wordsCol] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[wordsCol] operator[SEP] identifier[j] operator[+=] Other[2] operator[SEP] { Keyword[float] identifier[real] operator[=] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[words] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[imaginary] operator[=] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[words] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[A] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[j] , identifier[real] , identifier[imaginary] operator[SEP] operator[SEP] } } Keyword[return] identifier[A] operator[SEP] }
public final int getInt24(final int pos) { final int position = origin + pos; if (pos + 2 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + (pos < 0 ? pos : (pos + 2))); byte[] buf = buffer; return (0xff & buf[position]) | ((0xff & buf[position + 1]) << 8) | ((buf[position + 2]) << 16); }
class class_name[name] begin[{] method[getInt24, return_type[type[int]], modifier[final public], parameter[pos]] begin[{] local_variable[type[int], position] if[binary_operation[binary_operation[binary_operation[member[.pos], +, literal[2]], >=, member[.limit]], ||, binary_operation[member[.pos], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="limit excceed: "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), if_true=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[byte], buf] return[binary_operation[binary_operation[binary_operation[literal[0xff], &, member[.buf]], |, binary_operation[binary_operation[literal[0xff], &, member[.buf]], <<, literal[8]]], |, binary_operation[member[.buf], <<, literal[16]]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[int] identifier[getInt24] operator[SEP] Keyword[final] Keyword[int] identifier[pos] operator[SEP] { Keyword[final] Keyword[int] identifier[position] operator[=] identifier[origin] operator[+] identifier[pos] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[+] Other[2] operator[>=] identifier[limit] operator[||] identifier[pos] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[pos] operator[<] Other[0] operator[?] identifier[pos] operator[:] operator[SEP] identifier[pos] operator[+] Other[2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] identifier[buffer] operator[SEP] Keyword[return] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[|] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[1] operator[SEP] operator[SEP] operator[<<] Other[8] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[position] operator[+] Other[2] operator[SEP] operator[SEP] operator[<<] Other[16] operator[SEP] operator[SEP] }
@ObjectiveCName("sendPhotoWithPeer:withName:withW:withH:withThumb:withDescriptor:") public void sendPhoto(@NotNull Peer peer, @NotNull String fileName, int w, int h, @Nullable FastThumb fastThumb, @NotNull String descriptor) { modules.getMessagesModule().sendPhoto(peer, fileName, w, h, fastThumb, descriptor); }
class class_name[name] begin[{] method[sendPhoto, return_type[void], modifier[public], parameter[peer, fileName, w, h, fastThumb, descriptor]] begin[{] call[modules.getMessagesModule, parameter[]] end[}] END[}]
annotation[@] identifier[ObjectiveCName] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[sendPhoto] operator[SEP] annotation[@] identifier[NotNull] identifier[Peer] identifier[peer] , annotation[@] identifier[NotNull] identifier[String] identifier[fileName] , Keyword[int] identifier[w] , Keyword[int] identifier[h] , annotation[@] identifier[Nullable] identifier[FastThumb] identifier[fastThumb] , annotation[@] identifier[NotNull] identifier[String] identifier[descriptor] operator[SEP] { identifier[modules] operator[SEP] identifier[getMessagesModule] operator[SEP] operator[SEP] operator[SEP] identifier[sendPhoto] operator[SEP] identifier[peer] , identifier[fileName] , identifier[w] , identifier[h] , identifier[fastThumb] , identifier[descriptor] operator[SEP] operator[SEP] }
public static void sqlRS(Connection conn, String sql, Consumer<ResultSet> consumer) { try (Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql)) { consumer.accept(rs); } catch (SQLException e) { logger.error(e.getMessage(), e); } }
class class_name[name] begin[{] method[sqlRS, return_type[void], modifier[public static], parameter[conn, sql, consumer]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=consumer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stmt, type=ReferenceType(arguments=None, dimensions=[], name=Statement, sub_type=None), value=MethodInvocation(arguments=[], member=createStatement, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), TryResource(annotations=[], modifiers=set(), name=rs, type=ReferenceType(arguments=None, dimensions=[], name=ResultSet, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[sqlRS] operator[SEP] identifier[Connection] identifier[conn] , identifier[String] identifier[sql] , identifier[Consumer] operator[<] identifier[ResultSet] operator[>] identifier[consumer] operator[SEP] { Keyword[try] operator[SEP] identifier[Statement] identifier[stmt] operator[=] identifier[conn] operator[SEP] identifier[createStatement] operator[SEP] operator[SEP] operator[SEP] identifier[ResultSet] identifier[rs] operator[=] identifier[stmt] operator[SEP] identifier[executeQuery] operator[SEP] identifier[sql] operator[SEP] operator[SEP] { identifier[consumer] operator[SEP] identifier[accept] operator[SEP] identifier[rs] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void startParsing(Reader reader, T data) throws XMLStreamException { checkState(model != null, "No model was set"); init(reader, data); isIncremental = true; }
class class_name[name] begin[{] method[startParsing, return_type[void], modifier[public], parameter[reader, data]] begin[{] call[.checkState, parameter[binary_operation[member[.model], !=, literal[null]], literal["No model was set"]]] call[.init, parameter[member[.reader], member[.data]]] assign[member[.isIncremental], literal[true]] end[}] END[}]
Keyword[public] Keyword[void] identifier[startParsing] operator[SEP] identifier[Reader] identifier[reader] , identifier[T] identifier[data] operator[SEP] Keyword[throws] identifier[XMLStreamException] { identifier[checkState] operator[SEP] identifier[model] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[init] operator[SEP] identifier[reader] , identifier[data] operator[SEP] operator[SEP] identifier[isIncremental] operator[=] literal[boolean] operator[SEP] }
public static Result unsupportedMediaType(File content, FileMimeTypes fileMimeTypes) { return status(UNSUPPORTED_MEDIA_TYPE, content, fileMimeTypes); }
class class_name[name] begin[{] method[unsupportedMediaType, return_type[type[Result]], modifier[public static], parameter[content, fileMimeTypes]] begin[{] return[call[.status, parameter[member[.UNSUPPORTED_MEDIA_TYPE], member[.content], member[.fileMimeTypes]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Result] identifier[unsupportedMediaType] operator[SEP] identifier[File] identifier[content] , identifier[FileMimeTypes] identifier[fileMimeTypes] operator[SEP] { Keyword[return] identifier[status] operator[SEP] identifier[UNSUPPORTED_MEDIA_TYPE] , identifier[content] , identifier[fileMimeTypes] operator[SEP] operator[SEP] }
public static void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) { if (PRE_ICS) { preIcsUnregisterActivityLifecycleCallbacks(callback); } else { postIcsUnregisterActivityLifecycleCallbacks(application, callback); } }
class class_name[name] begin[{] method[unregisterActivityLifecycleCallbacks, return_type[void], modifier[public static], parameter[application, callback]] begin[{] if[member[.PRE_ICS]] begin[{] call[.preIcsUnregisterActivityLifecycleCallbacks, parameter[member[.callback]]] else begin[{] call[.postIcsUnregisterActivityLifecycleCallbacks, parameter[member[.application], member[.callback]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[unregisterActivityLifecycleCallbacks] operator[SEP] identifier[Application] identifier[application] , identifier[ActivityLifecycleCallbacksCompat] identifier[callback] operator[SEP] { Keyword[if] operator[SEP] identifier[PRE_ICS] operator[SEP] { identifier[preIcsUnregisterActivityLifecycleCallbacks] operator[SEP] identifier[callback] operator[SEP] operator[SEP] } Keyword[else] { identifier[postIcsUnregisterActivityLifecycleCallbacks] operator[SEP] identifier[application] , identifier[callback] operator[SEP] operator[SEP] } }
@Override public StringBuilderWriter append(CharSequence csq, int start, int end) { CharSequence cs = (csq == null ? "null" : csq); buf.append(cs, start, end); return this; }
class class_name[name] begin[{] method[append, return_type[type[StringBuilderWriter]], modifier[public], parameter[csq, start, end]] begin[{] local_variable[type[CharSequence], cs] call[buf.append, parameter[member[.cs], member[.start], member[.end]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[StringBuilderWriter] identifier[append] operator[SEP] identifier[CharSequence] identifier[csq] , Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] { identifier[CharSequence] identifier[cs] operator[=] operator[SEP] identifier[csq] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[csq] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[cs] , identifier[start] , identifier[end] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void closeConnection() { if (this.manualMode == false && this.dataSource != null) { MjdbcUtils.closeQuietly(this.conn); this.conn = null; } }
class class_name[name] begin[{] method[closeConnection, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[THIS[member[None.manualMode]], ==, literal[false]], &&, binary_operation[THIS[member[None.dataSource]], !=, literal[null]]]] begin[{] call[MjdbcUtils.closeQuietly, parameter[THIS[member[None.conn]]]] assign[THIS[member[None.conn]], literal[null]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[closeConnection] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[manualMode] operator[==] literal[boolean] operator[&&] Keyword[this] operator[SEP] identifier[dataSource] operator[!=] Other[null] operator[SEP] { identifier[MjdbcUtils] operator[SEP] identifier[closeQuietly] operator[SEP] Keyword[this] operator[SEP] identifier[conn] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[conn] operator[=] Other[null] operator[SEP] } }
public boolean add(String field, List<RDFNode> result) { this.result.put(field, result); return true; }
class class_name[name] begin[{] method[add, return_type[type[boolean]], modifier[public], parameter[field, result]] begin[{] THIS[member[None.result]call[None.put, parameter[member[.field], member[.result]]]] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[add] operator[SEP] identifier[String] identifier[field] , identifier[List] operator[<] identifier[RDFNode] operator[>] identifier[result] operator[SEP] { Keyword[this] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[field] , identifier[result] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public static <K, V> KeyAffinityService<K> newKeyAffinityService(Cache<K, V> cache, Executor ex, KeyGenerator<K> keyGenerator, int keyBufferSize, boolean start) { return new KeyAffinityServiceImpl<>(ex, cache, keyGenerator, keyBufferSize, null, start); }
class class_name[name] begin[{] method[newKeyAffinityService, return_type[type[KeyAffinityService]], modifier[public static], parameter[cache, ex, keyGenerator, keyBufferSize, start]] begin[{] return[ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyGenerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyBufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=KeyAffinityServiceImpl, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[KeyAffinityService] operator[<] identifier[K] operator[>] identifier[newKeyAffinityService] operator[SEP] identifier[Cache] operator[<] identifier[K] , identifier[V] operator[>] identifier[cache] , identifier[Executor] identifier[ex] , identifier[KeyGenerator] operator[<] identifier[K] operator[>] identifier[keyGenerator] , Keyword[int] identifier[keyBufferSize] , Keyword[boolean] identifier[start] operator[SEP] { Keyword[return] Keyword[new] identifier[KeyAffinityServiceImpl] operator[<] operator[>] operator[SEP] identifier[ex] , identifier[cache] , identifier[keyGenerator] , identifier[keyBufferSize] , Other[null] , identifier[start] operator[SEP] operator[SEP] }
public static UserDetailsManagerResourceFactoryBean fromString(String users) { UserDetailsManagerResourceFactoryBean result = new UserDetailsManagerResourceFactoryBean(); result.setResource(new InMemoryResource(users)); return result; }
class class_name[name] begin[{] method[fromString, return_type[type[UserDetailsManagerResourceFactoryBean]], modifier[public static], parameter[users]] begin[{] local_variable[type[UserDetailsManagerResourceFactoryBean], result] call[result.setResource, parameter[ClassCreator(arguments=[MemberReference(member=users, 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=InMemoryResource, sub_type=None))]] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[UserDetailsManagerResourceFactoryBean] identifier[fromString] operator[SEP] identifier[String] identifier[users] operator[SEP] { identifier[UserDetailsManagerResourceFactoryBean] identifier[result] operator[=] Keyword[new] identifier[UserDetailsManagerResourceFactoryBean] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setResource] operator[SEP] Keyword[new] identifier[InMemoryResource] operator[SEP] identifier[users] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
private char rdQuotedCh() throws LexException { quotedQuote = false; char c = rdCh(); if (c == '\\') { rdCh(); switch (ch) { case 'r': ch = '\r'; break; case 'n': ch = '\n'; break; case 't': ch = '\t'; break; case 'f': ch = '\f'; break; case 'e': ch = '\033'; break; case 'a': ch = '\007'; break; case '\'': ch = '\''; break; case '\"': ch = '\"'; quotedQuote = true; break; case '\\': ch = '\\'; break; case 'x': ch = (char) (value(rdCh()) * 16 + value(rdCh())); break; case 'c': ch = (char) (rdCh() - 'A' + 1); // eg. CTRL-A = 1 break; case 'u': ch = (char) (value(rdCh()) * 4096 + value(rdCh()) * 256 + value(rdCh()) * 16 + value(rdCh())); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': ch = (char) (value(ch) * 64 + value(rdCh()) * 8 + value(rdCh())); break; default: throwMessage(1000, "Malformed quoted character"); } } return ch; }
class class_name[name] begin[{] method[rdQuotedCh, return_type[type[char]], modifier[private], parameter[]] begin[{] assign[member[.quotedQuote], literal[false]] local_variable[type[char], c] if[binary_operation[member[.c], ==, literal['\\']]] begin[{] call[.rdCh, parameter[]] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\f')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='e')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\033')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\007')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"')), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=quotedQuote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='x')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=*), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), type=BasicType(dimensions=[], name=char))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='c')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), type=BasicType(dimensions=[], name=char))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='u')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096), operator=*), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256), operator=*), operator=+), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=*), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), type=BasicType(dimensions=[], name=char))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='1'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='2'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='3'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='4'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='5'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='6'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='7')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64), operator=*), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=*), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=rdCh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), type=BasicType(dimensions=[], name=char))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed quoted character")], member=throwMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] return[member[.ch]] end[}] END[}]
Keyword[private] Keyword[char] identifier[rdQuotedCh] operator[SEP] operator[SEP] Keyword[throws] identifier[LexException] { identifier[quotedQuote] operator[=] literal[boolean] operator[SEP] Keyword[char] identifier[c] operator[=] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[ch] operator[SEP] { Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] identifier[quotedQuote] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[*] Other[16] operator[+] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[-] literal[String] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[*] Other[4096] operator[+] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[*] Other[256] operator[+] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[*] Other[16] operator[+] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[ch] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[value] operator[SEP] identifier[ch] operator[SEP] operator[*] Other[64] operator[+] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[*] Other[8] operator[+] identifier[value] operator[SEP] identifier[rdCh] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[throwMessage] operator[SEP] Other[1000] , literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[ch] operator[SEP] }
public static void setupClasspath( final Path distributedClassPath, final Path intermediateClassPath, final Job job ) throws IOException { String classpathProperty = System.getProperty("druid.hadoop.internal.classpath"); if (classpathProperty == null) { classpathProperty = System.getProperty("java.class.path"); } String[] jarFiles = classpathProperty.split(File.pathSeparator); final Configuration conf = job.getConfiguration(); final FileSystem fs = distributedClassPath.getFileSystem(conf); if (fs instanceof LocalFileSystem) { return; } for (String jarFilePath : jarFiles) { final File jarFile = new File(jarFilePath); if (jarFile.getName().endsWith(".jar")) { try { RetryUtils.retry( () -> { if (isSnapshot(jarFile)) { addSnapshotJarToClassPath(jarFile, intermediateClassPath, fs, job); } else { addJarToClassPath(jarFile, distributedClassPath, intermediateClassPath, fs, job); } return true; }, shouldRetryPredicate(), NUM_RETRIES ); } catch (Exception e) { throw new RuntimeException(e); } } } }
class class_name[name] begin[{] method[setupClasspath, return_type[void], modifier[public static], parameter[distributedClassPath, intermediateClassPath, job]] begin[{] local_variable[type[String], classpathProperty] if[binary_operation[member[.classpathProperty], ==, literal[null]]] begin[{] assign[member[.classpathProperty], call[System.getProperty, parameter[literal["java.class.path"]]]] else begin[{] None end[}] local_variable[type[String], jarFiles] local_variable[type[Configuration], conf] local_variable[type[FileSystem], fs] if[binary_operation[member[.fs], instanceof, type[LocalFileSystem]]] begin[{] return[None] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=jarFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=jarFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=jarFile, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".jar")], member=endsWith, 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=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=jarFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSnapshot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jarFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=distributedClassPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=intermediateClassPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addJarToClassPath, 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=jarFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=intermediateClassPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSnapshotJarToClassPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], parameters=[]), MethodInvocation(arguments=[], member=shouldRetryPredicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=NUM_RETRIES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=retry, postfix_operators=[], prefix_operators=[], qualifier=RetryUtils, 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=['Exception']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=jarFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=jarFilePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setupClasspath] operator[SEP] Keyword[final] identifier[Path] identifier[distributedClassPath] , Keyword[final] identifier[Path] identifier[intermediateClassPath] , Keyword[final] identifier[Job] identifier[job] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[classpathProperty] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classpathProperty] operator[==] Other[null] operator[SEP] { identifier[classpathProperty] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[jarFiles] operator[=] identifier[classpathProperty] operator[SEP] identifier[split] operator[SEP] identifier[File] operator[SEP] identifier[pathSeparator] operator[SEP] operator[SEP] Keyword[final] identifier[Configuration] identifier[conf] operator[=] identifier[job] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[FileSystem] identifier[fs] operator[=] identifier[distributedClassPath] operator[SEP] identifier[getFileSystem] operator[SEP] identifier[conf] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fs] Keyword[instanceof] identifier[LocalFileSystem] operator[SEP] { Keyword[return] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[jarFilePath] operator[:] identifier[jarFiles] operator[SEP] { Keyword[final] identifier[File] identifier[jarFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[jarFilePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jarFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[RetryUtils] operator[SEP] identifier[retry] operator[SEP] operator[SEP] operator[SEP] operator[->] { Keyword[if] operator[SEP] identifier[isSnapshot] operator[SEP] identifier[jarFile] operator[SEP] operator[SEP] { identifier[addSnapshotJarToClassPath] operator[SEP] identifier[jarFile] , identifier[intermediateClassPath] , identifier[fs] , identifier[job] operator[SEP] operator[SEP] } Keyword[else] { identifier[addJarToClassPath] operator[SEP] identifier[jarFile] , identifier[distributedClassPath] , identifier[intermediateClassPath] , identifier[fs] , identifier[job] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } , identifier[shouldRetryPredicate] operator[SEP] operator[SEP] , identifier[NUM_RETRIES] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } }
public static Map<String, String> getVersionAttributes(ServletContext servletContext) throws IOException { URL url = servletContext.getResource("/META-INF/MANIFEST.MF"); if (url != null) { return getVersionAttributes(url); } else { return new LinkedHashMap<>(); } }
class class_name[name] begin[{] method[getVersionAttributes, return_type[type[Map]], modifier[public static], parameter[servletContext]] begin[{] local_variable[type[URL], url] if[binary_operation[member[.url], !=, literal[null]]] begin[{] return[call[.getVersionAttributes, parameter[member[.url]]]] else begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashMap, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getVersionAttributes] operator[SEP] identifier[ServletContext] identifier[servletContext] operator[SEP] Keyword[throws] identifier[IOException] { identifier[URL] identifier[url] operator[=] identifier[servletContext] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[getVersionAttributes] operator[SEP] identifier[url] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } }
public Result<List<DATA>> read(TRANS trans, DATA data) { if(readPS==null) { Result.err(Result.ERR_NotImplemented,"Read is disabled for %s",getClass().getSimpleName()); } return readPS.read(trans, R_TEXT, data); }
class class_name[name] begin[{] method[read, return_type[type[Result]], modifier[public], parameter[trans, data]] begin[{] if[binary_operation[member[.readPS], ==, literal[null]]] begin[{] call[Result.err, parameter[member[Result.ERR_NotImplemented], literal["Read is disabled for %s"], call[.getClass, parameter[]]]] else begin[{] None end[}] return[call[readPS.read, parameter[member[.trans], member[.R_TEXT], member[.data]]]] end[}] END[}]
Keyword[public] identifier[Result] operator[<] identifier[List] operator[<] identifier[DATA] operator[>] operator[>] identifier[read] operator[SEP] identifier[TRANS] identifier[trans] , identifier[DATA] identifier[data] operator[SEP] { Keyword[if] operator[SEP] identifier[readPS] operator[==] Other[null] operator[SEP] { identifier[Result] operator[SEP] identifier[err] operator[SEP] identifier[Result] operator[SEP] identifier[ERR_NotImplemented] , literal[String] , identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[readPS] operator[SEP] identifier[read] operator[SEP] identifier[trans] , identifier[R_TEXT] , identifier[data] operator[SEP] operator[SEP] }
public static Image getInstance(java.awt.Image image, java.awt.Color color, boolean forceBW) throws BadElementException, IOException { if(image instanceof BufferedImage){ BufferedImage bi = (BufferedImage) image; if(bi.getType()==BufferedImage.TYPE_BYTE_BINARY) { forceBW=true; } } java.awt.image.PixelGrabber pg = new java.awt.image.PixelGrabber(image, 0, 0, -1, -1, true); try { pg.grabPixels(); } catch (InterruptedException e) { throw new IOException( "java.awt.Image Interrupted waiting for pixels!"); } if ((pg.getStatus() & java.awt.image.ImageObserver.ABORT) != 0) { throw new IOException("java.awt.Image fetch aborted or errored"); } int w = pg.getWidth(); int h = pg.getHeight(); int[] pixels = (int[]) pg.getPixels(); if (forceBW) { int byteWidth = (w / 8) + ((w & 7) != 0 ? 1 : 0); byte[] pixelsByte = new byte[byteWidth * h]; int index = 0; int size = h * w; int transColor = 1; if (color != null) { transColor = (color.getRed() + color.getGreen() + color.getBlue() < 384) ? 0 : 1; } int transparency[] = null; int cbyte = 0x80; int wMarker = 0; int currByte = 0; if (color != null) { for (int j = 0; j < size; j++) { int alpha = (pixels[j] >> 24) & 0xff; if (alpha < 250) { if (transColor == 1) currByte |= cbyte; } else { if ((pixels[j] & 0x888) != 0) currByte |= cbyte; } cbyte >>= 1; if (cbyte == 0 || wMarker + 1 >= w) { pixelsByte[index++] = (byte) currByte; cbyte = 0x80; currByte = 0; } ++wMarker; if (wMarker >= w) wMarker = 0; } } else { for (int j = 0; j < size; j++) { if (transparency == null) { int alpha = (pixels[j] >> 24) & 0xff; if (alpha == 0) { transparency = new int[2]; /* bugfix by M.P. Liston, ASC, was: ... ? 1: 0; */ transparency[0] = transparency[1] = ((pixels[j] & 0x888) != 0) ? 0xff : 0; } } if ((pixels[j] & 0x888) != 0) currByte |= cbyte; cbyte >>= 1; if (cbyte == 0 || wMarker + 1 >= w) { pixelsByte[index++] = (byte) currByte; cbyte = 0x80; currByte = 0; } ++wMarker; if (wMarker >= w) wMarker = 0; } } return Image.getInstance(w, h, 1, 1, pixelsByte, transparency); } else { byte[] pixelsByte = new byte[w * h * 3]; byte[] smask = null; int index = 0; int size = h * w; int red = 255; int green = 255; int blue = 255; if (color != null) { red = color.getRed(); green = color.getGreen(); blue = color.getBlue(); } int transparency[] = null; if (color != null) { for (int j = 0; j < size; j++) { int alpha = (pixels[j] >> 24) & 0xff; if (alpha < 250) { pixelsByte[index++] = (byte) red; pixelsByte[index++] = (byte) green; pixelsByte[index++] = (byte) blue; } else { pixelsByte[index++] = (byte) ((pixels[j] >> 16) & 0xff); pixelsByte[index++] = (byte) ((pixels[j] >> 8) & 0xff); pixelsByte[index++] = (byte) ((pixels[j]) & 0xff); } } } else { int transparentPixel = 0; smask = new byte[w * h]; boolean shades = false; for (int j = 0; j < size; j++) { byte alpha = smask[j] = (byte) ((pixels[j] >> 24) & 0xff); /* bugfix by Chris Nokleberg */ if (!shades) { if (alpha != 0 && alpha != -1) { shades = true; } else if (transparency == null) { if (alpha == 0) { transparentPixel = pixels[j] & 0xffffff; transparency = new int[6]; transparency[0] = transparency[1] = (transparentPixel >> 16) & 0xff; transparency[2] = transparency[3] = (transparentPixel >> 8) & 0xff; transparency[4] = transparency[5] = transparentPixel & 0xff; } } else if ((pixels[j] & 0xffffff) != transparentPixel) { shades = true; } } pixelsByte[index++] = (byte) ((pixels[j] >> 16) & 0xff); pixelsByte[index++] = (byte) ((pixels[j] >> 8) & 0xff); pixelsByte[index++] = (byte) ((pixels[j]) & 0xff); } if (shades) transparency = null; else smask = null; } Image img = Image.getInstance(w, h, 3, 8, pixelsByte, transparency); if (smask != null) { Image sm = Image.getInstance(w, h, 1, 8, smask); try { sm.makeMask(); img.setImageMask(sm); } catch (DocumentException de) { throw new ExceptionConverter(de); } } return img; } }
class class_name[name] begin[{] method[getInstance, return_type[type[Image]], modifier[public static], parameter[image, color, forceBW]] begin[{] if[binary_operation[member[.image], instanceof, type[BufferedImage]]] begin[{] local_variable[type[BufferedImage], bi] if[binary_operation[call[bi.getType, parameter[]], ==, member[BufferedImage.TYPE_BYTE_BINARY]]] begin[{] assign[member[.forceBW], literal[true]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[java], pg] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=grabPixels, postfix_operators=[], prefix_operators=[], qualifier=pg, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.awt.Image Interrupted waiting for pixels!")], 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=['InterruptedException']))], finally_block=None, label=None, resources=None) if[binary_operation[binary_operation[call[pg.getStatus, parameter[]], &, member[java.awt.image.ImageObserver.ABORT]], !=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.awt.Image fetch aborted or errored")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], w] local_variable[type[int], h] local_variable[type[int], pixels] if[member[.forceBW]] begin[{] local_variable[type[int], byteWidth] local_variable[type[byte], pixelsByte] local_variable[type[int], index] local_variable[type[int], size] local_variable[type[int], transColor] if[binary_operation[member[.color], !=, literal[null]]] begin[{] assign[member[.transColor], TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRed, postfix_operators=[], prefix_operators=[], qualifier=color, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getGreen, postfix_operators=[], prefix_operators=[], qualifier=color, selectors=[], type_arguments=None), operator=+), operandr=MethodInvocation(arguments=[], member=getBlue, postfix_operators=[], prefix_operators=[], qualifier=color, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=384), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))] else begin[{] None end[}] local_variable[type[int], transparency] local_variable[type[int], cbyte] local_variable[type[int], wMarker] local_variable[type[int], currByte] if[binary_operation[member[.color], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=alpha)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=250), operator=<), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x888), operator=&), 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=currByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=transColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=currByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=>>=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=currByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), StatementExpression(expression=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=transparency, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=alpha)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x888), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff)))), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x888), operator=&), 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=currByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=>>=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=currByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cbyte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), StatementExpression(expression=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=wMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] return[call[Image.getInstance, parameter[member[.w], member[.h], literal[1], literal[1], member[.pixelsByte], member[.transparency]]]] else begin[{] local_variable[type[byte], pixelsByte] local_variable[type[byte], smask] local_variable[type[int], index] local_variable[type[int], size] local_variable[type[int], red] local_variable[type[int], green] local_variable[type[int], blue] if[binary_operation[member[.color], !=, literal[null]]] begin[{] assign[member[.red], call[color.getRed, parameter[]]] assign[member[.green], call[color.getGreen, parameter[]]] assign[member[.blue], call[color.getBlue, parameter[]]] else begin[{] None end[}] local_variable[type[int], transparency] if[binary_operation[member[.color], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=alpha)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=250), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=red, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=green, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=blue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] local_variable[type[int], transparentPixel] assign[member[.smask], ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))] local_variable[type[boolean], shades] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Assignment(expressionl=MemberReference(member=smask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), name=alpha)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), IfStatement(condition=MemberReference(member=shades, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffffff), operator=&), operandr=MemberReference(member=transparentPixel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shades, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=transparentPixel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffffff), operator=&)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=transparentPixel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type==, value=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=transparentPixel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4))]), type==, value=Assignment(expressionl=MemberReference(member=transparency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5))]), type==, value=BinaryOperation(operandl=MemberReference(member=transparentPixel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&))), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shades, 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=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pixelsByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[member[.shades]] begin[{] assign[member[.transparency], literal[null]] else begin[{] assign[member[.smask], literal[null]] end[}] end[}] local_variable[type[Image], img] if[binary_operation[member[.smask], !=, literal[null]]] begin[{] local_variable[type[Image], sm] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=makeMask, postfix_operators=[], prefix_operators=[], qualifier=sm, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setImageMask, postfix_operators=[], prefix_operators=[], qualifier=img, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=de, 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=ExceptionConverter, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=de, types=['DocumentException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.img]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Image] identifier[getInstance] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Image] identifier[image] , identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Color] identifier[color] , Keyword[boolean] identifier[forceBW] operator[SEP] Keyword[throws] identifier[BadElementException] , identifier[IOException] { Keyword[if] operator[SEP] identifier[image] Keyword[instanceof] identifier[BufferedImage] operator[SEP] { identifier[BufferedImage] identifier[bi] operator[=] operator[SEP] identifier[BufferedImage] operator[SEP] identifier[image] operator[SEP] Keyword[if] operator[SEP] identifier[bi] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[BufferedImage] operator[SEP] identifier[TYPE_BYTE_BINARY] operator[SEP] { identifier[forceBW] operator[=] literal[boolean] operator[SEP] } } identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[image] operator[SEP] identifier[PixelGrabber] identifier[pg] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[image] operator[SEP] identifier[PixelGrabber] operator[SEP] identifier[image] , Other[0] , Other[0] , operator[-] Other[1] , operator[-] Other[1] , literal[boolean] operator[SEP] operator[SEP] Keyword[try] { identifier[pg] operator[SEP] identifier[grabPixels] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[pg] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[&] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[image] operator[SEP] identifier[ImageObserver] operator[SEP] identifier[ABORT] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[w] operator[=] identifier[pg] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[h] operator[=] identifier[pg] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[pixels] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[pg] operator[SEP] identifier[getPixels] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[forceBW] operator[SEP] { Keyword[int] identifier[byteWidth] operator[=] operator[SEP] identifier[w] operator[/] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[w] operator[&] Other[7] operator[SEP] operator[!=] Other[0] operator[?] Other[1] operator[:] Other[0] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[pixelsByte] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[byteWidth] operator[*] identifier[h] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[h] operator[*] identifier[w] operator[SEP] Keyword[int] identifier[transColor] operator[=] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[color] operator[!=] Other[null] operator[SEP] { identifier[transColor] operator[=] operator[SEP] identifier[color] operator[SEP] identifier[getRed] operator[SEP] operator[SEP] operator[+] identifier[color] operator[SEP] identifier[getGreen] operator[SEP] operator[SEP] operator[+] identifier[color] operator[SEP] identifier[getBlue] operator[SEP] operator[SEP] operator[<] Other[384] operator[SEP] operator[?] Other[0] operator[:] Other[1] operator[SEP] } Keyword[int] identifier[transparency] operator[SEP] operator[SEP] operator[=] Other[null] operator[SEP] Keyword[int] identifier[cbyte] operator[=] literal[Integer] operator[SEP] Keyword[int] identifier[wMarker] operator[=] Other[0] operator[SEP] Keyword[int] identifier[currByte] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[color] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[size] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[int] identifier[alpha] operator[=] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[alpha] operator[<] Other[250] operator[SEP] { Keyword[if] operator[SEP] identifier[transColor] operator[==] Other[1] operator[SEP] identifier[currByte] operator[|=] identifier[cbyte] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[currByte] operator[|=] identifier[cbyte] operator[SEP] } identifier[cbyte] operator[>>=] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[cbyte] operator[==] Other[0] operator[||] identifier[wMarker] operator[+] Other[1] operator[>=] identifier[w] operator[SEP] { identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[currByte] operator[SEP] identifier[cbyte] operator[=] literal[Integer] operator[SEP] identifier[currByte] operator[=] Other[0] operator[SEP] } operator[++] identifier[wMarker] operator[SEP] Keyword[if] operator[SEP] identifier[wMarker] operator[>=] identifier[w] operator[SEP] identifier[wMarker] operator[=] Other[0] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[size] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[transparency] operator[==] Other[null] operator[SEP] { Keyword[int] identifier[alpha] operator[=] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[alpha] operator[==] Other[0] operator[SEP] { identifier[transparency] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[transparency] operator[SEP] Other[0] operator[SEP] operator[=] identifier[transparency] operator[SEP] Other[1] operator[SEP] operator[=] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] operator[?] literal[Integer] operator[:] Other[0] operator[SEP] } } Keyword[if] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[currByte] operator[|=] identifier[cbyte] operator[SEP] identifier[cbyte] operator[>>=] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[cbyte] operator[==] Other[0] operator[||] identifier[wMarker] operator[+] Other[1] operator[>=] identifier[w] operator[SEP] { identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[currByte] operator[SEP] identifier[cbyte] operator[=] literal[Integer] operator[SEP] identifier[currByte] operator[=] Other[0] operator[SEP] } operator[++] identifier[wMarker] operator[SEP] Keyword[if] operator[SEP] identifier[wMarker] operator[>=] identifier[w] operator[SEP] identifier[wMarker] operator[=] Other[0] operator[SEP] } } Keyword[return] identifier[Image] operator[SEP] identifier[getInstance] operator[SEP] identifier[w] , identifier[h] , Other[1] , Other[1] , identifier[pixelsByte] , identifier[transparency] operator[SEP] operator[SEP] } Keyword[else] { Keyword[byte] operator[SEP] operator[SEP] identifier[pixelsByte] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[w] operator[*] identifier[h] operator[*] Other[3] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[smask] operator[=] Other[null] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[h] operator[*] identifier[w] operator[SEP] Keyword[int] identifier[red] operator[=] Other[255] operator[SEP] Keyword[int] identifier[green] operator[=] Other[255] operator[SEP] Keyword[int] identifier[blue] operator[=] Other[255] operator[SEP] Keyword[if] operator[SEP] identifier[color] operator[!=] Other[null] operator[SEP] { identifier[red] operator[=] identifier[color] operator[SEP] identifier[getRed] operator[SEP] operator[SEP] operator[SEP] identifier[green] operator[=] identifier[color] operator[SEP] identifier[getGreen] operator[SEP] operator[SEP] operator[SEP] identifier[blue] operator[=] identifier[color] operator[SEP] identifier[getBlue] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[transparency] operator[SEP] operator[SEP] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[color] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[size] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[int] identifier[alpha] operator[=] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[alpha] operator[<] Other[250] operator[SEP] { identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[red] operator[SEP] identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[green] operator[SEP] identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[blue] operator[SEP] } Keyword[else] { identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[int] identifier[transparentPixel] operator[=] Other[0] operator[SEP] identifier[smask] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[w] operator[*] identifier[h] operator[SEP] operator[SEP] Keyword[boolean] identifier[shades] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[size] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[byte] identifier[alpha] operator[=] identifier[smask] operator[SEP] identifier[j] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[shades] operator[SEP] { Keyword[if] operator[SEP] identifier[alpha] operator[!=] Other[0] operator[&&] identifier[alpha] operator[!=] operator[-] Other[1] operator[SEP] { identifier[shades] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[transparency] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[alpha] operator[==] Other[0] operator[SEP] { identifier[transparentPixel] operator[=] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[&] literal[Integer] operator[SEP] identifier[transparency] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[6] operator[SEP] operator[SEP] identifier[transparency] operator[SEP] Other[0] operator[SEP] operator[=] identifier[transparency] operator[SEP] Other[1] operator[SEP] operator[=] operator[SEP] identifier[transparentPixel] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] identifier[transparency] operator[SEP] Other[2] operator[SEP] operator[=] identifier[transparency] operator[SEP] Other[3] operator[SEP] operator[=] operator[SEP] identifier[transparentPixel] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] identifier[transparency] operator[SEP] Other[4] operator[SEP] operator[=] identifier[transparency] operator[SEP] Other[5] operator[SEP] operator[=] identifier[transparentPixel] operator[&] literal[Integer] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[!=] identifier[transparentPixel] operator[SEP] { identifier[shades] operator[=] literal[boolean] operator[SEP] } } identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[pixelsByte] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[pixels] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[shades] operator[SEP] identifier[transparency] operator[=] Other[null] operator[SEP] Keyword[else] identifier[smask] operator[=] Other[null] operator[SEP] } identifier[Image] identifier[img] operator[=] identifier[Image] operator[SEP] identifier[getInstance] operator[SEP] identifier[w] , identifier[h] , Other[3] , Other[8] , identifier[pixelsByte] , identifier[transparency] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[smask] operator[!=] Other[null] operator[SEP] { identifier[Image] identifier[sm] operator[=] identifier[Image] operator[SEP] identifier[getInstance] operator[SEP] identifier[w] , identifier[h] , Other[1] , Other[8] , identifier[smask] operator[SEP] operator[SEP] Keyword[try] { identifier[sm] operator[SEP] identifier[makeMask] operator[SEP] operator[SEP] operator[SEP] identifier[img] operator[SEP] identifier[setImageMask] operator[SEP] identifier[sm] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DocumentException] identifier[de] operator[SEP] { Keyword[throw] Keyword[new] identifier[ExceptionConverter] operator[SEP] identifier[de] operator[SEP] operator[SEP] } } Keyword[return] identifier[img] operator[SEP] } }
public char[] getCharBuffer(int expected) { if (this.charBuffer.length >= expected) { return charBuffer; } else if (expected < MAX_SIZE) { // ?预先设置多一点 this.charBuffer = new char[(int) (expected * 1.2)]; } else { return EMPTY_CHAR_ARRAY; } return this.charBuffer; }
class class_name[name] begin[{] method[getCharBuffer, return_type[type[char]], modifier[public], parameter[expected]] begin[{] if[binary_operation[THIS[member[None.charBuffer]member[None.length]], >=, member[.expected]]] begin[{] return[member[.charBuffer]] else begin[{] if[binary_operation[member[.expected], <, member[.MAX_SIZE]]] begin[{] assign[THIS[member[None.charBuffer]], ArrayCreator(dimensions=[Cast(expression=BinaryOperation(operandl=MemberReference(member=expected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.2), operator=*), type=BasicType(dimensions=[], name=int))], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char))] else begin[{] return[member[.EMPTY_CHAR_ARRAY]] end[}] end[}] return[THIS[member[None.charBuffer]]] end[}] END[}]
Keyword[public] Keyword[char] operator[SEP] operator[SEP] identifier[getCharBuffer] operator[SEP] Keyword[int] identifier[expected] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[charBuffer] operator[SEP] identifier[length] operator[>=] identifier[expected] operator[SEP] { Keyword[return] identifier[charBuffer] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[expected] operator[<] identifier[MAX_SIZE] operator[SEP] { Keyword[this] operator[SEP] identifier[charBuffer] operator[=] Keyword[new] Keyword[char] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[expected] operator[*] literal[Float] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[EMPTY_CHAR_ARRAY] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[charBuffer] operator[SEP] }
private void doDeployNetwork(final String name, final Message<JsonObject> message) { // When deploying a bare network, we first attempt to load any existing // configuration from the cluster. This ensures that we don't overwrite // a cluster configuration. In some cases, the manager can be redeployed // by deploying a network name. String scontext = data.<String, String>getMap(String.format("%s.%s", cluster, name)).get(String.format("%s.%s", cluster, name)); final NetworkContext context = scontext != null ? Contexts.<NetworkContext>deserialize(new JsonObject(scontext)) : ContextBuilder.buildContext(new DefaultNetworkConfig(name), cluster); // Simply deploy an empty network. if (!managers.containsKey(context.address())) { // If the network manager hasn't yet been deployed then deploy the manager // and then update the network's configuration. platform.deployVerticle(NetworkManager.class.getName(), new JsonObject().putString("cluster", cluster).putString("address", context.address()), 1, new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { if (result.failed()) { message.reply(new JsonObject().putString("status", "error").putString("message", "Failed to deploy network manager.")); } else { // Once the manager has been deployed we can add the network name to // the set of networks that are deployed in the cluster. final String deploymentID = result.result(); DefaultNodeManager.this.context.execute(new Action<Void>() { @Override public Void perform() { networks.add(context.name()); return null; } }, new Handler<AsyncResult<Void>>() { @Override public void handle(AsyncResult<Void> result) { // And store the manager's deployment ID in the local managers map. managers.put(context.address(), deploymentID); doDeployNetwork(context, message); } }); } } }); } else { message.reply(new JsonObject().putString("status", "ok").putObject("context", Contexts.serialize(context))); } }
class class_name[name] begin[{] method[doDeployNetwork, return_type[void], modifier[private], parameter[name, message]] begin[{] local_variable[type[String], scontext] local_variable[type[NetworkContext], context] if[call[managers.containsKey, parameter[call[context.address, parameter[]]]]] begin[{] call[platform.deployVerticle, parameter[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=NetworkManager, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cluster"), MemberReference(member=cluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="address"), MethodInvocation(arguments=[], member=address, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None)), literal[1], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MethodInvocation(arguments=[], member=failed, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=deploymentID)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=DefaultNodeManager, selectors=[MemberReference(member=context, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=networks, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=perform, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=Action, sub_type=None)), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=address, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MemberReference(member=deploymentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=managers, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doDeployNetwork, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None))], dimensions=None, name=Handler, sub_type=None))], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="message"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to deploy network manager.")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None))], member=reply, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None))], dimensions=None, name=Handler, sub_type=None))]] else begin[{] call[message.reply, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ok")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="context"), MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=Contexts, selectors=[], type_arguments=None)], member=putObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None))]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[doDeployNetwork] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[Message] operator[<] identifier[JsonObject] operator[>] identifier[message] operator[SEP] { identifier[String] identifier[scontext] operator[=] identifier[data] operator[SEP] operator[<] identifier[String] , identifier[String] operator[>] identifier[getMap] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[cluster] , identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[cluster] , identifier[name] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[NetworkContext] identifier[context] operator[=] identifier[scontext] operator[!=] Other[null] operator[?] identifier[Contexts] operator[SEP] operator[<] identifier[NetworkContext] operator[>] identifier[deserialize] operator[SEP] Keyword[new] identifier[JsonObject] operator[SEP] identifier[scontext] operator[SEP] operator[SEP] operator[:] identifier[ContextBuilder] operator[SEP] identifier[buildContext] operator[SEP] Keyword[new] identifier[DefaultNetworkConfig] operator[SEP] identifier[name] operator[SEP] , identifier[cluster] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[managers] operator[SEP] identifier[containsKey] operator[SEP] identifier[context] operator[SEP] identifier[address] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[platform] operator[SEP] identifier[deployVerticle] operator[SEP] identifier[NetworkManager] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , identifier[cluster] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , identifier[context] operator[SEP] identifier[address] operator[SEP] operator[SEP] operator[SEP] , Other[1] , Keyword[new] identifier[Handler] operator[<] identifier[AsyncResult] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[AsyncResult] operator[<] identifier[String] operator[>] identifier[result] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { identifier[message] operator[SEP] identifier[reply] operator[SEP] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[String] identifier[deploymentID] operator[=] identifier[result] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] identifier[DefaultNodeManager] operator[SEP] Keyword[this] operator[SEP] identifier[context] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Action] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[perform] operator[SEP] operator[SEP] { identifier[networks] operator[SEP] identifier[add] operator[SEP] identifier[context] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } , Keyword[new] identifier[Handler] operator[<] identifier[AsyncResult] operator[<] identifier[Void] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[AsyncResult] operator[<] identifier[Void] operator[>] identifier[result] operator[SEP] { identifier[managers] operator[SEP] identifier[put] operator[SEP] identifier[context] operator[SEP] identifier[address] operator[SEP] operator[SEP] , identifier[deploymentID] operator[SEP] operator[SEP] identifier[doDeployNetwork] operator[SEP] identifier[context] , identifier[message] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] } Keyword[else] { identifier[message] operator[SEP] identifier[reply] operator[SEP] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putObject] operator[SEP] literal[String] , identifier[Contexts] operator[SEP] identifier[serialize] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public BigComplex subtract(BigComplex value, MathContext mathContext) { return valueOf( re.subtract(value.re, mathContext), im.subtract(value.im, mathContext)); }
class class_name[name] begin[{] method[subtract, return_type[type[BigComplex]], modifier[public], parameter[value, mathContext]] begin[{] return[call[.valueOf, parameter[call[re.subtract, parameter[member[value.re], member[.mathContext]]], call[im.subtract, parameter[member[value.im], member[.mathContext]]]]]] end[}] END[}]
Keyword[public] identifier[BigComplex] identifier[subtract] operator[SEP] identifier[BigComplex] identifier[value] , identifier[MathContext] identifier[mathContext] operator[SEP] { Keyword[return] identifier[valueOf] operator[SEP] identifier[re] operator[SEP] identifier[subtract] operator[SEP] identifier[value] operator[SEP] identifier[re] , identifier[mathContext] operator[SEP] , identifier[im] operator[SEP] identifier[subtract] operator[SEP] identifier[value] operator[SEP] identifier[im] , identifier[mathContext] operator[SEP] operator[SEP] operator[SEP] }
public static String selectSingleNodeValue(Node node, String xpathQuery) { Node resultNode = node.selectSingleNode(xpathQuery); if (resultNode != null) { return resultNode.getText(); } else { return null; } }
class class_name[name] begin[{] method[selectSingleNodeValue, return_type[type[String]], modifier[public static], parameter[node, xpathQuery]] begin[{] local_variable[type[Node], resultNode] if[binary_operation[member[.resultNode], !=, literal[null]]] begin[{] return[call[resultNode.getText, parameter[]]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[selectSingleNodeValue] operator[SEP] identifier[Node] identifier[node] , identifier[String] identifier[xpathQuery] operator[SEP] { identifier[Node] identifier[resultNode] operator[=] identifier[node] operator[SEP] identifier[selectSingleNode] operator[SEP] identifier[xpathQuery] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resultNode] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[resultNode] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }