code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private boolean isAllSuitableNodesOffline(R build) { Label label = getAssignedLabel(); List<Node> allNodes = Jenkins.getInstance().getNodes(); if (label != null) { //Invalid label. Put in queue to make administrator fix if(label.getNodes().isEmpty()) { return false; } //Returns true, if all suitable nodes are offline return label.isOffline(); } else { if(canRoam) { for (Node n : Jenkins.getInstance().getNodes()) { Computer c = n.toComputer(); if (c != null && c.isOnline() && c.isAcceptingTasks() && n.getMode() == Mode.NORMAL) { // Some executor is online that is ready and this job can run anywhere return false; } } //We can roam, check that the master is set to be used as much as possible, and not tied jobs only. return Jenkins.getInstance().getMode() == Mode.EXCLUSIVE; } } return true; }
class class_name[name] begin[{] method[isAllSuitableNodesOffline, return_type[type[boolean]], modifier[private], parameter[build]] begin[{] local_variable[type[Label], label] local_variable[type[List], allNodes] if[binary_operation[member[.label], !=, literal[null]]] begin[{] if[call[label.getNodes, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] return[call[label.isOffline, parameter[]]] else begin[{] if[member[.canRoam]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toComputer, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Computer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isOnline, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=isAcceptingTasks, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMode, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), operandr=MemberReference(member=NORMAL, postfix_operators=[], prefix_operators=[], qualifier=Mode, selectors=[]), operator===), 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=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Jenkins, selectors=[MethodInvocation(arguments=[], member=getNodes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) return[binary_operation[call[Jenkins.getInstance, parameter[]], ==, member[Mode.EXCLUSIVE]]] else begin[{] None end[}] end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isAllSuitableNodesOffline] operator[SEP] identifier[R] identifier[build] operator[SEP] { identifier[Label] identifier[label] operator[=] identifier[getAssignedLabel] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Node] operator[>] identifier[allNodes] operator[=] identifier[Jenkins] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[label] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[label] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[label] operator[SEP] identifier[isOffline] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[canRoam] operator[SEP] { Keyword[for] operator[SEP] identifier[Node] identifier[n] operator[:] identifier[Jenkins] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] { identifier[Computer] identifier[c] operator[=] identifier[n] operator[SEP] identifier[toComputer] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] Other[null] operator[&&] identifier[c] operator[SEP] identifier[isOnline] operator[SEP] operator[SEP] operator[&&] identifier[c] operator[SEP] identifier[isAcceptingTasks] operator[SEP] operator[SEP] operator[&&] identifier[n] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] operator[==] identifier[Mode] operator[SEP] identifier[NORMAL] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] identifier[Jenkins] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] operator[==] identifier[Mode] operator[SEP] identifier[EXCLUSIVE] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public void setPath(String path) throws URIException { if (path == null || path.length() == 0) { _path = _opaque = (path == null) ? null : path.toCharArray(); setURI(); return; } // set the charset to do escape encoding String charset = getProtocolCharset(); if (_is_net_path || _is_abs_path) { _path = encode(path, allowed_abs_path, charset); } else if (_is_rel_path) { StringBuffer buff = new StringBuffer(path.length()); int at = path.indexOf('/'); if (at == 0) { // never 0 throw new URIException(URIException.PARSING, "incorrect relative path"); } if (at > 0) { buff.append(encode(path.substring(0, at), allowed_rel_path, charset)); buff.append(encode(path.substring(at), allowed_abs_path, charset)); } else { buff.append(encode(path, allowed_rel_path, charset)); } _path = buff.toString().toCharArray(); } else if (_is_opaque_part) { StringBuffer buf = new StringBuffer(); buf.insert(0, encode(path.substring(0, 1), uric_no_slash, charset)); buf.insert(1, encode(path.substring(1), uric, charset)); _opaque = buf.toString().toCharArray(); } else { throw new URIException(URIException.PARSING, "incorrect path"); } setURI(); }
class class_name[name] begin[{] method[setPath, return_type[void], modifier[public], parameter[path]] begin[{] if[binary_operation[binary_operation[member[.path], ==, literal[null]], ||, binary_operation[call[path.length, parameter[]], ==, literal[0]]]] begin[{] assign[member[._path], assign[member[._opaque], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]] call[.setURI, parameter[]] return[None] else begin[{] None end[}] local_variable[type[String], charset] if[binary_operation[member[._is_net_path], ||, member[._is_abs_path]]] begin[{] assign[member[._path], call[.encode, parameter[member[.path], member[.allowed_abs_path], member[.charset]]]] else begin[{] if[member[._is_rel_path]] begin[{] local_variable[type[StringBuffer], buff] local_variable[type[int], at] if[binary_operation[member[.at], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=PARSING, postfix_operators=[], prefix_operators=[], qualifier=URIException, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="incorrect relative path")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URIException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.at], >, literal[0]]] begin[{] call[buff.append, parameter[call[.encode, parameter[call[path.substring, parameter[literal[0], member[.at]]], member[.allowed_rel_path], member[.charset]]]]] call[buff.append, parameter[call[.encode, parameter[call[path.substring, parameter[member[.at]]], member[.allowed_abs_path], member[.charset]]]]] else begin[{] call[buff.append, parameter[call[.encode, parameter[member[.path], member[.allowed_rel_path], member[.charset]]]]] end[}] assign[member[._path], call[buff.toString, parameter[]]] else begin[{] if[member[._is_opaque_part]] begin[{] local_variable[type[StringBuffer], buf] call[buf.insert, parameter[literal[0], call[.encode, parameter[call[path.substring, parameter[literal[0], literal[1]]], member[.uric_no_slash], member[.charset]]]]] call[buf.insert, parameter[literal[1], call[.encode, parameter[call[path.substring, parameter[literal[1]]], member[.uric], member[.charset]]]]] assign[member[._opaque], call[buf.toString, parameter[]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=PARSING, postfix_operators=[], prefix_operators=[], qualifier=URIException, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="incorrect path")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URIException, sub_type=None)), label=None) end[}] end[}] end[}] call[.setURI, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPath] operator[SEP] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[URIException] { Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[||] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[_path] operator[=] identifier[_opaque] operator[=] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[path] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[setURI] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[String] identifier[charset] operator[=] identifier[getProtocolCharset] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_is_net_path] operator[||] identifier[_is_abs_path] operator[SEP] { identifier[_path] operator[=] identifier[encode] operator[SEP] identifier[path] , identifier[allowed_abs_path] , identifier[charset] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[_is_rel_path] operator[SEP] { identifier[StringBuffer] identifier[buff] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[at] operator[=] identifier[path] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[at] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[URIException] operator[SEP] identifier[URIException] operator[SEP] identifier[PARSING] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[at] operator[>] Other[0] operator[SEP] { identifier[buff] operator[SEP] identifier[append] operator[SEP] identifier[encode] operator[SEP] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[at] operator[SEP] , identifier[allowed_rel_path] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] identifier[buff] operator[SEP] identifier[append] operator[SEP] identifier[encode] operator[SEP] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[at] operator[SEP] , identifier[allowed_abs_path] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buff] operator[SEP] identifier[append] operator[SEP] identifier[encode] operator[SEP] identifier[path] , identifier[allowed_rel_path] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] } identifier[_path] operator[=] identifier[buff] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[_is_opaque_part] operator[SEP] { identifier[StringBuffer] identifier[buf] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[insert] operator[SEP] Other[0] , identifier[encode] operator[SEP] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] , identifier[uric_no_slash] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[insert] operator[SEP] Other[1] , identifier[encode] operator[SEP] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] , identifier[uric] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] identifier[_opaque] operator[=] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[URIException] operator[SEP] identifier[URIException] operator[SEP] identifier[PARSING] , literal[String] operator[SEP] operator[SEP] } identifier[setURI] operator[SEP] operator[SEP] operator[SEP] }
@Override public List<CommerceShippingFixedOption> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
class class_name[name] begin[{] method[findAll, return_type[type[List]], modifier[public], parameter[]] begin[{] return[call[.findAll, parameter[member[QueryUtil.ALL_POS], member[QueryUtil.ALL_POS], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceShippingFixedOption] operator[>] identifier[findAll] operator[SEP] operator[SEP] { Keyword[return] identifier[findAll] operator[SEP] identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] }
public void readRadioConfig(Callback<RadioConfig> callback) { addCallback(BeanMessageID.BT_GET_CONFIG, callback); sendMessageWithoutPayload(BeanMessageID.BT_GET_CONFIG); }
class class_name[name] begin[{] method[readRadioConfig, return_type[void], modifier[public], parameter[callback]] begin[{] call[.addCallback, parameter[member[BeanMessageID.BT_GET_CONFIG], member[.callback]]] call[.sendMessageWithoutPayload, parameter[member[BeanMessageID.BT_GET_CONFIG]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[readRadioConfig] operator[SEP] identifier[Callback] operator[<] identifier[RadioConfig] operator[>] identifier[callback] operator[SEP] { identifier[addCallback] operator[SEP] identifier[BeanMessageID] operator[SEP] identifier[BT_GET_CONFIG] , identifier[callback] operator[SEP] operator[SEP] identifier[sendMessageWithoutPayload] operator[SEP] identifier[BeanMessageID] operator[SEP] identifier[BT_GET_CONFIG] operator[SEP] operator[SEP] }
protected void clearCaches(CmsEvent event) { // synchronization of this method is not required as the individual maps are all synchronized maps anyway, // and setExportnames() is doing it's own synchronization // flush all caches m_cacheOnlineLinks.clear(); m_cacheExportUris.clear(); m_cacheSecureLinks.clear(); m_cacheExportLinks.clear(); m_exportnameResources = null; if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLUSHED_CACHES_1, new Integer(event.getType()))); } }
class class_name[name] begin[{] method[clearCaches, return_type[void], modifier[protected], parameter[event]] begin[{] call[m_cacheOnlineLinks.clear, parameter[]] call[m_cacheExportUris.clear, parameter[]] call[m_cacheSecureLinks.clear, parameter[]] call[m_cacheExportLinks.clear, parameter[]] assign[member[.m_exportnameResources], literal[null]] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[clearCaches] operator[SEP] identifier[CmsEvent] identifier[event] operator[SEP] { identifier[m_cacheOnlineLinks] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_cacheExportUris] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_cacheSecureLinks] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_cacheExportLinks] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_exportnameResources] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_FLUSHED_CACHES_1] , Keyword[new] identifier[Integer] operator[SEP] identifier[event] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@SuppressWarnings("unused") private List<CmsResource> getLinkSources(CmsObject cms, CmsResource resource, HashSet<CmsUUID> deleteIds) throws CmsException { List<CmsRelation> relations = cms.getRelationsForResource(resource, CmsRelationFilter.SOURCES); List<CmsResource> result = new ArrayList<CmsResource>(); for (CmsRelation relation : relations) { // only add related resources that are not going to be deleted if (!deleteIds.contains(relation.getSourceId())) { CmsResource source = relation.getSource(cms, CmsResourceFilter.ALL); if (!source.getState().isDeleted()) { result.add(source); } } } return result; }
class class_name[name] begin[{] method[getLinkSources, return_type[type[List]], modifier[private], parameter[cms, resource, deleteIds]] begin[{] local_variable[type[List], relations] local_variable[type[List], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSourceId, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=deleteIds, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None), name=source)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=['!'], qualifier=source, selectors=[MethodInvocation(arguments=[], member=isDeleted, 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=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=relations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=relation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsRelation, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[getLinkSources] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[CmsResource] identifier[resource] , identifier[HashSet] operator[<] identifier[CmsUUID] operator[>] identifier[deleteIds] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[List] operator[<] identifier[CmsRelation] operator[>] identifier[relations] operator[=] identifier[cms] operator[SEP] identifier[getRelationsForResource] operator[SEP] identifier[resource] , identifier[CmsRelationFilter] operator[SEP] identifier[SOURCES] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsResource] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsRelation] identifier[relation] operator[:] identifier[relations] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[deleteIds] operator[SEP] identifier[contains] operator[SEP] identifier[relation] operator[SEP] identifier[getSourceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[CmsResource] identifier[source] operator[=] identifier[relation] operator[SEP] identifier[getSource] operator[SEP] identifier[cms] , identifier[CmsResourceFilter] operator[SEP] identifier[ALL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[source] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] identifier[isDeleted] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[source] operator[SEP] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] }
public static <T> Class<T> unwrap(Class<T> type) { if (type == null) { throw new IllegalArgumentException(); } Class<T> unwrapped = (Class<T>) WRAP_TO_PRIMITIVE.get(type); return (unwrapped == null) ? type : unwrapped; }
class class_name[name] begin[{] method[unwrap, return_type[type[Class]], modifier[public static], parameter[type]] begin[{] if[binary_operation[member[.type], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Class], unwrapped] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=unwrapped, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=unwrapped, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Class] operator[<] identifier[T] operator[>] identifier[unwrap] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } identifier[Class] operator[<] identifier[T] operator[>] identifier[unwrapped] operator[=] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] operator[SEP] identifier[WRAP_TO_PRIMITIVE] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[unwrapped] operator[==] Other[null] operator[SEP] operator[?] identifier[type] operator[:] identifier[unwrapped] operator[SEP] }
public OTAUpdateInfo withAdditionalParameters(java.util.Map<String, String> additionalParameters) { setAdditionalParameters(additionalParameters); return this; }
class class_name[name] begin[{] method[withAdditionalParameters, return_type[type[OTAUpdateInfo]], modifier[public], parameter[additionalParameters]] begin[{] call[.setAdditionalParameters, parameter[member[.additionalParameters]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[OTAUpdateInfo] identifier[withAdditionalParameters] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[additionalParameters] operator[SEP] { identifier[setAdditionalParameters] operator[SEP] identifier[additionalParameters] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public List<CommerceAccountUserRel> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
class class_name[name] begin[{] method[findAll, return_type[type[List]], modifier[public], parameter[]] begin[{] return[call[.findAll, parameter[member[QueryUtil.ALL_POS], member[QueryUtil.ALL_POS], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceAccountUserRel] operator[>] identifier[findAll] operator[SEP] operator[SEP] { Keyword[return] identifier[findAll] operator[SEP] identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] }
public EEnum getIfcReinforcingBarSurfaceEnum() { if (ifcReinforcingBarSurfaceEnumEEnum == null) { ifcReinforcingBarSurfaceEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(885); } return ifcReinforcingBarSurfaceEnumEEnum; }
class class_name[name] begin[{] method[getIfcReinforcingBarSurfaceEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcReinforcingBarSurfaceEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcReinforcingBarSurfaceEnumEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=885)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcReinforcingBarSurfaceEnumEEnum]] end[}] END[}]
Keyword[public] identifier[EEnum] identifier[getIfcReinforcingBarSurfaceEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcReinforcingBarSurfaceEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcReinforcingBarSurfaceEnumEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[885] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcReinforcingBarSurfaceEnumEEnum] operator[SEP] }
public static void debug(final Throwable throwable) { final StringWriter errors = new StringWriter(); throwable.printStackTrace(new PrintWriter(errors)); debugLogger.accept(errors.toString()); }
class class_name[name] begin[{] method[debug, return_type[void], modifier[public static], parameter[throwable]] begin[{] local_variable[type[StringWriter], errors] call[throwable.printStackTrace, parameter[ClassCreator(arguments=[MemberReference(member=errors, 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=PrintWriter, sub_type=None))]] call[debugLogger.accept, parameter[call[errors.toString, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[debug] operator[SEP] Keyword[final] identifier[Throwable] identifier[throwable] operator[SEP] { Keyword[final] identifier[StringWriter] identifier[errors] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[throwable] operator[SEP] identifier[printStackTrace] operator[SEP] Keyword[new] identifier[PrintWriter] operator[SEP] identifier[errors] operator[SEP] operator[SEP] operator[SEP] identifier[debugLogger] operator[SEP] identifier[accept] operator[SEP] identifier[errors] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static String getExtension(String resourceName) { // if the resource name indicates a folder if (resourceName.charAt(resourceName.length() - 1) == '/') { // folders have no extensions return ""; } // get just the name of the resource String name = CmsResource.getName(resourceName); // get the position of the last dot int pos = name.lastIndexOf('.'); // if no dot or if no chars after the dot if ((pos < 0) || ((pos + 1) == name.length())) { return ""; } // return the extension return name.substring(pos).toLowerCase(); }
class class_name[name] begin[{] method[getExtension, return_type[type[String]], modifier[public static], parameter[resourceName]] begin[{] if[binary_operation[call[resourceName.charAt, parameter[binary_operation[call[resourceName.length, parameter[]], -, literal[1]]]], ==, literal['/']]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[String], name] local_variable[type[int], pos] if[binary_operation[binary_operation[member[.pos], <, literal[0]], ||, binary_operation[binary_operation[member[.pos], +, literal[1]], ==, call[name.length, parameter[]]]]] begin[{] return[literal[""]] else begin[{] None end[}] return[call[name.substring, parameter[member[.pos]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getExtension] operator[SEP] identifier[String] identifier[resourceName] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceName] operator[SEP] identifier[charAt] operator[SEP] identifier[resourceName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[String] identifier[name] operator[=] identifier[CmsResource] operator[SEP] identifier[getName] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] identifier[name] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[pos] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[==] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[return] identifier[name] operator[SEP] identifier[substring] operator[SEP] identifier[pos] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] }
@Override public List<CommerceTaxMethod> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
class class_name[name] begin[{] method[findAll, return_type[type[List]], modifier[public], parameter[]] begin[{] return[call[.findAll, parameter[member[QueryUtil.ALL_POS], member[QueryUtil.ALL_POS], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceTaxMethod] operator[>] identifier[findAll] operator[SEP] operator[SEP] { Keyword[return] identifier[findAll] operator[SEP] identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] }
public static <C extends Comparable<?>> Range<C> range( C lower, BoundType lowerType, C upper, BoundType upperType) { checkNotNull(lowerType); checkNotNull(upperType); Cut<C> lowerBound = (lowerType == BoundType.OPEN) ? Cut.aboveValue(lower) : Cut.belowValue(lower); Cut<C> upperBound = (upperType == BoundType.OPEN) ? Cut.belowValue(upper) : Cut.aboveValue(upper); return create(lowerBound, upperBound); }
class class_name[name] begin[{] method[range, return_type[type[Range]], modifier[public static], parameter[lower, lowerType, upper, upperType]] begin[{] call[.checkNotNull, parameter[member[.lowerType]]] call[.checkNotNull, parameter[member[.upperType]]] local_variable[type[Cut], lowerBound] local_variable[type[Cut], upperBound] return[call[.create, parameter[member[.lowerBound], member[.upperBound]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[C] Keyword[extends] identifier[Comparable] operator[<] operator[?] operator[>] operator[>] identifier[Range] operator[<] identifier[C] operator[>] identifier[range] operator[SEP] identifier[C] identifier[lower] , identifier[BoundType] identifier[lowerType] , identifier[C] identifier[upper] , identifier[BoundType] identifier[upperType] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[lowerType] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[upperType] operator[SEP] operator[SEP] identifier[Cut] operator[<] identifier[C] operator[>] identifier[lowerBound] operator[=] operator[SEP] identifier[lowerType] operator[==] identifier[BoundType] operator[SEP] identifier[OPEN] operator[SEP] operator[?] identifier[Cut] operator[SEP] identifier[aboveValue] operator[SEP] identifier[lower] operator[SEP] operator[:] identifier[Cut] operator[SEP] identifier[belowValue] operator[SEP] identifier[lower] operator[SEP] operator[SEP] identifier[Cut] operator[<] identifier[C] operator[>] identifier[upperBound] operator[=] operator[SEP] identifier[upperType] operator[==] identifier[BoundType] operator[SEP] identifier[OPEN] operator[SEP] operator[?] identifier[Cut] operator[SEP] identifier[belowValue] operator[SEP] identifier[upper] operator[SEP] operator[:] identifier[Cut] operator[SEP] identifier[aboveValue] operator[SEP] identifier[upper] operator[SEP] operator[SEP] Keyword[return] identifier[create] operator[SEP] identifier[lowerBound] , identifier[upperBound] operator[SEP] operator[SEP] }
public static CPDefinition fetchByG_NotS_First(long groupId, int status, OrderByComparator<CPDefinition> orderByComparator) { return getPersistence() .fetchByG_NotS_First(groupId, status, orderByComparator); }
class class_name[name] begin[{] method[fetchByG_NotS_First, return_type[type[CPDefinition]], modifier[public static], parameter[groupId, status, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPDefinition] identifier[fetchByG_NotS_First] operator[SEP] Keyword[long] identifier[groupId] , Keyword[int] identifier[status] , identifier[OrderByComparator] operator[<] identifier[CPDefinition] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByG_NotS_First] operator[SEP] identifier[groupId] , identifier[status] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public static void writeCustomAttributes(Collection<List<ExtensionAttribute>> attributes, XMLStreamWriter xtw, Map<String, String> namespaceMap, List<ExtensionAttribute>... blackLists) throws XMLStreamException { for (List<ExtensionAttribute> attributeList : attributes) { if (attributeList != null && !attributeList.isEmpty()) { for (ExtensionAttribute attribute : attributeList) { if (!isBlacklisted(attribute, blackLists)) { if (attribute.getNamespacePrefix() == null) { if (attribute.getNamespace() == null) xtw.writeAttribute(attribute.getName(), attribute.getValue()); else { xtw.writeAttribute(attribute.getNamespace(), attribute.getName(), attribute.getValue()); } } else { if (!namespaceMap.containsKey(attribute.getNamespacePrefix())) { namespaceMap.put(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeNamespace(attribute.getNamespacePrefix(), attribute.getNamespace()); } xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue()); } } } } } }
class class_name[name] begin[{] method[writeCustomAttributes, return_type[void], modifier[public static], parameter[attributes, xtw, namespaceMap, blackLists]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=attributeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=attributeList, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=blackLists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBlacklisted, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNamespacePrefix, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespacePrefix, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=namespaceMap, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespacePrefix, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getNamespace, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=namespaceMap, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespacePrefix, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getNamespace, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)], member=writeNamespace, postfix_operators=[], prefix_operators=[], qualifier=xtw, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespacePrefix, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getNamespace, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=xtw, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNamespace, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespace, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=xtw, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=xtw, selectors=[], type_arguments=None), label=None))]))]))]), control=EnhancedForControl(iterable=MemberReference(member=attributeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExtensionAttribute, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attributeList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ExtensionAttribute, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeCustomAttributes] operator[SEP] identifier[Collection] operator[<] identifier[List] operator[<] identifier[ExtensionAttribute] operator[>] operator[>] identifier[attributes] , identifier[XMLStreamWriter] identifier[xtw] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[namespaceMap] , identifier[List] operator[<] identifier[ExtensionAttribute] operator[>] operator[...] identifier[blackLists] operator[SEP] Keyword[throws] identifier[XMLStreamException] { Keyword[for] operator[SEP] identifier[List] operator[<] identifier[ExtensionAttribute] operator[>] identifier[attributeList] operator[:] identifier[attributes] operator[SEP] { Keyword[if] operator[SEP] identifier[attributeList] operator[!=] Other[null] operator[&&] operator[!] identifier[attributeList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[ExtensionAttribute] identifier[attribute] operator[:] identifier[attributeList] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isBlacklisted] operator[SEP] identifier[attribute] , identifier[blackLists] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[attribute] operator[SEP] identifier[getNamespacePrefix] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[attribute] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[xtw] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[attribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] { identifier[xtw] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[attribute] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[namespaceMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[attribute] operator[SEP] identifier[getNamespacePrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[namespaceMap] operator[SEP] identifier[put] operator[SEP] identifier[attribute] operator[SEP] identifier[getNamespacePrefix] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[xtw] operator[SEP] identifier[writeNamespace] operator[SEP] identifier[attribute] operator[SEP] identifier[getNamespacePrefix] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[xtw] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[attribute] operator[SEP] identifier[getNamespacePrefix] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } } }
private String checkVarReq(final Request request, final UtilActionForm form) throws Throwable { Collection<String> avs = request.getReqPars("setappvar"); if (avs == null) { return null; } HashMap<String, String> appVars = getAppVars(request); for (String reqpar: avs) { int start; if (reqpar.endsWith("}")) { start = reqpar.indexOf('{'); } else if (reqpar.endsWith(")")) { start = reqpar.indexOf('('); } else { return "badRequest"; } if (start < 0) { return "badRequest"; } String varName = reqpar.substring(0, start); String varVal = reqpar.substring(start + 1, reqpar.length() - 1); if (varVal.length() == 0) { varVal = null; } if (!setAppVar(varName, varVal, appVars)) { return "badRequest"; } } form.setAppVarsTbl(appVars); return null; }
class class_name[name] begin[{] method[checkVarReq, return_type[type[String]], modifier[private], parameter[request, form]] begin[{] local_variable[type[Collection], avs] if[binary_operation[member[.avs], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[HashMap], appVars] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=start)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="}")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=reqpar, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=reqpar, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="badRequest"), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='(')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=reqpar, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=reqpar, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=start, 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=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="badRequest"), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=reqpar, selectors=[], type_arguments=None), name=varName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=reqpar, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=reqpar, selectors=[], type_arguments=None), name=varVal)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=varVal, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=varVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=varName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=varVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=appVars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAppVar, postfix_operators=[], prefix_operators=['!'], qualifier=, 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="badRequest"), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=avs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=reqpar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[form.setAppVarsTbl, parameter[member[.appVars]]] return[literal[null]] end[}] END[}]
Keyword[private] identifier[String] identifier[checkVarReq] operator[SEP] Keyword[final] identifier[Request] identifier[request] , Keyword[final] identifier[UtilActionForm] identifier[form] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[Collection] operator[<] identifier[String] operator[>] identifier[avs] operator[=] identifier[request] operator[SEP] identifier[getReqPars] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[avs] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[appVars] operator[=] identifier[getAppVars] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[reqpar] operator[:] identifier[avs] operator[SEP] { Keyword[int] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[reqpar] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[start] operator[=] identifier[reqpar] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[reqpar] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[start] operator[=] identifier[reqpar] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[start] operator[<] Other[0] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[String] identifier[varName] operator[=] identifier[reqpar] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[start] operator[SEP] operator[SEP] identifier[String] identifier[varVal] operator[=] identifier[reqpar] operator[SEP] identifier[substring] operator[SEP] identifier[start] operator[+] Other[1] , identifier[reqpar] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[varVal] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[varVal] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[setAppVar] operator[SEP] identifier[varName] , identifier[varVal] , identifier[appVars] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } } identifier[form] operator[SEP] identifier[setAppVarsTbl] operator[SEP] identifier[appVars] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
private static Stream<String> getAgentMembers(final IdentifierConverter<Resource, FedoraResource> translator, final FedoraResource resource, final String hashPortion) { //resolve list of triples, accounting for hash-uris. final List<Triple> triples = resource.getTriples(translator, PROPERTIES).filter( triple -> hashPortion == null || triple.getSubject().getURI().endsWith(hashPortion)).collect(toList()); //determine if there is a rdf:type vcard:Group final boolean hasVcardGroup = triples.stream().anyMatch( triple -> triple.matches(triple.getSubject(), RDF_TYPE_NODE, VCARD_GROUP_NODE)); //return members only if there is an associated vcard:Group if (hasVcardGroup) { return triples.stream() .filter(triple -> triple.predicateMatches(VCARD_MEMBER_NODE)) .map(Triple::getObject).flatMap(WebACRolesProvider::nodeToStringStream) .map(WebACRolesProvider::stripUserAgentBaseURI); } else { return empty(); } }
class class_name[name] begin[{] method[getAgentMembers, return_type[type[Stream]], modifier[private static], parameter[translator, resource, hashPortion]] begin[{] local_variable[type[List], triples] local_variable[type[boolean], hasVcardGroup] if[member[.hasVcardGroup]] begin[{] return[call[triples.stream, parameter[]]] else begin[{] return[call[.empty, parameter[]]] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[Stream] operator[<] identifier[String] operator[>] identifier[getAgentMembers] operator[SEP] Keyword[final] identifier[IdentifierConverter] operator[<] identifier[Resource] , identifier[FedoraResource] operator[>] identifier[translator] , Keyword[final] identifier[FedoraResource] identifier[resource] , Keyword[final] identifier[String] identifier[hashPortion] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[Triple] operator[>] identifier[triples] operator[=] identifier[resource] operator[SEP] identifier[getTriples] operator[SEP] identifier[translator] , identifier[PROPERTIES] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[triple] operator[->] identifier[hashPortion] operator[==] Other[null] operator[||] identifier[triple] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] identifier[hashPortion] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[hasVcardGroup] operator[=] identifier[triples] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[triple] operator[->] identifier[triple] operator[SEP] identifier[matches] operator[SEP] identifier[triple] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] , identifier[RDF_TYPE_NODE] , identifier[VCARD_GROUP_NODE] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasVcardGroup] operator[SEP] { Keyword[return] identifier[triples] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[triple] operator[->] identifier[triple] operator[SEP] identifier[predicateMatches] operator[SEP] identifier[VCARD_MEMBER_NODE] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Triple] operator[::] identifier[getObject] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[WebACRolesProvider] operator[::] identifier[nodeToStringStream] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[WebACRolesProvider] operator[::] identifier[stripUserAgentBaseURI] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } }
public CommonProfile validateToken(final String token) { final TokenCredentials credentials = new TokenCredentials(token); try { validate(credentials, null); } catch (final HttpAction e) { throw new TechnicalException(e); } catch (final CredentialsException e) { logger.info("Failed to retrieve or validate credentials: {}", e.getMessage()); logger.debug("Failed to retrieve or validate credentials", e); return null; } return credentials.getUserProfile(); }
class class_name[name] begin[{] method[validateToken, return_type[type[CommonProfile]], modifier[public], parameter[token]] begin[{] local_variable[type[TokenCredentials], credentials] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=credentials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=validate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TechnicalException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['HttpAction'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to retrieve or validate credentials: {}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=info, 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="Failed to retrieve or validate credentials"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], 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=['CredentialsException']))], finally_block=None, label=None, resources=None) return[call[credentials.getUserProfile, parameter[]]] end[}] END[}]
Keyword[public] identifier[CommonProfile] identifier[validateToken] operator[SEP] Keyword[final] identifier[String] identifier[token] operator[SEP] { Keyword[final] identifier[TokenCredentials] identifier[credentials] operator[=] Keyword[new] identifier[TokenCredentials] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[try] { identifier[validate] operator[SEP] identifier[credentials] , Other[null] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[HttpAction] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[TechnicalException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[CredentialsException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[credentials] operator[SEP] identifier[getUserProfile] operator[SEP] operator[SEP] operator[SEP] }
public static snmp_user delete(nitro_service client, snmp_user resource) throws Exception { resource.validate("delete"); return ((snmp_user[]) resource.delete_resource(client))[0]; }
class class_name[name] begin[{] method[delete, return_type[type[snmp_user]], modifier[public static], parameter[client, resource]] begin[{] call[resource.validate, parameter[literal["delete"]]] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete_resource, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=snmp_user, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[snmp_user] identifier[delete] operator[SEP] identifier[nitro_service] identifier[client] , identifier[snmp_user] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] { identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[snmp_user] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[delete_resource] operator[SEP] identifier[client] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] }
@Override public ListInputSecurityGroupsResult listInputSecurityGroups(ListInputSecurityGroupsRequest request) { request = beforeClientExecution(request); return executeListInputSecurityGroups(request); }
class class_name[name] begin[{] method[listInputSecurityGroups, return_type[type[ListInputSecurityGroupsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeListInputSecurityGroups, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ListInputSecurityGroupsResult] identifier[listInputSecurityGroups] operator[SEP] identifier[ListInputSecurityGroupsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListInputSecurityGroups] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
protected boolean chooseRemoteRack(int rackIdx, int firstRack, int rackWindow, int machineIdx, int windowSize, HashMap<Node, Node> excludedNodes, long blocksize, int maxReplicasPerRack, List<DatanodeDescriptor> results, boolean reverse) throws NotEnoughReplicasException { // randomly choose one node from remote racks readLock(); try { HashSet<Integer> excludedRacks = new HashSet<Integer>(); excludedRacks.add(rackIdx); int n = racks.size(); int currRackSize = racksMap.get(racks.get(rackIdx)).rackNodes.size(); while (excludedRacks.size() < rackWindow) { int newRack = randomIntInWindow(firstRack, rackWindow, n, excludedRacks); if (newRack < 0) break; excludedRacks.add(newRack); int newRackSize = racksMap.get(racks.get(newRack)).rackNodes.size(); int firstMachine = machineIdx * newRackSize / currRackSize; int newWindowSize = windowSize; if (reverse) { firstMachine = ((int) Math.ceil((double) machineIdx * newRackSize / currRackSize)) % newRackSize; newWindowSize = Math.max(1, windowSize * newRackSize / currRackSize); } if (newWindowSize <= 0) { continue; } if (chooseMachine(racks.get(newRack), firstMachine, newWindowSize, excludedNodes, blocksize, maxReplicasPerRack, results)) { return true; } } return false; } finally { readUnlock(); } }
class class_name[name] begin[{] method[chooseRemoteRack, return_type[type[boolean]], modifier[protected], parameter[rackIdx, firstRack, rackWindow, machineIdx, windowSize, excludedNodes, blocksize, maxReplicasPerRack, results, reverse]] begin[{] call[.readLock, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=HashSet, sub_type=None)), name=excludedRacks)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=HashSet, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rackIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=excludedRacks, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=racks, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=rackIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=racks, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=racksMap, selectors=[MemberReference(member=rackNodes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=currRackSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=firstRack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rackWindow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=excludedRacks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=randomIntInWindow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=newRack)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newRack, 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=BreakStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newRack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=excludedRacks, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=newRack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=racks, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=racksMap, selectors=[MemberReference(member=rackNodes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=newRackSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=machineIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=newRackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=currRackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=firstMachine)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=windowSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=newWindowSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MemberReference(member=reverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=firstMachine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Cast(expression=MemberReference(member=machineIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), operandr=MemberReference(member=newRackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=currRackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)], member=ceil, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), operandr=MemberReference(member=newRackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=newWindowSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=windowSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=newRackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=currRackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newWindowSize, 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=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=newRack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=racks, selectors=[], type_arguments=None), MemberReference(member=firstMachine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newWindowSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=excludedNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=blocksize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxReplicasPerRack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=chooseMachine, postfix_operators=[], prefix_operators=[], qualifier=, 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)]))]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=excludedRacks, selectors=[], type_arguments=None), operandr=MemberReference(member=rackWindow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readUnlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[chooseRemoteRack] operator[SEP] Keyword[int] identifier[rackIdx] , Keyword[int] identifier[firstRack] , Keyword[int] identifier[rackWindow] , Keyword[int] identifier[machineIdx] , Keyword[int] identifier[windowSize] , identifier[HashMap] operator[<] identifier[Node] , identifier[Node] operator[>] identifier[excludedNodes] , Keyword[long] identifier[blocksize] , Keyword[int] identifier[maxReplicasPerRack] , identifier[List] operator[<] identifier[DatanodeDescriptor] operator[>] identifier[results] , Keyword[boolean] identifier[reverse] operator[SEP] Keyword[throws] identifier[NotEnoughReplicasException] { identifier[readLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[HashSet] operator[<] identifier[Integer] operator[>] identifier[excludedRacks] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[excludedRacks] operator[SEP] identifier[add] operator[SEP] identifier[rackIdx] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[racks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[currRackSize] operator[=] identifier[racksMap] operator[SEP] identifier[get] operator[SEP] identifier[racks] operator[SEP] identifier[get] operator[SEP] identifier[rackIdx] operator[SEP] operator[SEP] operator[SEP] identifier[rackNodes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[excludedRacks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[rackWindow] operator[SEP] { Keyword[int] identifier[newRack] operator[=] identifier[randomIntInWindow] operator[SEP] identifier[firstRack] , identifier[rackWindow] , identifier[n] , identifier[excludedRacks] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newRack] operator[<] Other[0] operator[SEP] Keyword[break] operator[SEP] identifier[excludedRacks] operator[SEP] identifier[add] operator[SEP] identifier[newRack] operator[SEP] operator[SEP] Keyword[int] identifier[newRackSize] operator[=] identifier[racksMap] operator[SEP] identifier[get] operator[SEP] identifier[racks] operator[SEP] identifier[get] operator[SEP] identifier[newRack] operator[SEP] operator[SEP] operator[SEP] identifier[rackNodes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[firstMachine] operator[=] identifier[machineIdx] operator[*] identifier[newRackSize] operator[/] identifier[currRackSize] operator[SEP] Keyword[int] identifier[newWindowSize] operator[=] identifier[windowSize] operator[SEP] Keyword[if] operator[SEP] identifier[reverse] operator[SEP] { identifier[firstMachine] operator[=] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[ceil] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[machineIdx] operator[*] identifier[newRackSize] operator[/] identifier[currRackSize] operator[SEP] operator[SEP] operator[%] identifier[newRackSize] operator[SEP] identifier[newWindowSize] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[1] , identifier[windowSize] operator[*] identifier[newRackSize] operator[/] identifier[currRackSize] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[newWindowSize] operator[<=] Other[0] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[chooseMachine] operator[SEP] identifier[racks] operator[SEP] identifier[get] operator[SEP] identifier[newRack] operator[SEP] , identifier[firstMachine] , identifier[newWindowSize] , identifier[excludedNodes] , identifier[blocksize] , identifier[maxReplicasPerRack] , identifier[results] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] } Keyword[finally] { identifier[readUnlock] operator[SEP] operator[SEP] operator[SEP] } }
@Execute public ActionResponse index(final GoForm form) throws IOException { validate(form, messages -> {}, () -> asHtml(virtualHost(path_Error_ErrorJsp))); if (isLoginRequired()) { return redirectToLogin(); } Map<String, Object> doc = null; try { doc = searchService.getDocumentByDocId(form.docId, new String[] { fessConfig.getIndexFieldUrl(), fessConfig.getIndexFieldConfigId() }, getUserBean()).orElse(null); } catch (final Exception e) { logger.warn("Failed to request: " + form.docId, e); } if (doc == null) { saveError(messages -> messages.addErrorsDocidNotFound(GLOBAL, form.docId)); return redirect(ErrorAction.class); } final String url = DocumentUtil.getValue(doc, fessConfig.getIndexFieldUrl(), String.class); if (url == null) { saveError(messages -> messages.addErrorsDocumentNotFound(GLOBAL, form.docId)); return redirect(ErrorAction.class); } if (fessConfig.isSearchLog()) { final String userSessionId = userInfoHelper.getUserCode(); if (userSessionId != null) { final SearchLogHelper searchLogHelper = ComponentUtil.getSearchLogHelper(); final ClickLog clickLog = new ClickLog(); clickLog.setUrlId((String) doc.get(fessConfig.getIndexFieldId())); clickLog.setUrl(url); clickLog.setRequestedAt(systemHelper.getCurrentTimeAsLocalDateTime()); clickLog.setQueryRequestedAt(DfTypeUtil.toLocalDateTime(Long.parseLong(form.rt))); clickLog.setUserSessionId(userSessionId); clickLog.setDocId(form.docId); clickLog.setQueryId(form.queryId); if (form.order != null) { clickLog.setOrder(form.order); } searchLogHelper.addClickLog(clickLog); } } String hash; if (StringUtil.isNotBlank(form.hash)) { final String value = URLUtil.decode(form.hash, Constants.UTF_8); final StringBuilder buf = new StringBuilder(value.length() + 100); for (final char c : value.toCharArray()) { if (CharUtil.isUrlChar(c) || c == ' ') { buf.append(c); } else { try { buf.append(URLEncoder.encode(String.valueOf(c), Constants.UTF_8)); } catch (final UnsupportedEncodingException e) { // NOP } } } hash = buf.toString(); } else { hash = StringUtil.EMPTY; } final String targetUrl = pathMappingHelper.replaceUrl(url); if (isFileSystemPath(targetUrl)) { if (fessConfig.isSearchFileProxyEnabled()) { final ViewHelper viewHelper = ComponentUtil.getViewHelper(); try { final StreamResponse response = viewHelper.asContentResponse(doc); if (response.getHttpStatus().orElse(200) == 404) { logger.debug("Not found: " + targetUrl); saveError(messages -> messages.addErrorsNotFoundOnFileSystem(GLOBAL, targetUrl)); return redirect(ErrorAction.class); } return response; } catch (final Exception e) { logger.warn("Failed to load: " + doc, e); saveError(messages -> messages.addErrorsNotLoadFromServer(GLOBAL, targetUrl)); return redirect(ErrorAction.class); } } else { return HtmlResponse.fromRedirectPathAsIs(targetUrl + hash); } } else { return HtmlResponse.fromRedirectPathAsIs(DocumentUtil.encodeUrl(targetUrl + hash)); } }
class class_name[name] begin[{] method[index, return_type[type[ActionResponse]], modifier[public], parameter[form]] begin[{] call[.validate, parameter[member[.form], LambdaExpression(body=[], parameters=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=path_Error_ErrorJsp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=virtualHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=asHtml, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[])]] if[call[.isLoginRequired, parameter[]]] begin[{] return[call[.redirectToLogin, parameter[]]] else begin[{] None end[}] local_variable[type[Map], doc] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=docId, postfix_operators=[], prefix_operators=[], qualifier=form, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getIndexFieldUrl, postfix_operators=[], prefix_operators=[], qualifier=fessConfig, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getIndexFieldConfigId, postfix_operators=[], prefix_operators=[], qualifier=fessConfig, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), MethodInvocation(arguments=[], member=getUserBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getDocumentByDocId, postfix_operators=[], prefix_operators=[], qualifier=searchService, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=orElse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to request: "), operandr=MemberReference(member=docId, postfix_operators=[], prefix_operators=[], qualifier=form, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, 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) if[binary_operation[member[.doc], ==, literal[null]]] begin[{] call[.saveError, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=GLOBAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=docId, postfix_operators=[], prefix_operators=[], qualifier=form, selectors=[])], member=addErrorsDocidNotFound, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), parameters=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] return[call[.redirect, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorAction, sub_type=None))]]] else begin[{] None end[}] local_variable[type[String], url] if[binary_operation[member[.url], ==, literal[null]]] begin[{] call[.saveError, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=GLOBAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=docId, postfix_operators=[], prefix_operators=[], qualifier=form, selectors=[])], member=addErrorsDocumentNotFound, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), parameters=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] return[call[.redirect, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorAction, sub_type=None))]]] else begin[{] None end[}] if[call[fessConfig.isSearchLog, parameter[]]] begin[{] local_variable[type[String], userSessionId] if[binary_operation[member[.userSessionId], !=, literal[null]]] begin[{] local_variable[type[SearchLogHelper], searchLogHelper] local_variable[type[ClickLog], clickLog] call[clickLog.setUrlId, parameter[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIndexFieldId, postfix_operators=[], prefix_operators=[], qualifier=fessConfig, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=doc, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]] call[clickLog.setUrl, parameter[member[.url]]] call[clickLog.setRequestedAt, parameter[call[systemHelper.getCurrentTimeAsLocalDateTime, parameter[]]]] call[clickLog.setQueryRequestedAt, parameter[call[DfTypeUtil.toLocalDateTime, parameter[call[Long.parseLong, parameter[member[form.rt]]]]]]] call[clickLog.setUserSessionId, parameter[member[.userSessionId]]] call[clickLog.setDocId, parameter[member[form.docId]]] call[clickLog.setQueryId, parameter[member[form.queryId]]] if[binary_operation[member[form.order], !=, literal[null]]] begin[{] call[clickLog.setOrder, parameter[member[form.order]]] else begin[{] None end[}] call[searchLogHelper.addClickLog, parameter[member[.clickLog]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[String], hash] if[call[StringUtil.isNotBlank, parameter[member[form.hash]]]] begin[{] local_variable[type[String], value] local_variable[type[StringBuilder], buf] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isUrlChar, postfix_operators=[], prefix_operators=[], qualifier=CharUtil, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers={'final'}, type=BasicType(dimensions=[], name=char))), label=None) assign[member[.hash], call[buf.toString, parameter[]]] else begin[{] assign[member[.hash], member[StringUtil.EMPTY]] end[}] local_variable[type[String], targetUrl] if[call[.isFileSystemPath, parameter[member[.targetUrl]]]] begin[{] if[call[fessConfig.isSearchFileProxyEnabled, parameter[]]] begin[{] local_variable[type[ViewHelper], viewHelper] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asContentResponse, postfix_operators=[], prefix_operators=[], qualifier=viewHelper, selectors=[], type_arguments=None), name=response)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StreamResponse, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHttpStatus, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=200)], member=orElse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=404), operator===), 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="Not found: "), operandr=MemberReference(member=targetUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=GLOBAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addErrorsNotFoundOnFileSystem, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), parameters=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=saveError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorAction, sub_type=None))], member=redirect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to load: "), operandr=MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=GLOBAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addErrorsNotLoadFromServer, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), parameters=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=saveError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorAction, sub_type=None))], member=redirect, 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) else begin[{] return[call[HtmlResponse.fromRedirectPathAsIs, parameter[binary_operation[member[.targetUrl], +, member[.hash]]]]] end[}] else begin[{] return[call[HtmlResponse.fromRedirectPathAsIs, parameter[call[DocumentUtil.encodeUrl, parameter[binary_operation[member[.targetUrl], +, member[.hash]]]]]]] end[}] end[}] END[}]
annotation[@] identifier[Execute] Keyword[public] identifier[ActionResponse] identifier[index] operator[SEP] Keyword[final] identifier[GoForm] identifier[form] operator[SEP] Keyword[throws] identifier[IOException] { identifier[validate] operator[SEP] identifier[form] , identifier[messages] operator[->] { } , operator[SEP] operator[SEP] operator[->] identifier[asHtml] operator[SEP] identifier[virtualHost] operator[SEP] identifier[path_Error_ErrorJsp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isLoginRequired] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[redirectToLogin] operator[SEP] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[doc] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[doc] operator[=] identifier[searchService] operator[SEP] identifier[getDocumentByDocId] operator[SEP] identifier[form] operator[SEP] identifier[docId] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[fessConfig] operator[SEP] identifier[getIndexFieldUrl] operator[SEP] operator[SEP] , identifier[fessConfig] operator[SEP] identifier[getIndexFieldConfigId] operator[SEP] operator[SEP] } , identifier[getUserBean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[form] operator[SEP] identifier[docId] , identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[doc] operator[==] Other[null] operator[SEP] { identifier[saveError] operator[SEP] identifier[messages] operator[->] identifier[messages] operator[SEP] identifier[addErrorsDocidNotFound] operator[SEP] identifier[GLOBAL] , identifier[form] operator[SEP] identifier[docId] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[redirect] operator[SEP] identifier[ErrorAction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[url] operator[=] identifier[DocumentUtil] operator[SEP] identifier[getValue] operator[SEP] identifier[doc] , identifier[fessConfig] operator[SEP] identifier[getIndexFieldUrl] operator[SEP] operator[SEP] , identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { identifier[saveError] operator[SEP] identifier[messages] operator[->] identifier[messages] operator[SEP] identifier[addErrorsDocumentNotFound] operator[SEP] identifier[GLOBAL] , identifier[form] operator[SEP] identifier[docId] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[redirect] operator[SEP] identifier[ErrorAction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fessConfig] operator[SEP] identifier[isSearchLog] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[userSessionId] operator[=] identifier[userInfoHelper] operator[SEP] identifier[getUserCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userSessionId] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[SearchLogHelper] identifier[searchLogHelper] operator[=] identifier[ComponentUtil] operator[SEP] identifier[getSearchLogHelper] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ClickLog] identifier[clickLog] operator[=] Keyword[new] identifier[ClickLog] operator[SEP] operator[SEP] operator[SEP] identifier[clickLog] operator[SEP] identifier[setUrlId] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[doc] operator[SEP] identifier[get] operator[SEP] identifier[fessConfig] operator[SEP] identifier[getIndexFieldId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[clickLog] operator[SEP] identifier[setUrl] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[clickLog] operator[SEP] identifier[setRequestedAt] operator[SEP] identifier[systemHelper] operator[SEP] identifier[getCurrentTimeAsLocalDateTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[clickLog] operator[SEP] identifier[setQueryRequestedAt] operator[SEP] identifier[DfTypeUtil] operator[SEP] identifier[toLocalDateTime] operator[SEP] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[form] operator[SEP] identifier[rt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[clickLog] operator[SEP] identifier[setUserSessionId] operator[SEP] identifier[userSessionId] operator[SEP] operator[SEP] identifier[clickLog] operator[SEP] identifier[setDocId] operator[SEP] identifier[form] operator[SEP] identifier[docId] operator[SEP] operator[SEP] identifier[clickLog] operator[SEP] identifier[setQueryId] operator[SEP] identifier[form] operator[SEP] identifier[queryId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[form] operator[SEP] identifier[order] operator[!=] Other[null] operator[SEP] { identifier[clickLog] operator[SEP] identifier[setOrder] operator[SEP] identifier[form] operator[SEP] identifier[order] operator[SEP] operator[SEP] } identifier[searchLogHelper] operator[SEP] identifier[addClickLog] operator[SEP] identifier[clickLog] operator[SEP] operator[SEP] } } identifier[String] identifier[hash] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtil] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[form] operator[SEP] identifier[hash] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[value] operator[=] identifier[URLUtil] operator[SEP] identifier[decode] operator[SEP] identifier[form] operator[SEP] identifier[hash] , identifier[Constants] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[100] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] Keyword[char] identifier[c] operator[:] identifier[value] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[CharUtil] operator[SEP] identifier[isUrlChar] operator[SEP] identifier[c] operator[SEP] operator[||] identifier[c] operator[==] literal[String] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[else] { Keyword[try] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[c] operator[SEP] , identifier[Constants] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { } } } identifier[hash] operator[=] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[hash] operator[=] identifier[StringUtil] operator[SEP] identifier[EMPTY] operator[SEP] } Keyword[final] identifier[String] identifier[targetUrl] operator[=] identifier[pathMappingHelper] operator[SEP] identifier[replaceUrl] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isFileSystemPath] operator[SEP] identifier[targetUrl] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[fessConfig] operator[SEP] identifier[isSearchFileProxyEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[ViewHelper] identifier[viewHelper] operator[=] identifier[ComponentUtil] operator[SEP] identifier[getViewHelper] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[StreamResponse] identifier[response] operator[=] identifier[viewHelper] operator[SEP] identifier[asContentResponse] operator[SEP] identifier[doc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[getHttpStatus] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] Other[200] operator[SEP] operator[==] Other[404] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[targetUrl] operator[SEP] operator[SEP] identifier[saveError] operator[SEP] identifier[messages] operator[->] identifier[messages] operator[SEP] identifier[addErrorsNotFoundOnFileSystem] operator[SEP] identifier[GLOBAL] , identifier[targetUrl] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[redirect] operator[SEP] identifier[ErrorAction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[doc] , identifier[e] operator[SEP] operator[SEP] identifier[saveError] operator[SEP] identifier[messages] operator[->] identifier[messages] operator[SEP] identifier[addErrorsNotLoadFromServer] operator[SEP] identifier[GLOBAL] , identifier[targetUrl] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[redirect] operator[SEP] identifier[ErrorAction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] identifier[HtmlResponse] operator[SEP] identifier[fromRedirectPathAsIs] operator[SEP] identifier[targetUrl] operator[+] identifier[hash] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] identifier[HtmlResponse] operator[SEP] identifier[fromRedirectPathAsIs] operator[SEP] identifier[DocumentUtil] operator[SEP] identifier[encodeUrl] operator[SEP] identifier[targetUrl] operator[+] identifier[hash] operator[SEP] operator[SEP] operator[SEP] } }
public Content getNonBreakResource(String key) { String text = configuration.getText(key); Content c = configuration.newContent(); int start = 0; int p; while ((p = text.indexOf(" ", start)) != -1) { c.addContent(text.substring(start, p)); c.addContent(RawHtml.nbsp); start = p + 1; } c.addContent(text.substring(start)); return c; }
class class_name[name] begin[{] method[getNonBreakResource, return_type[type[Content]], modifier[public], parameter[key]] begin[{] local_variable[type[String], text] local_variable[type[Content], c] local_variable[type[int], start] local_variable[type[int], p] while[binary_operation[assign[member[.p], call[text.indexOf, parameter[literal[" "], member[.start]]]], !=, literal[1]]] begin[{] call[c.addContent, parameter[call[text.substring, parameter[member[.start], member[.p]]]]] call[c.addContent, parameter[member[RawHtml.nbsp]]] assign[member[.start], binary_operation[member[.p], +, literal[1]]] end[}] call[c.addContent, parameter[call[text.substring, parameter[member[.start]]]]] return[member[.c]] end[}] END[}]
Keyword[public] identifier[Content] identifier[getNonBreakResource] operator[SEP] identifier[String] identifier[key] operator[SEP] { identifier[String] identifier[text] operator[=] identifier[configuration] operator[SEP] identifier[getText] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[Content] identifier[c] operator[=] identifier[configuration] operator[SEP] identifier[newContent] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] Keyword[int] identifier[p] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[p] operator[=] identifier[text] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[start] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[c] operator[SEP] identifier[addContent] operator[SEP] identifier[text] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[p] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[addContent] operator[SEP] identifier[RawHtml] operator[SEP] identifier[nbsp] operator[SEP] operator[SEP] identifier[start] operator[=] identifier[p] operator[+] Other[1] operator[SEP] } identifier[c] operator[SEP] identifier[addContent] operator[SEP] identifier[text] operator[SEP] identifier[substring] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP] }
private static void encodeHeader(DnsQuery query, ByteBuf buf) { buf.writeShort(query.id()); int flags = 0; flags |= (query.opCode().byteValue() & 0xFF) << 14; if (query.isRecursionDesired()) { flags |= 1 << 8; } buf.writeShort(flags); buf.writeShort(query.count(DnsSection.QUESTION)); buf.writeShort(0); // answerCount buf.writeShort(0); // authorityResourceCount buf.writeShort(query.count(DnsSection.ADDITIONAL)); }
class class_name[name] begin[{] method[encodeHeader, return_type[void], modifier[private static], parameter[query, buf]] begin[{] call[buf.writeShort, parameter[call[query.id, parameter[]]]] local_variable[type[int], flags] assign[member[.flags], binary_operation[binary_operation[call[query.opCode, parameter[]], &, literal[0xFF]], <<, literal[14]]] if[call[query.isRecursionDesired, parameter[]]] begin[{] assign[member[.flags], binary_operation[literal[1], <<, literal[8]]] else begin[{] None end[}] call[buf.writeShort, parameter[member[.flags]]] call[buf.writeShort, parameter[call[query.count, parameter[member[DnsSection.QUESTION]]]]] call[buf.writeShort, parameter[literal[0]]] call[buf.writeShort, parameter[literal[0]]] call[buf.writeShort, parameter[call[query.count, parameter[member[DnsSection.ADDITIONAL]]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[encodeHeader] operator[SEP] identifier[DnsQuery] identifier[query] , identifier[ByteBuf] identifier[buf] operator[SEP] { identifier[buf] operator[SEP] identifier[writeShort] operator[SEP] identifier[query] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[flags] operator[=] Other[0] operator[SEP] identifier[flags] operator[|=] operator[SEP] identifier[query] operator[SEP] identifier[opCode] operator[SEP] operator[SEP] operator[SEP] identifier[byteValue] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[14] operator[SEP] Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[isRecursionDesired] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] Other[1] operator[<<] Other[8] operator[SEP] } identifier[buf] operator[SEP] identifier[writeShort] operator[SEP] identifier[flags] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[writeShort] operator[SEP] identifier[query] operator[SEP] identifier[count] operator[SEP] identifier[DnsSection] operator[SEP] identifier[QUESTION] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[writeShort] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[writeShort] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[writeShort] operator[SEP] identifier[query] operator[SEP] identifier[count] operator[SEP] identifier[DnsSection] operator[SEP] identifier[ADDITIONAL] operator[SEP] operator[SEP] operator[SEP] }
public List<TableSchema> getAvailableTablesFromGroups(DbUser user) throws Exception { Map<String,TableSchemaImpl> nameToTableMap = getTableDataFromGroups(user,null); List<TableSchema> result = new Vector<TableSchema>(); result.addAll(nameToTableMap.values()); return result; }
class class_name[name] begin[{] method[getAvailableTablesFromGroups, return_type[type[List]], modifier[public], parameter[user]] begin[{] local_variable[type[Map], nameToTableMap] local_variable[type[List], result] call[result.addAll, parameter[call[nameToTableMap.values, parameter[]]]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[TableSchema] operator[>] identifier[getAvailableTablesFromGroups] operator[SEP] identifier[DbUser] identifier[user] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Map] operator[<] identifier[String] , identifier[TableSchemaImpl] operator[>] identifier[nameToTableMap] operator[=] identifier[getTableDataFromGroups] operator[SEP] identifier[user] , Other[null] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[TableSchema] operator[>] identifier[result] operator[=] Keyword[new] identifier[Vector] operator[<] identifier[TableSchema] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[nameToTableMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) { return map(String::valueOf).rawCollect(Collectors.joining(delimiter, prefix, suffix)); }
class class_name[name] begin[{] method[joining, return_type[type[String]], modifier[public], parameter[delimiter, prefix, suffix]] begin[{] return[call[.map, parameter[MethodReference(expression=MemberReference(member=String, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] END[}]
Keyword[public] identifier[String] identifier[joining] operator[SEP] identifier[CharSequence] identifier[delimiter] , identifier[CharSequence] identifier[prefix] , identifier[CharSequence] identifier[suffix] operator[SEP] { Keyword[return] identifier[map] operator[SEP] identifier[String] operator[::] identifier[valueOf] operator[SEP] operator[SEP] identifier[rawCollect] operator[SEP] identifier[Collectors] operator[SEP] identifier[joining] operator[SEP] identifier[delimiter] , identifier[prefix] , identifier[suffix] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean createGeometryColumnsTable() { verifyWritable(); boolean created = false; GeometryColumnsDao dao = getGeometryColumnsDao(); try { if (!dao.isTableExists()) { created = tableCreator.createGeometryColumns() > 0; } } catch (SQLException e) { throw new GeoPackageException("Failed to check if " + GeometryColumns.class.getSimpleName() + " table exists and create it", e); } return created; }
class class_name[name] begin[{] method[createGeometryColumnsTable, return_type[type[boolean]], modifier[public], parameter[]] begin[{] call[.verifyWritable, parameter[]] local_variable[type[boolean], created] local_variable[type[GeometryColumnsDao], dao] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTableExists, postfix_operators=[], prefix_operators=['!'], qualifier=dao, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=created, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[], member=createGeometryColumns, postfix_operators=[], prefix_operators=[], qualifier=tableCreator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to check if "), operandr=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=GeometryColumns, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" table exists and create it"), 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=GeoPackageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None) return[member[.created]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[createGeometryColumnsTable] operator[SEP] operator[SEP] { identifier[verifyWritable] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[created] operator[=] literal[boolean] operator[SEP] identifier[GeometryColumnsDao] identifier[dao] operator[=] identifier[getGeometryColumnsDao] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[dao] operator[SEP] identifier[isTableExists] operator[SEP] operator[SEP] operator[SEP] { identifier[created] operator[=] identifier[tableCreator] operator[SEP] identifier[createGeometryColumns] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] } } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[GeometryColumns] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[created] operator[SEP] }
private String _serializeMap(Map map, Set<Object> done) throws ConverterException { StringBuilder sb = new StringBuilder(goIn() + "<struct>"); Iterator it = map.keySet().iterator(); deep++; while (it.hasNext()) { Object key = it.next(); sb.append(goIn() + "<var name=" + del + XMLUtil.escapeXMLString(key.toString()) + del + ">"); sb.append(_serialize(map.get(key), done)); sb.append(goIn() + "</var>"); } deep--; sb.append(goIn() + "</struct>"); return sb.toString(); }
class class_name[name] begin[{] method[_serializeMap, return_type[type[String]], modifier[private], parameter[map, done]] begin[{] local_variable[type[StringBuilder], sb] local_variable[type[Iterator], it] member[.deep] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[Object], key] call[sb.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[.goIn, parameter[]], +, literal["<var name="]], +, member[.del]], +, call[XMLUtil.escapeXMLString, parameter[call[key.toString, parameter[]]]]], +, member[.del]], +, literal[">"]]]] call[sb.append, parameter[call[._serialize, parameter[call[map.get, parameter[member[.key]]], member[.done]]]]] call[sb.append, parameter[binary_operation[call[.goIn, parameter[]], +, literal["</var>"]]]] end[}] member[.deep] call[sb.append, parameter[binary_operation[call[.goIn, parameter[]], +, literal["</struct>"]]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[_serializeMap] operator[SEP] identifier[Map] identifier[map] , identifier[Set] operator[<] identifier[Object] operator[>] identifier[done] operator[SEP] Keyword[throws] identifier[ConverterException] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[goIn] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[deep] operator[++] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[key] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[goIn] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[del] operator[+] identifier[XMLUtil] operator[SEP] identifier[escapeXMLString] operator[SEP] identifier[key] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[del] operator[+] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[_serialize] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] , identifier[done] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[goIn] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[deep] operator[--] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[goIn] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public SubmitSmResp submitSmResp(byte[] b) throws PDUStringException { SubmitSmResp resp = new SubmitSmResp(); SequentialBytesReader reader = new SequentialBytesReader(b); assignHeader(resp, reader); if (resp.getCommandLength() > 16 && resp.getCommandStatus() == 0) { resp.setMessageId(reader.readCString()); StringValidator.validateString(resp.getMessageId(), StringParameter.MESSAGE_ID); } return resp; }
class class_name[name] begin[{] method[submitSmResp, return_type[type[SubmitSmResp]], modifier[public], parameter[b]] begin[{] local_variable[type[SubmitSmResp], resp] local_variable[type[SequentialBytesReader], reader] call[.assignHeader, parameter[member[.resp], member[.reader]]] if[binary_operation[binary_operation[call[resp.getCommandLength, parameter[]], >, literal[16]], &&, binary_operation[call[resp.getCommandStatus, parameter[]], ==, literal[0]]]] begin[{] call[resp.setMessageId, parameter[call[reader.readCString, parameter[]]]] call[StringValidator.validateString, parameter[call[resp.getMessageId, parameter[]], member[StringParameter.MESSAGE_ID]]] else begin[{] None end[}] return[member[.resp]] end[}] END[}]
Keyword[public] identifier[SubmitSmResp] identifier[submitSmResp] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[SEP] Keyword[throws] identifier[PDUStringException] { identifier[SubmitSmResp] identifier[resp] operator[=] Keyword[new] identifier[SubmitSmResp] operator[SEP] operator[SEP] operator[SEP] identifier[SequentialBytesReader] identifier[reader] operator[=] Keyword[new] identifier[SequentialBytesReader] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[assignHeader] operator[SEP] identifier[resp] , identifier[reader] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resp] operator[SEP] identifier[getCommandLength] operator[SEP] operator[SEP] operator[>] Other[16] operator[&&] identifier[resp] operator[SEP] identifier[getCommandStatus] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[resp] operator[SEP] identifier[setMessageId] operator[SEP] identifier[reader] operator[SEP] identifier[readCString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StringValidator] operator[SEP] identifier[validateString] operator[SEP] identifier[resp] operator[SEP] identifier[getMessageId] operator[SEP] operator[SEP] , identifier[StringParameter] operator[SEP] identifier[MESSAGE_ID] operator[SEP] operator[SEP] } Keyword[return] identifier[resp] operator[SEP] }
@Override public void clearCache() { entityCache.clearCache(CommerceShippingFixedOptionImpl.class); finderCache.clearCache(FINDER_CLASS_NAME_ENTITY); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); }
class class_name[name] begin[{] method[clearCache, return_type[void], modifier[public], parameter[]] begin[{] call[entityCache.clearCache, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceShippingFixedOptionImpl, sub_type=None))]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_ENTITY]]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_LIST_WITH_PAGINATION]]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[clearCache] operator[SEP] operator[SEP] { identifier[entityCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[CommerceShippingFixedOptionImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_ENTITY] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_LIST_WITH_PAGINATION] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION] operator[SEP] operator[SEP] }
public void getIntersectingSprites (List<Sprite> list, Shape shape) { int size = _sprites.size(); for (int ii = 0; ii < size; ii++) { Sprite sprite = _sprites.get(ii); if (sprite.intersects(shape)) { list.add(sprite); } } }
class class_name[name] begin[{] method[getIntersectingSprites, return_type[void], modifier[public], parameter[list, shape]] begin[{] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_sprites, selectors=[], type_arguments=None), name=sprite)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Sprite, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=shape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intersects, postfix_operators=[], prefix_operators=[], qualifier=sprite, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sprite, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, 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=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[getIntersectingSprites] operator[SEP] identifier[List] operator[<] identifier[Sprite] operator[>] identifier[list] , identifier[Shape] identifier[shape] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[_sprites] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] operator[SEP] identifier[ii] operator[<] identifier[size] operator[SEP] identifier[ii] operator[++] operator[SEP] { identifier[Sprite] identifier[sprite] operator[=] identifier[_sprites] operator[SEP] identifier[get] operator[SEP] identifier[ii] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sprite] operator[SEP] identifier[intersects] operator[SEP] identifier[shape] operator[SEP] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[sprite] operator[SEP] operator[SEP] } } }
public Map<String, String> getUsersGroups() { Map<String, String> usersGroups = new LinkedHashMap<String, String>(); for (Map.Entry<String, List<String>> entry : USERS_GROUPS.entrySet()) { String key = entry.getKey(); usersGroups.put(key + " (" + entry.getValue().get(0) + ")", key); } return usersGroups; }
class class_name[name] begin[{] method[getUsersGroups, return_type[type[Map]], modifier[public], parameter[]] begin[{] local_variable[type[Map], usersGroups] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ("), operator=+), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=usersGroups, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=USERS_GROUPS, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.usersGroups]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getUsersGroups] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[usersGroups] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[USERS_GROUPS] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[key] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[usersGroups] operator[SEP] identifier[put] operator[SEP] identifier[key] operator[+] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] , identifier[key] operator[SEP] operator[SEP] } Keyword[return] identifier[usersGroups] operator[SEP] }
@Override public View getView(int position, View convertView, ViewGroup parent){ VH holder; if(convertView == null){ // Load the view from scratch convertView = inflater.inflate(viewResource, parent, false); // Load the ViewHolder holder = createHolder(convertView); // set holder to the tag convertView.setTag(holder); }else{ // Pull the view holder from convertView's tag holder = (VH) convertView.getTag(); } // bind the data to the holder bindHolder(holder, position, getItem(position)); return convertView; }
class class_name[name] begin[{] method[getView, return_type[type[View]], modifier[public], parameter[position, convertView, parent]] begin[{] local_variable[type[VH], holder] if[binary_operation[member[.convertView], ==, literal[null]]] begin[{] assign[member[.convertView], call[inflater.inflate, parameter[member[.viewResource], member[.parent], literal[false]]]] assign[member[.holder], call[.createHolder, parameter[member[.convertView]]]] call[convertView.setTag, parameter[member[.holder]]] else begin[{] assign[member[.holder], Cast(expression=MethodInvocation(arguments=[], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=convertView, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=VH, sub_type=None))] end[}] call[.bindHolder, parameter[member[.holder], member[.position], call[.getItem, parameter[member[.position]]]]] return[member[.convertView]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[View] identifier[getView] operator[SEP] Keyword[int] identifier[position] , identifier[View] identifier[convertView] , identifier[ViewGroup] identifier[parent] operator[SEP] { identifier[VH] identifier[holder] operator[SEP] Keyword[if] operator[SEP] identifier[convertView] operator[==] Other[null] operator[SEP] { identifier[convertView] operator[=] identifier[inflater] operator[SEP] identifier[inflate] operator[SEP] identifier[viewResource] , identifier[parent] , literal[boolean] operator[SEP] operator[SEP] identifier[holder] operator[=] identifier[createHolder] operator[SEP] identifier[convertView] operator[SEP] operator[SEP] identifier[convertView] operator[SEP] identifier[setTag] operator[SEP] identifier[holder] operator[SEP] operator[SEP] } Keyword[else] { identifier[holder] operator[=] operator[SEP] identifier[VH] operator[SEP] identifier[convertView] operator[SEP] identifier[getTag] operator[SEP] operator[SEP] operator[SEP] } identifier[bindHolder] operator[SEP] identifier[holder] , identifier[position] , identifier[getItem] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[convertView] operator[SEP] }
public String getType() { String type = getPropertyAsString(FIELD_TYPE); if (type == null){ return getPropertyAsString(FIELD_ITEM_TYPE); } return type; }
class class_name[name] begin[{] method[getType, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], type] if[binary_operation[member[.type], ==, literal[null]]] begin[{] return[call[.getPropertyAsString, parameter[member[.FIELD_ITEM_TYPE]]]] else begin[{] None end[}] return[member[.type]] end[}] END[}]
Keyword[public] identifier[String] identifier[getType] operator[SEP] operator[SEP] { identifier[String] identifier[type] operator[=] identifier[getPropertyAsString] operator[SEP] identifier[FIELD_TYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[getPropertyAsString] operator[SEP] identifier[FIELD_ITEM_TYPE] operator[SEP] operator[SEP] } Keyword[return] identifier[type] operator[SEP] }
public static String format(Date date) { Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); StringBuffer sb = new StringBuffer(); c.setTime(date); sb.append(w4.format(c.get(Calendar.YEAR))); sb.append(w2.format(c.get(Calendar.MONTH)+1)); sb.append(w2.format(c.get(Calendar.DAY_OF_MONTH))); sb.append(w2.format(c.get(Calendar.HOUR_OF_DAY))); sb.append(w2.format(c.get(Calendar.MINUTE))); sb.append(w2.format(c.get(Calendar.SECOND))); return sb.toString(); }
class class_name[name] begin[{] method[format, return_type[type[String]], modifier[public static], parameter[date]] begin[{] local_variable[type[Calendar], c] local_variable[type[StringBuffer], sb] call[c.setTime, parameter[member[.date]]] call[sb.append, parameter[call[w4.format, parameter[call[c.get, parameter[member[Calendar.YEAR]]]]]]] call[sb.append, parameter[call[w2.format, parameter[binary_operation[call[c.get, parameter[member[Calendar.MONTH]]], +, literal[1]]]]]] call[sb.append, parameter[call[w2.format, parameter[call[c.get, parameter[member[Calendar.DAY_OF_MONTH]]]]]]] call[sb.append, parameter[call[w2.format, parameter[call[c.get, parameter[member[Calendar.HOUR_OF_DAY]]]]]]] call[sb.append, parameter[call[w2.format, parameter[call[c.get, parameter[member[Calendar.MINUTE]]]]]]] call[sb.append, parameter[call[w2.format, parameter[call[c.get, parameter[member[Calendar.SECOND]]]]]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[format] operator[SEP] identifier[Date] identifier[date] operator[SEP] { identifier[Calendar] identifier[c] operator[=] Keyword[new] identifier[GregorianCalendar] operator[SEP] identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[w4] operator[SEP] identifier[format] operator[SEP] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[YEAR] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[w2] operator[SEP] identifier[format] operator[SEP] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[MONTH] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[w2] operator[SEP] identifier[format] operator[SEP] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_MONTH] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[w2] operator[SEP] identifier[format] operator[SEP] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[w2] operator[SEP] identifier[format] operator[SEP] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[w2] operator[SEP] identifier[format] operator[SEP] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private Node parseParamTypeExpression(JsDocToken token) { boolean restArg = false; if (token == JsDocToken.ELLIPSIS) { token = next(); if (token == JsDocToken.RIGHT_CURLY) { restoreLookAhead(token); // EMPTY represents the UNKNOWN type in the Type AST. return wrapNode(Token.ELLIPSIS, IR.empty()); } restArg = true; } Node typeNode = parseTopLevelTypeExpression(token); if (typeNode != null) { skipEOLs(); if (restArg) { typeNode = wrapNode(Token.ELLIPSIS, typeNode); } else if (match(JsDocToken.EQUALS)) { next(); skipEOLs(); typeNode = wrapNode(Token.EQUALS, typeNode); } } return typeNode; }
class class_name[name] begin[{] method[parseParamTypeExpression, return_type[type[Node]], modifier[private], parameter[token]] begin[{] local_variable[type[boolean], restArg] if[binary_operation[member[.token], ==, member[JsDocToken.ELLIPSIS]]] begin[{] assign[member[.token], call[.next, parameter[]]] if[binary_operation[member[.token], ==, member[JsDocToken.RIGHT_CURLY]]] begin[{] call[.restoreLookAhead, parameter[member[.token]]] return[call[.wrapNode, parameter[member[Token.ELLIPSIS], call[IR.empty, parameter[]]]]] else begin[{] None end[}] assign[member[.restArg], literal[true]] else begin[{] None end[}] local_variable[type[Node], typeNode] if[binary_operation[member[.typeNode], !=, literal[null]]] begin[{] call[.skipEOLs, parameter[]] if[member[.restArg]] begin[{] assign[member[.typeNode], call[.wrapNode, parameter[member[Token.ELLIPSIS], member[.typeNode]]]] else begin[{] if[call[.match, parameter[member[JsDocToken.EQUALS]]]] begin[{] call[.next, parameter[]] call[.skipEOLs, parameter[]] assign[member[.typeNode], call[.wrapNode, parameter[member[Token.EQUALS], member[.typeNode]]]] else begin[{] None end[}] end[}] else begin[{] None end[}] return[member[.typeNode]] end[}] END[}]
Keyword[private] identifier[Node] identifier[parseParamTypeExpression] operator[SEP] identifier[JsDocToken] identifier[token] operator[SEP] { Keyword[boolean] identifier[restArg] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[==] identifier[JsDocToken] operator[SEP] identifier[ELLIPSIS] operator[SEP] { identifier[token] operator[=] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[==] identifier[JsDocToken] operator[SEP] identifier[RIGHT_CURLY] operator[SEP] { identifier[restoreLookAhead] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[return] identifier[wrapNode] operator[SEP] identifier[Token] operator[SEP] identifier[ELLIPSIS] , identifier[IR] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[restArg] operator[=] literal[boolean] operator[SEP] } identifier[Node] identifier[typeNode] operator[=] identifier[parseTopLevelTypeExpression] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeNode] operator[!=] Other[null] operator[SEP] { identifier[skipEOLs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[restArg] operator[SEP] { identifier[typeNode] operator[=] identifier[wrapNode] operator[SEP] identifier[Token] operator[SEP] identifier[ELLIPSIS] , identifier[typeNode] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[match] operator[SEP] identifier[JsDocToken] operator[SEP] identifier[EQUALS] operator[SEP] operator[SEP] { identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[skipEOLs] operator[SEP] operator[SEP] operator[SEP] identifier[typeNode] operator[=] identifier[wrapNode] operator[SEP] identifier[Token] operator[SEP] identifier[EQUALS] , identifier[typeNode] operator[SEP] operator[SEP] } } Keyword[return] identifier[typeNode] operator[SEP] }
public void save(XMLWriter w) throws KNXMLException { final List att = new ArrayList(); att.add(new Attribute(ATTR_TYPE, getType())); w.writeElement(TAG_ADDRESS, att, Integer.toString(address)); w.endElement(); }
class class_name[name] begin[{] method[save, return_type[void], modifier[public], parameter[w]] begin[{] local_variable[type[List], att] call[att.add, parameter[ClassCreator(arguments=[MemberReference(member=ATTR_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[w.writeElement, parameter[member[.TAG_ADDRESS], member[.att], call[Integer.toString, parameter[member[.address]]]]] call[w.endElement, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[save] operator[SEP] identifier[XMLWriter] identifier[w] operator[SEP] Keyword[throws] identifier[KNXMLException] { Keyword[final] identifier[List] identifier[att] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[att] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[ATTR_TYPE] , identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[writeElement] operator[SEP] identifier[TAG_ADDRESS] , identifier[att] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[address] operator[SEP] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[endElement] operator[SEP] operator[SEP] operator[SEP] }
private void applySettings() { container.reset(); infoPanel.reset(); // create the list of options. List<String> options = new ArrayList<>(Arrays.asList(OPTIONS_ARRAY)); if (cbNullOption.isSelected()) { options.add(0, ""); } // create the dropdown. final WDropdown dropdown = new WDropdown(options); // set the dropdown type. dropdown.setType((DropdownType) rbsDDType.getSelected()); // set the selected option if applicable. String selected = (String) rgDefaultOption.getSelected(); if (selected != null && !NONE.equals(selected)) { dropdown.setSelected(selected); } // set the width. if (nfWidth.getValue() != null) { dropdown.setOptionWidth(nfWidth.getValue().intValue()); } // set the tool tip. if (tfToolTip.getText() != null && tfToolTip.getText().length() > 0) { dropdown.setToolTip(tfToolTip.getText()); } // set misc options. dropdown.setVisible(cbVisible.isSelected()); dropdown.setDisabled(cbDisabled.isSelected()); // add the action for action on change, ajax and subordinate. if (cbActionOnChange.isSelected() || cbAjax.isSelected() || cbSubmitOnChange.isSelected()) { final WStyledText info = new WStyledText(); info.setWhitespaceMode(WhitespaceMode.PRESERVE); infoPanel.add(info); dropdown.setActionOnChange(new Action() { @Override public void execute(final ActionEvent event) { String selectedOption = (String) dropdown.getSelected(); info.setText(selectedOption); } }); } // this has to be below the set action on change so it is // not over written. dropdown.setSubmitOnChange(cbSubmitOnChange.isSelected()); // add the ajax target. if (cbAjax.isSelected()) { WAjaxControl update = new WAjaxControl(dropdown); update.addTarget(infoPanel); container.add(update); } // add the subordinate stuff. if (rbsDDType.getValue() == WDropdown.DropdownType.COMBO) { //This is to work around a WComponent Subordinate logic flaw. cbSubordinate.setSelected(false); } if (cbSubordinate.isSelected()) { WComponentGroup<SubordinateTarget> group = new WComponentGroup<>(); container.add(group); WSubordinateControl control = new WSubordinateControl(); container.add(control); for (String option : OPTIONS_ARRAY) { buildSubordinatePanel(dropdown, option, group, control); } // add a rule for none selected. Rule rule = new Rule(); control.addRule(rule); rule.setCondition(new Equal(dropdown, "")); rule.addActionOnTrue(new Hide(group)); } WFieldLayout flay = new WFieldLayout(); flay.setLabelWidth(25); container.add(flay); flay.addField("Configured dropdown", dropdown); flay.addField((WLabel) null, new WButton("Submit")); }
class class_name[name] begin[{] method[applySettings, return_type[void], modifier[private], parameter[]] begin[{] call[container.reset, parameter[]] call[infoPanel.reset, parameter[]] local_variable[type[List], options] if[call[cbNullOption.isSelected, parameter[]]] begin[{] call[options.add, parameter[literal[0], literal[""]]] else begin[{] None end[}] local_variable[type[WDropdown], dropdown] call[dropdown.setType, parameter[Cast(expression=MethodInvocation(arguments=[], member=getSelected, postfix_operators=[], prefix_operators=[], qualifier=rbsDDType, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DropdownType, sub_type=None))]] local_variable[type[String], selected] if[binary_operation[binary_operation[member[.selected], !=, literal[null]], &&, call[NONE.equals, parameter[member[.selected]]]]] begin[{] call[dropdown.setSelected, parameter[member[.selected]]] else begin[{] None end[}] if[binary_operation[call[nfWidth.getValue, parameter[]], !=, literal[null]]] begin[{] call[dropdown.setOptionWidth, parameter[call[nfWidth.getValue, parameter[]]]] else begin[{] None end[}] if[binary_operation[binary_operation[call[tfToolTip.getText, parameter[]], !=, literal[null]], &&, binary_operation[call[tfToolTip.getText, parameter[]], >, literal[0]]]] begin[{] call[dropdown.setToolTip, parameter[call[tfToolTip.getText, parameter[]]]] else begin[{] None end[}] call[dropdown.setVisible, parameter[call[cbVisible.isSelected, parameter[]]]] call[dropdown.setDisabled, parameter[call[cbDisabled.isSelected, parameter[]]]] if[binary_operation[binary_operation[call[cbActionOnChange.isSelected, parameter[]], ||, call[cbAjax.isSelected, parameter[]]], ||, call[cbSubmitOnChange.isSelected, parameter[]]]] begin[{] local_variable[type[WStyledText], info] call[info.setWhitespaceMode, parameter[member[WhitespaceMode.PRESERVE]]] call[infoPanel.add, parameter[member[.info]]] call[dropdown.setActionOnChange, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getSelected, postfix_operators=[], prefix_operators=[], qualifier=dropdown, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=selectedOption)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=selectedOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setText, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=event, type=ReferenceType(arguments=None, dimensions=[], name=ActionEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Action, sub_type=None))]] else begin[{] None end[}] call[dropdown.setSubmitOnChange, parameter[call[cbSubmitOnChange.isSelected, parameter[]]]] if[call[cbAjax.isSelected, parameter[]]] begin[{] local_variable[type[WAjaxControl], update] call[update.addTarget, parameter[member[.infoPanel]]] call[container.add, parameter[member[.update]]] else begin[{] None end[}] if[binary_operation[call[rbsDDType.getValue, parameter[]], ==, member[WDropdown.DropdownType.COMBO]]] begin[{] call[cbSubordinate.setSelected, parameter[literal[false]]] else begin[{] None end[}] if[call[cbSubordinate.isSelected, parameter[]]] begin[{] local_variable[type[WComponentGroup], group] call[container.add, parameter[member[.group]]] local_variable[type[WSubordinateControl], control] call[container.add, parameter[member[.control]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dropdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=option, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=control, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildSubordinatePanel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=OPTIONS_ARRAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=option)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[Rule], rule] call[control.addRule, parameter[member[.rule]]] call[rule.setCondition, parameter[ClassCreator(arguments=[MemberReference(member=dropdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Equal, sub_type=None))]] call[rule.addActionOnTrue, parameter[ClassCreator(arguments=[MemberReference(member=group, 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=Hide, sub_type=None))]] else begin[{] None end[}] local_variable[type[WFieldLayout], flay] call[flay.setLabelWidth, parameter[literal[25]]] call[container.add, parameter[member[.flay]]] call[flay.addField, parameter[literal["Configured dropdown"], member[.dropdown]]] call[flay.addField, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=WLabel, sub_type=None)), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Submit")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WButton, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[applySettings] operator[SEP] operator[SEP] { identifier[container] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[infoPanel] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[options] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[OPTIONS_ARRAY] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cbNullOption] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] { identifier[options] operator[SEP] identifier[add] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[WDropdown] identifier[dropdown] operator[=] Keyword[new] identifier[WDropdown] operator[SEP] identifier[options] operator[SEP] operator[SEP] identifier[dropdown] operator[SEP] identifier[setType] operator[SEP] operator[SEP] identifier[DropdownType] operator[SEP] identifier[rbsDDType] operator[SEP] identifier[getSelected] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[selected] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[rgDefaultOption] operator[SEP] identifier[getSelected] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selected] operator[!=] Other[null] operator[&&] operator[!] identifier[NONE] operator[SEP] identifier[equals] operator[SEP] identifier[selected] operator[SEP] operator[SEP] { identifier[dropdown] operator[SEP] identifier[setSelected] operator[SEP] identifier[selected] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[nfWidth] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[dropdown] operator[SEP] identifier[setOptionWidth] operator[SEP] identifier[nfWidth] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tfToolTip] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[tfToolTip] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[dropdown] operator[SEP] identifier[setToolTip] operator[SEP] identifier[tfToolTip] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[dropdown] operator[SEP] identifier[setVisible] operator[SEP] identifier[cbVisible] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dropdown] operator[SEP] identifier[setDisabled] operator[SEP] identifier[cbDisabled] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cbActionOnChange] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[||] identifier[cbAjax] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[||] identifier[cbSubmitOnChange] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[WStyledText] identifier[info] operator[=] Keyword[new] identifier[WStyledText] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] identifier[setWhitespaceMode] operator[SEP] identifier[WhitespaceMode] operator[SEP] identifier[PRESERVE] operator[SEP] operator[SEP] identifier[infoPanel] operator[SEP] identifier[add] operator[SEP] identifier[info] operator[SEP] operator[SEP] identifier[dropdown] operator[SEP] identifier[setActionOnChange] operator[SEP] Keyword[new] identifier[Action] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] Keyword[final] identifier[ActionEvent] identifier[event] operator[SEP] { identifier[String] identifier[selectedOption] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[dropdown] operator[SEP] identifier[getSelected] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] identifier[setText] operator[SEP] identifier[selectedOption] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } identifier[dropdown] operator[SEP] identifier[setSubmitOnChange] operator[SEP] identifier[cbSubmitOnChange] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cbAjax] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] { identifier[WAjaxControl] identifier[update] operator[=] Keyword[new] identifier[WAjaxControl] operator[SEP] identifier[dropdown] operator[SEP] operator[SEP] identifier[update] operator[SEP] identifier[addTarget] operator[SEP] identifier[infoPanel] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[add] operator[SEP] identifier[update] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[rbsDDType] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] identifier[WDropdown] operator[SEP] identifier[DropdownType] operator[SEP] identifier[COMBO] operator[SEP] { identifier[cbSubordinate] operator[SEP] identifier[setSelected] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cbSubordinate] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] { identifier[WComponentGroup] operator[<] identifier[SubordinateTarget] operator[>] identifier[group] operator[=] Keyword[new] identifier[WComponentGroup] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[add] operator[SEP] identifier[group] operator[SEP] operator[SEP] identifier[WSubordinateControl] identifier[control] operator[=] Keyword[new] identifier[WSubordinateControl] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[add] operator[SEP] identifier[control] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[option] operator[:] identifier[OPTIONS_ARRAY] operator[SEP] { identifier[buildSubordinatePanel] operator[SEP] identifier[dropdown] , identifier[option] , identifier[group] , identifier[control] operator[SEP] operator[SEP] } identifier[Rule] identifier[rule] operator[=] Keyword[new] identifier[Rule] operator[SEP] operator[SEP] operator[SEP] identifier[control] operator[SEP] identifier[addRule] operator[SEP] identifier[rule] operator[SEP] operator[SEP] identifier[rule] operator[SEP] identifier[setCondition] operator[SEP] Keyword[new] identifier[Equal] operator[SEP] identifier[dropdown] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[rule] operator[SEP] identifier[addActionOnTrue] operator[SEP] Keyword[new] identifier[Hide] operator[SEP] identifier[group] operator[SEP] operator[SEP] operator[SEP] } identifier[WFieldLayout] identifier[flay] operator[=] Keyword[new] identifier[WFieldLayout] operator[SEP] operator[SEP] operator[SEP] identifier[flay] operator[SEP] identifier[setLabelWidth] operator[SEP] Other[25] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[add] operator[SEP] identifier[flay] operator[SEP] operator[SEP] identifier[flay] operator[SEP] identifier[addField] operator[SEP] literal[String] , identifier[dropdown] operator[SEP] operator[SEP] identifier[flay] operator[SEP] identifier[addField] operator[SEP] operator[SEP] identifier[WLabel] operator[SEP] Other[null] , Keyword[new] identifier[WButton] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] }
public static double averageCommonFeatureRank(double[] a, double[] b) { class Pair{ public int i; public double v; public Pair(int index, double value){i=index;v=value;} public void set(int index, double value){ i=index; v=value; } } class PairCompare implements Comparator<Pair>{ // note that 1 and -1 have been switched so that sort will sort in // descending order // this method sorts by value first, then by index public int compare(Pair o1, Pair o2){ if(o1.v < o2.v) return 1; else if(o1.v > o2.v) return -1; else{ if(o1.i < o2.i) return 1; else if(o1.i > o2.i) return -1; return 0; } } public boolean equals(Pair o1, Pair o2){ return (compare(o1,o2)==0)?true:false; } } check(a, b); int size=a.length; // number of features to compare // calculate how much 10% is, rounded up. //int n = (int)Math.ceil(a.length/10.0); int n = 20; // generate array of index-value pairs for a Pair[] a_index = new Pair[size]; for(int i=0;i<size;i++) a_index[i] = new Pair(i,a[i]); // generate array of index-value pairs for b Pair[] b_index = new Pair[size]; for(int i=0;i<size;i++) b_index[i] = new Pair(i,b[i]); // sort the features in a_rank by weight Arrays.sort(a_index, new PairCompare()); // sort the features in b_rank by weight Arrays.sort(b_index, new PairCompare()); // a_index are index-value pairs, ordered by rank // this loop changes to a_rank which are rank-value, ordered by index // make indices start at 1 so inv(ind) is defined for all indices Pair[] a_rank = new Pair[size]; int last_i = 1; for(int i=0;i<size;i++){ Pair x = a_index[i]; // share rank if tied if(i>0 && a_index[i].v==a_index[i-1].v) a_rank[x.i] = new Pair(last_i,x.v); else{ a_rank[x.i] = new Pair(i+1,x.v); last_i=i+1; } } // do the same for b_index and b_rank last_i=1; Pair[] b_rank = new Pair[size]; for(int i=0;i<size;i++){ Pair x = b_index[i]; // share rank if tied if(i>0 && b_index[i].v==b_index[i-1].v) b_rank[x.i] = new Pair(last_i,x.v); else{ b_rank[x.i] = new Pair(i+1,x.v); last_i=i+1; } } // get best ranked n elements // nTop will be the top n ranking dimensions by weight // where nTop[i] is the ith highest ranking dimension (i.e. feature) int[] nTop = new int[n]; boolean[] seenbefore = new boolean[size]; Arrays.fill(seenbefore,false); int a_i=0; int b_i=0; for(int i=0;i<n;i++){ // skip over features already encountered while(a_i<size && seenbefore[a_index[a_i].i]) a_i++; while(b_i<size && seenbefore[b_index[b_i].i]) b_i++; // assign rank by highest weight // select the index from A when max(A)>max(B) if(a_i<size && 1 == (new PairCompare()).compare(a_index[a_i],b_index[b_i]) ){ nTop[i] = a_index[a_i].i; seenbefore[nTop[i]]=true; a_i++; } else{ nTop[i] = b_index[b_i].i; seenbefore[nTop[i]]=true; b_i++; } } // computer the sum of the average rank for each top feature and divide // by the number of top features double sum = 0; for(int i=0;i<n;i++){ sum += 0.5*(a_rank[nTop[i]].i+b_rank[nTop[i]].i); } //return sum/n; return n/sum; }
class class_name[name] begin[{] method[averageCommonFeatureRank, return_type[type[double]], modifier[public static], parameter[a, b]] begin[{] class class_name[Pair] begin[{] type[int] field[i] type[double] field[v] method[Pair, modifier[public], parameter[index, value]] begin[{] assign[member[.i], member[.index]] assign[member[.v], member[.value]] end[}] method[set, return_type[void], modifier[public], parameter[index, value]] begin[{] assign[member[.i], member[.index]] assign[member[.v], member[.value]] end[}] END[}] class class_name[PairCompare] begin[{] method[compare, return_type[type[int]], modifier[public], parameter[o1, o2]] begin[{] if[binary_operation[member[o1.v], <, member[o2.v]]] begin[{] return[literal[1]] else begin[{] if[binary_operation[member[o1.v], >, member[o2.v]]] begin[{] return[literal[1]] else begin[{] if[binary_operation[member[o1.i], <, member[o2.i]]] begin[{] return[literal[1]] else begin[{] if[binary_operation[member[o1.i], >, member[o2.i]]] begin[{] return[literal[1]] else begin[{] None end[}] end[}] return[literal[0]] end[}] end[}] end[}] method[equals, return_type[type[boolean]], modifier[public], parameter[o1, o2]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true))] end[}] END[}] call[.check, parameter[member[.a], member[.b]]] local_variable[type[int], size] local_variable[type[int], n] local_variable[type[Pair], a_index] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=a_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=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=Pair, sub_type=None))), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, 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=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[Pair], b_index] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=b_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=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=Pair, sub_type=None))), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, 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=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[Arrays.sort, parameter[member[.a_index], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PairCompare, sub_type=None))]] call[Arrays.sort, parameter[member[.b_index], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PairCompare, sub_type=None))]] local_variable[type[Pair], a_rank] local_variable[type[int], last_i] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=a_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=x)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pair, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=a_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=v, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=a_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), MemberReference(member=v, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=a_rank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[]))]), type==, value=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pair, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=last_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=a_rank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=last_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pair, sub_type=None))), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, 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=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.last_i], literal[1]] local_variable[type[Pair], b_rank] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=b_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=x)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pair, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=b_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=v, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=b_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), MemberReference(member=v, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b_rank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[]))]), type==, value=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pair, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=last_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=b_rank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=last_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pair, sub_type=None))), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, 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=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[int], nTop] local_variable[type[boolean], seenbefore] call[Arrays.fill, parameter[member[.seenbefore], literal[false]]] local_variable[type[int], a_i] local_variable[type[int], b_i] ForStatement(body=BlockStatement(label=None, statements=[WhileStatement(body=StatementExpression(expression=MemberReference(member=a_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=a_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=MemberReference(member=seenbefore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=a_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=a_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=i, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), operator=&&), label=None), WhileStatement(body=StatementExpression(expression=MemberReference(member=b_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=MemberReference(member=seenbefore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=i, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), operator=&&), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=a_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=a_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=a_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=b_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=compare, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PairCompare, sub_type=None)), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=b_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=i, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seenbefore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MemberReference(member=b_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=a_index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=a_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=i, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seenbefore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MemberReference(member=a_i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[double], sum] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.5), operandr=BinaryOperation(operandl=MemberReference(member=a_rank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), MemberReference(member=i, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=b_rank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), MemberReference(member=i, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[binary_operation[member[.n], /, member[.sum]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[averageCommonFeatureRank] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[a] , Keyword[double] operator[SEP] operator[SEP] identifier[b] operator[SEP] { Keyword[class] identifier[Pair] { Keyword[public] Keyword[int] identifier[i] operator[SEP] Keyword[public] Keyword[double] identifier[v] operator[SEP] Keyword[public] identifier[Pair] operator[SEP] Keyword[int] identifier[index] , Keyword[double] identifier[value] operator[SEP] { identifier[i] operator[=] identifier[index] operator[SEP] identifier[v] operator[=] identifier[value] operator[SEP] } Keyword[public] Keyword[void] identifier[set] operator[SEP] Keyword[int] identifier[index] , Keyword[double] identifier[value] operator[SEP] { identifier[i] operator[=] identifier[index] operator[SEP] identifier[v] operator[=] identifier[value] operator[SEP] } } Keyword[class] identifier[PairCompare] Keyword[implements] identifier[Comparator] operator[<] identifier[Pair] operator[>] { Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[Pair] identifier[o1] , identifier[Pair] identifier[o2] operator[SEP] { Keyword[if] operator[SEP] identifier[o1] operator[SEP] identifier[v] operator[<] identifier[o2] operator[SEP] identifier[v] operator[SEP] Keyword[return] Other[1] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o1] operator[SEP] identifier[v] operator[>] identifier[o2] operator[SEP] identifier[v] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[else] { Keyword[if] operator[SEP] identifier[o1] operator[SEP] identifier[i] operator[<] identifier[o2] operator[SEP] identifier[i] operator[SEP] Keyword[return] Other[1] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o1] operator[SEP] identifier[i] operator[>] identifier[o2] operator[SEP] identifier[i] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[return] Other[0] operator[SEP] } } Keyword[public] Keyword[boolean] identifier[equals] operator[SEP] identifier[Pair] identifier[o1] , identifier[Pair] identifier[o2] operator[SEP] { Keyword[return] operator[SEP] identifier[compare] operator[SEP] identifier[o1] , identifier[o2] operator[SEP] operator[==] Other[0] operator[SEP] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] } } identifier[check] operator[SEP] identifier[a] , identifier[b] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[a] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[n] operator[=] Other[20] operator[SEP] identifier[Pair] operator[SEP] operator[SEP] identifier[a_index] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[a_index] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[i] , identifier[a] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[Pair] operator[SEP] operator[SEP] identifier[b_index] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[b_index] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[i] , identifier[b] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[a_index] , Keyword[new] identifier[PairCompare] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[b_index] , Keyword[new] identifier[PairCompare] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Pair] operator[SEP] operator[SEP] identifier[a_rank] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[int] identifier[last_i] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Pair] identifier[x] operator[=] identifier[a_index] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[&&] identifier[a_index] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[v] operator[==] identifier[a_index] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[a_rank] operator[SEP] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[last_i] , identifier[x] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[else] { identifier[a_rank] operator[SEP] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[i] operator[+] Other[1] , identifier[x] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[last_i] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } } identifier[last_i] operator[=] Other[1] operator[SEP] identifier[Pair] operator[SEP] operator[SEP] identifier[b_rank] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Pair] identifier[x] operator[=] identifier[b_index] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[&&] identifier[b_index] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[v] operator[==] identifier[b_index] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[b_rank] operator[SEP] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[last_i] , identifier[x] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[else] { identifier[b_rank] operator[SEP] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[Pair] operator[SEP] identifier[i] operator[+] Other[1] , identifier[x] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[last_i] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } } Keyword[int] operator[SEP] operator[SEP] identifier[nTop] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] identifier[seenbefore] operator[=] Keyword[new] Keyword[boolean] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[seenbefore] , literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[a_i] operator[=] Other[0] operator[SEP] Keyword[int] identifier[b_i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[while] operator[SEP] identifier[a_i] operator[<] identifier[size] operator[&&] identifier[seenbefore] operator[SEP] identifier[a_index] operator[SEP] identifier[a_i] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[a_i] operator[++] operator[SEP] Keyword[while] operator[SEP] identifier[b_i] operator[<] identifier[size] operator[&&] identifier[seenbefore] operator[SEP] identifier[b_index] operator[SEP] identifier[b_i] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[b_i] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[a_i] operator[<] identifier[size] operator[&&] Other[1] operator[==] operator[SEP] Keyword[new] identifier[PairCompare] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[compare] operator[SEP] identifier[a_index] operator[SEP] identifier[a_i] operator[SEP] , identifier[b_index] operator[SEP] identifier[b_i] operator[SEP] operator[SEP] operator[SEP] { identifier[nTop] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[a_index] operator[SEP] identifier[a_i] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[seenbefore] operator[SEP] identifier[nTop] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[a_i] operator[++] operator[SEP] } Keyword[else] { identifier[nTop] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[b_index] operator[SEP] identifier[b_i] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[seenbefore] operator[SEP] identifier[nTop] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[b_i] operator[++] operator[SEP] } } Keyword[double] identifier[sum] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sum] operator[+=] literal[Float] operator[*] operator[SEP] identifier[a_rank] operator[SEP] identifier[nTop] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[+] identifier[b_rank] operator[SEP] identifier[nTop] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[n] operator[/] identifier[sum] operator[SEP] }
public static <T> CloseableIterable<T> chain(final Iterable<? extends CloseableIterable<? extends T>> iterables) { requireNonNull(iterables); //Don't use CloseableIterators here, as Iterables can reiterate over their data //and don't want to close it on them. return new FluentCloseableIterable<T>() { @Override protected void doClose() { for (CloseableIterable<? extends T> curr : iterables) curr.closeQuietly(); } @Override protected Iterator<T> retrieveIterator() { return Iterators.concat(iterators(iterables)); } }; }
class class_name[name] begin[{] method[chain, return_type[type[CloseableIterable]], modifier[public static], parameter[iterables]] begin[{] call[.requireNonNull, parameter[member[.iterables]]] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=curr, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=iterables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=curr)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=CloseableIterable, sub_type=None))), label=None)], documentation=None, modifiers={'protected'}, name=doClose, parameters=[], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=iterables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=iterators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=concat, postfix_operators=[], prefix_operators=[], qualifier=Iterators, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=retrieveIterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=FluentCloseableIterable, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[CloseableIterable] operator[<] identifier[T] operator[>] identifier[chain] operator[SEP] Keyword[final] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[CloseableIterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[iterables] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[iterables] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[FluentCloseableIterable] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[doClose] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[CloseableIterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[curr] operator[:] identifier[iterables] operator[SEP] identifier[curr] operator[SEP] identifier[closeQuietly] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[protected] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[retrieveIterator] operator[SEP] operator[SEP] { Keyword[return] identifier[Iterators] operator[SEP] identifier[concat] operator[SEP] identifier[iterators] operator[SEP] identifier[iterables] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
private boolean isParentFirst(String resourceName) { // default to the global setting and then see // if this class belongs to a package which has been // designated to use a specific loader first // (this one or the parent one) // TODO shouldn't this always return false in isolated mode? boolean useParentFirst = parentFirst; for (Enumeration e = systemPackages.elements(); e.hasMoreElements();) { String packageName = (String) e.nextElement(); if (resourceName.startsWith(packageName)) { useParentFirst = true; break; } } for (Enumeration e = loaderPackages.elements(); e.hasMoreElements();) { String packageName = (String) e.nextElement(); if (resourceName.startsWith(packageName)) { useParentFirst = false; break; } } return useParentFirst; }
class class_name[name] begin[{] method[isParentFirst, return_type[type[boolean]], modifier[private], parameter[resourceName]] begin[{] local_variable[type[boolean], useParentFirst] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=packageName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=resourceName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=useParentFirst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=elements, postfix_operators=[], prefix_operators=[], qualifier=systemPackages, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), update=None), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=packageName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=resourceName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=useParentFirst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=elements, postfix_operators=[], prefix_operators=[], qualifier=loaderPackages, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), update=None), label=None) return[member[.useParentFirst]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isParentFirst] operator[SEP] identifier[String] identifier[resourceName] operator[SEP] { Keyword[boolean] identifier[useParentFirst] operator[=] identifier[parentFirst] operator[SEP] Keyword[for] operator[SEP] identifier[Enumeration] identifier[e] operator[=] identifier[systemPackages] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[packageName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceName] operator[SEP] identifier[startsWith] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] { identifier[useParentFirst] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[for] operator[SEP] identifier[Enumeration] identifier[e] operator[=] identifier[loaderPackages] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[packageName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceName] operator[SEP] identifier[startsWith] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] { identifier[useParentFirst] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[useParentFirst] operator[SEP] }
public boolean sendsStringParametersAsUnicode() { if (sendsStringParametersAsUnicode == null) { try { if (getConnection() instanceof JdbcConnection) { PreparedStatement ps = null; ResultSet rs = null; try { String sql = "SELECT CONVERT([sysname], SQL_VARIANT_PROPERTY(?, 'BaseType'))"; ps = ((JdbcConnection) getConnection()).prepareStatement(sql); ps.setString(1, "Liquibase"); rs = ps.executeQuery(); String baseType = null; if (rs.next()) { baseType = rs.getString(1); } // baseTypes starting with "n" can be something like nvarchar (or nchar) sendsStringParametersAsUnicode = (baseType == null) || baseType.startsWith("n"); } finally { JdbcUtils.close(rs, ps); } } else if (getConnection() instanceof OfflineConnection) { sendsStringParametersAsUnicode = ((OfflineConnection) getConnection()).getSendsStringParametersAsUnicode(); } } catch (SQLException | DatabaseException e) { Scope.getCurrentScope().getLog(getClass()).warning( LogType.LOG, "Cannot determine whether String parameters are sent as Unicode for MSSQL", e); } } return (sendsStringParametersAsUnicode == null) ? true : sendsStringParametersAsUnicode; }
class class_name[name] begin[{] method[sendsStringParametersAsUnicode, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.sendsStringParametersAsUnicode], ==, literal[null]]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=JdbcConnection, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=OfflineConnection, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sendsStringParametersAsUnicode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=OfflineConnection, sub_type=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=ps)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PreparedStatement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=rs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResultSet, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SELECT CONVERT([sysname], SQL_VARIANT_PROPERTY(?, 'BaseType'))"), name=sql)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JdbcConnection, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Liquibase")], member=setString, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=baseType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=baseType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getString, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sendsStringParametersAsUnicode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=baseType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="n")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=baseType, selectors=[], type_arguments=None), operator=||)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=JdbcUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getCurrentScope, postfix_operators=[], prefix_operators=[], qualifier=Scope, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getLog, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG, postfix_operators=[], prefix_operators=[], qualifier=LogType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot determine whether String parameters are sent as Unicode for MSSQL"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warning, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException', 'DatabaseException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=sendsStringParametersAsUnicode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=sendsStringParametersAsUnicode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true))] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[sendsStringParametersAsUnicode] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[sendsStringParametersAsUnicode] operator[==] Other[null] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] Keyword[instanceof] identifier[JdbcConnection] operator[SEP] { identifier[PreparedStatement] identifier[ps] operator[=] Other[null] operator[SEP] identifier[ResultSet] identifier[rs] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[String] identifier[sql] operator[=] literal[String] operator[SEP] identifier[ps] operator[=] operator[SEP] operator[SEP] identifier[JdbcConnection] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[sql] operator[SEP] operator[SEP] identifier[ps] operator[SEP] identifier[setString] operator[SEP] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[rs] operator[=] identifier[ps] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[baseType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { identifier[baseType] operator[=] identifier[rs] operator[SEP] identifier[getString] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[sendsStringParametersAsUnicode] operator[=] operator[SEP] identifier[baseType] operator[==] Other[null] operator[SEP] operator[||] identifier[baseType] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[finally] { identifier[JdbcUtils] operator[SEP] identifier[close] operator[SEP] identifier[rs] , identifier[ps] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] Keyword[instanceof] identifier[OfflineConnection] operator[SEP] { identifier[sendsStringParametersAsUnicode] operator[=] operator[SEP] operator[SEP] identifier[OfflineConnection] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getSendsStringParametersAsUnicode] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[SQLException] operator[|] identifier[DatabaseException] identifier[e] operator[SEP] { identifier[Scope] operator[SEP] identifier[getCurrentScope] operator[SEP] operator[SEP] operator[SEP] identifier[getLog] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[warning] operator[SEP] identifier[LogType] operator[SEP] identifier[LOG] , literal[String] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] operator[SEP] identifier[sendsStringParametersAsUnicode] operator[==] Other[null] operator[SEP] operator[?] literal[boolean] operator[:] identifier[sendsStringParametersAsUnicode] operator[SEP] }
public static dnsview[] get(nitro_service service, String viewname[]) throws Exception{ if (viewname !=null && viewname.length>0) { dnsview response[] = new dnsview[viewname.length]; dnsview obj[] = new dnsview[viewname.length]; for (int i=0;i<viewname.length;i++) { obj[i] = new dnsview(); obj[i].set_viewname(viewname[i]); response[i] = (dnsview) obj[i].get_resource(service); } return response; } return null; }
class class_name[name] begin[{] method[get, return_type[type[dnsview]], modifier[public static], parameter[service, viewname]] begin[{] if[binary_operation[binary_operation[member[.viewname], !=, literal[null]], &&, binary_operation[member[viewname.length], >, literal[0]]]] begin[{] local_variable[type[dnsview], response] local_variable[type[dnsview], obj] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=dnsview, sub_type=None))), label=None), StatementExpression(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=viewname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=set_viewname, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_resource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=dnsview, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=viewname, 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[.response]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[dnsview] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[viewname] operator[SEP] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[viewname] operator[!=] Other[null] operator[&&] identifier[viewname] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[dnsview] identifier[response] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[dnsview] operator[SEP] identifier[viewname] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[dnsview] identifier[obj] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[dnsview] operator[SEP] identifier[viewname] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[viewname] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[obj] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[dnsview] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[set_viewname] operator[SEP] identifier[viewname] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[dnsview] operator[SEP] identifier[obj] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[get_resource] operator[SEP] identifier[service] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private Map<String, Properties> loadRegisteredMessageResources(String name) { Map<String, Properties> messageResources = new TreeMap<>(); // Load default messages Properties defaultMessages = loadMessages(String.format(name, "")); if (defaultMessages == null) { log.error("Could not locate the default messages resource '{}', please create it.", String.format(name, "")); } else { messageResources.put("", defaultMessages); } // Load the registered language resources List<String> registeredLanguages = languages.getRegisteredLanguages(); for (String language : registeredLanguages) { // First step: Load complete language eg. en-US Properties messages = loadMessages(String.format(name, "_" + language)); Properties messagesLangOnly = null; // If the language has a country code load the default values for // the language. For example missing keys in en-US will // be filled-in by the default language. String langComponent = languages.getLanguageComponent(language); if (!langComponent.equals(language)) { // see if we have already loaded the language messages messagesLangOnly = messageResources.get(langComponent); if (messagesLangOnly == null) { // load the language messages messagesLangOnly = loadMessages(String.format(name, "_" + langComponent)); } } // If a language is registered in application.properties it should // be there. if (messages == null) { log.error( "Could not locate the '{}' messages resource '{}' specified in '{}'.", language, String.format(name, "_" + language), PippoConstants.SETTING_APPLICATION_LANGUAGES); } else { // add a new language // start with the default messages Properties compositeMessages = new Properties(defaultMessages); // put all the language component messages "en" if (messagesLangOnly != null) { compositeMessages.putAll(messagesLangOnly); // cache language component messages if (!messageResources.containsKey(langComponent)) { Properties langResources = new Properties(); langResources.putAll(compositeMessages); messageResources.put(langComponent, langResources); } } // put all the language specific messages "en-US" compositeMessages.putAll(messages); // and add the composite messages to the hashmap with the // mapping. messageResources.put(language.toLowerCase(), compositeMessages); } } return Collections.unmodifiableMap(messageResources); }
class class_name[name] begin[{] method[loadRegisteredMessageResources, return_type[type[Map]], modifier[private], parameter[name]] begin[{] local_variable[type[Map], messageResources] local_variable[type[Properties], defaultMessages] if[binary_operation[member[.defaultMessages], ==, literal[null]]] begin[{] call[log.error, parameter[literal["Could not locate the default messages resource '{}', please create it."], call[String.format, parameter[member[.name], literal[""]]]]] else begin[{] call[messageResources.put, parameter[literal[""], member[.defaultMessages]]] end[}] local_variable[type[List], registeredLanguages] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_"), operandr=MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=loadMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=messages)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=messagesLangOnly)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLanguageComponent, postfix_operators=[], prefix_operators=[], qualifier=languages, selectors=[], type_arguments=None), name=langComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=langComponent, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=messagesLangOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=langComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=messageResources, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=messagesLangOnly, 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=messagesLangOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_"), operandr=MemberReference(member=langComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=loadMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=defaultMessages, 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=Properties, sub_type=None)), name=compositeMessages)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=messagesLangOnly, 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=messagesLangOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=compositeMessages, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=langComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=messageResources, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None)), name=langResources)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=compositeMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=langResources, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=langComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=langResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=messageResources, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=compositeMessages, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=language, selectors=[], type_arguments=None), MemberReference(member=compositeMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=messageResources, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not locate the '{}' messages resource '{}' specified in '{}'."), MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_"), operandr=MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=SETTING_APPLICATION_LANGUAGES, postfix_operators=[], prefix_operators=[], qualifier=PippoConstants, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=registeredLanguages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=language)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[Collections.unmodifiableMap, parameter[member[.messageResources]]]] end[}] END[}]
Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[Properties] operator[>] identifier[loadRegisteredMessageResources] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Properties] operator[>] identifier[messageResources] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Properties] identifier[defaultMessages] operator[=] identifier[loadMessages] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[name] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[defaultMessages] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[name] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[messageResources] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[defaultMessages] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[registeredLanguages] operator[=] identifier[languages] operator[SEP] identifier[getRegisteredLanguages] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[language] operator[:] identifier[registeredLanguages] operator[SEP] { identifier[Properties] identifier[messages] operator[=] identifier[loadMessages] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[name] , literal[String] operator[+] identifier[language] operator[SEP] operator[SEP] operator[SEP] identifier[Properties] identifier[messagesLangOnly] operator[=] Other[null] operator[SEP] identifier[String] identifier[langComponent] operator[=] identifier[languages] operator[SEP] identifier[getLanguageComponent] operator[SEP] identifier[language] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[langComponent] operator[SEP] identifier[equals] operator[SEP] identifier[language] operator[SEP] operator[SEP] { identifier[messagesLangOnly] operator[=] identifier[messageResources] operator[SEP] identifier[get] operator[SEP] identifier[langComponent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[messagesLangOnly] operator[==] Other[null] operator[SEP] { identifier[messagesLangOnly] operator[=] identifier[loadMessages] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[name] , literal[String] operator[+] identifier[langComponent] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[messages] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[language] , identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[name] , literal[String] operator[+] identifier[language] operator[SEP] , identifier[PippoConstants] operator[SEP] identifier[SETTING_APPLICATION_LANGUAGES] operator[SEP] operator[SEP] } Keyword[else] { identifier[Properties] identifier[compositeMessages] operator[=] Keyword[new] identifier[Properties] operator[SEP] identifier[defaultMessages] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[messagesLangOnly] operator[!=] Other[null] operator[SEP] { identifier[compositeMessages] operator[SEP] identifier[putAll] operator[SEP] identifier[messagesLangOnly] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[messageResources] operator[SEP] identifier[containsKey] operator[SEP] identifier[langComponent] operator[SEP] operator[SEP] { identifier[Properties] identifier[langResources] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[langResources] operator[SEP] identifier[putAll] operator[SEP] identifier[compositeMessages] operator[SEP] operator[SEP] identifier[messageResources] operator[SEP] identifier[put] operator[SEP] identifier[langComponent] , identifier[langResources] operator[SEP] operator[SEP] } } identifier[compositeMessages] operator[SEP] identifier[putAll] operator[SEP] identifier[messages] operator[SEP] operator[SEP] identifier[messageResources] operator[SEP] identifier[put] operator[SEP] identifier[language] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] , identifier[compositeMessages] operator[SEP] operator[SEP] } } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[messageResources] operator[SEP] operator[SEP] }
public void getAllMasteryID(Callback<List<Integer>> callback) throws NullPointerException { gw2API.getAllMasteryIDs().enqueue(callback); }
class class_name[name] begin[{] method[getAllMasteryID, return_type[void], modifier[public], parameter[callback]] begin[{] call[gw2API.getAllMasteryIDs, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[getAllMasteryID] operator[SEP] identifier[Callback] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[callback] operator[SEP] Keyword[throws] identifier[NullPointerException] { identifier[gw2API] operator[SEP] identifier[getAllMasteryIDs] operator[SEP] operator[SEP] operator[SEP] identifier[enqueue] operator[SEP] identifier[callback] operator[SEP] operator[SEP] }
protected List<EmailAttachment<? extends DataSource>> filterEmbeddedAttachments(final List<EmailAttachment<? extends DataSource>> attachments, final EmailMessage emailMessage) { final List<EmailAttachment<? extends DataSource>> embeddedAttachments = new ArrayList<>(); if (attachments == null || attachments.isEmpty() || emailMessage == null) { return embeddedAttachments; } final Iterator<EmailAttachment<? extends DataSource>> iterator = attachments.iterator(); while (iterator.hasNext()) { final EmailAttachment<? extends DataSource> emailAttachment = iterator.next(); if (emailAttachment.isEmbeddedInto(emailMessage)) { embeddedAttachments.add(emailAttachment); iterator.remove(); } } return embeddedAttachments; }
class class_name[name] begin[{] method[filterEmbeddedAttachments, return_type[type[List]], modifier[protected], parameter[attachments, emailMessage]] begin[{] local_variable[type[List], embeddedAttachments] if[binary_operation[binary_operation[binary_operation[member[.attachments], ==, literal[null]], ||, call[attachments.isEmpty, parameter[]]], ||, binary_operation[member[.emailMessage], ==, literal[null]]]] begin[{] return[member[.embeddedAttachments]] else begin[{] None end[}] local_variable[type[Iterator], iterator] while[call[iterator.hasNext, parameter[]]] begin[{] local_variable[type[EmailAttachment], emailAttachment] if[call[emailAttachment.isEmbeddedInto, parameter[member[.emailMessage]]]] begin[{] call[embeddedAttachments.add, parameter[member[.emailAttachment]]] call[iterator.remove, parameter[]] else begin[{] None end[}] end[}] return[member[.embeddedAttachments]] end[}] END[}]
Keyword[protected] identifier[List] operator[<] identifier[EmailAttachment] operator[<] operator[?] Keyword[extends] identifier[DataSource] operator[>] operator[>] identifier[filterEmbeddedAttachments] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[EmailAttachment] operator[<] operator[?] Keyword[extends] identifier[DataSource] operator[>] operator[>] identifier[attachments] , Keyword[final] identifier[EmailMessage] identifier[emailMessage] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[EmailAttachment] operator[<] operator[?] Keyword[extends] identifier[DataSource] operator[>] operator[>] identifier[embeddedAttachments] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attachments] operator[==] Other[null] operator[||] identifier[attachments] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[emailMessage] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[embeddedAttachments] operator[SEP] } Keyword[final] identifier[Iterator] operator[<] identifier[EmailAttachment] operator[<] operator[?] Keyword[extends] identifier[DataSource] operator[>] operator[>] identifier[iterator] operator[=] identifier[attachments] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[EmailAttachment] operator[<] operator[?] Keyword[extends] identifier[DataSource] operator[>] identifier[emailAttachment] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[emailAttachment] operator[SEP] identifier[isEmbeddedInto] operator[SEP] identifier[emailMessage] operator[SEP] operator[SEP] { identifier[embeddedAttachments] operator[SEP] identifier[add] operator[SEP] identifier[emailAttachment] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[embeddedAttachments] operator[SEP] }
public static void generateWhereByPrimaryKeyTo(XmlElement element, List<IntrospectedColumn> primaryKeyColumns, String prefix) { StringBuilder sb = new StringBuilder(); boolean and = false; for (IntrospectedColumn introspectedColumn : primaryKeyColumns) { sb.setLength(0); if (and) { sb.append(" and "); } else { sb.append("where "); and = true; } sb.append(MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn)); sb.append(" = "); sb.append(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, prefix)); element.addElement(new TextElement(sb.toString())); } }
class class_name[name] begin[{] method[generateWhereByPrimaryKeyTo, return_type[void], modifier[public static], parameter[element, primaryKeyColumns, prefix]] begin[{] local_variable[type[StringBuilder], sb] local_variable[type[boolean], and] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setLength, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=and, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="where ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=and, 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=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" and ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=introspectedColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEscapedColumnName, postfix_operators=[], prefix_operators=[], qualifier=MyBatis3FormattingUtilities, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=introspectedColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameterClause, postfix_operators=[], prefix_operators=[], qualifier=MyBatis3FormattingUtilities, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TextElement, sub_type=None))], member=addElement, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=primaryKeyColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=introspectedColumn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntrospectedColumn, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[generateWhereByPrimaryKeyTo] operator[SEP] identifier[XmlElement] identifier[element] , identifier[List] operator[<] identifier[IntrospectedColumn] operator[>] identifier[primaryKeyColumns] , identifier[String] identifier[prefix] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[and] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[IntrospectedColumn] identifier[introspectedColumn] operator[:] identifier[primaryKeyColumns] operator[SEP] { identifier[sb] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[and] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[and] operator[=] literal[boolean] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[MyBatis3FormattingUtilities] operator[SEP] identifier[getEscapedColumnName] operator[SEP] identifier[introspectedColumn] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[MyBatis3FormattingUtilities] operator[SEP] identifier[getParameterClause] operator[SEP] identifier[introspectedColumn] , identifier[prefix] operator[SEP] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[addElement] operator[SEP] Keyword[new] identifier[TextElement] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private boolean getLocalItemSupport(FPTree.Node node, int[] localItemSupport) { boolean end = true; Arrays.fill(localItemSupport, 0); while (node != null) { int support = node.count; Node parent = node.parent; while (parent != null) { localItemSupport[parent.id] += support; parent = parent.parent; end = false; } node = node.next; } return !end; }
class class_name[name] begin[{] method[getLocalItemSupport, return_type[type[boolean]], modifier[private], parameter[node, localItemSupport]] begin[{] local_variable[type[boolean], end] call[Arrays.fill, parameter[member[.localItemSupport], literal[0]]] while[binary_operation[member[.node], !=, literal[null]]] begin[{] local_variable[type[int], support] local_variable[type[Node], parent] while[binary_operation[member[.parent], !=, literal[null]]] begin[{] assign[member[.localItemSupport], member[.support]] assign[member[.parent], member[parent.parent]] assign[member[.end], literal[false]] end[}] assign[member[.node], member[node.next]] end[}] return[member[.end]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[getLocalItemSupport] operator[SEP] identifier[FPTree] operator[SEP] identifier[Node] identifier[node] , Keyword[int] operator[SEP] operator[SEP] identifier[localItemSupport] operator[SEP] { Keyword[boolean] identifier[end] operator[=] literal[boolean] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[localItemSupport] , Other[0] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[support] operator[=] identifier[node] operator[SEP] identifier[count] operator[SEP] identifier[Node] identifier[parent] operator[=] identifier[node] operator[SEP] identifier[parent] operator[SEP] Keyword[while] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] { identifier[localItemSupport] operator[SEP] identifier[parent] operator[SEP] identifier[id] operator[SEP] operator[+=] identifier[support] operator[SEP] identifier[parent] operator[=] identifier[parent] operator[SEP] identifier[parent] operator[SEP] identifier[end] operator[=] literal[boolean] operator[SEP] } identifier[node] operator[=] identifier[node] operator[SEP] identifier[next] operator[SEP] } Keyword[return] operator[!] identifier[end] operator[SEP] }
void chinv2(double[][] matrix, int n) { double temp; int i, j, k; /* ** invert the cholesky in the lower triangle ** take full advantage of the cholesky's diagonal of 1's */ for (i = 0; i < n; i++) { if (matrix[i][i] > 0) { matrix[i][i] = 1 / matrix[i][i]; /*this line inverts D */ for (j = (i + 1); j < n; j++) { matrix[j][i] = -matrix[j][i]; for (k = 0; k < i; k++) /*sweep operator */ { matrix[j][k] += matrix[j][i] * matrix[i][k]; } } } } /* ** lower triangle now contains inverse of cholesky ** calculate F'DF (inverse of cholesky decomp process) to get inverse ** of original matrix */ for (i = 0; i < n; i++) { if (matrix[i][i] == 0) { /* singular row */ for (j = 0; j < i; j++) { matrix[j][i] = 0; } for (j = i; j < n; j++) { matrix[i][j] = 0; } } else { for (j = (i + 1); j < n; j++) { temp = matrix[j][i] * matrix[j][j]; if (j != i) { matrix[i][j] = temp; } for (k = i; k < j; k++) { matrix[i][k] += temp * matrix[j][k]; } } } } }
class class_name[name] begin[{] method[chinv2, return_type[void], modifier[default], parameter[matrix, n]] begin[{] local_variable[type[double], temp] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=/)), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=matrix, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=BinaryOperation(operandl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=BinaryOperation(operandl=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, 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=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, 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), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, 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=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[void] identifier[chinv2] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[matrix] , Keyword[int] identifier[n] operator[SEP] { Keyword[double] identifier[temp] operator[SEP] Keyword[int] identifier[i] , identifier[j] , identifier[k] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[/] identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[j] operator[<] identifier[n] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[=] operator[-] identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[i] operator[SEP] identifier[k] operator[++] operator[SEP] { identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[+=] identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] } } } } Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[i] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP] } Keyword[for] operator[SEP] identifier[j] operator[=] identifier[i] operator[SEP] identifier[j] operator[<] identifier[n] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] Other[0] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] identifier[j] operator[=] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[j] operator[<] identifier[n] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[temp] operator[=] identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[j] operator[!=] identifier[i] operator[SEP] { identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[temp] operator[SEP] } Keyword[for] operator[SEP] identifier[k] operator[=] identifier[i] operator[SEP] identifier[k] operator[<] identifier[j] operator[SEP] identifier[k] operator[++] operator[SEP] { identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[+=] identifier[temp] operator[*] identifier[matrix] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] } } } } }
public TimestampInterval move( long amount, IsoUnit unit ) { if (amount == 0) { return this; } Boundary<PlainTimestamp> s; Boundary<PlainTimestamp> e; if (this.getStart().isInfinite()) { s = Boundary.infinitePast(); } else { s = Boundary.of( this.getStart().getEdge(), this.getStart().getTemporal().plus(amount, unit)); } if (this.getEnd().isInfinite()) { e = Boundary.infiniteFuture(); } else { e = Boundary.of( this.getEnd().getEdge(), this.getEnd().getTemporal().plus(amount, unit)); } return new TimestampInterval(s, e); }
class class_name[name] begin[{] method[move, return_type[type[TimestampInterval]], modifier[public], parameter[amount, unit]] begin[{] if[binary_operation[member[.amount], ==, literal[0]]] begin[{] return[THIS[]] else begin[{] None end[}] local_variable[type[Boundary], s] local_variable[type[Boundary], e] if[THIS[call[None.getStart, parameter[]]call[None.isInfinite, parameter[]]]] begin[{] assign[member[.s], call[Boundary.infinitePast, parameter[]]] else begin[{] assign[member[.s], call[Boundary.of, parameter[THIS[call[None.getStart, parameter[]]call[None.getEdge, parameter[]]], THIS[call[None.getStart, parameter[]]call[None.getTemporal, parameter[]]call[None.plus, parameter[member[.amount], member[.unit]]]]]]] end[}] if[THIS[call[None.getEnd, parameter[]]call[None.isInfinite, parameter[]]]] begin[{] assign[member[.e], call[Boundary.infiniteFuture, parameter[]]] else begin[{] assign[member[.e], call[Boundary.of, parameter[THIS[call[None.getEnd, parameter[]]call[None.getEdge, parameter[]]], THIS[call[None.getEnd, parameter[]]call[None.getTemporal, parameter[]]call[None.plus, parameter[member[.amount], member[.unit]]]]]]] end[}] return[ClassCreator(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimestampInterval, sub_type=None))] end[}] END[}]
Keyword[public] identifier[TimestampInterval] identifier[move] operator[SEP] Keyword[long] identifier[amount] , identifier[IsoUnit] identifier[unit] operator[SEP] { Keyword[if] operator[SEP] identifier[amount] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } identifier[Boundary] operator[<] identifier[PlainTimestamp] operator[>] identifier[s] operator[SEP] identifier[Boundary] operator[<] identifier[PlainTimestamp] operator[>] identifier[e] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[isInfinite] operator[SEP] operator[SEP] operator[SEP] { identifier[s] operator[=] identifier[Boundary] operator[SEP] identifier[infinitePast] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[s] operator[=] identifier[Boundary] operator[SEP] identifier[of] operator[SEP] Keyword[this] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getEdge] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getTemporal] operator[SEP] operator[SEP] operator[SEP] identifier[plus] operator[SEP] identifier[amount] , identifier[unit] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[isInfinite] operator[SEP] operator[SEP] operator[SEP] { identifier[e] operator[=] identifier[Boundary] operator[SEP] identifier[infiniteFuture] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[e] operator[=] identifier[Boundary] operator[SEP] identifier[of] operator[SEP] Keyword[this] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[getEdge] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[getTemporal] operator[SEP] operator[SEP] operator[SEP] identifier[plus] operator[SEP] identifier[amount] , identifier[unit] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[TimestampInterval] operator[SEP] identifier[s] , identifier[e] operator[SEP] operator[SEP] }
public boolean isExternalizable() { try { return env.types.isSubtype(type, env.externalizableSym.type); } catch (CompletionFailure ex) { // quietly ignore completion failures return false; } }
class class_name[name] begin[{] method[isExternalizable, return_type[type[boolean]], modifier[public], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=env.externalizableSym, selectors=[])], member=isSubtype, postfix_operators=[], prefix_operators=[], qualifier=env.types, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CompletionFailure']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isExternalizable] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] identifier[env] operator[SEP] identifier[types] operator[SEP] identifier[isSubtype] operator[SEP] identifier[type] , identifier[env] operator[SEP] identifier[externalizableSym] operator[SEP] identifier[type] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CompletionFailure] identifier[ex] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
public int[] getTDWRLevels2(int nlevel, short[] th) { int inc = th.length; int [] levels = new int[ inc]; //th[2] ]; for ( int i = 0; i < inc; i++ ) { /* calibrated data values */ levels[i] = th[i]; } return levels; }
class class_name[name] begin[{] method[getTDWRLevels2, return_type[type[int]], modifier[public], parameter[nlevel, th]] begin[{] local_variable[type[int], inc] local_variable[type[int], levels] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=levels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=th, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=inc, 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[.levels]] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[getTDWRLevels2] operator[SEP] Keyword[int] identifier[nlevel] , Keyword[short] operator[SEP] operator[SEP] identifier[th] operator[SEP] { Keyword[int] identifier[inc] operator[=] identifier[th] operator[SEP] identifier[length] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[levels] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[inc] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[inc] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[levels] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[th] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[levels] operator[SEP] }
public void handleResult(TaskCommand<String,String> taskCommand, String result){ /** if(result == null){ error( taskCommand, result); return ; } int errorStartIdx = result.indexOf("\"errors\":"); if(errorStartIdx < 0) { error(taskCommand, result); return; } int errorEndIdx = result.indexOf(",",errorStartIdx); if(errorEndIdx < 0){ error(taskCommand, result); return; } String errorInfo = result.substring(errorStartIdx,errorEndIdx); if(errorInfo.equals("\"errors\":false")){ success( taskCommand, result); } else{ error( taskCommand, result); } */ if(!ResultUtil.bulkResponseError(result)){ success( taskCommand, result); } else{ error( taskCommand, result); } }
class class_name[name] begin[{] method[handleResult, return_type[void], modifier[public], parameter[taskCommand, result]] begin[{] if[call[ResultUtil.bulkResponseError, parameter[member[.result]]]] begin[{] call[.success, parameter[member[.taskCommand], member[.result]]] else begin[{] call[.error, parameter[member[.taskCommand], member[.result]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[handleResult] operator[SEP] identifier[TaskCommand] operator[<] identifier[String] , identifier[String] operator[>] identifier[taskCommand] , identifier[String] identifier[result] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[ResultUtil] operator[SEP] identifier[bulkResponseError] operator[SEP] identifier[result] operator[SEP] operator[SEP] { identifier[success] operator[SEP] identifier[taskCommand] , identifier[result] operator[SEP] operator[SEP] } Keyword[else] { identifier[error] operator[SEP] identifier[taskCommand] , identifier[result] operator[SEP] operator[SEP] } }
public Map<String, String> toMap() { Map<String, String> map = new HashMap<>(); map.put("message", message); map.put("country-code", countryCode); map.put("url", url); return map; }
class class_name[name] begin[{] method[toMap, return_type[type[Map]], modifier[public], parameter[]] begin[{] local_variable[type[Map], map] call[map.put, parameter[literal["message"], member[.message]]] call[map.put, parameter[literal["country-code"], member[.countryCode]]] call[map.put, parameter[literal["url"], member[.url]]] return[member[.map]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[toMap] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[message] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[countryCode] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP] }
@Programmatic public ApplicationUser newDelegateUser( final String username, final ApplicationRole initialRole, final Boolean enabled) { final ApplicationUser user = getApplicationUserFactory().newApplicationUser(); user.setUsername(username); user.setStatus(ApplicationUserStatus.parse(enabled)); user.setAccountType(AccountType.DELEGATED); if (initialRole != null) { user.addRole(initialRole); } container.persistIfNotAlready(user); return user; }
class class_name[name] begin[{] method[newDelegateUser, return_type[type[ApplicationUser]], modifier[public], parameter[username, initialRole, enabled]] begin[{] local_variable[type[ApplicationUser], user] call[user.setUsername, parameter[member[.username]]] call[user.setStatus, parameter[call[ApplicationUserStatus.parse, parameter[member[.enabled]]]]] call[user.setAccountType, parameter[member[AccountType.DELEGATED]]] if[binary_operation[member[.initialRole], !=, literal[null]]] begin[{] call[user.addRole, parameter[member[.initialRole]]] else begin[{] None end[}] call[container.persistIfNotAlready, parameter[member[.user]]] return[member[.user]] end[}] END[}]
annotation[@] identifier[Programmatic] Keyword[public] identifier[ApplicationUser] identifier[newDelegateUser] operator[SEP] Keyword[final] identifier[String] identifier[username] , Keyword[final] identifier[ApplicationRole] identifier[initialRole] , Keyword[final] identifier[Boolean] identifier[enabled] operator[SEP] { Keyword[final] identifier[ApplicationUser] identifier[user] operator[=] identifier[getApplicationUserFactory] operator[SEP] operator[SEP] operator[SEP] identifier[newApplicationUser] operator[SEP] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setUsername] operator[SEP] identifier[username] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setStatus] operator[SEP] identifier[ApplicationUserStatus] operator[SEP] identifier[parse] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setAccountType] operator[SEP] identifier[AccountType] operator[SEP] identifier[DELEGATED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[initialRole] operator[!=] Other[null] operator[SEP] { identifier[user] operator[SEP] identifier[addRole] operator[SEP] identifier[initialRole] operator[SEP] operator[SEP] } identifier[container] operator[SEP] identifier[persistIfNotAlready] operator[SEP] identifier[user] operator[SEP] operator[SEP] Keyword[return] identifier[user] operator[SEP] }
private synchronized final boolean _declareNotDiscardable(AbstractItem item) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "_declareNotDiscardable"); boolean notifyRequired = false; // we are going to need the item in memory, so we make sure that // we pin it with a hard reference _strongReferenceToItem = item; if (_itemIsDiscardableIfPersistentRepresentationStable) { // if we have become discardable, and we were // releasable (stable) then we must notify the cache notifyRequired = _persistentRepresentationIsStable; _itemIsDiscardableIfPersistentRepresentationStable = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_declareNotDiscardable", Boolean.valueOf(notifyRequired)); return notifyRequired; }
class class_name[name] begin[{] method[_declareNotDiscardable, return_type[type[boolean]], modifier[synchronized final private], parameter[item]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["_declareNotDiscardable"]]] else begin[{] None end[}] local_variable[type[boolean], notifyRequired] assign[member[._strongReferenceToItem], member[.item]] if[member[._itemIsDiscardableIfPersistentRepresentationStable]] begin[{] assign[member[.notifyRequired], member[._persistentRepresentationIsStable]] assign[member[._itemIsDiscardableIfPersistentRepresentationStable], literal[false]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["_declareNotDiscardable"], call[Boolean.valueOf, parameter[member[.notifyRequired]]]]] else begin[{] None end[}] return[member[.notifyRequired]] end[}] END[}]
Keyword[private] Keyword[synchronized] Keyword[final] Keyword[boolean] identifier[_declareNotDiscardable] operator[SEP] identifier[AbstractItem] identifier[item] 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] operator[SEP] operator[SEP] Keyword[boolean] identifier[notifyRequired] operator[=] literal[boolean] operator[SEP] identifier[_strongReferenceToItem] operator[=] identifier[item] operator[SEP] Keyword[if] operator[SEP] identifier[_itemIsDiscardableIfPersistentRepresentationStable] operator[SEP] { identifier[notifyRequired] operator[=] identifier[_persistentRepresentationIsStable] operator[SEP] identifier[_itemIsDiscardableIfPersistentRepresentationStable] operator[=] literal[boolean] 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[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[notifyRequired] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[notifyRequired] operator[SEP] }
void exportToMapProperty(Object target, String property, Object result) { @SuppressWarnings("unchecked") Map<Object, Object> map = (Map<Object, Object>) target; if (result == null) { map.remove(property); } else { map.put(property, result); } }
class class_name[name] begin[{] method[exportToMapProperty, return_type[void], modifier[default], parameter[target, property, result]] begin[{] local_variable[type[Map], map] if[binary_operation[member[.result], ==, literal[null]]] begin[{] call[map.remove, parameter[member[.property]]] else begin[{] call[map.put, parameter[member[.property], member[.result]]] end[}] end[}] END[}]
Keyword[void] identifier[exportToMapProperty] operator[SEP] identifier[Object] identifier[target] , identifier[String] identifier[property] , identifier[Object] identifier[result] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[map] operator[=] operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] operator[SEP] identifier[target] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] { identifier[map] operator[SEP] identifier[remove] operator[SEP] identifier[property] operator[SEP] operator[SEP] } Keyword[else] { identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[result] operator[SEP] operator[SEP] } }
public void asyncPost(final String url, final String mediaType, final Supplier<String> supplier, final Callback callback) { requireNonNull(supplier, "A valid supplier expected"); asyncPostBytes(url, mediaType, () -> ofNullable(supplier.get()).orElse("").getBytes(), callback); }
class class_name[name] begin[{] method[asyncPost, return_type[void], modifier[public], parameter[url, mediaType, supplier, callback]] begin[{] call[.requireNonNull, parameter[member[.supplier], literal["A valid supplier expected"]]] call[.asyncPostBytes, parameter[member[.url], member[.mediaType], LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=supplier, selectors=[], type_arguments=None)], member=ofNullable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=orElse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[]), member[.callback]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[asyncPost] operator[SEP] Keyword[final] identifier[String] identifier[url] , Keyword[final] identifier[String] identifier[mediaType] , Keyword[final] identifier[Supplier] operator[<] identifier[String] operator[>] identifier[supplier] , Keyword[final] identifier[Callback] identifier[callback] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[supplier] , literal[String] operator[SEP] operator[SEP] identifier[asyncPostBytes] operator[SEP] identifier[url] , identifier[mediaType] , operator[SEP] operator[SEP] operator[->] identifier[ofNullable] operator[SEP] identifier[supplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] , identifier[callback] operator[SEP] operator[SEP] }
public <T> ConstructorInjectionPoint<T> createConstructorInjectionPoint(Bean<T> declaringBean, EnhancedAnnotatedType<T> type, BeanManagerImpl manager) { EnhancedAnnotatedConstructor<T> constructor = Beans.getBeanConstructorStrict(type); return createConstructorInjectionPoint(declaringBean, type.getJavaClass(), constructor, manager); }
class class_name[name] begin[{] method[createConstructorInjectionPoint, return_type[type[ConstructorInjectionPoint]], modifier[public], parameter[declaringBean, type, manager]] begin[{] local_variable[type[EnhancedAnnotatedConstructor], constructor] return[call[.createConstructorInjectionPoint, parameter[member[.declaringBean], call[type.getJavaClass, parameter[]], member[.constructor], member[.manager]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[ConstructorInjectionPoint] operator[<] identifier[T] operator[>] identifier[createConstructorInjectionPoint] operator[SEP] identifier[Bean] operator[<] identifier[T] operator[>] identifier[declaringBean] , identifier[EnhancedAnnotatedType] operator[<] identifier[T] operator[>] identifier[type] , identifier[BeanManagerImpl] identifier[manager] operator[SEP] { identifier[EnhancedAnnotatedConstructor] operator[<] identifier[T] operator[>] identifier[constructor] operator[=] identifier[Beans] operator[SEP] identifier[getBeanConstructorStrict] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[createConstructorInjectionPoint] operator[SEP] identifier[declaringBean] , identifier[type] operator[SEP] identifier[getJavaClass] operator[SEP] operator[SEP] , identifier[constructor] , identifier[manager] operator[SEP] operator[SEP] }
public static Collection<TemplateEntry> findTemplatesForApplication( String appName, Collection<TemplateEntry> templates ) { final Collection<TemplateEntry> result = new ArrayList<> (); for( TemplateEntry te : templates ) { // TE.appName == null => OK. It applies to this application. // TE.appName == appName => OK. It also applies. if( te.getAppName() == null || te.getAppName().equals( appName )) result.add( te ); } return result; }
class class_name[name] begin[{] method[findTemplatesForApplication, return_type[type[Collection]], modifier[public static], parameter[appName, templates]] begin[{] local_variable[type[Collection], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[MethodInvocation(arguments=[MemberReference(member=appName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=te, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=templates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=te)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TemplateEntry, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[TemplateEntry] operator[>] identifier[findTemplatesForApplication] operator[SEP] identifier[String] identifier[appName] , identifier[Collection] operator[<] identifier[TemplateEntry] operator[>] identifier[templates] operator[SEP] { Keyword[final] identifier[Collection] operator[<] identifier[TemplateEntry] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TemplateEntry] identifier[te] operator[:] identifier[templates] operator[SEP] { Keyword[if] operator[SEP] identifier[te] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[te] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[appName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[te] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Override public HashMap<String, String> parseSuggestV1() { final String json = query.getContent(); if (json == null || json.isEmpty()) { throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, "Missing message content", "Supply valid JSON formatted data in the body of your request"); } try { return JSON.parseToObject(query.getContent(), new TypeReference<HashMap<String, String>>(){}); } catch (IllegalArgumentException iae) { throw new BadRequestException("Unable to parse the given JSON", iae); } }
class class_name[name] begin[{] method[parseSuggestV1, return_type[type[HashMap]], modifier[public], parameter[]] begin[{] local_variable[type[String], json] if[binary_operation[binary_operation[member[.json], ==, literal[null]], ||, call[json.isEmpty, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=BAD_REQUEST, postfix_operators=[], prefix_operators=[], qualifier=HttpResponseStatus, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing message content"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Supply valid JSON formatted data in the body of your request")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getContent, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[], 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)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashMap, sub_type=None))], dimensions=None, name=TypeReference, sub_type=None))], member=parseToObject, postfix_operators=[], prefix_operators=[], qualifier=JSON, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to parse the given JSON"), MemberReference(member=iae, 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=BadRequestException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[parseSuggestV1] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[json] operator[=] identifier[query] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[json] operator[==] Other[null] operator[||] identifier[json] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[BAD_REQUEST] , literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] identifier[JSON] operator[SEP] identifier[parseToObject] operator[SEP] identifier[query] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] , Keyword[new] identifier[TypeReference] operator[<] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[iae] operator[SEP] { Keyword[throw] Keyword[new] identifier[BadRequestException] operator[SEP] literal[String] , identifier[iae] operator[SEP] operator[SEP] } }
@Override protected String replaceDeclaration(final String originalDeclaration, final String modifiedDeclaration) { return originalDeclaration.equals(modifiedDeclaration) ? modifiedDeclaration : computeNewDeclaration( originalDeclaration, modifiedDeclaration); }
class class_name[name] begin[{] method[replaceDeclaration, return_type[type[String]], modifier[protected], parameter[originalDeclaration, modifiedDeclaration]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=modifiedDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=originalDeclaration, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=originalDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=modifiedDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeNewDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MemberReference(member=modifiedDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[String] identifier[replaceDeclaration] operator[SEP] Keyword[final] identifier[String] identifier[originalDeclaration] , Keyword[final] identifier[String] identifier[modifiedDeclaration] operator[SEP] { Keyword[return] identifier[originalDeclaration] operator[SEP] identifier[equals] operator[SEP] identifier[modifiedDeclaration] operator[SEP] operator[?] identifier[modifiedDeclaration] operator[:] identifier[computeNewDeclaration] operator[SEP] identifier[originalDeclaration] , identifier[modifiedDeclaration] operator[SEP] operator[SEP] }
public String toSQL(final MasterSlaveRule masterSlaveRule, final ShardingDataSourceMetaData shardingDataSourceMetaData) { StringBuilder result = new StringBuilder(); for (Object each : segments) { if (each instanceof SchemaPlaceholder) { result.append(shardingDataSourceMetaData.getActualDataSourceMetaData(masterSlaveRule.getMasterDataSourceName()).getSchemaName()); } else { result.append(each); } } return result.toString(); }
class class_name[name] begin[{] method[toSQL, return_type[type[String]], modifier[public], parameter[masterSlaveRule, shardingDataSourceMetaData]] begin[{] local_variable[type[StringBuilder], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=each, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SchemaPlaceholder, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=each, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMasterDataSourceName, postfix_operators=[], prefix_operators=[], qualifier=masterSlaveRule, selectors=[], type_arguments=None)], member=getActualDataSourceMetaData, postfix_operators=[], prefix_operators=[], qualifier=shardingDataSourceMetaData, selectors=[MethodInvocation(arguments=[], member=getSchemaName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=segments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=each)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[toSQL] operator[SEP] Keyword[final] identifier[MasterSlaveRule] identifier[masterSlaveRule] , Keyword[final] identifier[ShardingDataSourceMetaData] identifier[shardingDataSourceMetaData] operator[SEP] { identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[each] operator[:] identifier[segments] operator[SEP] { Keyword[if] operator[SEP] identifier[each] Keyword[instanceof] identifier[SchemaPlaceholder] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[shardingDataSourceMetaData] operator[SEP] identifier[getActualDataSourceMetaData] operator[SEP] identifier[masterSlaveRule] operator[SEP] identifier[getMasterDataSourceName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getSchemaName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[each] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void setCat(String v) { if (CoordinationElement_Type.featOkTst && ((CoordinationElement_Type)jcasType).casFeat_cat == null) jcasType.jcas.throwFeatMissing("cat", "de.julielab.jules.types.CoordinationElement"); jcasType.ll_cas.ll_setStringValue(addr, ((CoordinationElement_Type)jcasType).casFeatCode_cat, v);}
class class_name[name] begin[{] method[setCat, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[CoordinationElement_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CoordinationElement_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["cat"], literal["de.julielab.jules.types.CoordinationElement"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CoordinationElement_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCat] operator[SEP] identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[CoordinationElement_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[CoordinationElement_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_cat] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[CoordinationElement_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_cat] , identifier[v] operator[SEP] operator[SEP] }
public static boolean isDefaultValue(final String value) { if (value == null || value.equals("") || value.equals("0,00") || value.equals("0")) { return true; } return false; }
class class_name[name] begin[{] method[isDefaultValue, return_type[type[boolean]], modifier[public static], parameter[value]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.value], ==, literal[null]], ||, call[value.equals, parameter[literal[""]]]], ||, call[value.equals, parameter[literal["0,00"]]]], ||, call[value.equals, parameter[literal["0"]]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isDefaultValue] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[||] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private String encodeBatch (Batch<String> batch) throws IOException { // Convert original json object to a new json object with format {"Body": "originalJson"} // Add new json object to an array and send the whole array to eventhub using REST api // Refer to https://docs.microsoft.com/en-us/rest/api/eventhub/send-batch-events List<String> records = batch.getRecords(); ArrayList<EventhubRequest> arrayList = new ArrayList<>(); for (String record: records) { arrayList.add(new EventhubRequest(record)); } return mapper.writeValueAsString (arrayList); }
class class_name[name] begin[{] method[encodeBatch, return_type[type[String]], modifier[private], parameter[batch]] begin[{] local_variable[type[List], records] local_variable[type[ArrayList], arrayList] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=record, 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=EventhubRequest, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=arrayList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=records, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=record)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[mapper.writeValueAsString, parameter[member[.arrayList]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[encodeBatch] operator[SEP] identifier[Batch] operator[<] identifier[String] operator[>] identifier[batch] operator[SEP] Keyword[throws] identifier[IOException] { identifier[List] operator[<] identifier[String] operator[>] identifier[records] operator[=] identifier[batch] operator[SEP] identifier[getRecords] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[EventhubRequest] operator[>] identifier[arrayList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[record] operator[:] identifier[records] operator[SEP] { identifier[arrayList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[EventhubRequest] operator[SEP] identifier[record] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[mapper] operator[SEP] identifier[writeValueAsString] operator[SEP] identifier[arrayList] operator[SEP] operator[SEP] }
public void setProgram(Program program) { if (program == null) { throw new IllegalStateException("Program cannot be null"); } program.checkCreated(); this.program = program; }
class class_name[name] begin[{] method[setProgram, return_type[void], modifier[public], parameter[program]] begin[{] if[binary_operation[member[.program], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Program cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] call[program.checkCreated, parameter[]] assign[THIS[member[None.program]], member[.program]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setProgram] operator[SEP] identifier[Program] identifier[program] operator[SEP] { Keyword[if] operator[SEP] identifier[program] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[program] operator[SEP] identifier[checkCreated] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[program] operator[=] identifier[program] operator[SEP] }
public void setLayerInfo(VectorLayerInfo layerInfo) throws LayerException { this.layerInfo = layerInfo; if (null != sessionFactory) { setSessionFactory(sessionFactory); } }
class class_name[name] begin[{] method[setLayerInfo, return_type[void], modifier[public], parameter[layerInfo]] begin[{] assign[THIS[member[None.layerInfo]], member[.layerInfo]] if[binary_operation[literal[null], !=, member[.sessionFactory]]] begin[{] call[.setSessionFactory, parameter[member[.sessionFactory]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLayerInfo] operator[SEP] identifier[VectorLayerInfo] identifier[layerInfo] operator[SEP] Keyword[throws] identifier[LayerException] { Keyword[this] operator[SEP] identifier[layerInfo] operator[=] identifier[layerInfo] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[sessionFactory] operator[SEP] { identifier[setSessionFactory] operator[SEP] identifier[sessionFactory] operator[SEP] operator[SEP] } }
public static physical_disk[] get_filtered(nitro_service service, String filter) throws Exception { physical_disk obj = new physical_disk(); options option = new options(); option.set_filter(filter); physical_disk[] response = (physical_disk[]) obj.getfiltered(service, option); return response; }
class class_name[name] begin[{] method[get_filtered, return_type[type[physical_disk]], modifier[public static], parameter[service, filter]] begin[{] local_variable[type[physical_disk], obj] local_variable[type[options], option] call[option.set_filter, parameter[member[.filter]]] local_variable[type[physical_disk], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[physical_disk] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] { identifier[physical_disk] identifier[obj] operator[=] Keyword[new] identifier[physical_disk] operator[SEP] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[physical_disk] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[physical_disk] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
boolean killTask(TaskAttemptID taskId, boolean shouldFail, String diagnosticInfo) { TaskStatus st = taskStatuses.get(taskId); if(st != null && (st.getRunState() == TaskStatus.State.RUNNING || st.getRunState() == TaskStatus.State.COMMIT_PENDING || st.inTaskCleanupPhase() || st.getRunState() == TaskStatus.State.UNASSIGNED) && tasksToKill.put(taskId, shouldFail) == null ) { addDiagnosticInfo(taskId, diagnosticInfo); LOG.info(diagnosticInfo); return true; } return false; }
class class_name[name] begin[{] method[killTask, return_type[type[boolean]], modifier[default], parameter[taskId, shouldFail, diagnosticInfo]] begin[{] local_variable[type[TaskStatus], st] if[binary_operation[binary_operation[binary_operation[member[.st], !=, literal[null]], &&, binary_operation[binary_operation[binary_operation[binary_operation[call[st.getRunState, parameter[]], ==, member[TaskStatus.State.RUNNING]], ||, binary_operation[call[st.getRunState, parameter[]], ==, member[TaskStatus.State.COMMIT_PENDING]]], ||, call[st.inTaskCleanupPhase, parameter[]]], ||, binary_operation[call[st.getRunState, parameter[]], ==, member[TaskStatus.State.UNASSIGNED]]]], &&, binary_operation[call[tasksToKill.put, parameter[member[.taskId], member[.shouldFail]]], ==, literal[null]]]] begin[{] call[.addDiagnosticInfo, parameter[member[.taskId], member[.diagnosticInfo]]] call[LOG.info, parameter[member[.diagnosticInfo]]] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[boolean] identifier[killTask] operator[SEP] identifier[TaskAttemptID] identifier[taskId] , Keyword[boolean] identifier[shouldFail] , identifier[String] identifier[diagnosticInfo] operator[SEP] { identifier[TaskStatus] identifier[st] operator[=] identifier[taskStatuses] operator[SEP] identifier[get] operator[SEP] identifier[taskId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[st] operator[!=] Other[null] operator[&&] operator[SEP] identifier[st] operator[SEP] identifier[getRunState] operator[SEP] operator[SEP] operator[==] identifier[TaskStatus] operator[SEP] identifier[State] operator[SEP] identifier[RUNNING] operator[||] identifier[st] operator[SEP] identifier[getRunState] operator[SEP] operator[SEP] operator[==] identifier[TaskStatus] operator[SEP] identifier[State] operator[SEP] identifier[COMMIT_PENDING] operator[||] identifier[st] operator[SEP] identifier[inTaskCleanupPhase] operator[SEP] operator[SEP] operator[||] identifier[st] operator[SEP] identifier[getRunState] operator[SEP] operator[SEP] operator[==] identifier[TaskStatus] operator[SEP] identifier[State] operator[SEP] identifier[UNASSIGNED] operator[SEP] operator[&&] identifier[tasksToKill] operator[SEP] identifier[put] operator[SEP] identifier[taskId] , identifier[shouldFail] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[addDiagnosticInfo] operator[SEP] identifier[taskId] , identifier[diagnosticInfo] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[diagnosticInfo] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Override public void closeConnection() { checkState(!lock.isHeldByCurrentThread()); try { channel.close(); } catch (IOException e) { throw new RuntimeException(e); } connectionClosed(); }
class class_name[name] begin[{] method[closeConnection, return_type[void], modifier[public], parameter[]] begin[{] call[.checkState, parameter[call[lock.isHeldByCurrentThread, parameter[]]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) call[.connectionClosed, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[closeConnection] operator[SEP] operator[SEP] { identifier[checkState] operator[SEP] operator[!] identifier[lock] operator[SEP] identifier[isHeldByCurrentThread] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[channel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[connectionClosed] operator[SEP] operator[SEP] operator[SEP] }
public void reinit(final String id, final Object caller, final MessageResources messages, final ActionMessages msgs, final String exceptionPname, final boolean clear) { super.reinit(id, caller, messages, null, exceptionPname, clear); this.msgs = msgs; }
class class_name[name] begin[{] method[reinit, return_type[void], modifier[public], parameter[id, caller, messages, msgs, exceptionPname, clear]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=caller, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=exceptionPname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clear, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reinit, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[THIS[member[None.msgs]], member[.msgs]] end[}] END[}]
Keyword[public] Keyword[void] identifier[reinit] operator[SEP] Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[Object] identifier[caller] , Keyword[final] identifier[MessageResources] identifier[messages] , Keyword[final] identifier[ActionMessages] identifier[msgs] , Keyword[final] identifier[String] identifier[exceptionPname] , Keyword[final] Keyword[boolean] identifier[clear] operator[SEP] { Keyword[super] operator[SEP] identifier[reinit] operator[SEP] identifier[id] , identifier[caller] , identifier[messages] , Other[null] , identifier[exceptionPname] , identifier[clear] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[msgs] operator[=] identifier[msgs] operator[SEP] }
public void register( Object source, String path ) { unregister(); dataBinding = Binder.bind( source, path ).mode( Mode.OneWay ).to( adapter ).activate(); }
class class_name[name] begin[{] method[register, return_type[void], modifier[public], parameter[source, path]] begin[{] call[.unregister, parameter[]] assign[member[.dataBinding], call[Binder.bind, parameter[member[.source], member[.path]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[register] operator[SEP] identifier[Object] identifier[source] , identifier[String] identifier[path] operator[SEP] { identifier[unregister] operator[SEP] operator[SEP] operator[SEP] identifier[dataBinding] operator[=] identifier[Binder] operator[SEP] identifier[bind] operator[SEP] identifier[source] , identifier[path] operator[SEP] operator[SEP] identifier[mode] operator[SEP] identifier[Mode] operator[SEP] identifier[OneWay] operator[SEP] operator[SEP] identifier[to] operator[SEP] identifier[adapter] operator[SEP] operator[SEP] identifier[activate] operator[SEP] operator[SEP] operator[SEP] }
public MethodHandle invokeVirtual(MethodHandles.Lookup lookup, String name) throws NoSuchMethodException, IllegalAccessException { return invoke(lookup.findVirtual(type().parameterType(0), name, type().dropParameterTypes(0, 1))); }
class class_name[name] begin[{] method[invokeVirtual, return_type[type[MethodHandle]], modifier[public], parameter[lookup, name]] begin[{] return[call[.invoke, parameter[call[lookup.findVirtual, parameter[call[.type, parameter[]], member[.name], call[.type, parameter[]]]]]]] end[}] END[}]
Keyword[public] identifier[MethodHandle] identifier[invokeVirtual] operator[SEP] identifier[MethodHandles] operator[SEP] identifier[Lookup] identifier[lookup] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[NoSuchMethodException] , identifier[IllegalAccessException] { Keyword[return] identifier[invoke] operator[SEP] identifier[lookup] operator[SEP] identifier[findVirtual] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[parameterType] operator[SEP] Other[0] operator[SEP] , identifier[name] , identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[dropParameterTypes] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void initializeFromFile(TreeIndexHeader header, PageFile<N> file) { super.initializeFromFile(header, file); // compute height this.height = computeHeight(); if(getLogger().isDebugging()) { getLogger().debugFine(new StringBuilder(100).append(getClass()) // .append("\n height = ").append(height).toString()); } }
class class_name[name] begin[{] method[initializeFromFile, return_type[void], modifier[public], parameter[header, file]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initializeFromFile, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[THIS[member[None.height]], call[.computeHeight, parameter[]]] if[call[.getLogger, parameter[]]] begin[{] call[.getLogger, parameter[]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[initializeFromFile] operator[SEP] identifier[TreeIndexHeader] identifier[header] , identifier[PageFile] operator[<] identifier[N] operator[>] identifier[file] operator[SEP] { Keyword[super] operator[SEP] identifier[initializeFromFile] operator[SEP] identifier[header] , identifier[file] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[height] operator[=] identifier[computeHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[isDebugging] operator[SEP] operator[SEP] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debugFine] operator[SEP] Keyword[new] identifier[StringBuilder] operator[SEP] Other[100] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public String getMaxChangeDate() { Collector col = featureCollectorRepository.findByName(FeatureCollectorConstants.VERSIONONE); if (col == null) return ""; if (StringUtils.isEmpty(getFeatureSettings().getDeltaCollectorItemStartDate())) return ""; List<Team> response = teamRepo.findTopByChangeDateDesc(col.getId(), getFeatureSettings().getDeltaCollectorItemStartDate()); if (!CollectionUtils.isEmpty(response)) return response.get(0).getChangeDate(); return ""; }
class class_name[name] begin[{] method[getMaxChangeDate, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[Collector], col] if[binary_operation[member[.col], ==, literal[null]]] begin[{] return[literal[""]] else begin[{] None end[}] if[call[StringUtils.isEmpty, parameter[call[.getFeatureSettings, parameter[]]]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[List], response] if[call[CollectionUtils.isEmpty, parameter[member[.response]]]] begin[{] return[call[response.get, parameter[literal[0]]]] else begin[{] None end[}] return[literal[""]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getMaxChangeDate] operator[SEP] operator[SEP] { identifier[Collector] identifier[col] operator[=] identifier[featureCollectorRepository] operator[SEP] identifier[findByName] operator[SEP] identifier[FeatureCollectorConstants] operator[SEP] identifier[VERSIONONE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[col] operator[==] Other[null] operator[SEP] Keyword[return] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[getFeatureSettings] operator[SEP] operator[SEP] operator[SEP] identifier[getDeltaCollectorItemStartDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] identifier[List] operator[<] identifier[Team] operator[>] identifier[response] operator[=] identifier[teamRepo] operator[SEP] identifier[findTopByChangeDateDesc] operator[SEP] identifier[col] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[getFeatureSettings] operator[SEP] operator[SEP] operator[SEP] identifier[getDeltaCollectorItemStartDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[CollectionUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getChangeDate] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] }
public RangeDistributionBuilder add(String data) { Map<Double, Double> map = KeyValueFormat.parse(data, KeyValueFormat.newDoubleConverter(), KeyValueFormat.newDoubleConverter()); if (bottomLimits == null) { Number[] limits = map.keySet().toArray(new Number[map.size()]); init(limits); } else if (!areSameLimits(bottomLimits, map.keySet())) { isValid = false; } if (isValid) { for (Map.Entry<Double, Double> entry : map.entrySet()) { addLimitCount(entry.getKey(), entry.getValue().intValue()); } } return this; }
class class_name[name] begin[{] method[add, return_type[type[RangeDistributionBuilder]], modifier[public], parameter[data]] begin[{] local_variable[type[Map], map] if[binary_operation[member[.bottomLimits], ==, literal[null]]] begin[{] local_variable[type[Number], limits] call[.init, parameter[member[.limits]]] else begin[{] if[call[.areSameLimits, parameter[member[.bottomLimits], call[map.keySet, parameter[]]]]] begin[{] assign[member[.isValid], literal[false]] else begin[{] None end[}] end[}] if[member[.isValid]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=intValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=addLimitCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, 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=Double, 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) else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[RangeDistributionBuilder] identifier[add] operator[SEP] identifier[String] identifier[data] operator[SEP] { identifier[Map] operator[<] identifier[Double] , identifier[Double] operator[>] identifier[map] operator[=] identifier[KeyValueFormat] operator[SEP] identifier[parse] operator[SEP] identifier[data] , identifier[KeyValueFormat] operator[SEP] identifier[newDoubleConverter] operator[SEP] operator[SEP] , identifier[KeyValueFormat] operator[SEP] identifier[newDoubleConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bottomLimits] operator[==] Other[null] operator[SEP] { identifier[Number] operator[SEP] operator[SEP] identifier[limits] operator[=] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Number] operator[SEP] identifier[map] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[init] operator[SEP] identifier[limits] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[areSameLimits] operator[SEP] identifier[bottomLimits] , identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[isValid] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isValid] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Double] , identifier[Double] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[addLimitCount] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] }
protected Set<Event> resolveEventsInternal(final Set<Event> resolveEvents, final Authentication authentication, final RegisteredService registeredService, final HttpServletRequest request, final RequestContext context) { if (!resolveEvents.isEmpty()) { LOGGER.trace("Collection of resolved events for this authentication sequence are:"); resolveEvents.forEach(e -> LOGGER.trace("Event id [{}] resolved from [{}]", e.getId(), e.getSource().getClass().getName())); } else { LOGGER.trace("No events could be resolved for this authentication transaction [{}] and service [{}]", authentication, registeredService); } val pair = filterEventsByMultifactorAuthenticationProvider(resolveEvents, authentication, registeredService, request); WebUtils.putResolvedMultifactorAuthenticationProviders(context, pair.getValue()); return pair.getKey(); }
class class_name[name] begin[{] method[resolveEventsInternal, return_type[type[Set]], modifier[protected], parameter[resolveEvents, authentication, registeredService, request, context]] begin[{] if[call[resolveEvents.isEmpty, parameter[]]] begin[{] call[LOGGER.trace, parameter[literal["Collection of resolved events for this authentication sequence are:"]]] call[resolveEvents.forEach, parameter[LambdaExpression(body=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Event id [{}] resolved from [{}]"), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] else begin[{] call[LOGGER.trace, parameter[literal["No events could be resolved for this authentication transaction [{}] and service [{}]"], member[.authentication], member[.registeredService]]] end[}] local_variable[type[val], pair] call[WebUtils.putResolvedMultifactorAuthenticationProviders, parameter[member[.context], call[pair.getValue, parameter[]]]] return[call[pair.getKey, parameter[]]] end[}] END[}]
Keyword[protected] identifier[Set] operator[<] identifier[Event] operator[>] identifier[resolveEventsInternal] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Event] operator[>] identifier[resolveEvents] , Keyword[final] identifier[Authentication] identifier[authentication] , Keyword[final] identifier[RegisteredService] identifier[registeredService] , Keyword[final] identifier[HttpServletRequest] identifier[request] , Keyword[final] identifier[RequestContext] identifier[context] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[resolveEvents] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolveEvents] operator[SEP] identifier[forEach] operator[SEP] identifier[e] operator[->] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[authentication] , identifier[registeredService] operator[SEP] operator[SEP] } identifier[val] identifier[pair] operator[=] identifier[filterEventsByMultifactorAuthenticationProvider] operator[SEP] identifier[resolveEvents] , identifier[authentication] , identifier[registeredService] , identifier[request] operator[SEP] operator[SEP] identifier[WebUtils] operator[SEP] identifier[putResolvedMultifactorAuthenticationProviders] operator[SEP] identifier[context] , identifier[pair] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[pair] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] }
public static NamespaceContext createNamespaceContext() { return new NamespaceContext() { private HashMap<String, String> namespaces = new HashMap<String, String>(1); { namespaces.put(DEFAULT_NAMESPACE_PREFIX, DEFAULT_NAMESPACE_URI); } public String getNamespaceURI(String prefix) { if (namespaces.isEmpty() || StringUtil.isNullOrEmpty(prefix) || !namespaces.containsKey(prefix)) return StringUtil.empty; return namespaces.get(prefix); } public Iterator getPrefixes(String namespaceURI) { return namespaces.values().iterator(); } public String getPrefix(String namespaceURI) { if (StringUtil.isNullOrEmpty(namespaceURI)) return StringUtil.empty; for(Entry<String, String> entry : namespaces.entrySet()) if (namespaceURI.equals(entry.getValue())) return entry.getKey(); return StringUtil.empty; } }; }
class class_name[name] begin[{] method[createNamespaceContext, return_type[type[NamespaceContext]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), name=namespaces)], documentation=None, modifiers={'private'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashMap, sub_type=None)), [StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEFAULT_NAMESPACE_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_NAMESPACE_URI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None), label=None)], MethodDeclaration(annotations=[], body=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNullOrEmpty, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=namespaces, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=empty, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[]), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getNamespaceURI, parameters=[FormalParameter(annotations=[], modifiers=set(), name=prefix, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getPrefixes, parameters=[FormalParameter(annotations=[], modifiers=set(), name=namespaceURI, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=namespaceURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNullOrEmpty, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=empty, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[]), label=None)), ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=namespaceURI, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), label=None)), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None), ReturnStatement(expression=MemberReference(member=empty, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getPrefix, parameters=[FormalParameter(annotations=[], modifiers=set(), name=namespaceURI, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NamespaceContext, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[NamespaceContext] identifier[createNamespaceContext] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[NamespaceContext] operator[SEP] operator[SEP] { Keyword[private] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[namespaces] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] { identifier[namespaces] operator[SEP] identifier[put] operator[SEP] identifier[DEFAULT_NAMESPACE_PREFIX] , identifier[DEFAULT_NAMESPACE_URI] operator[SEP] operator[SEP] } Keyword[public] identifier[String] identifier[getNamespaceURI] operator[SEP] identifier[String] identifier[prefix] operator[SEP] { Keyword[if] operator[SEP] identifier[namespaces] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[StringUtil] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[prefix] operator[SEP] operator[||] operator[!] identifier[namespaces] operator[SEP] identifier[containsKey] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] Keyword[return] identifier[StringUtil] operator[SEP] identifier[empty] operator[SEP] Keyword[return] identifier[namespaces] operator[SEP] identifier[get] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] } Keyword[public] identifier[Iterator] identifier[getPrefixes] operator[SEP] identifier[String] identifier[namespaceURI] operator[SEP] { Keyword[return] identifier[namespaces] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] } Keyword[public] identifier[String] identifier[getPrefix] operator[SEP] identifier[String] identifier[namespaceURI] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtil] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[namespaceURI] operator[SEP] operator[SEP] Keyword[return] identifier[StringUtil] operator[SEP] identifier[empty] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[namespaces] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[namespaceURI] operator[SEP] identifier[equals] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[StringUtil] operator[SEP] identifier[empty] operator[SEP] } } operator[SEP] }
@Override public double getValueAt(final U user, final int at) { if (userMAPAtCutoff.containsKey(at) && userMAPAtCutoff.get(at).containsKey(user)) { double map = userMAPAtCutoff.get(at).get(user); return map; } return Double.NaN; }
class class_name[name] begin[{] method[getValueAt, return_type[type[double]], modifier[public], parameter[user, at]] begin[{] if[binary_operation[call[userMAPAtCutoff.containsKey, parameter[member[.at]]], &&, call[userMAPAtCutoff.get, parameter[member[.at]]]]] begin[{] local_variable[type[double], map] return[member[.map]] else begin[{] None end[}] return[member[Double.NaN]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[double] identifier[getValueAt] operator[SEP] Keyword[final] identifier[U] identifier[user] , Keyword[final] Keyword[int] identifier[at] operator[SEP] { Keyword[if] operator[SEP] identifier[userMAPAtCutoff] operator[SEP] identifier[containsKey] operator[SEP] identifier[at] operator[SEP] operator[&&] identifier[userMAPAtCutoff] operator[SEP] identifier[get] operator[SEP] identifier[at] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[user] operator[SEP] operator[SEP] { Keyword[double] identifier[map] operator[=] identifier[userMAPAtCutoff] operator[SEP] identifier[get] operator[SEP] identifier[at] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[user] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP] } Keyword[return] identifier[Double] operator[SEP] identifier[NaN] operator[SEP] }
public static String replaceWithVisibleWhiteSpaceChars(String string) { return string.replaceAll("\r", CARRIAGE_RETURN_SYMBOL) .replaceAll("\n", LINE_FEED_SYMBOL) .replaceAll("\\t", TAB_SYMBOL) .replaceAll(" ", SPACE_SYMBOL); }
class class_name[name] begin[{] method[replaceWithVisibleWhiteSpaceChars, return_type[type[String]], modifier[public static], parameter[string]] begin[{] return[call[string.replaceAll, parameter[literal["\r"], member[.CARRIAGE_RETURN_SYMBOL]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[replaceWithVisibleWhiteSpaceChars] operator[SEP] identifier[String] identifier[string] operator[SEP] { Keyword[return] identifier[string] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , identifier[CARRIAGE_RETURN_SYMBOL] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , identifier[LINE_FEED_SYMBOL] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , identifier[TAB_SYMBOL] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , identifier[SPACE_SYMBOL] operator[SEP] operator[SEP] }
public synchronized void suspended(ServerActivityCallback requestCountListener) { this.paused = true; listenerUpdater.set(this, requestCountListener); if (activeRequestCountUpdater.get(this) == 0) { if (listenerUpdater.compareAndSet(this, requestCountListener, null)) { requestCountListener.done(); } } }
class class_name[name] begin[{] method[suspended, return_type[void], modifier[synchronized public], parameter[requestCountListener]] begin[{] assign[THIS[member[None.paused]], literal[true]] call[listenerUpdater.set, parameter[THIS[], member[.requestCountListener]]] if[binary_operation[call[activeRequestCountUpdater.get, parameter[THIS[]]], ==, literal[0]]] begin[{] if[call[listenerUpdater.compareAndSet, parameter[THIS[], member[.requestCountListener], literal[null]]]] begin[{] call[requestCountListener.done, parameter[]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[suspended] operator[SEP] identifier[ServerActivityCallback] identifier[requestCountListener] operator[SEP] { Keyword[this] operator[SEP] identifier[paused] operator[=] literal[boolean] operator[SEP] identifier[listenerUpdater] operator[SEP] identifier[set] operator[SEP] Keyword[this] , identifier[requestCountListener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[activeRequestCountUpdater] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[listenerUpdater] operator[SEP] identifier[compareAndSet] operator[SEP] Keyword[this] , identifier[requestCountListener] , Other[null] operator[SEP] operator[SEP] { identifier[requestCountListener] operator[SEP] identifier[done] operator[SEP] operator[SEP] operator[SEP] } } }
public static <K, V> Map<V, K> inverse(Map<K, V> map) { return inverse(map, false); }
class class_name[name] begin[{] method[inverse, return_type[type[Map]], modifier[public static], parameter[map]] begin[{] return[call[.inverse, parameter[member[.map], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[V] , identifier[K] operator[>] identifier[inverse] operator[SEP] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] operator[SEP] { Keyword[return] identifier[inverse] operator[SEP] identifier[map] , literal[boolean] operator[SEP] operator[SEP] }
public int read() throws IOException { if ( total >= limit ) { if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"read", "Over the limit: -1"); } return -1; } if ( pos >= count ) { fill(); if ( pos >= count ) { if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"read", pos+" >= "+count+" : -1"); } return -1; } } total++; return buf[pos++] & 0xff; }
class class_name[name] begin[{] method[read, return_type[type[int]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.total], >=, member[.limit]]] 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["read"], literal["Over the limit: -1"]]] else begin[{] None end[}] return[literal[1]] else begin[{] None end[}] if[binary_operation[member[.pos], >=, member[.count]]] begin[{] call[.fill, parameter[]] if[binary_operation[member[.pos], >=, member[.count]]] 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["read"], binary_operation[binary_operation[binary_operation[member[.pos], +, literal[" >= "]], +, member[.count]], +, literal[" : -1"]]]] else begin[{] None end[}] return[literal[1]] else begin[{] None end[}] else begin[{] None end[}] member[.total] return[binary_operation[member[.buf], &, literal[0xff]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[read] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[total] operator[>=] identifier[limit] 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[return] operator[-] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[pos] operator[>=] identifier[count] operator[SEP] { identifier[fill] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[>=] identifier[count] 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] , identifier[pos] operator[+] literal[String] operator[+] identifier[count] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] } } identifier[total] operator[++] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] }
public String generateToken(TokenOptions tokenOptions) throws OpenTokException { // Token format // // | ------------------------------ tokenStringBuilder ----------------------------- | // | "T1=="+Base64Encode(| --------------------- innerBuilder --------------------- |)| // | "partner_id={apiKey}&sig={sig}:| -- dataStringBuilder -- | if (tokenOptions == null) { throw new InvalidArgumentException("Token options cannot be null"); } Role role = tokenOptions.getRole(); double expireTime = tokenOptions.getExpireTime(); // will be 0 if nothing was explicitly set String data = tokenOptions.getData(); // will be null if nothing was explicitly set Long create_time = new Long(System.currentTimeMillis() / 1000).longValue(); StringBuilder dataStringBuilder = new StringBuilder(); Random random = new Random(); int nonce = random.nextInt(); dataStringBuilder.append("session_id="); dataStringBuilder.append(sessionId); dataStringBuilder.append("&create_time="); dataStringBuilder.append(create_time); dataStringBuilder.append("&nonce="); dataStringBuilder.append(nonce); dataStringBuilder.append("&role="); dataStringBuilder.append(role); if(tokenOptions.getInitialLayoutClassList() != null ){ dataStringBuilder.append("&initial_layout_class_list="); dataStringBuilder.append(tokenOptions.getInitialLayoutClassList().stream().collect(Collectors.joining(" "))); } double now = System.currentTimeMillis() / 1000L; if (expireTime == 0) { expireTime = now + (60*60*24); // 1 day } else if(expireTime < now-1) { throw new InvalidArgumentException( "Expire time must be in the future. relative time: "+ (expireTime - now)); } else if(expireTime > (now + (60*60*24*30) /* 30 days */)) { throw new InvalidArgumentException( "Expire time must be in the next 30 days. too large by "+ (expireTime - (now + (60*60*24*30)))); } // NOTE: Double.toString() would print the value with scientific notation dataStringBuilder.append(String.format("&expire_time=%.0f", expireTime)); if (data != null) { if(data.length() > 1000) { throw new InvalidArgumentException( "Connection data must be less than 1000 characters. length: " + data.length()); } dataStringBuilder.append("&connection_data="); try { dataStringBuilder.append(URLEncoder.encode(data, "UTF-8")); } catch (UnsupportedEncodingException e) { throw new InvalidArgumentException( "Error during URL encode of your connection data: " + e.getMessage()); } } StringBuilder tokenStringBuilder = new StringBuilder(); try { tokenStringBuilder.append("T1=="); StringBuilder innerBuilder = new StringBuilder(); innerBuilder.append("partner_id="); innerBuilder.append(this.apiKey); innerBuilder.append("&sig="); innerBuilder.append(Crypto.signData(dataStringBuilder.toString(), this.apiSecret)); innerBuilder.append(":"); innerBuilder.append(dataStringBuilder.toString()); tokenStringBuilder.append( Base64.encodeBase64String( innerBuilder.toString().getBytes("UTF-8") ) .replace("+", "-") .replace("/", "_") ); } catch (SignatureException | NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) { throw new OpenTokException("Could not generate token, a signing error occurred.", e); } return tokenStringBuilder.toString(); }
class class_name[name] begin[{] method[generateToken, return_type[type[String]], modifier[public], parameter[tokenOptions]] begin[{] if[binary_operation[member[.tokenOptions], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Token options cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Role], role] local_variable[type[double], expireTime] local_variable[type[String], data] local_variable[type[Long], create_time] local_variable[type[StringBuilder], dataStringBuilder] local_variable[type[Random], random] local_variable[type[int], nonce] call[dataStringBuilder.append, parameter[literal["session_id="]]] call[dataStringBuilder.append, parameter[member[.sessionId]]] call[dataStringBuilder.append, parameter[literal["&create_time="]]] call[dataStringBuilder.append, parameter[member[.create_time]]] call[dataStringBuilder.append, parameter[literal["&nonce="]]] call[dataStringBuilder.append, parameter[member[.nonce]]] call[dataStringBuilder.append, parameter[literal["&role="]]] call[dataStringBuilder.append, parameter[member[.role]]] if[binary_operation[call[tokenOptions.getInitialLayoutClassList, parameter[]], !=, literal[null]]] begin[{] call[dataStringBuilder.append, parameter[literal["&initial_layout_class_list="]]] call[dataStringBuilder.append, parameter[call[tokenOptions.getInitialLayoutClassList, parameter[]]]] else begin[{] None end[}] local_variable[type[double], now] if[binary_operation[member[.expireTime], ==, literal[0]]] begin[{] assign[member[.expireTime], binary_operation[member[.now], +, binary_operation[binary_operation[literal[60], *, literal[60]], *, literal[24]]]] else begin[{] if[binary_operation[member[.expireTime], <, binary_operation[member[.now], -, literal[1]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expire time must be in the future. relative time: "), operandr=BinaryOperation(operandl=MemberReference(member=expireTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None) else begin[{] if[binary_operation[member[.expireTime], >, binary_operation[member[.now], +, binary_operation[binary_operation[binary_operation[literal[60], *, literal[60]], *, literal[24]], *, literal[30]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expire time must be in the next 30 days. too large by "), operandr=BinaryOperation(operandl=MemberReference(member=expireTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=30), operator=*), operator=+), operator=-), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None) else begin[{] None end[}] end[}] end[}] call[dataStringBuilder.append, parameter[call[String.format, parameter[literal["&expire_time=%.0f"], member[.expireTime]]]]] if[binary_operation[member[.data], !=, literal[null]]] begin[{] if[binary_operation[call[data.length, parameter[]], >, literal[1000]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connection data must be less than 1000 characters. length: "), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[dataStringBuilder.append, parameter[literal["&connection_data="]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=dataStringBuilder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during URL encode of your connection data: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] local_variable[type[StringBuilder], tokenStringBuilder] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="T1==")], member=append, postfix_operators=[], prefix_operators=[], qualifier=tokenStringBuilder, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=innerBuilder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="partner_id=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=innerBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=apiKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=append, postfix_operators=[], prefix_operators=[], qualifier=innerBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="&sig=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=innerBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=dataStringBuilder, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=apiSecret, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=signData, postfix_operators=[], prefix_operators=[], qualifier=Crypto, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=innerBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=append, postfix_operators=[], prefix_operators=[], qualifier=innerBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=dataStringBuilder, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=innerBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=innerBuilder, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=encodeBase64String, postfix_operators=[], prefix_operators=[], qualifier=Base64, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=tokenStringBuilder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not generate token, a signing error occurred."), 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=OpenTokException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SignatureException', 'NoSuchAlgorithmException', 'InvalidKeyException', 'UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) return[call[tokenStringBuilder.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[generateToken] operator[SEP] identifier[TokenOptions] identifier[tokenOptions] operator[SEP] Keyword[throws] identifier[OpenTokException] { Keyword[if] operator[SEP] identifier[tokenOptions] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Role] identifier[role] operator[=] identifier[tokenOptions] operator[SEP] identifier[getRole] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[expireTime] operator[=] identifier[tokenOptions] operator[SEP] identifier[getExpireTime] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[data] operator[=] identifier[tokenOptions] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[Long] identifier[create_time] operator[=] Keyword[new] identifier[Long] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[/] Other[1000] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[dataStringBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[Random] identifier[random] operator[=] Keyword[new] identifier[Random] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[nonce] operator[=] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[create_time] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[nonce] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[role] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tokenOptions] operator[SEP] identifier[getInitialLayoutClassList] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[tokenOptions] operator[SEP] identifier[getInitialLayoutClassList] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[joining] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[double] identifier[now] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[/] Other[1000L] operator[SEP] Keyword[if] operator[SEP] identifier[expireTime] operator[==] Other[0] operator[SEP] { identifier[expireTime] operator[=] identifier[now] operator[+] operator[SEP] Other[60] operator[*] Other[60] operator[*] Other[24] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[expireTime] operator[<] identifier[now] operator[-] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[expireTime] operator[-] identifier[now] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[expireTime] operator[>] operator[SEP] identifier[now] operator[+] operator[SEP] Other[60] operator[*] Other[60] operator[*] Other[24] operator[*] Other[30] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[expireTime] operator[-] operator[SEP] identifier[now] operator[+] operator[SEP] Other[60] operator[*] Other[60] operator[*] Other[24] operator[*] Other[30] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[expireTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[1000] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[+] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[dataStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[data] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[StringBuilder] identifier[tokenStringBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[tokenStringBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[innerBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[innerBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[innerBuilder] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[apiKey] operator[SEP] operator[SEP] identifier[innerBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[innerBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Crypto] operator[SEP] identifier[signData] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[apiSecret] operator[SEP] operator[SEP] operator[SEP] identifier[innerBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[innerBuilder] operator[SEP] identifier[append] operator[SEP] identifier[dataStringBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tokenStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Base64] operator[SEP] identifier[encodeBase64String] operator[SEP] identifier[innerBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] 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] operator[SEP] } Keyword[catch] operator[SEP] identifier[SignatureException] operator[|] identifier[NoSuchAlgorithmException] operator[|] identifier[InvalidKeyException] operator[|] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[OpenTokException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[tokenStringBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected boolean isEscaped(byte nextByte) { boolean result = false; if (inString) { if (nextByte == '\"' && !escapedInString) { inString = false; } if (nextByte == '\\' && !escapedInString) { escapedInString = true; } else if (escapedInString) { escapedInString = false; } result = true; } else { if (nextByte == '\"') { inString = true; result = true; } } return result; }
class class_name[name] begin[{] method[isEscaped, return_type[type[boolean]], modifier[protected], parameter[nextByte]] begin[{] local_variable[type[boolean], result] if[member[.inString]] begin[{] if[binary_operation[binary_operation[member[.nextByte], ==, literal['\"']], &&, member[.escapedInString]]] begin[{] assign[member[.inString], literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.nextByte], ==, literal['\\']], &&, member[.escapedInString]]] begin[{] assign[member[.escapedInString], literal[true]] else begin[{] if[member[.escapedInString]] begin[{] assign[member[.escapedInString], literal[false]] else begin[{] None end[}] end[}] assign[member[.result], literal[true]] else begin[{] if[binary_operation[member[.nextByte], ==, literal['\"']]] begin[{] assign[member[.inString], literal[true]] assign[member[.result], literal[true]] else begin[{] None end[}] end[}] return[member[.result]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isEscaped] operator[SEP] Keyword[byte] identifier[nextByte] operator[SEP] { Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[inString] operator[SEP] { Keyword[if] operator[SEP] identifier[nextByte] operator[==] literal[String] operator[&&] operator[!] identifier[escapedInString] operator[SEP] { identifier[inString] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[nextByte] operator[==] literal[String] operator[&&] operator[!] identifier[escapedInString] operator[SEP] { identifier[escapedInString] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[escapedInString] operator[SEP] { identifier[escapedInString] operator[=] literal[boolean] operator[SEP] } identifier[result] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[nextByte] operator[==] literal[String] operator[SEP] { identifier[inString] operator[=] literal[boolean] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
@Override public List<CPDAvailabilityEstimate> findByCommerceAvailabilityEstimateId( long commerceAvailabilityEstimateId, int start, int end, OrderByComparator<CPDAvailabilityEstimate> orderByComparator) { return findByCommerceAvailabilityEstimateId(commerceAvailabilityEstimateId, start, end, orderByComparator, true); }
class class_name[name] begin[{] method[findByCommerceAvailabilityEstimateId, return_type[type[List]], modifier[public], parameter[commerceAvailabilityEstimateId, start, end, orderByComparator]] begin[{] return[call[.findByCommerceAvailabilityEstimateId, parameter[member[.commerceAvailabilityEstimateId], member[.start], member[.end], member[.orderByComparator], literal[true]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CPDAvailabilityEstimate] operator[>] identifier[findByCommerceAvailabilityEstimateId] operator[SEP] Keyword[long] identifier[commerceAvailabilityEstimateId] , Keyword[int] identifier[start] , Keyword[int] identifier[end] , identifier[OrderByComparator] operator[<] identifier[CPDAvailabilityEstimate] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[findByCommerceAvailabilityEstimateId] operator[SEP] identifier[commerceAvailabilityEstimateId] , identifier[start] , identifier[end] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP] }
public void onClick(MenuItemClickEvent event) { final FeatureTransaction ft = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction(); if (ft != null && index != null) { List<Feature> features = new ArrayList<Feature>(); features.add(ft.getNewFeatures()[index.getFeatureIndex()]); LazyLoader.lazyLoad(features, GeomajasConstant.FEATURE_INCLUDE_GEOMETRY, new LazyLoadCallback() { public void execute(List<Feature> response) { controller.setEditMode(EditMode.INSERT_MODE); Geometry geometry = response.get(0).getGeometry(); if (geometry instanceof Polygon) { geometry = addRing((Polygon) geometry); } else if (geometry instanceof MultiPolygon) { geometry = addRing((MultiPolygon) geometry); } ft.getNewFeatures()[index.getFeatureIndex()].setGeometry(geometry); controller.setGeometryIndex(index); controller.hideGeometricInfo(); } }); } }
class class_name[name] begin[{] method[onClick, return_type[void], modifier[public], parameter[event]] begin[{] local_variable[type[FeatureTransaction], ft] if[binary_operation[binary_operation[member[.ft], !=, literal[null]], &&, binary_operation[member[.index], !=, literal[null]]]] begin[{] local_variable[type[List], features] call[features.add, parameter[call[ft.getNewFeatures, parameter[]]]] call[LazyLoader.lazyLoad, parameter[member[.features], member[GeomajasConstant.FEATURE_INCLUDE_GEOMETRY], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INSERT_MODE, postfix_operators=[], prefix_operators=[], qualifier=EditMode, selectors=[])], member=setEditMode, postfix_operators=[], prefix_operators=[], qualifier=controller, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[MethodInvocation(arguments=[], member=getGeometry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=geometry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Geometry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=MultiPolygon, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MultiPolygon, sub_type=None))], member=addRing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None))], member=addRing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getNewFeatures, postfix_operators=[], prefix_operators=[], qualifier=ft, selectors=[ArraySelector(index=MethodInvocation(arguments=[], member=getFeatureIndex, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None)), MethodInvocation(arguments=[MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setGeometry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setGeometryIndex, postfix_operators=[], prefix_operators=[], qualifier=controller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=hideGeometricInfo, postfix_operators=[], prefix_operators=[], qualifier=controller, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=response, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Feature, sub_type=None))], dimensions=[], name=List, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LazyLoadCallback, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[MenuItemClickEvent] identifier[event] operator[SEP] { Keyword[final] identifier[FeatureTransaction] identifier[ft] operator[=] identifier[mapWidget] operator[SEP] identifier[getMapModel] operator[SEP] operator[SEP] operator[SEP] identifier[getFeatureEditor] operator[SEP] operator[SEP] operator[SEP] identifier[getFeatureTransaction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ft] operator[!=] Other[null] operator[&&] identifier[index] operator[!=] Other[null] operator[SEP] { identifier[List] operator[<] identifier[Feature] operator[>] identifier[features] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Feature] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[features] operator[SEP] identifier[add] operator[SEP] identifier[ft] operator[SEP] identifier[getNewFeatures] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[SEP] identifier[getFeatureIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LazyLoader] operator[SEP] identifier[lazyLoad] operator[SEP] identifier[features] , identifier[GeomajasConstant] operator[SEP] identifier[FEATURE_INCLUDE_GEOMETRY] , Keyword[new] identifier[LazyLoadCallback] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[List] operator[<] identifier[Feature] operator[>] identifier[response] operator[SEP] { identifier[controller] operator[SEP] identifier[setEditMode] operator[SEP] identifier[EditMode] operator[SEP] identifier[INSERT_MODE] operator[SEP] operator[SEP] identifier[Geometry] identifier[geometry] operator[=] identifier[response] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getGeometry] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[Polygon] operator[SEP] { identifier[geometry] operator[=] identifier[addRing] operator[SEP] operator[SEP] identifier[Polygon] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[MultiPolygon] operator[SEP] { identifier[geometry] operator[=] identifier[addRing] operator[SEP] operator[SEP] identifier[MultiPolygon] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] } identifier[ft] operator[SEP] identifier[getNewFeatures] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[SEP] identifier[getFeatureIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setGeometry] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] identifier[controller] operator[SEP] identifier[setGeometryIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[controller] operator[SEP] identifier[hideGeometricInfo] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } }
public final void copyPrimitiveAtOffset(Object source, Object copy, Class<?> type, long offset) { if (java.lang.Boolean.TYPE == type) { boolean origFieldValue = THE_UNSAFE.getBoolean(source, offset); THE_UNSAFE.putBoolean(copy, offset, origFieldValue); } else if (java.lang.Byte.TYPE == type) { byte origFieldValue = THE_UNSAFE.getByte(source, offset); THE_UNSAFE.putByte(copy, offset, origFieldValue); } else if (java.lang.Character.TYPE == type) { char origFieldValue = THE_UNSAFE.getChar(source, offset); THE_UNSAFE.putChar(copy, offset, origFieldValue); } else if (java.lang.Short.TYPE == type) { short origFieldValue = THE_UNSAFE.getShort(source, offset); THE_UNSAFE.putShort(copy, offset, origFieldValue); } else if (java.lang.Integer.TYPE == type) { int origFieldValue = THE_UNSAFE.getInt(source, offset); THE_UNSAFE.putInt(copy, offset, origFieldValue); } else if (java.lang.Long.TYPE == type) { long origFieldValue = THE_UNSAFE.getLong(source, offset); THE_UNSAFE.putLong(copy, offset, origFieldValue); } else if (java.lang.Float.TYPE == type) { float origFieldValue = THE_UNSAFE.getFloat(source, offset); THE_UNSAFE.putFloat(copy, offset, origFieldValue); } else if (java.lang.Double.TYPE == type) { double origFieldValue = THE_UNSAFE.getDouble(source, offset); THE_UNSAFE.putDouble(copy, offset, origFieldValue); } }
class class_name[name] begin[{] method[copyPrimitiveAtOffset, return_type[void], modifier[final public], parameter[source, copy, type, offset]] begin[{] if[binary_operation[member[java.lang.Boolean.TYPE], ==, member[.type]]] begin[{] local_variable[type[boolean], origFieldValue] call[THE_UNSAFE.putBoolean, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] if[binary_operation[member[java.lang.Byte.TYPE], ==, member[.type]]] begin[{] local_variable[type[byte], origFieldValue] call[THE_UNSAFE.putByte, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] if[binary_operation[member[java.lang.Character.TYPE], ==, member[.type]]] begin[{] local_variable[type[char], origFieldValue] call[THE_UNSAFE.putChar, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] if[binary_operation[member[java.lang.Short.TYPE], ==, member[.type]]] begin[{] local_variable[type[short], origFieldValue] call[THE_UNSAFE.putShort, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] if[binary_operation[member[java.lang.Integer.TYPE], ==, member[.type]]] begin[{] local_variable[type[int], origFieldValue] call[THE_UNSAFE.putInt, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] if[binary_operation[member[java.lang.Long.TYPE], ==, member[.type]]] begin[{] local_variable[type[long], origFieldValue] call[THE_UNSAFE.putLong, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] if[binary_operation[member[java.lang.Float.TYPE], ==, member[.type]]] begin[{] local_variable[type[float], origFieldValue] call[THE_UNSAFE.putFloat, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] if[binary_operation[member[java.lang.Double.TYPE], ==, member[.type]]] begin[{] local_variable[type[double], origFieldValue] call[THE_UNSAFE.putDouble, parameter[member[.copy], member[.offset], member[.origFieldValue]]] else begin[{] None end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[copyPrimitiveAtOffset] operator[SEP] identifier[Object] identifier[source] , identifier[Object] identifier[copy] , identifier[Class] operator[<] operator[?] operator[>] identifier[type] , Keyword[long] identifier[offset] operator[SEP] { Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Boolean] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[boolean] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getBoolean] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putBoolean] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Byte] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[byte] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getByte] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putByte] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Character] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[char] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getChar] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putChar] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Short] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[short] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getShort] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putShort] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Integer] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[int] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getInt] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putInt] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Long] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[long] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getLong] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putLong] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Float] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[float] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getFloat] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putFloat] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Double] operator[SEP] identifier[TYPE] operator[==] identifier[type] operator[SEP] { Keyword[double] identifier[origFieldValue] operator[=] identifier[THE_UNSAFE] operator[SEP] identifier[getDouble] operator[SEP] identifier[source] , identifier[offset] operator[SEP] operator[SEP] identifier[THE_UNSAFE] operator[SEP] identifier[putDouble] operator[SEP] identifier[copy] , identifier[offset] , identifier[origFieldValue] operator[SEP] operator[SEP] } }
@Override public GetHostReservationPurchasePreviewResult getHostReservationPurchasePreview(GetHostReservationPurchasePreviewRequest request) { request = beforeClientExecution(request); return executeGetHostReservationPurchasePreview(request); }
class class_name[name] begin[{] method[getHostReservationPurchasePreview, return_type[type[GetHostReservationPurchasePreviewResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetHostReservationPurchasePreview, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetHostReservationPurchasePreviewResult] identifier[getHostReservationPurchasePreview] operator[SEP] identifier[GetHostReservationPurchasePreviewRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetHostReservationPurchasePreview] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public boolean isFunction(final String variableExpression) { if (variableExpression == null || variableExpression.length() == 0) { return false; } for (int i = 0; i < functionLibraries.size(); i++) { FunctionLibrary lib = (FunctionLibrary)functionLibraries.get(i); if (variableExpression.startsWith(lib.getPrefix())) { return true; } } return false; }
class class_name[name] begin[{] method[isFunction, return_type[type[boolean]], modifier[public], parameter[variableExpression]] begin[{] if[binary_operation[binary_operation[member[.variableExpression], ==, literal[null]], ||, binary_operation[call[variableExpression.length, parameter[]], ==, literal[0]]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=functionLibraries, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FunctionLibrary, sub_type=None)), name=lib)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FunctionLibrary, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPrefix, postfix_operators=[], prefix_operators=[], qualifier=lib, selectors=[], type_arguments=None)], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=variableExpression, 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=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=functionLibraries, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isFunction] operator[SEP] Keyword[final] identifier[String] identifier[variableExpression] operator[SEP] { Keyword[if] operator[SEP] identifier[variableExpression] operator[==] Other[null] operator[||] identifier[variableExpression] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[functionLibraries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[FunctionLibrary] identifier[lib] operator[=] operator[SEP] identifier[FunctionLibrary] operator[SEP] identifier[functionLibraries] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[variableExpression] operator[SEP] identifier[startsWith] operator[SEP] identifier[lib] operator[SEP] identifier[getPrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static <MSG extends Message> MSG read(File file, Parser<MSG> parser) { InputStream input = null; try { input = new BufferedInputStream(new FileInputStream(file)); return parser.parseFrom(input); } catch (Exception e) { throw ContextException.of("Unable to read message", e).addContext("file", file); } finally { IOUtils.closeQuietly(input); } }
class class_name[name] begin[{] method[read, return_type[type[MSG]], modifier[public static], parameter[file, parser]] begin[{] local_variable[type[InputStream], input] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[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))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None))), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFrom, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to read message"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=ContextException, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="file"), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[MSG] Keyword[extends] identifier[Message] operator[>] identifier[MSG] identifier[read] operator[SEP] identifier[File] identifier[file] , identifier[Parser] operator[<] identifier[MSG] operator[>] identifier[parser] operator[SEP] { identifier[InputStream] identifier[input] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[input] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[parser] operator[SEP] identifier[parseFrom] operator[SEP] identifier[input] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[ContextException] operator[SEP] identifier[of] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[addContext] operator[SEP] literal[String] , identifier[file] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[input] operator[SEP] operator[SEP] } }
public PluginDescriptor loadPlugin(Plugin plugin) throws MojoExecutionException { try { final Object repositorySessionObject = this.getRepositorySessionMethod.invoke(this.session); return (PluginDescriptor) this.loadPluginMethod.invoke( this.buildPluginManager, plugin, getSession().getCurrentProject().getRemotePluginRepositories(), repositorySessionObject); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw new MojoExecutionException(e.getLocalizedMessage(), e); } }
class class_name[name] begin[{] method[loadPlugin, return_type[type[PluginDescriptor]], modifier[public], parameter[plugin]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=getRepositorySessionMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=session, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=repositorySessionObject)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), ReturnStatement(expression=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=loadPluginMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=buildPluginManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCurrentProject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getRemotePluginRepositories, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=repositorySessionObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=PluginDescriptor, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MojoExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException', 'IllegalArgumentException', 'InvocationTargetException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[PluginDescriptor] identifier[loadPlugin] operator[SEP] identifier[Plugin] identifier[plugin] operator[SEP] Keyword[throws] identifier[MojoExecutionException] { Keyword[try] { Keyword[final] identifier[Object] identifier[repositorySessionObject] operator[=] Keyword[this] operator[SEP] identifier[getRepositorySessionMethod] operator[SEP] identifier[invoke] operator[SEP] Keyword[this] operator[SEP] identifier[session] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[PluginDescriptor] operator[SEP] Keyword[this] operator[SEP] identifier[loadPluginMethod] operator[SEP] identifier[invoke] operator[SEP] Keyword[this] operator[SEP] identifier[buildPluginManager] , identifier[plugin] , identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentProject] operator[SEP] operator[SEP] operator[SEP] identifier[getRemotePluginRepositories] operator[SEP] operator[SEP] , identifier[repositorySessionObject] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] operator[|] identifier[IllegalArgumentException] operator[|] identifier[InvocationTargetException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MojoExecutionException] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static int nextPowerOfTwo(int x) { assert x < 0x10000; int bit = 0x8000, highest = -1, count = 0; for (int i = 15; i >= 0; --i, bit >>= 1) { if ((x & bit) != 0) { ++count; if (highest == -1) { highest = i; } } } if (count <= 1) { return 0; } return 1 << (highest + 1); }
class class_name[name] begin[{] method[nextPowerOfTwo, return_type[type[int]], modifier[public static], parameter[x]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x10000), operator=<), label=None, value=None) local_variable[type[int], bit] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), 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=MemberReference(member=count, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=highest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=highest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), Assignment(expressionl=MemberReference(member=bit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=>>=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), label=None) if[binary_operation[member[.count], <=, literal[1]]] begin[{] return[literal[0]] else begin[{] None end[}] return[binary_operation[literal[1], <<, binary_operation[member[.highest], +, literal[1]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[nextPowerOfTwo] operator[SEP] Keyword[int] identifier[x] operator[SEP] { Keyword[assert] identifier[x] operator[<] literal[Integer] operator[SEP] Keyword[int] identifier[bit] operator[=] literal[Integer] , identifier[highest] operator[=] operator[-] Other[1] , identifier[count] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[15] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] operator[--] identifier[i] , identifier[bit] operator[>>=] Other[1] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[x] operator[&] identifier[bit] operator[SEP] operator[!=] Other[0] operator[SEP] { operator[++] identifier[count] operator[SEP] Keyword[if] operator[SEP] identifier[highest] operator[==] operator[-] Other[1] operator[SEP] { identifier[highest] operator[=] identifier[i] operator[SEP] } } } Keyword[if] operator[SEP] identifier[count] operator[<=] Other[1] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[return] Other[1] operator[<<] operator[SEP] identifier[highest] operator[+] Other[1] operator[SEP] operator[SEP] }
@Override protected String getDescription(final MBeanAttributeInfo info) { String descr = info.getDescription(); Method m = getMethod(getMBeanInterface(), "get" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1)); if (m == null) { m = getMethod(getMBeanInterface(), "is" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1)); } if (m == null) { m = getMethod(getMBeanInterface(), "does" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1)); } if (m != null) { MBeanInfo d = m.getAnnotation(MBeanInfo.class); if (d != null) { descr = d.value(); } } return descr; }
class class_name[name] begin[{] method[getDescription, return_type[type[String]], modifier[protected], parameter[info]] begin[{] local_variable[type[String], descr] local_variable[type[Method], m] if[binary_operation[member[.m], ==, literal[null]]] begin[{] assign[member[.m], call[.getMethod, parameter[call[.getMBeanInterface, parameter[]], binary_operation[binary_operation[literal["is"], +, call[info.getName, parameter[]]], +, call[info.getName, parameter[]]]]]] else begin[{] None end[}] if[binary_operation[member[.m], ==, literal[null]]] begin[{] assign[member[.m], call[.getMethod, parameter[call[.getMBeanInterface, parameter[]], binary_operation[binary_operation[literal["does"], +, call[info.getName, parameter[]]], +, call[info.getName, parameter[]]]]]] else begin[{] None end[}] if[binary_operation[member[.m], !=, literal[null]]] begin[{] local_variable[type[MBeanInfo], d] if[binary_operation[member[.d], !=, literal[null]]] begin[{] assign[member[.descr], call[d.value, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.descr]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[String] identifier[getDescription] operator[SEP] Keyword[final] identifier[MBeanAttributeInfo] identifier[info] operator[SEP] { identifier[String] identifier[descr] operator[=] identifier[info] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] identifier[Method] identifier[m] operator[=] identifier[getMethod] operator[SEP] identifier[getMBeanInterface] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[info] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[+] identifier[info] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[==] Other[null] operator[SEP] { identifier[m] operator[=] identifier[getMethod] operator[SEP] identifier[getMBeanInterface] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[info] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[+] identifier[info] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m] operator[==] Other[null] operator[SEP] { identifier[m] operator[=] identifier[getMethod] operator[SEP] identifier[getMBeanInterface] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[info] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[+] identifier[info] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m] operator[!=] Other[null] operator[SEP] { identifier[MBeanInfo] identifier[d] operator[=] identifier[m] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[MBeanInfo] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[!=] Other[null] operator[SEP] { identifier[descr] operator[=] identifier[d] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[descr] operator[SEP] }
public static <T> T invoke(MethodHandle methodHandle, Object... params) { try { return (T)methodHandle.invokeWithArguments(params); } catch (RuntimeException e) { throw e; } catch (Throwable throwable) { throw new RuntimeException(throwable); } }
class class_name[name] begin[{] method[invoke, return_type[type[T]], modifier[public static], parameter[methodHandle, params]] begin[{] TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeWithArguments, postfix_operators=[], prefix_operators=[], qualifier=methodHandle, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=throwable, 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=throwable, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[invoke] operator[SEP] identifier[MethodHandle] identifier[methodHandle] , identifier[Object] operator[...] identifier[params] operator[SEP] { Keyword[try] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[methodHandle] operator[SEP] identifier[invokeWithArguments] operator[SEP] identifier[params] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[throwable] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[throwable] operator[SEP] operator[SEP] } }
public LinuxParameters withDevices(Device... devices) { if (this.devices == null) { setDevices(new com.amazonaws.internal.SdkInternalList<Device>(devices.length)); } for (Device ele : devices) { this.devices.add(ele); } return this; }
class class_name[name] begin[{] method[withDevices, return_type[type[LinuxParameters]], modifier[public], parameter[devices]] begin[{] if[binary_operation[THIS[member[None.devices]], ==, literal[null]]] begin[{] call[.setDevices, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=devices, 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=Device, sub_type=None))], dimensions=None, name=SdkInternalList, 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=devices, 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=devices, 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=Device, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[LinuxParameters] identifier[withDevices] operator[SEP] identifier[Device] operator[...] identifier[devices] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[devices] operator[==] Other[null] operator[SEP] { identifier[setDevices] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[Device] operator[>] operator[SEP] identifier[devices] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Device] identifier[ele] operator[:] identifier[devices] operator[SEP] { Keyword[this] operator[SEP] identifier[devices] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public long totalSize() { long retval=0; for(int i=0; i < index; i++) retval+=total_size_visitor.applyAsLong(messages[i], this); return retval; }
class class_name[name] begin[{] method[totalSize, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[long], retval] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=applyAsLong, postfix_operators=[], prefix_operators=[], qualifier=total_size_visitor, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=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[.retval]] end[}] END[}]
Keyword[public] Keyword[long] identifier[totalSize] operator[SEP] operator[SEP] { Keyword[long] identifier[retval] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[index] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[retval] operator[+=] identifier[total_size_visitor] operator[SEP] identifier[applyAsLong] operator[SEP] identifier[messages] operator[SEP] identifier[i] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[retval] operator[SEP] }
@Override public java.util.List<com.liferay.commerce.notification.model.CommerceNotificationAttachment> getCommerceNotificationAttachmentsByUuidAndCompanyId( String uuid, long companyId) { return _commerceNotificationAttachmentLocalService.getCommerceNotificationAttachmentsByUuidAndCompanyId(uuid, companyId); }
class class_name[name] begin[{] method[getCommerceNotificationAttachmentsByUuidAndCompanyId, return_type[type[java]], modifier[public], parameter[uuid, companyId]] begin[{] return[call[_commerceNotificationAttachmentLocalService.getCommerceNotificationAttachmentsByUuidAndCompanyId, parameter[member[.uuid], member[.companyId]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[notification] operator[SEP] identifier[model] operator[SEP] identifier[CommerceNotificationAttachment] operator[>] identifier[getCommerceNotificationAttachmentsByUuidAndCompanyId] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] operator[SEP] { Keyword[return] identifier[_commerceNotificationAttachmentLocalService] operator[SEP] identifier[getCommerceNotificationAttachmentsByUuidAndCompanyId] operator[SEP] identifier[uuid] , identifier[companyId] operator[SEP] operator[SEP] }