code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static ClientBean unmarshallClient(Map<String, Object> source) { if (source == null) { return null; } ClientBean bean = new ClientBean(); bean.setId(asString(source.get("id"))); bean.setName(asString(source.get("name"))); bean.setDescription(asString(source.get("description"))); bean.setCreatedBy(asString(source.get("createdBy"))); bean.setCreatedOn(asDate(source.get("createdOn"))); postMarshall(bean); return bean; }
class class_name[name] begin[{] method[unmarshallClient, return_type[type[ClientBean]], modifier[public static], parameter[source]] begin[{] if[binary_operation[member[.source], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[ClientBean], bean] call[bean.setId, parameter[call[.asString, parameter[call[source.get, parameter[literal["id"]]]]]]] call[bean.setName, parameter[call[.asString, parameter[call[source.get, parameter[literal["name"]]]]]]] call[bean.setDescription, parameter[call[.asString, parameter[call[source.get, parameter[literal["description"]]]]]]] call[bean.setCreatedBy, parameter[call[.asString, parameter[call[source.get, parameter[literal["createdBy"]]]]]]] call[bean.setCreatedOn, parameter[call[.asDate, parameter[call[source.get, parameter[literal["createdOn"]]]]]]] call[.postMarshall, parameter[member[.bean]]] return[member[.bean]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ClientBean] identifier[unmarshallClient] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[source] operator[SEP] { Keyword[if] operator[SEP] identifier[source] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[ClientBean] identifier[bean] operator[=] Keyword[new] identifier[ClientBean] operator[SEP] operator[SEP] operator[SEP] identifier[bean] operator[SEP] identifier[setId] operator[SEP] identifier[asString] operator[SEP] identifier[source] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bean] operator[SEP] identifier[setName] operator[SEP] identifier[asString] operator[SEP] identifier[source] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bean] operator[SEP] identifier[setDescription] operator[SEP] identifier[asString] operator[SEP] identifier[source] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bean] operator[SEP] identifier[setCreatedBy] operator[SEP] identifier[asString] operator[SEP] identifier[source] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bean] operator[SEP] identifier[setCreatedOn] operator[SEP] identifier[asDate] operator[SEP] identifier[source] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[postMarshall] operator[SEP] identifier[bean] operator[SEP] operator[SEP] Keyword[return] identifier[bean] operator[SEP] }
public static base_responses add(nitro_service client, cachecontentgroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { cachecontentgroup addresources[] = new cachecontentgroup[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new cachecontentgroup(); addresources[i].name = resources[i].name; addresources[i].weakposrelexpiry = resources[i].weakposrelexpiry; addresources[i].heurexpiryparam = resources[i].heurexpiryparam; addresources[i].relexpiry = resources[i].relexpiry; addresources[i].relexpirymillisec = resources[i].relexpirymillisec; addresources[i].absexpiry = resources[i].absexpiry; addresources[i].absexpirygmt = resources[i].absexpirygmt; addresources[i].weaknegrelexpiry = resources[i].weaknegrelexpiry; addresources[i].hitparams = resources[i].hitparams; addresources[i].invalparams = resources[i].invalparams; addresources[i].ignoreparamvaluecase = resources[i].ignoreparamvaluecase; addresources[i].matchcookies = resources[i].matchcookies; addresources[i].invalrestrictedtohost = resources[i].invalrestrictedtohost; addresources[i].polleverytime = resources[i].polleverytime; addresources[i].ignorereloadreq = resources[i].ignorereloadreq; addresources[i].removecookies = resources[i].removecookies; addresources[i].prefetch = resources[i].prefetch; addresources[i].prefetchperiod = resources[i].prefetchperiod; addresources[i].prefetchperiodmillisec = resources[i].prefetchperiodmillisec; addresources[i].prefetchmaxpending = resources[i].prefetchmaxpending; addresources[i].flashcache = resources[i].flashcache; addresources[i].expireatlastbyte = resources[i].expireatlastbyte; addresources[i].insertvia = resources[i].insertvia; addresources[i].insertage = resources[i].insertage; addresources[i].insertetag = resources[i].insertetag; addresources[i].cachecontrol = resources[i].cachecontrol; addresources[i].quickabortsize = resources[i].quickabortsize; addresources[i].minressize = resources[i].minressize; addresources[i].maxressize = resources[i].maxressize; addresources[i].memlimit = resources[i].memlimit; addresources[i].ignorereqcachinghdrs = resources[i].ignorereqcachinghdrs; addresources[i].minhits = resources[i].minhits; addresources[i].alwaysevalpolicies = resources[i].alwaysevalpolicies; addresources[i].persist = resources[i].persist; addresources[i].pinned = resources[i].pinned; addresources[i].lazydnsresolve = resources[i].lazydnsresolve; addresources[i].hitselector = resources[i].hitselector; addresources[i].invalselector = resources[i].invalselector; addresources[i].type = resources[i].type; } result = add_bulk_request(client, addresources); } return result; }
class class_name[name] begin[{] method[add, return_type[type[base_responses]], modifier[public static], parameter[client, resources]] begin[{] local_variable[type[base_responses], result] if[binary_operation[binary_operation[member[.resources], !=, literal[null]], &&, binary_operation[member[resources.length], >, literal[0]]]] begin[{] local_variable[type[cachecontentgroup], addresources] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, 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=cachecontentgroup, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=weakposrelexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=weakposrelexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=heurexpiryparam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=heurexpiryparam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=relexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=relexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=relexpirymillisec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=relexpirymillisec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=absexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=absexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=absexpirygmt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=absexpirygmt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=weaknegrelexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=weaknegrelexpiry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=hitparams, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=hitparams, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=invalparams, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=invalparams, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=ignoreparamvaluecase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=ignoreparamvaluecase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=matchcookies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=matchcookies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=invalrestrictedtohost, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=invalrestrictedtohost, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=polleverytime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=polleverytime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=ignorereloadreq, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=ignorereloadreq, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=removecookies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=removecookies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetchperiod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetchperiod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetchperiodmillisec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetchperiodmillisec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetchmaxpending, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=prefetchmaxpending, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=flashcache, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=flashcache, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=expireatlastbyte, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=expireatlastbyte, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=insertvia, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=insertvia, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=insertage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=insertage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=insertetag, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=insertetag, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=cachecontrol, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=cachecontrol, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=quickabortsize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=quickabortsize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=minressize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=minressize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=maxressize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=maxressize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=memlimit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=memlimit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=ignorereqcachinghdrs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=ignorereqcachinghdrs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=minhits, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=minhits, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=alwaysevalpolicies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=alwaysevalpolicies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=persist, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=persist, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=pinned, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=pinned, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=lazydnsresolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=lazydnsresolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=hitselector, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=hitselector, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=invalselector, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=invalselector, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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=resources, 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[.result], call[.add_bulk_request, parameter[member[.client], member[.addresources]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[base_responses] identifier[add] operator[SEP] identifier[nitro_service] identifier[client] , identifier[cachecontentgroup] identifier[resources] operator[SEP] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[base_responses] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[!=] Other[null] operator[&&] identifier[resources] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[cachecontentgroup] identifier[addresources] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[cachecontentgroup] operator[SEP] identifier[resources] 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[resources] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[cachecontentgroup] operator[SEP] operator[SEP] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[weakposrelexpiry] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[weakposrelexpiry] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[heurexpiryparam] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[heurexpiryparam] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[relexpiry] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[relexpiry] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[relexpirymillisec] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[relexpirymillisec] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[absexpiry] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[absexpiry] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[absexpirygmt] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[absexpirygmt] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[weaknegrelexpiry] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[weaknegrelexpiry] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[hitparams] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[hitparams] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[invalparams] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[invalparams] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ignoreparamvaluecase] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ignoreparamvaluecase] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[matchcookies] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[matchcookies] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[invalrestrictedtohost] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[invalrestrictedtohost] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[polleverytime] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[polleverytime] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ignorereloadreq] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ignorereloadreq] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[removecookies] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[removecookies] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetch] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetch] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetchperiod] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetchperiod] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetchperiodmillisec] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetchperiodmillisec] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetchmaxpending] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[prefetchmaxpending] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[flashcache] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[flashcache] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[expireatlastbyte] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[expireatlastbyte] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[insertvia] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[insertvia] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[insertage] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[insertage] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[insertetag] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[insertetag] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[cachecontrol] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[cachecontrol] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[quickabortsize] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[quickabortsize] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[minressize] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[minressize] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[maxressize] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[maxressize] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[memlimit] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[memlimit] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ignorereqcachinghdrs] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ignorereqcachinghdrs] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[minhits] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[minhits] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[alwaysevalpolicies] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[alwaysevalpolicies] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[persist] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[persist] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[pinned] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[pinned] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[lazydnsresolve] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[lazydnsresolve] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[hitselector] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[hitselector] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[invalselector] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[invalselector] operator[SEP] identifier[addresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[type] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[type] operator[SEP] } identifier[result] operator[=] identifier[add_bulk_request] operator[SEP] identifier[client] , identifier[addresources] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
static void generateVisitors(Set<String> elementNames, List<XsdAttribute> attributes, String apiName){ generateVisitorInterface(elementNames, filterAttributes(attributes), apiName); }
class class_name[name] begin[{] method[generateVisitors, return_type[void], modifier[static], parameter[elementNames, attributes, apiName]] begin[{] call[.generateVisitorInterface, parameter[member[.elementNames], call[.filterAttributes, parameter[member[.attributes]]], member[.apiName]]] end[}] END[}]
Keyword[static] Keyword[void] identifier[generateVisitors] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[elementNames] , identifier[List] operator[<] identifier[XsdAttribute] operator[>] identifier[attributes] , identifier[String] identifier[apiName] operator[SEP] { identifier[generateVisitorInterface] operator[SEP] identifier[elementNames] , identifier[filterAttributes] operator[SEP] identifier[attributes] operator[SEP] , identifier[apiName] operator[SEP] operator[SEP] }
public static Feed buildFeed(FeedDesc feedDesc){ Feed feed = null; NitFactory nitFactory = new NitFactory(); NitDesc nitDesc = nitDescFromDynamic(feedDesc); nitDesc.setConstructorParameters(new Class [] { Map.class }); nitDesc.setConstructorArguments(new Object[] { feedDesc.getProperties() }); try { feed = nitFactory.construct(nitDesc); } catch (NitException e) { throw new RuntimeException(e); } return feed; }
class class_name[name] begin[{] method[buildFeed, return_type[type[Feed]], modifier[public static], parameter[feedDesc]] begin[{] local_variable[type[Feed], feed] local_variable[type[NitFactory], nitFactory] local_variable[type[NitDesc], nitDesc] call[nitDesc.setConstructorParameters, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))]] call[nitDesc.setConstructorArguments, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=feedDesc, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=feed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=nitDesc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=construct, postfix_operators=[], prefix_operators=[], qualifier=nitFactory, 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=['NitException']))], finally_block=None, label=None, resources=None) return[member[.feed]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Feed] identifier[buildFeed] operator[SEP] identifier[FeedDesc] identifier[feedDesc] operator[SEP] { identifier[Feed] identifier[feed] operator[=] Other[null] operator[SEP] identifier[NitFactory] identifier[nitFactory] operator[=] Keyword[new] identifier[NitFactory] operator[SEP] operator[SEP] operator[SEP] identifier[NitDesc] identifier[nitDesc] operator[=] identifier[nitDescFromDynamic] operator[SEP] identifier[feedDesc] operator[SEP] operator[SEP] identifier[nitDesc] operator[SEP] identifier[setConstructorParameters] operator[SEP] Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[Map] operator[SEP] Keyword[class] } operator[SEP] operator[SEP] identifier[nitDesc] operator[SEP] identifier[setConstructorArguments] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[feedDesc] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[try] { identifier[feed] operator[=] identifier[nitFactory] operator[SEP] identifier[construct] operator[SEP] identifier[nitDesc] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NitException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[feed] operator[SEP] }
@Pure public static <P1, P2> Procedure1<P2> curry(final Procedure2<? super P1, ? super P2> procedure, final P1 argument) { if (procedure == null) throw new NullPointerException("procedure"); return new Procedure1<P2>() { @Override public void apply(P2 p) { procedure.apply(argument, p); } }; }
class class_name[name] begin[{] method[curry, return_type[type[Procedure1]], modifier[public static], parameter[procedure, argument]] begin[{] if[binary_operation[member[.procedure], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="procedure")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=argument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=procedure, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=p, type=ReferenceType(arguments=None, dimensions=[], name=P2, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=P2, sub_type=None))], dimensions=None, name=Procedure1, sub_type=None))] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] operator[<] identifier[P1] , identifier[P2] operator[>] identifier[Procedure1] operator[<] identifier[P2] operator[>] identifier[curry] operator[SEP] Keyword[final] identifier[Procedure2] operator[<] operator[?] Keyword[super] identifier[P1] , operator[?] Keyword[super] identifier[P2] operator[>] identifier[procedure] , Keyword[final] identifier[P1] identifier[argument] operator[SEP] { Keyword[if] operator[SEP] identifier[procedure] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Procedure1] operator[<] identifier[P2] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[apply] operator[SEP] identifier[P2] identifier[p] operator[SEP] { identifier[procedure] operator[SEP] identifier[apply] operator[SEP] identifier[argument] , identifier[p] operator[SEP] operator[SEP] } } operator[SEP] }
public long raw_total(int i){ if(!seekable||i>=links) return (-1); if(i<0){ long acc=0; // bug? for(int j=0; j<links; j++){ acc+=raw_total(j); } return (acc); } else{ return (offsets[i+1]-offsets[i]); } }
class class_name[name] begin[{] method[raw_total, return_type[type[long]], modifier[public], parameter[i]] begin[{] if[binary_operation[member[.seekable], ||, binary_operation[member[.i], >=, member[.links]]]] begin[{] return[literal[1]] else begin[{] None end[}] if[binary_operation[member[.i], <, literal[0]]] begin[{] local_variable[type[long], acc] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=acc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=raw_total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=links, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.acc]] else begin[{] return[binary_operation[member[.offsets], -, member[.offsets]]] end[}] end[}] END[}]
Keyword[public] Keyword[long] identifier[raw_total] operator[SEP] Keyword[int] identifier[i] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[seekable] operator[||] identifier[i] operator[>=] identifier[links] operator[SEP] Keyword[return] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] Other[0] operator[SEP] { Keyword[long] identifier[acc] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[links] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[acc] operator[+=] identifier[raw_total] operator[SEP] identifier[j] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[acc] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] identifier[offsets] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[-] identifier[offsets] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } }
public void startUp() throws Exception { logger.info(String.format("Starting RPC server on port %d", port)); ServerBootstrap bootstrap = new ServerBootstrap(); ChannelFuture futureChannel = bootstrap.group(parentGroup, childGroup) .channel(channelClass) .childHandler(channelInitializer()) .bind(port) .awaitUninterruptibly(); if (futureChannel.isSuccess()) { this.channel = futureChannel.channel(); logger.info("RPC server started successfully."); } else { logger.info("Failed to start RPC server."); throw new Exception(futureChannel.cause()); } }
class class_name[name] begin[{] method[startUp, return_type[void], modifier[public], parameter[]] begin[{] call[logger.info, parameter[call[String.format, parameter[literal["Starting RPC server on port %d"], member[.port]]]]] local_variable[type[ServerBootstrap], bootstrap] local_variable[type[ChannelFuture], futureChannel] if[call[futureChannel.isSuccess, parameter[]]] begin[{] assign[THIS[member[None.channel]], call[futureChannel.channel, parameter[]]] call[logger.info, parameter[literal["RPC server started successfully."]]] else begin[{] call[logger.info, parameter[literal["Failed to start RPC server."]]] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=cause, postfix_operators=[], prefix_operators=[], qualifier=futureChannel, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[startUp] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[port] operator[SEP] operator[SEP] operator[SEP] identifier[ServerBootstrap] identifier[bootstrap] operator[=] Keyword[new] identifier[ServerBootstrap] operator[SEP] operator[SEP] operator[SEP] identifier[ChannelFuture] identifier[futureChannel] operator[=] identifier[bootstrap] operator[SEP] identifier[group] operator[SEP] identifier[parentGroup] , identifier[childGroup] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[channelClass] operator[SEP] operator[SEP] identifier[childHandler] operator[SEP] identifier[channelInitializer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[port] operator[SEP] operator[SEP] identifier[awaitUninterruptibly] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[futureChannel] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[channel] operator[=] identifier[futureChannel] operator[SEP] identifier[channel] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] identifier[futureChannel] operator[SEP] identifier[cause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public HttpRequest buildPutRequest(GenericUrl url, HttpContent content) throws IOException { return buildRequest(HttpMethods.PUT, url, content); }
class class_name[name] begin[{] method[buildPutRequest, return_type[type[HttpRequest]], modifier[public], parameter[url, content]] begin[{] return[call[.buildRequest, parameter[member[HttpMethods.PUT], member[.url], member[.content]]]] end[}] END[}]
Keyword[public] identifier[HttpRequest] identifier[buildPutRequest] operator[SEP] identifier[GenericUrl] identifier[url] , identifier[HttpContent] identifier[content] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[buildRequest] operator[SEP] identifier[HttpMethods] operator[SEP] identifier[PUT] , identifier[url] , identifier[content] operator[SEP] operator[SEP] }
public void marshall(DeleteUserPoolClientRequest deleteUserPoolClientRequest, ProtocolMarshaller protocolMarshaller) { if (deleteUserPoolClientRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteUserPoolClientRequest.getUserPoolId(), USERPOOLID_BINDING); protocolMarshaller.marshall(deleteUserPoolClientRequest.getClientId(), CLIENTID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[deleteUserPoolClientRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.deleteUserPoolClientRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUserPoolId, postfix_operators=[], prefix_operators=[], qualifier=deleteUserPoolClientRequest, selectors=[], type_arguments=None), MemberReference(member=USERPOOLID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClientId, postfix_operators=[], prefix_operators=[], qualifier=deleteUserPoolClientRequest, selectors=[], type_arguments=None), MemberReference(member=CLIENTID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DeleteUserPoolClientRequest] identifier[deleteUserPoolClientRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[deleteUserPoolClientRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteUserPoolClientRequest] operator[SEP] identifier[getUserPoolId] operator[SEP] operator[SEP] , identifier[USERPOOLID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteUserPoolClientRequest] operator[SEP] identifier[getClientId] operator[SEP] operator[SEP] , identifier[CLIENTID_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
boolean addCode(int code, byte []minKey, byte []maxKey, int pid) { int len = minKey.length + maxKey.length + 5; int index = getIndex() - len; int ptr = index; if (ptr < 0) { return false; } byte []buffer = getBuffer(); buffer[ptr] = (byte) code; ptr += 1; System.arraycopy(minKey, 0, buffer, ptr, minKey.length); ptr += minKey.length; System.arraycopy(maxKey, 0, buffer, ptr, maxKey.length); ptr += maxKey.length; BitsUtil.writeInt(buffer, ptr, pid); setIndex(index); /* System.out.println("ADDC: " + code + " " + pid + " " + Hex.toShortHex(minKey) + " " + Hex.toShortHex(maxKey)); */ return true; }
class class_name[name] begin[{] method[addCode, return_type[type[boolean]], modifier[default], parameter[code, minKey, maxKey, pid]] begin[{] local_variable[type[int], len] local_variable[type[int], index] local_variable[type[int], ptr] if[binary_operation[member[.ptr], <, literal[0]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[byte], buffer] assign[member[.buffer], Cast(expression=MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))] assign[member[.ptr], literal[1]] call[System.arraycopy, parameter[member[.minKey], literal[0], member[.buffer], member[.ptr], member[minKey.length]]] assign[member[.ptr], member[minKey.length]] call[System.arraycopy, parameter[member[.maxKey], literal[0], member[.buffer], member[.ptr], member[maxKey.length]]] assign[member[.ptr], member[maxKey.length]] call[BitsUtil.writeInt, parameter[member[.buffer], member[.ptr], member[.pid]]] call[.setIndex, parameter[member[.index]]] return[literal[true]] end[}] END[}]
Keyword[boolean] identifier[addCode] operator[SEP] Keyword[int] identifier[code] , Keyword[byte] operator[SEP] operator[SEP] identifier[minKey] , Keyword[byte] operator[SEP] operator[SEP] identifier[maxKey] , Keyword[int] identifier[pid] operator[SEP] { Keyword[int] identifier[len] operator[=] identifier[minKey] operator[SEP] identifier[length] operator[+] identifier[maxKey] operator[SEP] identifier[length] operator[+] Other[5] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[getIndex] operator[SEP] operator[SEP] operator[-] identifier[len] operator[SEP] Keyword[int] identifier[ptr] operator[=] identifier[index] operator[SEP] Keyword[if] operator[SEP] identifier[ptr] operator[<] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[ptr] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[code] operator[SEP] identifier[ptr] operator[+=] Other[1] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[minKey] , Other[0] , identifier[buffer] , identifier[ptr] , identifier[minKey] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[ptr] operator[+=] identifier[minKey] operator[SEP] identifier[length] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[maxKey] , Other[0] , identifier[buffer] , identifier[ptr] , identifier[maxKey] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[ptr] operator[+=] identifier[maxKey] operator[SEP] identifier[length] operator[SEP] identifier[BitsUtil] operator[SEP] identifier[writeInt] operator[SEP] identifier[buffer] , identifier[ptr] , identifier[pid] operator[SEP] operator[SEP] identifier[setIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public static void handleThemeResourceRequest(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { if (req.getHeader("If-Modified-Since") != null) { resp.reset(); resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return; } String fileName = req.getParameter("f"); String path = req.getPathInfo(); if (fileName == null && !Util.empty(path)) { int offset = path.startsWith(THEME_RESOURCE_PATH_PARAM) ? THEME_RESOURCE_PATH_PARAM. length() : 1; fileName = path.substring(offset); } if (fileName == null || !checkThemeFile(fileName)) { resp.setStatus(HttpServletResponse.SC_NOT_FOUND); return; } InputStream resourceStream = null; try { URL url = null; // Check for project translation file if (fileName.startsWith(THEME_TRANSLATION_RESOURCE_PREFIX)) { String resourceFileName = fileName.substring(THEME_TRANSLATION_RESOURCE_PREFIX.length()); url = ServletUtil.class.getResource(THEME_PROJECT_TRANSLATION_RESOURCE_PATH + resourceFileName); } // Load from the theme path if (url == null) { String resourceName = ThemeUtil.getThemeBase() + fileName; url = ServletUtil.class.getResource(resourceName); } if (url == null) { resp.setStatus(HttpServletResponse.SC_NOT_FOUND); } else { URLConnection connection = url.openConnection(); resourceStream = connection.getInputStream(); int size = resourceStream.available(); if (size > 0) { resp.setContentLength(size); } /* I have commented out the setting of the Content-Disposition on static theme resources because, well why is it there? If this needs to be reinstated please provide a thorough justification comment here so the reasons are clear. Note that setting this header breaks Polymer 1.0 when it is present on HTML imports. String encodedName = WebUtilities.encodeForContentDispositionHeader(fileName. substring(fileName .lastIndexOf('/') + 1)); resp.setHeader("Content-Disposition", "filename=" + encodedName); // "filename=" to comply with https://tools.ietf.org/html/rfc6266 */ resp.setContentType(WebUtilities.getContentType(fileName)); resp.setHeader("Cache-Control", CacheType.THEME_CACHE.getSettings()); resp.setHeader("Expires", "31536000"); resp.setHeader("ETag", "\"" + WebUtilities.getProjectVersion() + "\""); // resp.setHeader("Last-Modified", "Mon, 02 Jan 2015 01:00:00 GMT"); long modified = connection.getLastModified(); resp.setDateHeader("Last-Modified", modified); StreamUtil.copy(resourceStream, resp.getOutputStream()); } } finally { StreamUtil.safeClose(resourceStream); } }
class class_name[name] begin[{] method[handleThemeResourceRequest, return_type[void], modifier[public static], parameter[req, resp]] begin[{] if[binary_operation[call[req.getHeader, parameter[literal["If-Modified-Since"]]], !=, literal[null]]] begin[{] call[resp.reset, parameter[]] call[resp.setStatus, parameter[member[HttpServletResponse.SC_NOT_MODIFIED]]] return[None] else begin[{] None end[}] local_variable[type[String], fileName] local_variable[type[String], path] if[binary_operation[binary_operation[member[.fileName], ==, literal[null]], &&, call[Util.empty, parameter[member[.path]]]]] begin[{] local_variable[type[int], offset] assign[member[.fileName], call[path.substring, parameter[member[.offset]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.fileName], ==, literal[null]], ||, call[.checkThemeFile, parameter[member[.fileName]]]]] begin[{] call[resp.setStatus, parameter[member[HttpServletResponse.SC_NOT_FOUND]]] return[None] else begin[{] None end[}] local_variable[type[InputStream], resourceStream] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=THEME_TRANSLATION_RESOURCE_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=fileName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=THEME_TRANSLATION_RESOURCE_PREFIX, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fileName, selectors=[], type_arguments=None), name=resourceFileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=THEME_PROJECT_TRANSLATION_RESOURCE_PATH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=resourceFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=getResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ServletUtil, sub_type=None))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getThemeBase, postfix_operators=[], prefix_operators=[], qualifier=ThemeUtil, selectors=[], type_arguments=None), operandr=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=resourceName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ServletUtil, sub_type=None))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=url, 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=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), name=connection)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URLConnection, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resourceStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=resourceStream, selectors=[], type_arguments=None), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContentLength, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getContentType, postfix_operators=[], prefix_operators=[], qualifier=WebUtilities, selectors=[], type_arguments=None)], member=setContentType, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cache-Control"), MethodInvocation(arguments=[], member=getSettings, postfix_operators=[], prefix_operators=[], qualifier=CacheType.THEME_CACHE, selectors=[], type_arguments=None)], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expires"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="31536000")], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ETag"), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operandr=MethodInvocation(arguments=[], member=getProjectVersion, postfix_operators=[], prefix_operators=[], qualifier=WebUtilities, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLastModified, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), name=modified)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Last-Modified"), MemberReference(member=modified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDateHeader, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None)], member=copy, postfix_operators=[], prefix_operators=[], qualifier=StreamUtil, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SC_NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=HttpServletResponse, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=safeClose, postfix_operators=[], prefix_operators=[], qualifier=StreamUtil, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[handleThemeResourceRequest] operator[SEP] Keyword[final] identifier[HttpServletRequest] identifier[req] , Keyword[final] identifier[HttpServletResponse] identifier[resp] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] { Keyword[if] operator[SEP] identifier[req] operator[SEP] identifier[getHeader] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[resp] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_MODIFIED] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[String] identifier[fileName] operator[=] identifier[req] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[req] operator[SEP] identifier[getPathInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileName] operator[==] Other[null] operator[&&] operator[!] identifier[Util] operator[SEP] identifier[empty] operator[SEP] identifier[path] operator[SEP] operator[SEP] { Keyword[int] identifier[offset] operator[=] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] identifier[THEME_RESOURCE_PATH_PARAM] operator[SEP] operator[?] identifier[THEME_RESOURCE_PATH_PARAM] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[:] Other[1] operator[SEP] identifier[fileName] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[offset] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fileName] operator[==] Other[null] operator[||] operator[!] identifier[checkThemeFile] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] { identifier[resp] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_FOUND] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[InputStream] identifier[resourceStream] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[URL] identifier[url] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[fileName] operator[SEP] identifier[startsWith] operator[SEP] identifier[THEME_TRANSLATION_RESOURCE_PREFIX] operator[SEP] operator[SEP] { identifier[String] identifier[resourceFileName] operator[=] identifier[fileName] operator[SEP] identifier[substring] operator[SEP] identifier[THEME_TRANSLATION_RESOURCE_PREFIX] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[url] operator[=] identifier[ServletUtil] operator[SEP] Keyword[class] operator[SEP] identifier[getResource] operator[SEP] identifier[THEME_PROJECT_TRANSLATION_RESOURCE_PATH] operator[+] identifier[resourceFileName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { identifier[String] identifier[resourceName] operator[=] identifier[ThemeUtil] operator[SEP] identifier[getThemeBase] operator[SEP] operator[SEP] operator[+] identifier[fileName] operator[SEP] identifier[url] operator[=] identifier[ServletUtil] operator[SEP] Keyword[class] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { identifier[resp] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_FOUND] operator[SEP] operator[SEP] } Keyword[else] { identifier[URLConnection] identifier[connection] operator[=] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[resourceStream] operator[=] identifier[connection] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[resourceStream] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>] Other[0] operator[SEP] { identifier[resp] operator[SEP] identifier[setContentLength] operator[SEP] identifier[size] operator[SEP] operator[SEP] } identifier[resp] operator[SEP] identifier[setContentType] operator[SEP] identifier[WebUtilities] operator[SEP] identifier[getContentType] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , identifier[CacheType] operator[SEP] identifier[THEME_CACHE] operator[SEP] identifier[getSettings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[WebUtilities] operator[SEP] identifier[getProjectVersion] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[long] identifier[modified] operator[=] identifier[connection] operator[SEP] identifier[getLastModified] operator[SEP] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setDateHeader] operator[SEP] literal[String] , identifier[modified] operator[SEP] operator[SEP] identifier[StreamUtil] operator[SEP] identifier[copy] operator[SEP] identifier[resourceStream] , identifier[resp] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[StreamUtil] operator[SEP] identifier[safeClose] operator[SEP] identifier[resourceStream] operator[SEP] operator[SEP] } }
private static LoginContext createLoginContext(AuthType authType, Subject subject, ClassLoader classLoader, javax.security.auth.login.Configuration configuration, AlluxioConfiguration alluxioConf) throws LoginException { CallbackHandler callbackHandler = null; if (authType.equals(AuthType.SIMPLE) || authType.equals(AuthType.CUSTOM)) { callbackHandler = new AppLoginModule.AppCallbackHandler(alluxioConf); } ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); try { // Create LoginContext based on authType, corresponding LoginModule should be registered // under the authType name in LoginModuleConfiguration. return new LoginContext(authType.getAuthName(), subject, callbackHandler, configuration); } finally { Thread.currentThread().setContextClassLoader(previousClassLoader); } }
class class_name[name] begin[{] method[createLoginContext, return_type[type[LoginContext]], modifier[private static], parameter[authType, subject, classLoader, configuration, alluxioConf]] begin[{] local_variable[type[CallbackHandler], callbackHandler] if[binary_operation[call[authType.equals, parameter[member[AuthType.SIMPLE]]], ||, call[authType.equals, parameter[member[AuthType.CUSTOM]]]]] begin[{] assign[member[.callbackHandler], ClassCreator(arguments=[MemberReference(member=alluxioConf, 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=AppLoginModule, sub_type=ReferenceType(arguments=None, dimensions=None, name=AppCallbackHandler, sub_type=None)))] else begin[{] None end[}] local_variable[type[ClassLoader], previousClassLoader] call[Thread.currentThread, parameter[]] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAuthName, postfix_operators=[], prefix_operators=[], qualifier=authType, selectors=[], type_arguments=None), MemberReference(member=subject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callbackHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=configuration, 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=LoginContext, sub_type=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[MemberReference(member=previousClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[LoginContext] identifier[createLoginContext] operator[SEP] identifier[AuthType] identifier[authType] , identifier[Subject] identifier[subject] , identifier[ClassLoader] identifier[classLoader] , identifier[javax] operator[SEP] identifier[security] operator[SEP] identifier[auth] operator[SEP] identifier[login] operator[SEP] identifier[Configuration] identifier[configuration] , identifier[AlluxioConfiguration] identifier[alluxioConf] operator[SEP] Keyword[throws] identifier[LoginException] { identifier[CallbackHandler] identifier[callbackHandler] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[authType] operator[SEP] identifier[equals] operator[SEP] identifier[AuthType] operator[SEP] identifier[SIMPLE] operator[SEP] operator[||] identifier[authType] operator[SEP] identifier[equals] operator[SEP] identifier[AuthType] operator[SEP] identifier[CUSTOM] operator[SEP] operator[SEP] { identifier[callbackHandler] operator[=] Keyword[new] identifier[AppLoginModule] operator[SEP] identifier[AppCallbackHandler] operator[SEP] identifier[alluxioConf] operator[SEP] operator[SEP] } identifier[ClassLoader] identifier[previousClassLoader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setContextClassLoader] operator[SEP] identifier[classLoader] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] Keyword[new] identifier[LoginContext] operator[SEP] identifier[authType] operator[SEP] identifier[getAuthName] operator[SEP] operator[SEP] , identifier[subject] , identifier[callbackHandler] , identifier[configuration] operator[SEP] operator[SEP] } Keyword[finally] { identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setContextClassLoader] operator[SEP] identifier[previousClassLoader] operator[SEP] operator[SEP] } }
public void eFeature1Init(int y, int yp, Map fmap) { eFeature1Init(y, yp); strId2IdxAdd(fmap); }
class class_name[name] begin[{] method[eFeature1Init, return_type[void], modifier[public], parameter[y, yp, fmap]] begin[{] call[.eFeature1Init, parameter[member[.y], member[.yp]]] call[.strId2IdxAdd, parameter[member[.fmap]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[eFeature1Init] operator[SEP] Keyword[int] identifier[y] , Keyword[int] identifier[yp] , identifier[Map] identifier[fmap] operator[SEP] { identifier[eFeature1Init] operator[SEP] identifier[y] , identifier[yp] operator[SEP] operator[SEP] identifier[strId2IdxAdd] operator[SEP] identifier[fmap] operator[SEP] operator[SEP] }
public final B setHeader(CharSequence name, Object value) { requireNonNull(name, "name"); requireNonNull(value, "value"); getOrCreateHeaders().setObject(HttpHeaderNames.of(name), value); return self(); }
class class_name[name] begin[{] method[setHeader, return_type[type[B]], modifier[final public], parameter[name, value]] begin[{] call[.requireNonNull, parameter[member[.name], literal["name"]]] call[.requireNonNull, parameter[member[.value], literal["value"]]] call[.getOrCreateHeaders, parameter[]] return[call[.self, parameter[]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[B] identifier[setHeader] operator[SEP] identifier[CharSequence] identifier[name] , identifier[Object] identifier[value] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[name] , literal[String] operator[SEP] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[value] , literal[String] operator[SEP] operator[SEP] identifier[getOrCreateHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[setObject] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[of] operator[SEP] identifier[name] operator[SEP] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP] }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { XAttributeMap map = null; // restore correct type of attribute map, i.e., check for buffered // implementation, and correctly restore lazy implementation if // this had been used for serialization. boolean lazy = reader.getAttribute("lazy").equals("true"); boolean buffered = reader.getAttribute("buffered").equals("true"); if (lazy) { if (buffered) { map = new XAttributeMapLazyImpl<XAttributeMapBufferedImpl>( XAttributeMapBufferedImpl.class); } else { map = new XAttributeMapLazyImpl<XAttributeMapImpl>( XAttributeMapImpl.class); } } else if (buffered) { map = new XAttributeMapBufferedImpl(); } else { map = new XAttributeMapImpl(); } while (reader.hasMoreChildren()) { reader.moveDown(); XAttribute attribute = (XAttribute) context.convertAnother(map, XAttribute.class, XesXStreamPersistency.attributeConverter); map.put(attribute.getKey(), attribute); reader.moveUp(); } return map; }
class class_name[name] begin[{] method[unmarshal, return_type[type[Object]], modifier[public], parameter[reader, context]] begin[{] local_variable[type[XAttributeMap], map] local_variable[type[boolean], lazy] local_variable[type[boolean], buffered] if[member[.lazy]] begin[{] if[member[.buffered]] begin[{] assign[member[.map], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAttributeMapBufferedImpl, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=XAttributeMapBufferedImpl, sub_type=None))], dimensions=None, name=XAttributeMapLazyImpl, sub_type=None))] else begin[{] assign[member[.map], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAttributeMapImpl, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=XAttributeMapImpl, sub_type=None))], dimensions=None, name=XAttributeMapLazyImpl, sub_type=None))] end[}] else begin[{] if[member[.buffered]] begin[{] assign[member[.map], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAttributeMapBufferedImpl, sub_type=None))] else begin[{] assign[member[.map], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAttributeMapImpl, sub_type=None))] end[}] end[}] while[call[reader.hasMoreChildren, parameter[]]] begin[{] call[reader.moveDown, parameter[]] local_variable[type[XAttribute], attribute] call[map.put, parameter[call[attribute.getKey, parameter[]], member[.attribute]]] call[reader.moveUp, parameter[]] end[}] return[member[.map]] end[}] END[}]
Keyword[public] identifier[Object] identifier[unmarshal] operator[SEP] identifier[HierarchicalStreamReader] identifier[reader] , identifier[UnmarshallingContext] identifier[context] operator[SEP] { identifier[XAttributeMap] identifier[map] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[lazy] operator[=] identifier[reader] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[buffered] operator[=] identifier[reader] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lazy] operator[SEP] { Keyword[if] operator[SEP] identifier[buffered] operator[SEP] { identifier[map] operator[=] Keyword[new] identifier[XAttributeMapLazyImpl] operator[<] identifier[XAttributeMapBufferedImpl] operator[>] operator[SEP] identifier[XAttributeMapBufferedImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[else] { identifier[map] operator[=] Keyword[new] identifier[XAttributeMapLazyImpl] operator[<] identifier[XAttributeMapImpl] operator[>] operator[SEP] identifier[XAttributeMapImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[buffered] operator[SEP] { identifier[map] operator[=] Keyword[new] identifier[XAttributeMapBufferedImpl] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[map] operator[=] Keyword[new] identifier[XAttributeMapImpl] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[reader] operator[SEP] identifier[hasMoreChildren] operator[SEP] operator[SEP] operator[SEP] { identifier[reader] operator[SEP] identifier[moveDown] operator[SEP] operator[SEP] operator[SEP] identifier[XAttribute] identifier[attribute] operator[=] operator[SEP] identifier[XAttribute] operator[SEP] identifier[context] operator[SEP] identifier[convertAnother] operator[SEP] identifier[map] , identifier[XAttribute] operator[SEP] Keyword[class] , identifier[XesXStreamPersistency] operator[SEP] identifier[attributeConverter] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[attribute] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] operator[SEP] identifier[reader] operator[SEP] identifier[moveUp] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[map] operator[SEP] }
public ParamBuilder put(String name, Object value) { params.put(name, value); return this; }
class class_name[name] begin[{] method[put, return_type[type[ParamBuilder]], modifier[public], parameter[name, value]] begin[{] call[params.put, parameter[member[.name], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ParamBuilder] identifier[put] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
protected AbstractBuffer reset(long offset, long capacity, long maxCapacity) { this.offset = offset; this.capacity = 0; this.initialCapacity = capacity; this.maxCapacity = maxCapacity; capacity(initialCapacity); references.set(0); rewind(); return this; }
class class_name[name] begin[{] method[reset, return_type[type[AbstractBuffer]], modifier[protected], parameter[offset, capacity, maxCapacity]] begin[{] assign[THIS[member[None.offset]], member[.offset]] assign[THIS[member[None.capacity]], literal[0]] assign[THIS[member[None.initialCapacity]], member[.capacity]] assign[THIS[member[None.maxCapacity]], member[.maxCapacity]] call[.capacity, parameter[member[.initialCapacity]]] call[references.set, parameter[literal[0]]] call[.rewind, parameter[]] return[THIS[]] end[}] END[}]
Keyword[protected] identifier[AbstractBuffer] identifier[reset] operator[SEP] Keyword[long] identifier[offset] , Keyword[long] identifier[capacity] , Keyword[long] identifier[maxCapacity] operator[SEP] { Keyword[this] operator[SEP] identifier[offset] operator[=] identifier[offset] operator[SEP] Keyword[this] operator[SEP] identifier[capacity] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[initialCapacity] operator[=] identifier[capacity] operator[SEP] Keyword[this] operator[SEP] identifier[maxCapacity] operator[=] identifier[maxCapacity] operator[SEP] identifier[capacity] operator[SEP] identifier[initialCapacity] operator[SEP] operator[SEP] identifier[references] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public String getInfix(String className) { String postfix = getActionSuffix(); String simpleName = className.substring(className.lastIndexOf('.') + 1); if (Strings.contains(simpleName, postfix)) { simpleName = Strings.uncapitalize(simpleName.substring(0, simpleName.length() - postfix.length())); } else { simpleName = Strings.uncapitalize(simpleName); } MatchInfo match = getCtlMatchInfo(className); StringBuilder infix = new StringBuilder(match.getReserved().toString()); if (infix.length() > 0) infix.append('.'); String remainder = Strings.substringBeforeLast(className, ".").substring(match.getStartIndex() + 1); if (remainder.length() > 0) { if ('.' == remainder.charAt(0)) remainder = remainder.substring(1); infix.append(remainder).append('.'); } if (infix.length() == 0) return simpleName; infix.append(simpleName); // 将.替换成/ for (int i = 0; i < infix.length(); i++) { if (infix.charAt(i) == '.') infix.setCharAt(i, '/'); } return infix.toString(); }
class class_name[name] begin[{] method[getInfix, return_type[type[String]], modifier[public], parameter[className]] begin[{] local_variable[type[String], postfix] local_variable[type[String], simpleName] if[call[Strings.contains, parameter[member[.simpleName], member[.postfix]]]] begin[{] assign[member[.simpleName], call[Strings.uncapitalize, parameter[call[simpleName.substring, parameter[literal[0], binary_operation[call[simpleName.length, parameter[]], -, call[postfix.length, parameter[]]]]]]]] else begin[{] assign[member[.simpleName], call[Strings.uncapitalize, parameter[member[.simpleName]]]] end[}] local_variable[type[MatchInfo], match] local_variable[type[StringBuilder], infix] if[binary_operation[call[infix.length, parameter[]], >, literal[0]]] begin[{] call[infix.append, parameter[literal['.']]] else begin[{] None end[}] local_variable[type[String], remainder] if[binary_operation[call[remainder.length, parameter[]], >, literal[0]]] begin[{] if[binary_operation[literal['.'], ==, call[remainder.charAt, parameter[literal[0]]]]] begin[{] assign[member[.remainder], call[remainder.substring, parameter[literal[1]]]] else begin[{] None end[}] call[infix.append, parameter[member[.remainder]]] else begin[{] None end[}] if[binary_operation[call[infix.length, parameter[]], ==, literal[0]]] begin[{] return[member[.simpleName]] else begin[{] None end[}] call[infix.append, parameter[member[.simpleName]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=infix, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/')], member=setCharAt, postfix_operators=[], prefix_operators=[], qualifier=infix, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=infix, 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[call[infix.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getInfix] operator[SEP] identifier[String] identifier[className] operator[SEP] { identifier[String] identifier[postfix] operator[=] identifier[getActionSuffix] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[simpleName] operator[=] identifier[className] operator[SEP] identifier[substring] operator[SEP] identifier[className] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[contains] operator[SEP] identifier[simpleName] , identifier[postfix] operator[SEP] operator[SEP] { identifier[simpleName] operator[=] identifier[Strings] operator[SEP] identifier[uncapitalize] operator[SEP] identifier[simpleName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[simpleName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[postfix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[simpleName] operator[=] identifier[Strings] operator[SEP] identifier[uncapitalize] operator[SEP] identifier[simpleName] operator[SEP] operator[SEP] } identifier[MatchInfo] identifier[match] operator[=] identifier[getCtlMatchInfo] operator[SEP] identifier[className] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[infix] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[match] operator[SEP] identifier[getReserved] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[infix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[infix] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[remainder] operator[=] identifier[Strings] operator[SEP] identifier[substringBeforeLast] operator[SEP] identifier[className] , literal[String] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[match] operator[SEP] identifier[getStartIndex] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remainder] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[==] identifier[remainder] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[remainder] operator[=] identifier[remainder] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[infix] operator[SEP] identifier[append] operator[SEP] identifier[remainder] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[infix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] identifier[simpleName] operator[SEP] identifier[infix] operator[SEP] identifier[append] operator[SEP] identifier[simpleName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[infix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[infix] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] identifier[infix] operator[SEP] identifier[setCharAt] operator[SEP] identifier[i] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[infix] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static String getFormattedMessage(Class<?> caller, String bundleName, String key, Object[] args, String defaultString) { return TraceNLSResolver.getInstance().getMessage(caller, null, bundleName, key, args, defaultString, true, null, false); }
class class_name[name] begin[{] method[getFormattedMessage, return_type[type[String]], modifier[public static], parameter[caller, bundleName, key, args, defaultString]] begin[{] return[call[TraceNLSResolver.getInstance, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getFormattedMessage] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[caller] , identifier[String] identifier[bundleName] , identifier[String] identifier[key] , identifier[Object] operator[SEP] operator[SEP] identifier[args] , identifier[String] identifier[defaultString] operator[SEP] { Keyword[return] identifier[TraceNLSResolver] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] identifier[caller] , Other[null] , identifier[bundleName] , identifier[key] , identifier[args] , identifier[defaultString] , literal[boolean] , Other[null] , literal[boolean] operator[SEP] operator[SEP] }
public static synchronized UTEHelper getHelperInstance() throws java.lang.IllegalStateException { if (tcInt.isEntryEnabled()) SibTr.entry(tcInt, "getHelperInstance"); // ************** CHECK TO SEE IF IT IS ENABLED ******************* try { // Initialise the test env flag from a system property if it has been set. String prop = System.getProperty("com.ibm.ws.sib.api.testenv"); // Check that the text reads "enabled". if ((prop != null) && ("enabled".equals(prop.toLowerCase()))) { if (tcInt.isDebugEnabled()) SibTr.debug(tcInt, "TestEnv flag enabled by system property."); UTEHelperFactory.jmsTestEnvironmentEnabled = true; } else { if (tcInt.isDebugEnabled()) SibTr.debug(tcInt, "testenv system property was present but did not enable testenv - "+prop); }//if } catch(SecurityException sce) { // No FFDC code needed if (tcInt.isDebugEnabled()) SibTr.debug(tcInt, "Could not read system property due to SecurityException", sce); }//try // d250397 IGH it is valid to use a UTEHelper with UTE disabled // when running unit tests in remote client mode (see JMSTestCase) // so don't throw an exception here /* if (!UTEHelperFactory.jmsTestEnvironmentEnabled) { // NB. This is for unit test only and so need not be NLS'd. throw new java.lang.IllegalStateException("JMS Test Environment is not enabled."); }//if */ if (instance == null) { try { instance = (UTEHelper)Class.forName( "com.ibm.ws.sib.api.jms.impl.ute.UTEHelperImpl").newInstance(); } catch (Exception e) { // No FFDC code needed if (tcInt.isDebugEnabled()) SibTr.debug(tcInt, "Couldn't find impl class", e); RuntimeException f = new java.lang.IllegalStateException("UTEHelperFactory.getHelperInstance()"); f.initCause(e); if (tcInt.isEntryEnabled()) SibTr.exit(tcInt, "getHelperInstance"); throw f; } } if (tcInt.isEntryEnabled()) SibTr.exit(tcInt, "getHelperInstance"); return instance; }
class class_name[name] begin[{] method[getHelperInstance, return_type[type[UTEHelper]], modifier[synchronized public static], parameter[]] begin[{] if[call[tcInt.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[member[.tcInt], literal["getHelperInstance"]]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.api.testenv")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="enabled"), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tcInt, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tcInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="testenv system property was present but did not enable testenv - "), operandr=MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tcInt, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tcInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TestEnv flag enabled by system property.")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=jmsTestEnvironmentEnabled, postfix_operators=[], prefix_operators=[], qualifier=UTEHelperFactory, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tcInt, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tcInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not read system property due to SecurityException"), MemberReference(member=sce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=sce, types=['SecurityException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.instance], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.api.jms.impl.ute.UTEHelperImpl")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=UTEHelper, sub_type=None))), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tcInt, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tcInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't find impl class"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTEHelperFactory.getHelperInstance()")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=lang, sub_type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)))), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tcInt, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tcInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getHelperInstance")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] if[call[tcInt.isEntryEnabled, parameter[]]] begin[{] call[SibTr.exit, parameter[member[.tcInt], literal["getHelperInstance"]]] else begin[{] None end[}] return[member[.instance]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] identifier[UTEHelper] identifier[getHelperInstance] operator[SEP] operator[SEP] Keyword[throws] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[IllegalStateException] { Keyword[if] operator[SEP] identifier[tcInt] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tcInt] , literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[String] identifier[prop] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[prop] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[prop] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tcInt] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tcInt] , literal[String] operator[SEP] operator[SEP] identifier[UTEHelperFactory] operator[SEP] identifier[jmsTestEnvironmentEnabled] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[tcInt] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tcInt] , literal[String] operator[+] identifier[prop] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[sce] operator[SEP] { Keyword[if] operator[SEP] identifier[tcInt] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tcInt] , literal[String] , identifier[sce] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[instance] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[instance] operator[=] operator[SEP] identifier[UTEHelper] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[tcInt] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tcInt] , literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[RuntimeException] identifier[f] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tcInt] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tcInt] , literal[String] operator[SEP] operator[SEP] Keyword[throw] identifier[f] operator[SEP] } } Keyword[if] operator[SEP] identifier[tcInt] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tcInt] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[instance] operator[SEP] }
@Override public void generateReadPropertyFromCursor(Builder methodBuilder, TypeName beanClass, String beanName, ModelProperty property, String cursorName, String indexName) { methodBuilder.addCode(setter(beanClass, beanName, property, "$T.parse$L($L.getBlob($L))"), TypeUtility.mergeTypeNameWithSuffix(beanClass, "Table"), formatter.convert(property.getName()), cursorName, indexName); }
class class_name[name] begin[{] method[generateReadPropertyFromCursor, return_type[void], modifier[public], parameter[methodBuilder, beanClass, beanName, property, cursorName, indexName]] begin[{] call[methodBuilder.addCode, parameter[call[.setter, parameter[member[.beanClass], member[.beanName], member[.property], literal["$T.parse$L($L.getBlob($L))"]]], call[TypeUtility.mergeTypeNameWithSuffix, parameter[member[.beanClass], literal["Table"]]], call[formatter.convert, parameter[call[property.getName, parameter[]]]], member[.cursorName], member[.indexName]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[generateReadPropertyFromCursor] operator[SEP] identifier[Builder] identifier[methodBuilder] , identifier[TypeName] identifier[beanClass] , identifier[String] identifier[beanName] , identifier[ModelProperty] identifier[property] , identifier[String] identifier[cursorName] , identifier[String] identifier[indexName] operator[SEP] { identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] identifier[setter] operator[SEP] identifier[beanClass] , identifier[beanName] , identifier[property] , literal[String] operator[SEP] , identifier[TypeUtility] operator[SEP] identifier[mergeTypeNameWithSuffix] operator[SEP] identifier[beanClass] , literal[String] operator[SEP] , identifier[formatter] operator[SEP] identifier[convert] operator[SEP] identifier[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , identifier[cursorName] , identifier[indexName] operator[SEP] operator[SEP] }
private long getPreviousSegmentId(File file) { PbdSegmentName segmentName = PbdSegmentName.parseFile(m_usageSpecificLog, file); if (segmentName.m_result != PbdSegmentName.Result.OK) { throw new IllegalStateException("Invalid file name: " + file.getName()); } return segmentName.m_prevId; }
class class_name[name] begin[{] method[getPreviousSegmentId, return_type[type[long]], modifier[private], parameter[file]] begin[{] local_variable[type[PbdSegmentName], segmentName] if[binary_operation[member[segmentName.m_result], !=, member[PbdSegmentName.Result.OK]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid file name: "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, 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=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[member[segmentName.m_prevId]] end[}] END[}]
Keyword[private] Keyword[long] identifier[getPreviousSegmentId] operator[SEP] identifier[File] identifier[file] operator[SEP] { identifier[PbdSegmentName] identifier[segmentName] operator[=] identifier[PbdSegmentName] operator[SEP] identifier[parseFile] operator[SEP] identifier[m_usageSpecificLog] , identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[segmentName] operator[SEP] identifier[m_result] operator[!=] identifier[PbdSegmentName] operator[SEP] identifier[Result] operator[SEP] identifier[OK] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[segmentName] operator[SEP] identifier[m_prevId] operator[SEP] }
@NonNull public static Scene getSceneForLayout(@NonNull ViewGroup sceneRoot, int layoutId, @NonNull Context context) { SparseArray<Scene> scenes = (SparseArray<Scene>) sceneRoot.getTag(R.id.scene_layoutid_cache); if (scenes == null) { scenes = new SparseArray<Scene>(); sceneRoot.setTag(R.id.scene_layoutid_cache, scenes); } Scene scene = scenes.get(layoutId); if (scene != null) { return scene; } else { scene = new Scene(sceneRoot, layoutId, context); scenes.put(layoutId, scene); return scene; } }
class class_name[name] begin[{] method[getSceneForLayout, return_type[type[Scene]], modifier[public static], parameter[sceneRoot, layoutId, context]] begin[{] local_variable[type[SparseArray], scenes] if[binary_operation[member[.scenes], ==, literal[null]]] begin[{] assign[member[.scenes], 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=Scene, sub_type=None))], dimensions=None, name=SparseArray, sub_type=None))] call[sceneRoot.setTag, parameter[member[R.id.scene_layoutid_cache], member[.scenes]]] else begin[{] None end[}] local_variable[type[Scene], scene] if[binary_operation[member[.scene], !=, literal[null]]] begin[{] return[member[.scene]] else begin[{] assign[member[.scene], ClassCreator(arguments=[MemberReference(member=sceneRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=layoutId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, 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=Scene, sub_type=None))] call[scenes.put, parameter[member[.layoutId], member[.scene]]] return[member[.scene]] end[}] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] Keyword[static] identifier[Scene] identifier[getSceneForLayout] operator[SEP] annotation[@] identifier[NonNull] identifier[ViewGroup] identifier[sceneRoot] , Keyword[int] identifier[layoutId] , annotation[@] identifier[NonNull] identifier[Context] identifier[context] operator[SEP] { identifier[SparseArray] operator[<] identifier[Scene] operator[>] identifier[scenes] operator[=] operator[SEP] identifier[SparseArray] operator[<] identifier[Scene] operator[>] operator[SEP] identifier[sceneRoot] operator[SEP] identifier[getTag] operator[SEP] identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[scene_layoutid_cache] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scenes] operator[==] Other[null] operator[SEP] { identifier[scenes] operator[=] Keyword[new] identifier[SparseArray] operator[<] identifier[Scene] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[sceneRoot] operator[SEP] identifier[setTag] operator[SEP] identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[scene_layoutid_cache] , identifier[scenes] operator[SEP] operator[SEP] } identifier[Scene] identifier[scene] operator[=] identifier[scenes] operator[SEP] identifier[get] operator[SEP] identifier[layoutId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scene] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[scene] operator[SEP] } Keyword[else] { identifier[scene] operator[=] Keyword[new] identifier[Scene] operator[SEP] identifier[sceneRoot] , identifier[layoutId] , identifier[context] operator[SEP] operator[SEP] identifier[scenes] operator[SEP] identifier[put] operator[SEP] identifier[layoutId] , identifier[scene] operator[SEP] operator[SEP] Keyword[return] identifier[scene] operator[SEP] } }
@Then("^the \"([^\"]*)\" view should contain the element \"([^\"]*)\"$") public WebElement the_view_should_contain(String viewName, String elementName) throws Throwable { return seleniumElementService.viewShouldContainElement(viewName, elementName); }
class class_name[name] begin[{] method[the_view_should_contain, return_type[type[WebElement]], modifier[public], parameter[viewName, elementName]] begin[{] return[call[seleniumElementService.viewShouldContainElement, parameter[member[.viewName], member[.elementName]]]] end[}] END[}]
annotation[@] identifier[Then] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[WebElement] identifier[the_view_should_contain] operator[SEP] identifier[String] identifier[viewName] , identifier[String] identifier[elementName] operator[SEP] Keyword[throws] identifier[Throwable] { Keyword[return] identifier[seleniumElementService] operator[SEP] identifier[viewShouldContainElement] operator[SEP] identifier[viewName] , identifier[elementName] operator[SEP] operator[SEP] }
protected String makeHeaderNamesLowercaseInLogFormat(String logformat) { // In vim I would simply do: %s@{\([^}]*\)}@{\L\1\E@g // But such an expression is not (yet) possible in Java StringBuffer sb = new StringBuffer(logformat.length()); // All patterns that have a 'name' (note we do NOT do it to %{...}t ) Pattern p = Pattern.compile("%\\{([^}]*)}([^t])"); Matcher m = p.matcher(logformat); while (m.find()) { m.appendReplacement(sb, "%{"+m.group(1).toLowerCase()+'}'+m.group(2)); } m.appendTail(sb); return sb.toString(); }
class class_name[name] begin[{] method[makeHeaderNamesLowercaseInLogFormat, return_type[type[String]], modifier[protected], parameter[logformat]] begin[{] local_variable[type[StringBuffer], sb] local_variable[type[Pattern], p] local_variable[type[Matcher], m] while[call[m.find, parameter[]]] begin[{] call[m.appendReplacement, parameter[member[.sb], binary_operation[binary_operation[binary_operation[literal["%{"], +, call[m.group, parameter[literal[1]]]], +, literal['}']], +, call[m.group, parameter[literal[2]]]]]] end[}] call[m.appendTail, parameter[member[.sb]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[makeHeaderNamesLowercaseInLogFormat] operator[SEP] identifier[String] identifier[logformat] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[logformat] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Pattern] identifier[p] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Matcher] identifier[m] operator[=] identifier[p] operator[SEP] identifier[matcher] operator[SEP] identifier[logformat] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[m] operator[SEP] identifier[appendReplacement] operator[SEP] identifier[sb] , literal[String] operator[+] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] } identifier[m] operator[SEP] identifier[appendTail] operator[SEP] identifier[sb] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private Map<String, String> getConfigVariables() { return AccessController.doPrivileged(new PrivilegedAction<Map<String, String>>() { @Override public Map<String, String> run() { return configVariables.getUserDefinedVariables(); } }); }
class class_name[name] begin[{] method[getConfigVariables, return_type[type[Map]], modifier[private], parameter[]] begin[{] return[call[AccessController.doPrivileged, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getUserDefinedVariables, postfix_operators=[], prefix_operators=[], qualifier=configVariables, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Map, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=None, name=PrivilegedAction, sub_type=None))]]] end[}] END[}]
Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getConfigVariables] operator[SEP] operator[SEP] { Keyword[return] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[run] operator[SEP] operator[SEP] { Keyword[return] identifier[configVariables] operator[SEP] identifier[getUserDefinedVariables] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public Topic getTopic(String topicId) throws Exception { // [START pubsub_get_topic] try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId); Topic topic = topicAdminClient.getTopic(topicName); return topic; } // [END pubsub_get_topic] }
class class_name[name] begin[{] method[getTopic, return_type[type[Topic]], modifier[public], parameter[topicId]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topicId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=ProjectTopicName, selectors=[], type_arguments=None), name=topicName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProjectTopicName, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=topicName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTopic, postfix_operators=[], prefix_operators=[], qualifier=topicAdminClient, selectors=[], type_arguments=None), name=topic)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Topic, sub_type=None)), ReturnStatement(expression=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=topicAdminClient, type=ReferenceType(arguments=None, dimensions=[], name=TopicAdminClient, sub_type=None), value=MethodInvocation(arguments=[], member=create, postfix_operators=[], prefix_operators=[], qualifier=TopicAdminClient, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[public] identifier[Topic] identifier[getTopic] operator[SEP] identifier[String] identifier[topicId] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[try] operator[SEP] identifier[TopicAdminClient] identifier[topicAdminClient] operator[=] identifier[TopicAdminClient] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] { identifier[ProjectTopicName] identifier[topicName] operator[=] identifier[ProjectTopicName] operator[SEP] identifier[of] operator[SEP] identifier[projectId] , identifier[topicId] operator[SEP] operator[SEP] identifier[Topic] identifier[topic] operator[=] identifier[topicAdminClient] operator[SEP] identifier[getTopic] operator[SEP] identifier[topicName] operator[SEP] operator[SEP] Keyword[return] identifier[topic] operator[SEP] } }
@Override public void loadPath(File path, FileFilter filt) { FilePathProcessor.processPath(path, filt, this); }
class class_name[name] begin[{] method[loadPath, return_type[void], modifier[public], parameter[path, filt]] begin[{] call[FilePathProcessor.processPath, parameter[member[.path], member[.filt], THIS[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[loadPath] operator[SEP] identifier[File] identifier[path] , identifier[FileFilter] identifier[filt] operator[SEP] { identifier[FilePathProcessor] operator[SEP] identifier[processPath] operator[SEP] identifier[path] , identifier[filt] , Keyword[this] operator[SEP] operator[SEP] }
public static CPAttachmentFileEntry fetchByUUID_G(String uuid, long groupId, boolean retrieveFromCache) { return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache); }
class class_name[name] begin[{] method[fetchByUUID_G, return_type[type[CPAttachmentFileEntry]], modifier[public static], parameter[uuid, groupId, retrieveFromCache]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPAttachmentFileEntry] identifier[fetchByUUID_G] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] , Keyword[boolean] identifier[retrieveFromCache] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByUUID_G] operator[SEP] identifier[uuid] , identifier[groupId] , identifier[retrieveFromCache] operator[SEP] operator[SEP] }
public void setReorderingMode(int reorderingMode) { if ((reorderingMode < REORDER_DEFAULT) || (reorderingMode >= REORDER_COUNT)) return; /* don't accept a wrong value */ this.reorderingMode = reorderingMode; this.isInverse = reorderingMode == REORDER_INVERSE_NUMBERS_AS_L; }
class class_name[name] begin[{] method[setReorderingMode, return_type[void], modifier[public], parameter[reorderingMode]] begin[{] if[binary_operation[binary_operation[member[.reorderingMode], <, member[.REORDER_DEFAULT]], ||, binary_operation[member[.reorderingMode], >=, member[.REORDER_COUNT]]]] begin[{] return[None] else begin[{] None end[}] assign[THIS[member[None.reorderingMode]], member[.reorderingMode]] assign[THIS[member[None.isInverse]], binary_operation[member[.reorderingMode], ==, member[.REORDER_INVERSE_NUMBERS_AS_L]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setReorderingMode] operator[SEP] Keyword[int] identifier[reorderingMode] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[reorderingMode] operator[<] identifier[REORDER_DEFAULT] operator[SEP] operator[||] operator[SEP] identifier[reorderingMode] operator[>=] identifier[REORDER_COUNT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[this] operator[SEP] identifier[reorderingMode] operator[=] identifier[reorderingMode] operator[SEP] Keyword[this] operator[SEP] identifier[isInverse] operator[=] identifier[reorderingMode] operator[==] identifier[REORDER_INVERSE_NUMBERS_AS_L] operator[SEP] }
public void setLabel (String label) { _label.setText(label); _label.setVisible(!StringUtil.isBlank(label)); }
class class_name[name] begin[{] method[setLabel, return_type[void], modifier[public], parameter[label]] begin[{] call[_label.setText, parameter[member[.label]]] call[_label.setVisible, parameter[call[StringUtil.isBlank, parameter[member[.label]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLabel] operator[SEP] identifier[String] identifier[label] operator[SEP] { identifier[_label] operator[SEP] identifier[setText] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[_label] operator[SEP] identifier[setVisible] operator[SEP] operator[!] identifier[StringUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] }
public <T> Set<T> detach(Set<T> pcs) { pm.getFetchPlan().setDetachmentOptions(FetchPlan.DETACH_LOAD_FIELDS); return new LinkedHashSet<>(pm.detachCopyAll(pcs)); }
class class_name[name] begin[{] method[detach, return_type[type[Set]], modifier[public], parameter[pcs]] begin[{] call[pm.getFetchPlan, parameter[]] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=pcs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=detachCopyAll, postfix_operators=[], prefix_operators=[], qualifier=pm, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashSet, sub_type=None))] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Set] operator[<] identifier[T] operator[>] identifier[detach] operator[SEP] identifier[Set] operator[<] identifier[T] operator[>] identifier[pcs] operator[SEP] { identifier[pm] operator[SEP] identifier[getFetchPlan] operator[SEP] operator[SEP] operator[SEP] identifier[setDetachmentOptions] operator[SEP] identifier[FetchPlan] operator[SEP] identifier[DETACH_LOAD_FIELDS] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[LinkedHashSet] operator[<] operator[>] operator[SEP] identifier[pm] operator[SEP] identifier[detachCopyAll] operator[SEP] identifier[pcs] operator[SEP] operator[SEP] operator[SEP] }
static WSATAsyncResource fromLogData(byte[] bytes) throws javax.transaction.SystemException { if (tc.isEntryEnabled()) Tr.entry(tc, "fromLogData", bytes); WSATAsyncResource resource = null; final ByteArrayInputStream bais = new ByteArrayInputStream(bytes); try { final ObjectInputStream ois = new ObjectInputStream(bais); final Object obj = ois.readObject(); resource = (WSATAsyncResource) obj; } catch (Exception e) { FFDCFilter.processException(e, "com.ibm.ws.Transaction.wstx.WSATAsyncResource.fromLogData", "307"); final SystemException se = new SystemException(); se.initCause(e); if (tc.isEntryEnabled()) Tr.exit(tc, "fromLogData", se); throw se; } if (tc.isEntryEnabled()) Tr.exit(tc, "fromLogData", resource); return resource; }
class class_name[name] begin[{] method[fromLogData, return_type[type[WSATAsyncResource]], modifier[static], parameter[bytes]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["fromLogData"], member[.bytes]]] else begin[{] None end[}] local_variable[type[WSATAsyncResource], resource] local_variable[type[ByteArrayInputStream], bais] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bais, 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=ObjectInputStream, sub_type=None)), name=ois)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ObjectInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), name=obj)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WSATAsyncResource, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.Transaction.wstx.WSATAsyncResource.fromLogData"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="307")], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, 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=SystemException, sub_type=None)), name=se)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SystemException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=se, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fromLogData"), MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["fromLogData"], member[.resource]]] else begin[{] None end[}] return[member[.resource]] end[}] END[}]
Keyword[static] identifier[WSATAsyncResource] identifier[fromLogData] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[transaction] operator[SEP] identifier[SystemException] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[bytes] operator[SEP] operator[SEP] identifier[WSATAsyncResource] identifier[resource] operator[=] Other[null] operator[SEP] Keyword[final] identifier[ByteArrayInputStream] identifier[bais] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[ObjectInputStream] identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] identifier[bais] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[obj] operator[=] identifier[ois] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[=] operator[SEP] identifier[WSATAsyncResource] operator[SEP] identifier[obj] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[SystemException] identifier[se] operator[=] Keyword[new] identifier[SystemException] operator[SEP] operator[SEP] operator[SEP] identifier[se] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[se] operator[SEP] operator[SEP] Keyword[throw] identifier[se] operator[SEP] } Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[resource] operator[SEP] operator[SEP] Keyword[return] identifier[resource] operator[SEP] }
@Override public DescribeDomainControllersResult describeDomainControllers(DescribeDomainControllersRequest request) { request = beforeClientExecution(request); return executeDescribeDomainControllers(request); }
class class_name[name] begin[{] method[describeDomainControllers, return_type[type[DescribeDomainControllersResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDescribeDomainControllers, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescribeDomainControllersResult] identifier[describeDomainControllers] operator[SEP] identifier[DescribeDomainControllersRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeDomainControllers] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void setCurrencyAttribute(String name, String value) { ensureAttributes(); Attribute attribute = new CurrencyAttribute(value); attribute.setEditable(isEditable(name)); getAllAttributes().put(name, attribute); }
class class_name[name] begin[{] method[setCurrencyAttribute, return_type[void], modifier[public], parameter[name, value]] begin[{] call[.ensureAttributes, parameter[]] local_variable[type[Attribute], attribute] call[attribute.setEditable, parameter[call[.isEditable, parameter[member[.name]]]]] call[.getAllAttributes, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCurrencyAttribute] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] operator[SEP] { identifier[ensureAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[Attribute] identifier[attribute] operator[=] Keyword[new] identifier[CurrencyAttribute] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[setEditable] operator[SEP] identifier[isEditable] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[getAllAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[attribute] operator[SEP] operator[SEP] }
public boolean matches(T target) { return target != null && matcher.matches(TypeDescription.ForLoadedType.of(target.getClass())); }
class class_name[name] begin[{] method[matches, return_type[type[boolean]], modifier[public], parameter[target]] begin[{] return[binary_operation[binary_operation[member[.target], !=, literal[null]], &&, call[matcher.matches, parameter[call[TypeDescription.ForLoadedType.of, parameter[call[target.getClass, parameter[]]]]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[T] identifier[target] operator[SEP] { Keyword[return] identifier[target] operator[!=] Other[null] operator[&&] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] identifier[TypeDescription] operator[SEP] identifier[ForLoadedType] operator[SEP] identifier[of] operator[SEP] identifier[target] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void init() { JButton testButton = new JButton(); oldDayBackgroundColor = testButton.getBackground(); selectedColor = new Color(160, 160, 160); Date date = calendar.getTime(); calendar = Calendar.getInstance(locale); calendar.setTime(date); drawDayNames(); drawDays(); }
class class_name[name] begin[{] method[init, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[JButton], testButton] assign[member[.oldDayBackgroundColor], call[testButton.getBackground, parameter[]]] assign[member[.selectedColor], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=160), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=160), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=160)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))] local_variable[type[Date], date] assign[member[.calendar], call[Calendar.getInstance, parameter[member[.locale]]]] call[calendar.setTime, parameter[member[.date]]] call[.drawDayNames, parameter[]] call[.drawDays, parameter[]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[init] operator[SEP] operator[SEP] { identifier[JButton] identifier[testButton] operator[=] Keyword[new] identifier[JButton] operator[SEP] operator[SEP] operator[SEP] identifier[oldDayBackgroundColor] operator[=] identifier[testButton] operator[SEP] identifier[getBackground] operator[SEP] operator[SEP] operator[SEP] identifier[selectedColor] operator[=] Keyword[new] identifier[Color] operator[SEP] Other[160] , Other[160] , Other[160] operator[SEP] operator[SEP] identifier[Date] identifier[date] operator[=] identifier[calendar] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[calendar] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[drawDayNames] operator[SEP] operator[SEP] operator[SEP] identifier[drawDays] operator[SEP] operator[SEP] operator[SEP] }
private void addInputRow(String label, Widget inputWidget) { FlowPanel row = new FlowPanel(); row.setStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().simpleFormRow()); CmsLabel labelWidget = new CmsLabel(label); labelWidget.setStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().simpleFormLabel()); row.add(labelWidget); inputWidget.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().simpleFormInputBox()); row.add(inputWidget); m_dialogContent.getFieldSet().add(row); }
class class_name[name] begin[{] method[addInputRow, return_type[void], modifier[private], parameter[label, inputWidget]] begin[{] local_variable[type[FlowPanel], row] call[row.setStyleName, parameter[call[I_CmsLayoutBundle.INSTANCE.generalCss, parameter[]]]] local_variable[type[CmsLabel], labelWidget] call[labelWidget.setStyleName, parameter[call[I_CmsLayoutBundle.INSTANCE.generalCss, parameter[]]]] call[row.add, parameter[member[.labelWidget]]] call[inputWidget.addStyleName, parameter[call[I_CmsLayoutBundle.INSTANCE.generalCss, parameter[]]]] call[row.add, parameter[member[.inputWidget]]] call[m_dialogContent.getFieldSet, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addInputRow] operator[SEP] identifier[String] identifier[label] , identifier[Widget] identifier[inputWidget] operator[SEP] { identifier[FlowPanel] identifier[row] operator[=] Keyword[new] identifier[FlowPanel] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[setStyleName] operator[SEP] identifier[I_CmsLayoutBundle] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[generalCss] operator[SEP] operator[SEP] operator[SEP] identifier[simpleFormRow] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CmsLabel] identifier[labelWidget] operator[=] Keyword[new] identifier[CmsLabel] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[labelWidget] operator[SEP] identifier[setStyleName] operator[SEP] identifier[I_CmsLayoutBundle] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[generalCss] operator[SEP] operator[SEP] operator[SEP] identifier[simpleFormLabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[add] operator[SEP] identifier[labelWidget] operator[SEP] operator[SEP] identifier[inputWidget] operator[SEP] identifier[addStyleName] operator[SEP] identifier[I_CmsLayoutBundle] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[generalCss] operator[SEP] operator[SEP] operator[SEP] identifier[simpleFormInputBox] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[add] operator[SEP] identifier[inputWidget] operator[SEP] operator[SEP] identifier[m_dialogContent] operator[SEP] identifier[getFieldSet] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] operator[SEP] }
public void moveLastChild( Row newParent ) { if( this == newParent ) return; // remove from its current position Row parentItem = m_parent; if( parentItem == null ) parentItem = this.treeTable.m_rootItem; parentItem.getChilds().remove( this ); // DOM.removeChild( m_body, m_tr ); if( newParent == null ) newParent = this.treeTable.m_rootItem; // insert at the end of the current parent // DOM add Row lastLeaf = newParent.getLastLeaf(); Element trToInsertAfter = lastLeaf.m_tr; if( trToInsertAfter != null ) { int after = DOM.getChildIndex( this.treeTable.m_body, trToInsertAfter ); int before = after + 1; DOM.insertChild( this.treeTable.m_body, m_tr, before ); } else { DOM.appendChild( this.treeTable.m_body, m_tr ); } parentItem.getChilds().add( this ); // take care of the left padding Element firstTd = DOM.getChild( m_tr, 0 ); firstTd.getStyle().setPaddingLeft( getLevel() * this.treeTable.treePadding, Unit.PX ); }
class class_name[name] begin[{] method[moveLastChild, return_type[void], modifier[public], parameter[newParent]] begin[{] if[binary_operation[THIS[], ==, member[.newParent]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Row], parentItem] if[binary_operation[member[.parentItem], ==, literal[null]]] begin[{] assign[member[.parentItem], THIS[member[None.treeTable]member[None.m_rootItem]]] else begin[{] None end[}] call[parentItem.getChilds, parameter[]] if[binary_operation[member[.newParent], ==, literal[null]]] begin[{] assign[member[.newParent], THIS[member[None.treeTable]member[None.m_rootItem]]] else begin[{] None end[}] local_variable[type[Row], lastLeaf] local_variable[type[Element], trToInsertAfter] if[binary_operation[member[.trToInsertAfter], !=, literal[null]]] begin[{] local_variable[type[int], after] local_variable[type[int], before] call[DOM.insertChild, parameter[THIS[member[None.treeTable]member[None.m_body]], member[.m_tr], member[.before]]] else begin[{] call[DOM.appendChild, parameter[THIS[member[None.treeTable]member[None.m_body]], member[.m_tr]]] end[}] call[parentItem.getChilds, parameter[]] local_variable[type[Element], firstTd] call[firstTd.getStyle, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[moveLastChild] operator[SEP] identifier[Row] identifier[newParent] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[==] identifier[newParent] operator[SEP] Keyword[return] operator[SEP] identifier[Row] identifier[parentItem] operator[=] identifier[m_parent] operator[SEP] Keyword[if] operator[SEP] identifier[parentItem] operator[==] Other[null] operator[SEP] identifier[parentItem] operator[=] Keyword[this] operator[SEP] identifier[treeTable] operator[SEP] identifier[m_rootItem] operator[SEP] identifier[parentItem] operator[SEP] identifier[getChilds] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newParent] operator[==] Other[null] operator[SEP] identifier[newParent] operator[=] Keyword[this] operator[SEP] identifier[treeTable] operator[SEP] identifier[m_rootItem] operator[SEP] identifier[Row] identifier[lastLeaf] operator[=] identifier[newParent] operator[SEP] identifier[getLastLeaf] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[trToInsertAfter] operator[=] identifier[lastLeaf] operator[SEP] identifier[m_tr] operator[SEP] Keyword[if] operator[SEP] identifier[trToInsertAfter] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[after] operator[=] identifier[DOM] operator[SEP] identifier[getChildIndex] operator[SEP] Keyword[this] operator[SEP] identifier[treeTable] operator[SEP] identifier[m_body] , identifier[trToInsertAfter] operator[SEP] operator[SEP] Keyword[int] identifier[before] operator[=] identifier[after] operator[+] Other[1] operator[SEP] identifier[DOM] operator[SEP] identifier[insertChild] operator[SEP] Keyword[this] operator[SEP] identifier[treeTable] operator[SEP] identifier[m_body] , identifier[m_tr] , identifier[before] operator[SEP] operator[SEP] } Keyword[else] { identifier[DOM] operator[SEP] identifier[appendChild] operator[SEP] Keyword[this] operator[SEP] identifier[treeTable] operator[SEP] identifier[m_body] , identifier[m_tr] operator[SEP] operator[SEP] } identifier[parentItem] operator[SEP] identifier[getChilds] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[Element] identifier[firstTd] operator[=] identifier[DOM] operator[SEP] identifier[getChild] operator[SEP] identifier[m_tr] , Other[0] operator[SEP] operator[SEP] identifier[firstTd] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[setPaddingLeft] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[*] Keyword[this] operator[SEP] identifier[treeTable] operator[SEP] identifier[treePadding] , identifier[Unit] operator[SEP] identifier[PX] operator[SEP] operator[SEP] }
private Set<File> getReadLocks() { final Set<File> readLocks = new HashSet<File>(); File[] lckFiles = this.lockPath.listFiles(lockFilter); for (final File lckFile : lckFiles) { if (lockFilter.isReaderLockFile(lckFile)) { readLocks.add(lckFile); } } return readLocks; }
class class_name[name] begin[{] method[getReadLocks, return_type[type[Set]], modifier[private], parameter[]] begin[{] local_variable[type[Set], readLocks] local_variable[type[File], lckFiles] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=lckFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isReaderLockFile, postfix_operators=[], prefix_operators=[], qualifier=lockFilter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lckFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=readLocks, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=lckFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=lckFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) return[member[.readLocks]] end[}] END[}]
Keyword[private] identifier[Set] operator[<] identifier[File] operator[>] identifier[getReadLocks] operator[SEP] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[File] operator[>] identifier[readLocks] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[File] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[File] operator[SEP] operator[SEP] identifier[lckFiles] operator[=] Keyword[this] operator[SEP] identifier[lockPath] operator[SEP] identifier[listFiles] operator[SEP] identifier[lockFilter] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[File] identifier[lckFile] operator[:] identifier[lckFiles] operator[SEP] { Keyword[if] operator[SEP] identifier[lockFilter] operator[SEP] identifier[isReaderLockFile] operator[SEP] identifier[lckFile] operator[SEP] operator[SEP] { identifier[readLocks] operator[SEP] identifier[add] operator[SEP] identifier[lckFile] operator[SEP] operator[SEP] } } Keyword[return] identifier[readLocks] operator[SEP] }
public float getWidthCorrected(float charSpacing, float wordSpacing) { if (image != null) { return image.getScaledWidth() + charSpacing; } int numberOfSpaces = 0; int idx = -1; while ((idx = value.indexOf(' ', idx + 1)) >= 0) ++numberOfSpaces; return width() + (value.length() * charSpacing + numberOfSpaces * wordSpacing); }
class class_name[name] begin[{] method[getWidthCorrected, return_type[type[float]], modifier[public], parameter[charSpacing, wordSpacing]] begin[{] if[binary_operation[member[.image], !=, literal[null]]] begin[{] return[binary_operation[call[image.getScaledWidth, parameter[]], +, member[.charSpacing]]] else begin[{] None end[}] local_variable[type[int], numberOfSpaces] local_variable[type[int], idx] while[binary_operation[assign[member[.idx], call[value.indexOf, parameter[literal[' '], binary_operation[member[.idx], +, literal[1]]]]], >=, literal[0]]] begin[{] member[.numberOfSpaces] end[}] return[binary_operation[call[.width, parameter[]], +, binary_operation[binary_operation[call[value.length, parameter[]], *, member[.charSpacing]], +, binary_operation[member[.numberOfSpaces], *, member[.wordSpacing]]]]] end[}] END[}]
Keyword[public] Keyword[float] identifier[getWidthCorrected] operator[SEP] Keyword[float] identifier[charSpacing] , Keyword[float] identifier[wordSpacing] operator[SEP] { Keyword[if] operator[SEP] identifier[image] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[image] operator[SEP] identifier[getScaledWidth] operator[SEP] operator[SEP] operator[+] identifier[charSpacing] operator[SEP] } Keyword[int] identifier[numberOfSpaces] operator[=] Other[0] operator[SEP] Keyword[int] identifier[idx] operator[=] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[idx] operator[=] identifier[value] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[idx] operator[+] Other[1] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] operator[++] identifier[numberOfSpaces] operator[SEP] Keyword[return] identifier[width] operator[SEP] operator[SEP] operator[+] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[*] identifier[charSpacing] operator[+] identifier[numberOfSpaces] operator[*] identifier[wordSpacing] operator[SEP] operator[SEP] }
public void run() throws Exception { if (config == null) { return; } SimpleRequest req = newRequest(); InetSocketAddress socketAddress = (InetSocketAddress) config.address; if (!config.tls) system.log().info("Using plaintext gRPC HTTP/2 connections"); GrpcClientSettings settings = Utils.createGrpcClientSettings(socketAddress, config.tls, system); List<BenchmarkServiceClient> clients = new ArrayList<BenchmarkServiceClient>(config.channels); for (int i = 0; i < config.channels; i++) { BenchmarkServiceClient client = BenchmarkServiceClient.create(settings, mat, system.dispatcher()); clients.add(client); } // Do a warmup first. It's the same as the actual benchmark, except that // we ignore the statistics. warmup(req, clients); long startTime = System.nanoTime(); long endTime = startTime + TimeUnit.SECONDS.toNanos(config.duration); List<Histogram> histograms = doBenchmark(req, clients, endTime); long elapsedTime = System.nanoTime() - startTime; Histogram merged = merge(histograms); printStats(merged, elapsedTime); if (config.histogramFile != null) { saveHistogram(merged, config.histogramFile); } shutdown(clients); }
class class_name[name] begin[{] method[run, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.config], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[SimpleRequest], req] local_variable[type[InetSocketAddress], socketAddress] if[member[config.tls]] begin[{] call[system.log, parameter[]] else begin[{] None end[}] local_variable[type[GrpcClientSettings], settings] local_variable[type[List], clients] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=settings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=dispatcher, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None)], member=create, postfix_operators=[], prefix_operators=[], qualifier=BenchmarkServiceClient, selectors=[], type_arguments=None), name=client)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BenchmarkServiceClient, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=clients, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=channels, postfix_operators=[], prefix_operators=[], qualifier=config, 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[.warmup, parameter[member[.req], member[.clients]]] local_variable[type[long], startTime] local_variable[type[long], endTime] local_variable[type[List], histograms] local_variable[type[long], elapsedTime] local_variable[type[Histogram], merged] call[.printStats, parameter[member[.merged], member[.elapsedTime]]] if[binary_operation[member[config.histogramFile], !=, literal[null]]] begin[{] call[.saveHistogram, parameter[member[.merged], member[config.histogramFile]]] else begin[{] None end[}] call[.shutdown, parameter[member[.clients]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[config] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[SimpleRequest] identifier[req] operator[=] identifier[newRequest] operator[SEP] operator[SEP] operator[SEP] identifier[InetSocketAddress] identifier[socketAddress] operator[=] operator[SEP] identifier[InetSocketAddress] operator[SEP] identifier[config] operator[SEP] identifier[address] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[config] operator[SEP] identifier[tls] operator[SEP] identifier[system] operator[SEP] identifier[log] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[GrpcClientSettings] identifier[settings] operator[=] identifier[Utils] operator[SEP] identifier[createGrpcClientSettings] operator[SEP] identifier[socketAddress] , identifier[config] operator[SEP] identifier[tls] , identifier[system] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[BenchmarkServiceClient] operator[>] identifier[clients] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[BenchmarkServiceClient] operator[>] operator[SEP] identifier[config] operator[SEP] identifier[channels] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[config] operator[SEP] identifier[channels] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[BenchmarkServiceClient] identifier[client] operator[=] identifier[BenchmarkServiceClient] operator[SEP] identifier[create] operator[SEP] identifier[settings] , identifier[mat] , identifier[system] operator[SEP] identifier[dispatcher] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[clients] operator[SEP] identifier[add] operator[SEP] identifier[client] operator[SEP] operator[SEP] } identifier[warmup] operator[SEP] identifier[req] , identifier[clients] operator[SEP] operator[SEP] Keyword[long] identifier[startTime] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[endTime] operator[=] identifier[startTime] operator[+] identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] identifier[toNanos] operator[SEP] identifier[config] operator[SEP] identifier[duration] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Histogram] operator[>] identifier[histograms] operator[=] identifier[doBenchmark] operator[SEP] identifier[req] , identifier[clients] , identifier[endTime] operator[SEP] operator[SEP] Keyword[long] identifier[elapsedTime] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[-] identifier[startTime] operator[SEP] identifier[Histogram] identifier[merged] operator[=] identifier[merge] operator[SEP] identifier[histograms] operator[SEP] operator[SEP] identifier[printStats] operator[SEP] identifier[merged] , identifier[elapsedTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[histogramFile] operator[!=] Other[null] operator[SEP] { identifier[saveHistogram] operator[SEP] identifier[merged] , identifier[config] operator[SEP] identifier[histogramFile] operator[SEP] operator[SEP] } identifier[shutdown] operator[SEP] identifier[clients] operator[SEP] operator[SEP] }
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PORT: return is_set_port(); case UPTIME: return is_set_uptime(); case TOPOLOGY: return is_set_topology(); case TASKS: return is_set_tasks(); } throw new IllegalStateException(); }
class class_name[name] begin[{] method[isSet, return_type[type[boolean]], modifier[public], parameter[field]] begin[{] if[binary_operation[member[.field], ==, 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[}] SwitchStatement(cases=[SwitchStatementCase(case=['PORT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['UPTIME'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_uptime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['TOPOLOGY'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_topology, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['TASKS'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_tasks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isSet] operator[SEP] identifier[_Fields] identifier[field] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[field] operator[SEP] { Keyword[case] identifier[PORT] operator[:] Keyword[return] identifier[is_set_port] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[UPTIME] operator[:] Keyword[return] identifier[is_set_uptime] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TOPOLOGY] operator[:] Keyword[return] identifier[is_set_topology] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TASKS] operator[:] Keyword[return] identifier[is_set_tasks] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] }
private Object handleTxWriteCommand(InvocationContext ctx, AbstractDataWriteCommand command, Object key) throws Throwable { try { if (!ctx.isOriginLocal()) { LocalizedCacheTopology cacheTopology = checkTopologyId(command); // Ignore any remote command when we aren't the owner if (!cacheTopology.isSegmentWriteOwner(command.getSegment())) { return null; } } CacheEntry entry = ctx.lookupEntry(command.getKey()); if (entry == null) { if (isLocalModeForced(command) || command.hasAnyFlag(FlagBitSets.SKIP_REMOTE_LOOKUP) || !needsPreviousValue(ctx, command)) { // in transactional mode, we always need the entry wrapped entryFactory.wrapExternalEntry(ctx, key, null, false, true); } else { // we need to retrieve the value locally regardless of load type; in transactional mode all operations // execute on origin // Also, operations that need value on backup [delta write] need to do the remote lookup even on // non-origin Object result = asyncInvokeNext(ctx, command, remoteGetSingleKey(ctx, command, command.getKey(), true)); return makeStage(result) .andFinally(ctx, command, (rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } } // already wrapped, we can continue return invokeNextAndFinally(ctx, command, (rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } catch (Throwable t) { updateMatcherForRetry(command); throw t; } }
class class_name[name] begin[{] method[handleTxWriteCommand, return_type[type[Object]], modifier[private], parameter[ctx, command, key]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isOriginLocal, postfix_operators=[], prefix_operators=['!'], qualifier=ctx, 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=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkTopologyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=cacheTopology)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocalizedCacheTopology, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSegment, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[], type_arguments=None)], member=isSegmentWriteOwner, postfix_operators=[], prefix_operators=['!'], qualifier=cacheTopology, 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=null), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[], type_arguments=None)], member=lookupEntry, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CacheEntry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLocalModeForced, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=SKIP_REMOTE_LOOKUP, postfix_operators=[], prefix_operators=[], qualifier=FlagBitSets, selectors=[])], member=hasAnyFlag, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=needsPreviousValue, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=remoteGetSingleKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=asyncInvokeNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeStage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=MethodInvocation(arguments=[Cast(expression=MemberReference(member=rCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WriteCommand, sub_type=None))], member=updateMatcherForRetry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=rCtx), InferredFormalParameter(name=rCommand), InferredFormalParameter(name=rv), InferredFormalParameter(name=t)])], member=andFinally, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=wrapExternalEntry, postfix_operators=[], prefix_operators=[], qualifier=entryFactory, selectors=[], type_arguments=None), label=None)]))])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=MethodInvocation(arguments=[Cast(expression=MemberReference(member=rCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WriteCommand, sub_type=None))], member=updateMatcherForRetry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=rCtx), InferredFormalParameter(name=rCommand), InferredFormalParameter(name=rv), InferredFormalParameter(name=t)])], member=invokeNextAndFinally, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateMatcherForRetry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[Object] identifier[handleTxWriteCommand] operator[SEP] identifier[InvocationContext] identifier[ctx] , identifier[AbstractDataWriteCommand] identifier[command] , identifier[Object] identifier[key] operator[SEP] Keyword[throws] identifier[Throwable] { Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[ctx] operator[SEP] identifier[isOriginLocal] operator[SEP] operator[SEP] operator[SEP] { identifier[LocalizedCacheTopology] identifier[cacheTopology] operator[=] identifier[checkTopologyId] operator[SEP] identifier[command] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cacheTopology] operator[SEP] identifier[isSegmentWriteOwner] operator[SEP] identifier[command] operator[SEP] identifier[getSegment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } identifier[CacheEntry] identifier[entry] operator[=] identifier[ctx] operator[SEP] identifier[lookupEntry] operator[SEP] identifier[command] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isLocalModeForced] operator[SEP] identifier[command] operator[SEP] operator[||] identifier[command] operator[SEP] identifier[hasAnyFlag] operator[SEP] identifier[FlagBitSets] operator[SEP] identifier[SKIP_REMOTE_LOOKUP] operator[SEP] operator[||] operator[!] identifier[needsPreviousValue] operator[SEP] identifier[ctx] , identifier[command] operator[SEP] operator[SEP] { identifier[entryFactory] operator[SEP] identifier[wrapExternalEntry] operator[SEP] identifier[ctx] , identifier[key] , Other[null] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[Object] identifier[result] operator[=] identifier[asyncInvokeNext] operator[SEP] identifier[ctx] , identifier[command] , identifier[remoteGetSingleKey] operator[SEP] identifier[ctx] , identifier[command] , identifier[command] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[makeStage] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[andFinally] operator[SEP] identifier[ctx] , identifier[command] , operator[SEP] identifier[rCtx] , identifier[rCommand] , identifier[rv] , identifier[t] operator[SEP] operator[->] identifier[updateMatcherForRetry] operator[SEP] operator[SEP] identifier[WriteCommand] operator[SEP] identifier[rCommand] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[invokeNextAndFinally] operator[SEP] identifier[ctx] , identifier[command] , operator[SEP] identifier[rCtx] , identifier[rCommand] , identifier[rv] , identifier[t] operator[SEP] operator[->] identifier[updateMatcherForRetry] operator[SEP] operator[SEP] identifier[WriteCommand] operator[SEP] identifier[rCommand] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[updateMatcherForRetry] operator[SEP] identifier[command] operator[SEP] operator[SEP] Keyword[throw] identifier[t] operator[SEP] } }
static JSTypeExpression getTypeFromProperty( MemberDefinition property, AbstractCompiler compiler) { if (property.info != null && property.info.hasType()) { return property.info.getType(); } String typeString; if (property.value.isObjectLit()) { Node typeValue = NodeUtil.getFirstPropMatchingKey(property.value, "type"); if (typeValue == null || !typeValue.isName()) { compiler.report(JSError.make(property.name, PolymerPassErrors.POLYMER_INVALID_PROPERTY)); return null; } typeString = typeValue.getString(); } else if (property.value.isName()) { typeString = property.value.getString(); } else { typeString = ""; } Node typeNode; switch (typeString) { case "Boolean": case "String": case "Number": typeNode = IR.string(typeString.toLowerCase()); break; case "Array": case "Function": case "Object": case "Date": typeNode = new Node(Token.BANG, IR.string(typeString)); break; default: compiler.report(JSError.make(property.name, PolymerPassErrors.POLYMER_INVALID_PROPERTY)); return null; } return new JSTypeExpression(typeNode, VIRTUAL_FILE); }
class class_name[name] begin[{] method[getTypeFromProperty, return_type[type[JSTypeExpression]], modifier[static], parameter[property, compiler]] begin[{] if[binary_operation[binary_operation[member[property.info], !=, literal[null]], &&, call[property.info.hasType, parameter[]]]] begin[{] return[call[property.info.getType, parameter[]]] else begin[{] None end[}] local_variable[type[String], typeString] if[call[property.value.isObjectLit, parameter[]]] begin[{] local_variable[type[Node], typeValue] if[binary_operation[binary_operation[member[.typeValue], ==, literal[null]], ||, call[typeValue.isName, parameter[]]]] begin[{] call[compiler.report, parameter[call[JSError.make, parameter[member[property.name], member[PolymerPassErrors.POLYMER_INVALID_PROPERTY]]]]] return[literal[null]] else begin[{] None end[}] assign[member[.typeString], call[typeValue.getString, parameter[]]] else begin[{] if[call[property.value.isName, parameter[]]] begin[{] assign[member[.typeString], call[property.value.getString, parameter[]]] else begin[{] assign[member[.typeString], literal[""]] end[}] end[}] local_variable[type[Node], typeNode] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Boolean"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="String"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Number")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=typeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=typeString, selectors=[], type_arguments=None)], member=string, postfix_operators=[], prefix_operators=[], qualifier=IR, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Array"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Function"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Object"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Date")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=typeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=BANG, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), MethodInvocation(arguments=[MemberReference(member=typeString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=string, postfix_operators=[], prefix_operators=[], qualifier=IR, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Node, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[]), MemberReference(member=POLYMER_INVALID_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=PolymerPassErrors, selectors=[])], member=make, postfix_operators=[], prefix_operators=[], qualifier=JSError, selectors=[], type_arguments=None)], member=report, postfix_operators=[], prefix_operators=[], qualifier=compiler, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])], expression=MemberReference(member=typeString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[ClassCreator(arguments=[MemberReference(member=typeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=VIRTUAL_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=JSTypeExpression, sub_type=None))] end[}] END[}]
Keyword[static] identifier[JSTypeExpression] identifier[getTypeFromProperty] operator[SEP] identifier[MemberDefinition] identifier[property] , identifier[AbstractCompiler] identifier[compiler] operator[SEP] { Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[info] operator[!=] Other[null] operator[&&] identifier[property] operator[SEP] identifier[info] operator[SEP] identifier[hasType] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[property] operator[SEP] identifier[info] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[typeString] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[value] operator[SEP] identifier[isObjectLit] operator[SEP] operator[SEP] operator[SEP] { identifier[Node] identifier[typeValue] operator[=] identifier[NodeUtil] operator[SEP] identifier[getFirstPropMatchingKey] operator[SEP] identifier[property] operator[SEP] identifier[value] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeValue] operator[==] Other[null] operator[||] operator[!] identifier[typeValue] operator[SEP] identifier[isName] operator[SEP] operator[SEP] operator[SEP] { identifier[compiler] operator[SEP] identifier[report] operator[SEP] identifier[JSError] operator[SEP] identifier[make] operator[SEP] identifier[property] operator[SEP] identifier[name] , identifier[PolymerPassErrors] operator[SEP] identifier[POLYMER_INVALID_PROPERTY] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[typeString] operator[=] identifier[typeValue] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[value] operator[SEP] identifier[isName] operator[SEP] operator[SEP] operator[SEP] { identifier[typeString] operator[=] identifier[property] operator[SEP] identifier[value] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[typeString] operator[=] literal[String] operator[SEP] } identifier[Node] identifier[typeNode] operator[SEP] Keyword[switch] operator[SEP] identifier[typeString] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[typeNode] operator[=] identifier[IR] operator[SEP] identifier[string] operator[SEP] identifier[typeString] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[typeNode] operator[=] Keyword[new] identifier[Node] operator[SEP] identifier[Token] operator[SEP] identifier[BANG] , identifier[IR] operator[SEP] identifier[string] operator[SEP] identifier[typeString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[compiler] operator[SEP] identifier[report] operator[SEP] identifier[JSError] operator[SEP] identifier[make] operator[SEP] identifier[property] operator[SEP] identifier[name] , identifier[PolymerPassErrors] operator[SEP] identifier[POLYMER_INVALID_PROPERTY] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[return] Keyword[new] identifier[JSTypeExpression] operator[SEP] identifier[typeNode] , identifier[VIRTUAL_FILE] operator[SEP] operator[SEP] }
public String deleteByIdList(MappedStatement ms) { final Class<?> entityClass = getEntityClass(ms); StringBuilder sql = new StringBuilder(); sql.append(SqlHelper.deleteFromTable(entityClass, tableName(entityClass))); appendWhereIdList(sql, entityClass, getConfig().isSafeDelete()); return sql.toString(); }
class class_name[name] begin[{] method[deleteByIdList, return_type[type[String]], modifier[public], parameter[ms]] begin[{] local_variable[type[Class], entityClass] local_variable[type[StringBuilder], sql] call[sql.append, parameter[call[SqlHelper.deleteFromTable, parameter[member[.entityClass], call[.tableName, parameter[member[.entityClass]]]]]]] call[.appendWhereIdList, parameter[member[.sql], member[.entityClass], call[.getConfig, parameter[]]]] return[call[sql.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[deleteByIdList] operator[SEP] identifier[MappedStatement] identifier[ms] operator[SEP] { Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[entityClass] operator[=] identifier[getEntityClass] operator[SEP] identifier[ms] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sql] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[SqlHelper] operator[SEP] identifier[deleteFromTable] operator[SEP] identifier[entityClass] , identifier[tableName] operator[SEP] identifier[entityClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[appendWhereIdList] operator[SEP] identifier[sql] , identifier[entityClass] , identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isSafeDelete] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sql] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
static void clear(byte[][] blocks, int off, int len) { // this is significantly faster than looping or Arrays.fill (which loops), particularly when // the length of the slice to be cleared is <= to ARRAY_LEN (in that case, it's faster by a // factor of 2) int remaining = len; while (remaining > ARRAY_LEN) { System.arraycopy(NULL_ARRAY, 0, blocks, off, ARRAY_LEN); off += ARRAY_LEN; remaining -= ARRAY_LEN; } System.arraycopy(NULL_ARRAY, 0, blocks, off, remaining); }
class class_name[name] begin[{] method[clear, return_type[void], modifier[static], parameter[blocks, off, len]] begin[{] local_variable[type[int], remaining] while[binary_operation[member[.remaining], >, member[.ARRAY_LEN]]] begin[{] call[System.arraycopy, parameter[member[.NULL_ARRAY], literal[0], member[.blocks], member[.off], member[.ARRAY_LEN]]] assign[member[.off], member[.ARRAY_LEN]] assign[member[.remaining], member[.ARRAY_LEN]] end[}] call[System.arraycopy, parameter[member[.NULL_ARRAY], literal[0], member[.blocks], member[.off], member[.remaining]]] end[}] END[}]
Keyword[static] Keyword[void] identifier[clear] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[blocks] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] { Keyword[int] identifier[remaining] operator[=] identifier[len] operator[SEP] Keyword[while] operator[SEP] identifier[remaining] operator[>] identifier[ARRAY_LEN] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[NULL_ARRAY] , Other[0] , identifier[blocks] , identifier[off] , identifier[ARRAY_LEN] operator[SEP] operator[SEP] identifier[off] operator[+=] identifier[ARRAY_LEN] operator[SEP] identifier[remaining] operator[-=] identifier[ARRAY_LEN] operator[SEP] } identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[NULL_ARRAY] , Other[0] , identifier[blocks] , identifier[off] , identifier[remaining] operator[SEP] operator[SEP] }
@CheckForNull public static PrivateKey loadPrivateKey(final Reader reader) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException { try (PEMParser pemParser = new PEMParser(reader)) { Object readObject = pemParser.readObject(); while (readObject != null) { PrivateKeyInfo privateKeyInfo = getPrivateKeyInfoOrNull(readObject); if (privateKeyInfo != null) { return new JcaPEMKeyConverter().getPrivateKey(privateKeyInfo); } readObject = pemParser.readObject(); } } return null; }
class class_name[name] begin[{] method[loadPrivateKey, return_type[type[PrivateKey]], modifier[public static], parameter[reader]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=pemParser, selectors=[], type_arguments=None), name=readObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=readObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPrivateKeyInfoOrNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=privateKeyInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PrivateKeyInfo, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=privateKeyInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=privateKeyInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPrivateKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JcaPEMKeyConverter, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=readObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=pemParser, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=readObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=pemParser, type=ReferenceType(arguments=None, dimensions=[], name=PEMParser, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=reader, 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=PEMParser, sub_type=None)))]) return[literal[null]] end[}] END[}]
annotation[@] identifier[CheckForNull] Keyword[public] Keyword[static] identifier[PrivateKey] identifier[loadPrivateKey] operator[SEP] Keyword[final] identifier[Reader] identifier[reader] operator[SEP] Keyword[throws] identifier[IOException] , identifier[NoSuchAlgorithmException] , identifier[InvalidKeySpecException] { Keyword[try] operator[SEP] identifier[PEMParser] identifier[pemParser] operator[=] Keyword[new] identifier[PEMParser] operator[SEP] identifier[reader] operator[SEP] operator[SEP] { identifier[Object] identifier[readObject] operator[=] identifier[pemParser] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[readObject] operator[!=] Other[null] operator[SEP] { identifier[PrivateKeyInfo] identifier[privateKeyInfo] operator[=] identifier[getPrivateKeyInfoOrNull] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[privateKeyInfo] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[JcaPEMKeyConverter] operator[SEP] operator[SEP] operator[SEP] identifier[getPrivateKey] operator[SEP] identifier[privateKeyInfo] operator[SEP] operator[SEP] } identifier[readObject] operator[=] identifier[pemParser] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public CompletableFuture<Void> registerEventProcessorFactory(IEventProcessorFactory<?> factory, EventProcessorOptions processorOptions) { if (this.unregistered != null) { throw new IllegalStateException("Register cannot be called on an EventProcessorHost after unregister. Please create a new EventProcessorHost instance."); } if (this.hostContext.getEventProcessorFactory() != null) { throw new IllegalStateException("Register has already been called on this EventProcessorHost"); } this.hostContext.setEventProcessorFactory(factory); this.hostContext.setEventProcessorOptions(processorOptions); if (this.executorService.isShutdown() || this.executorService.isTerminated()) { TRACE_LOGGER.warn(this.hostContext.withHost("Calling registerEventProcessor/Factory after executor service has been shut down.")); throw new RejectedExecutionException("EventProcessorHost executor service has been shut down"); } if (this.initializeLeaseManager) { try { ((AzureStorageCheckpointLeaseManager) this.hostContext.getLeaseManager()).initialize(this.hostContext); } catch (InvalidKeyException | URISyntaxException | StorageException e) { TRACE_LOGGER.error(this.hostContext.withHost("Failure initializing default lease and checkpoint manager.")); throw new RuntimeException("Failure initializing Storage lease manager", e); } } TRACE_LOGGER.info(this.hostContext.withHost("Starting event processing.")); return this.partitionManager.initialize(); }
class class_name[name] begin[{] method[registerEventProcessorFactory, return_type[type[CompletableFuture]], modifier[public], parameter[factory, processorOptions]] begin[{] if[binary_operation[THIS[member[None.unregistered]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Register cannot be called on an EventProcessorHost after unregister. Please create a new EventProcessorHost instance.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.hostContext]call[None.getEventProcessorFactory, parameter[]]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Register has already been called on this EventProcessorHost")], 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[}] THIS[member[None.hostContext]call[None.setEventProcessorFactory, parameter[member[.factory]]]] THIS[member[None.hostContext]call[None.setEventProcessorOptions, parameter[member[.processorOptions]]]] if[binary_operation[THIS[member[None.executorService]call[None.isShutdown, parameter[]]], ||, THIS[member[None.executorService]call[None.isTerminated, parameter[]]]]] begin[{] call[TRACE_LOGGER.warn, parameter[THIS[member[None.hostContext]call[None.withHost, parameter[literal["Calling registerEventProcessor/Factory after executor service has been shut down."]]]]]] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EventProcessorHost executor service has been shut down")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RejectedExecutionException, sub_type=None)), label=None) else begin[{] None end[}] if[THIS[member[None.initializeLeaseManager]]] begin[{] TryStatement(block=[StatementExpression(expression=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=hostContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getLeaseManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=AzureStorageCheckpointLeaseManager, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=hostContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure initializing default lease and checkpoint manager.")], member=withHost, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=error, postfix_operators=[], prefix_operators=[], qualifier=TRACE_LOGGER, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure initializing Storage lease manager"), 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=['InvalidKeyException', 'URISyntaxException', 'StorageException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] call[TRACE_LOGGER.info, parameter[THIS[member[None.hostContext]call[None.withHost, parameter[literal["Starting event processing."]]]]]] return[THIS[member[None.partitionManager]call[None.initialize, parameter[]]]] end[}] END[}]
Keyword[public] identifier[CompletableFuture] operator[<] identifier[Void] operator[>] identifier[registerEventProcessorFactory] operator[SEP] identifier[IEventProcessorFactory] operator[<] operator[?] operator[>] identifier[factory] , identifier[EventProcessorOptions] identifier[processorOptions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[unregistered] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] identifier[getEventProcessorFactory] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] identifier[setEventProcessorFactory] operator[SEP] identifier[factory] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] identifier[setEventProcessorOptions] operator[SEP] identifier[processorOptions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[executorService] operator[SEP] identifier[isShutdown] operator[SEP] operator[SEP] operator[||] Keyword[this] operator[SEP] identifier[executorService] operator[SEP] identifier[isTerminated] operator[SEP] operator[SEP] operator[SEP] { identifier[TRACE_LOGGER] operator[SEP] identifier[warn] operator[SEP] Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] identifier[withHost] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RejectedExecutionException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[initializeLeaseManager] operator[SEP] { Keyword[try] { operator[SEP] operator[SEP] identifier[AzureStorageCheckpointLeaseManager] operator[SEP] Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] identifier[getLeaseManager] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[initialize] operator[SEP] Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvalidKeyException] operator[|] identifier[URISyntaxException] operator[|] identifier[StorageException] identifier[e] operator[SEP] { identifier[TRACE_LOGGER] operator[SEP] identifier[error] operator[SEP] Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] identifier[withHost] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } identifier[TRACE_LOGGER] operator[SEP] identifier[info] operator[SEP] Keyword[this] operator[SEP] identifier[hostContext] operator[SEP] identifier[withHost] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[partitionManager] operator[SEP] identifier[initialize] operator[SEP] operator[SEP] operator[SEP] }
private void recycleBuffer(MemorySegment buffer) { synchronized (this.buffers) { if (this.isDestroyed) { this.globalBufferPool.returnBuffer(buffer); this.numRequestedBuffers--; } else { // if the number of designated buffers changed in the meantime, make sure // to return the buffer to the global buffer pool if (this.numRequestedBuffers > this.numDesignatedBuffers) { this.globalBufferPool.returnBuffer(buffer); this.numRequestedBuffers--; } else if (!this.listeners.isEmpty()) { Buffer availableBuffer = new Buffer(buffer, buffer.size(), this.recycler); try { this.listeners.poll().bufferAvailable(availableBuffer); } catch (Exception e) { this.buffers.add(buffer); this.buffers.notify(); } } else { this.buffers.add(buffer); this.buffers.notify(); } } } }
class class_name[name] begin[{] method[recycleBuffer, return_type[void], modifier[private], parameter[buffer]] begin[{] SYNCHRONIZED[THIS[member[None.buffers]]] BEGIN[{] if[THIS[member[None.isDestroyed]]] begin[{] THIS[member[None.globalBufferPool]call[None.returnBuffer, parameter[member[.buffer]]]] THIS[member[None.numRequestedBuffers]] else begin[{] if[binary_operation[THIS[member[None.numRequestedBuffers]], >, THIS[member[None.numDesignatedBuffers]]]] begin[{] THIS[member[None.globalBufferPool]call[None.returnBuffer, parameter[member[.buffer]]]] THIS[member[None.numRequestedBuffers]] else begin[{] if[THIS[member[None.listeners]call[None.isEmpty, parameter[]]]] begin[{] local_variable[type[Buffer], availableBuffer] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=listeners, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=poll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=availableBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bufferAvailable, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=buffers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=buffers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=notify, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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[{] THIS[member[None.buffers]call[None.add, parameter[member[.buffer]]]] THIS[member[None.buffers]call[None.notify, parameter[]]] end[}] end[}] end[}] END[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[recycleBuffer] operator[SEP] identifier[MemorySegment] identifier[buffer] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[buffers] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isDestroyed] operator[SEP] { Keyword[this] operator[SEP] identifier[globalBufferPool] operator[SEP] identifier[returnBuffer] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[numRequestedBuffers] operator[--] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[numRequestedBuffers] operator[>] Keyword[this] operator[SEP] identifier[numDesignatedBuffers] operator[SEP] { Keyword[this] operator[SEP] identifier[globalBufferPool] operator[SEP] identifier[returnBuffer] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[numRequestedBuffers] operator[--] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[listeners] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Buffer] identifier[availableBuffer] operator[=] Keyword[new] identifier[Buffer] operator[SEP] identifier[buffer] , identifier[buffer] operator[SEP] identifier[size] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[recycler] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[listeners] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[bufferAvailable] operator[SEP] identifier[availableBuffer] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[this] operator[SEP] identifier[buffers] operator[SEP] identifier[add] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[buffers] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[this] operator[SEP] identifier[buffers] operator[SEP] identifier[add] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[buffers] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } } } }
public void removeUserProfileEventListener(UserProfileEventListener listener) { SecurityHelper.validateSecurityPermission(PermissionConstants.MANAGE_LISTENERS); listeners.remove(listener); }
class class_name[name] begin[{] method[removeUserProfileEventListener, return_type[void], modifier[public], parameter[listener]] begin[{] call[SecurityHelper.validateSecurityPermission, parameter[member[PermissionConstants.MANAGE_LISTENERS]]] call[listeners.remove, parameter[member[.listener]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeUserProfileEventListener] operator[SEP] identifier[UserProfileEventListener] identifier[listener] operator[SEP] { identifier[SecurityHelper] operator[SEP] identifier[validateSecurityPermission] operator[SEP] identifier[PermissionConstants] operator[SEP] identifier[MANAGE_LISTENERS] operator[SEP] operator[SEP] identifier[listeners] operator[SEP] identifier[remove] operator[SEP] identifier[listener] operator[SEP] operator[SEP] }
public static <T> List<T> randomListFrom(Iterable<T> elements, Range<Integer> size) { checkArgument(!isEmpty(elements), "Elements to populate from must not be empty"); return randomListFrom(() -> IterableUtils.randomFrom(elements), size); }
class class_name[name] begin[{] method[randomListFrom, return_type[type[List]], modifier[public static], parameter[elements, size]] begin[{] call[.checkArgument, parameter[call[.isEmpty, parameter[member[.elements]]], literal["Elements to populate from must not be empty"]]] return[call[.randomListFrom, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=randomFrom, postfix_operators=[], prefix_operators=[], qualifier=IterableUtils, selectors=[], type_arguments=None), parameters=[]), member[.size]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[randomListFrom] operator[SEP] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[elements] , identifier[Range] operator[<] identifier[Integer] operator[>] identifier[size] operator[SEP] { identifier[checkArgument] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] identifier[elements] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[randomListFrom] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[IterableUtils] operator[SEP] identifier[randomFrom] operator[SEP] identifier[elements] operator[SEP] , identifier[size] operator[SEP] operator[SEP] }
public void resetPassword(CmsRequestContext context, String username, String oldPassword, String newPassword) throws CmsException, CmsSecurityException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.resetPassword( dbc, CmsOrganizationalUnit.removeLeadingSeparator(username), oldPassword, newPassword); } catch (Exception e) { dbc.report(null, Messages.get().container(Messages.ERR_RESET_PASSWORD_1, username), e); } finally { dbc.clear(); } }
class class_name[name] begin[{] method[resetPassword, return_type[void], modifier[public], parameter[context, username, oldPassword, newPassword]] begin[{] local_variable[type[CmsDbContext], dbc] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeLeadingSeparator, postfix_operators=[], prefix_operators=[], qualifier=CmsOrganizationalUnit, selectors=[], type_arguments=None), MemberReference(member=oldPassword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newPassword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resetPassword, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_RESET_PASSWORD_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=report, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[resetPassword] operator[SEP] identifier[CmsRequestContext] identifier[context] , identifier[String] identifier[username] , identifier[String] identifier[oldPassword] , identifier[String] identifier[newPassword] operator[SEP] Keyword[throws] identifier[CmsException] , identifier[CmsSecurityException] { identifier[CmsDbContext] identifier[dbc] operator[=] identifier[m_dbContextFactory] operator[SEP] identifier[getDbContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[try] { identifier[m_driverManager] operator[SEP] identifier[resetPassword] operator[SEP] identifier[dbc] , identifier[CmsOrganizationalUnit] operator[SEP] identifier[removeLeadingSeparator] operator[SEP] identifier[username] operator[SEP] , identifier[oldPassword] , identifier[newPassword] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[dbc] operator[SEP] identifier[report] operator[SEP] Other[null] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_RESET_PASSWORD_1] , identifier[username] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[dbc] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } }
static int countCityCoordinatesForCountry(final int codex, final int territoryRecord, final int firstTerritoryRecord) { assert codex >= 0; assert territoryRecord >= 0; assert firstTerritoryRecord >= 0; final int firstRecord = getFirstNamelessRecord(codex, territoryRecord, firstTerritoryRecord); int record = territoryRecord; while (Data.getCodex(record) == codex) { record++; } assert firstRecord <= record; return record - firstRecord; }
class class_name[name] begin[{] method[countCityCoordinatesForCountry, return_type[type[int]], modifier[static], parameter[codex, territoryRecord, firstTerritoryRecord]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=codex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None) AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=territoryRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None) AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=firstTerritoryRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None) local_variable[type[int], firstRecord] local_variable[type[int], record] while[binary_operation[call[Data.getCodex, parameter[member[.record]]], ==, member[.codex]]] begin[{] member[.record] end[}] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=firstRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), label=None, value=None) return[binary_operation[member[.record], -, member[.firstRecord]]] end[}] END[}]
Keyword[static] Keyword[int] identifier[countCityCoordinatesForCountry] operator[SEP] Keyword[final] Keyword[int] identifier[codex] , Keyword[final] Keyword[int] identifier[territoryRecord] , Keyword[final] Keyword[int] identifier[firstTerritoryRecord] operator[SEP] { Keyword[assert] identifier[codex] operator[>=] Other[0] operator[SEP] Keyword[assert] identifier[territoryRecord] operator[>=] Other[0] operator[SEP] Keyword[assert] identifier[firstTerritoryRecord] operator[>=] Other[0] operator[SEP] Keyword[final] Keyword[int] identifier[firstRecord] operator[=] identifier[getFirstNamelessRecord] operator[SEP] identifier[codex] , identifier[territoryRecord] , identifier[firstTerritoryRecord] operator[SEP] operator[SEP] Keyword[int] identifier[record] operator[=] identifier[territoryRecord] operator[SEP] Keyword[while] operator[SEP] identifier[Data] operator[SEP] identifier[getCodex] operator[SEP] identifier[record] operator[SEP] operator[==] identifier[codex] operator[SEP] { identifier[record] operator[++] operator[SEP] } Keyword[assert] identifier[firstRecord] operator[<=] identifier[record] operator[SEP] Keyword[return] identifier[record] operator[-] identifier[firstRecord] operator[SEP] }
private void initDecompressor(ChannelHandlerContext ctx, int streamId, Http2Headers headers, boolean endOfStream) throws Http2Exception { final Http2Stream stream = connection.stream(streamId); if (stream == null) { return; } Http2Decompressor decompressor = decompressor(stream); if (decompressor == null && !endOfStream) { // Determine the content encoding. CharSequence contentEncoding = headers.get(CONTENT_ENCODING); if (contentEncoding == null) { contentEncoding = IDENTITY; } final EmbeddedChannel channel = newContentDecompressor(ctx, contentEncoding); if (channel != null) { decompressor = new Http2Decompressor(channel); stream.setProperty(propertyKey, decompressor); // Decode the content and remove or replace the existing headers // so that the message looks like a decoded message. CharSequence targetContentEncoding = getTargetContentEncoding(contentEncoding); if (IDENTITY.contentEqualsIgnoreCase(targetContentEncoding)) { headers.remove(CONTENT_ENCODING); } else { headers.set(CONTENT_ENCODING, targetContentEncoding); } } } if (decompressor != null) { // The content length will be for the compressed data. Since we will decompress the data // this content-length will not be correct. Instead of queuing messages or delaying sending // header frames...just remove the content-length header headers.remove(CONTENT_LENGTH); // The first time that we initialize a decompressor, decorate the local flow controller to // properly convert consumed bytes. if (!flowControllerInitialized) { flowControllerInitialized = true; connection.local().flowController(new ConsumedBytesConverter(connection.local().flowController())); } } }
class class_name[name] begin[{] method[initDecompressor, return_type[void], modifier[private], parameter[ctx, streamId, headers, endOfStream]] begin[{] local_variable[type[Http2Stream], stream] if[binary_operation[member[.stream], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Http2Decompressor], decompressor] if[binary_operation[binary_operation[member[.decompressor], ==, literal[null]], &&, member[.endOfStream]]] begin[{] local_variable[type[CharSequence], contentEncoding] if[binary_operation[member[.contentEncoding], ==, literal[null]]] begin[{] assign[member[.contentEncoding], member[.IDENTITY]] else begin[{] None end[}] local_variable[type[EmbeddedChannel], channel] if[binary_operation[member[.channel], !=, literal[null]]] begin[{] assign[member[.decompressor], ClassCreator(arguments=[MemberReference(member=channel, 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=Http2Decompressor, sub_type=None))] call[stream.setProperty, parameter[member[.propertyKey], member[.decompressor]]] local_variable[type[CharSequence], targetContentEncoding] if[call[IDENTITY.contentEqualsIgnoreCase, parameter[member[.targetContentEncoding]]]] begin[{] call[headers.remove, parameter[member[.CONTENT_ENCODING]]] else begin[{] call[headers.set, parameter[member[.CONTENT_ENCODING], member[.targetContentEncoding]]] end[}] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.decompressor], !=, literal[null]]] begin[{] call[headers.remove, parameter[member[.CONTENT_LENGTH]]] if[member[.flowControllerInitialized]] begin[{] assign[member[.flowControllerInitialized], literal[true]] call[connection.local, parameter[]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[initDecompressor] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , Keyword[int] identifier[streamId] , identifier[Http2Headers] identifier[headers] , Keyword[boolean] identifier[endOfStream] operator[SEP] Keyword[throws] identifier[Http2Exception] { Keyword[final] identifier[Http2Stream] identifier[stream] operator[=] identifier[connection] operator[SEP] identifier[stream] operator[SEP] identifier[streamId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stream] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[Http2Decompressor] identifier[decompressor] operator[=] identifier[decompressor] operator[SEP] identifier[stream] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[decompressor] operator[==] Other[null] operator[&&] operator[!] identifier[endOfStream] operator[SEP] { identifier[CharSequence] identifier[contentEncoding] operator[=] identifier[headers] operator[SEP] identifier[get] operator[SEP] identifier[CONTENT_ENCODING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contentEncoding] operator[==] Other[null] operator[SEP] { identifier[contentEncoding] operator[=] identifier[IDENTITY] operator[SEP] } Keyword[final] identifier[EmbeddedChannel] identifier[channel] operator[=] identifier[newContentDecompressor] operator[SEP] identifier[ctx] , identifier[contentEncoding] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[channel] operator[!=] Other[null] operator[SEP] { identifier[decompressor] operator[=] Keyword[new] identifier[Http2Decompressor] operator[SEP] identifier[channel] operator[SEP] operator[SEP] identifier[stream] operator[SEP] identifier[setProperty] operator[SEP] identifier[propertyKey] , identifier[decompressor] operator[SEP] operator[SEP] identifier[CharSequence] identifier[targetContentEncoding] operator[=] identifier[getTargetContentEncoding] operator[SEP] identifier[contentEncoding] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[IDENTITY] operator[SEP] identifier[contentEqualsIgnoreCase] operator[SEP] identifier[targetContentEncoding] operator[SEP] operator[SEP] { identifier[headers] operator[SEP] identifier[remove] operator[SEP] identifier[CONTENT_ENCODING] operator[SEP] operator[SEP] } Keyword[else] { identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[CONTENT_ENCODING] , identifier[targetContentEncoding] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[decompressor] operator[!=] Other[null] operator[SEP] { identifier[headers] operator[SEP] identifier[remove] operator[SEP] identifier[CONTENT_LENGTH] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[flowControllerInitialized] operator[SEP] { identifier[flowControllerInitialized] operator[=] literal[boolean] operator[SEP] identifier[connection] operator[SEP] identifier[local] operator[SEP] operator[SEP] operator[SEP] identifier[flowController] operator[SEP] Keyword[new] identifier[ConsumedBytesConverter] operator[SEP] identifier[connection] operator[SEP] identifier[local] operator[SEP] operator[SEP] operator[SEP] identifier[flowController] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public static IntSet mutableFrom(Set<Integer> integerSet) { if (integerSet instanceof SmallIntSet) { return (SmallIntSet) integerSet; } if (integerSet instanceof ConcurrentSmallIntSet) { return (ConcurrentSmallIntSet) integerSet; } return mutableCopyFrom(integerSet); }
class class_name[name] begin[{] method[mutableFrom, return_type[type[IntSet]], modifier[public static], parameter[integerSet]] begin[{] if[binary_operation[member[.integerSet], instanceof, type[SmallIntSet]]] begin[{] return[Cast(expression=MemberReference(member=integerSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SmallIntSet, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.integerSet], instanceof, type[ConcurrentSmallIntSet]]] begin[{] return[Cast(expression=MemberReference(member=integerSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ConcurrentSmallIntSet, sub_type=None))] else begin[{] None end[}] return[call[.mutableCopyFrom, parameter[member[.integerSet]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[IntSet] identifier[mutableFrom] operator[SEP] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[integerSet] operator[SEP] { Keyword[if] operator[SEP] identifier[integerSet] Keyword[instanceof] identifier[SmallIntSet] operator[SEP] { Keyword[return] operator[SEP] identifier[SmallIntSet] operator[SEP] identifier[integerSet] operator[SEP] } Keyword[if] operator[SEP] identifier[integerSet] Keyword[instanceof] identifier[ConcurrentSmallIntSet] operator[SEP] { Keyword[return] operator[SEP] identifier[ConcurrentSmallIntSet] operator[SEP] identifier[integerSet] operator[SEP] } Keyword[return] identifier[mutableCopyFrom] operator[SEP] identifier[integerSet] operator[SEP] operator[SEP] }
private boolean setKey(UserContext context, UserTOTPKey key) throws GuacamoleException { // Get mutable set of attributes User self = context.self(); Map<String, String> attributes = new HashMap<String, String>(); // Set/overwrite current TOTP key state attributes.put(TOTPUser.TOTP_KEY_SECRET_ATTRIBUTE_NAME, BASE32.encode(key.getSecret())); attributes.put(TOTPUser.TOTP_KEY_CONFIRMED_ATTRIBUTE_NAME, key.isConfirmed() ? "true" : "false"); self.setAttributes(attributes); // Confirm that attributes have actually been set Map<String, String> setAttributes = self.getAttributes(); if (!setAttributes.containsKey(TOTPUser.TOTP_KEY_SECRET_ATTRIBUTE_NAME) || !setAttributes.containsKey(TOTPUser.TOTP_KEY_CONFIRMED_ATTRIBUTE_NAME)) return false; // Update user object try { context.getUserDirectory().update(self); } catch (GuacamoleSecurityException e) { logger.info("User \"{}\" cannot store their TOTP key as they " + "lack permission to update their own account. TOTP " + "will be disabled for this user.", self.getIdentifier()); logger.debug("Permission denied to set TOTP key of user " + "account.", e); return false; } catch (GuacamoleUnsupportedException e) { logger.debug("Extension storage for user is explicitly read-only. " + "Cannot update attributes to store TOTP key.", e); return false; } // TOTP key successfully stored/updated return true; }
class class_name[name] begin[{] method[setKey, return_type[type[boolean]], modifier[private], parameter[context, key]] begin[{] local_variable[type[User], self] local_variable[type[Map], attributes] call[attributes.put, parameter[member[TOTPUser.TOTP_KEY_SECRET_ATTRIBUTE_NAME], call[BASE32.encode, parameter[call[key.getSecret, parameter[]]]]]] call[attributes.put, parameter[member[TOTPUser.TOTP_KEY_CONFIRMED_ATTRIBUTE_NAME], TernaryExpression(condition=MethodInvocation(arguments=[], member=isConfirmed, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="false"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="true"))]] call[self.setAttributes, parameter[member[.attributes]]] local_variable[type[Map], setAttributes] if[binary_operation[call[setAttributes.containsKey, parameter[member[TOTPUser.TOTP_KEY_SECRET_ATTRIBUTE_NAME]]], ||, call[setAttributes.containsKey, parameter[member[TOTPUser.TOTP_KEY_CONFIRMED_ATTRIBUTE_NAME]]]]] begin[{] return[literal[false]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getUserDirectory, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, 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=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User \"{}\" cannot store their TOTP key as they "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="lack permission to update their own account. TOTP "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="will be disabled for this user."), operator=+), MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=self, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Permission denied to set TOTP key of user "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="account."), operator=+), 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=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GuacamoleSecurityException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Extension storage for user is explicitly read-only. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot update attributes to store TOTP key."), operator=+), 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=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GuacamoleUnsupportedException']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[setKey] operator[SEP] identifier[UserContext] identifier[context] , identifier[UserTOTPKey] identifier[key] operator[SEP] Keyword[throws] identifier[GuacamoleException] { identifier[User] identifier[self] operator[=] identifier[context] operator[SEP] identifier[self] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[attributes] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[TOTPUser] operator[SEP] identifier[TOTP_KEY_SECRET_ATTRIBUTE_NAME] , identifier[BASE32] operator[SEP] identifier[encode] operator[SEP] identifier[key] operator[SEP] identifier[getSecret] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[TOTPUser] operator[SEP] identifier[TOTP_KEY_CONFIRMED_ATTRIBUTE_NAME] , identifier[key] operator[SEP] identifier[isConfirmed] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[self] operator[SEP] identifier[setAttributes] operator[SEP] identifier[attributes] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[setAttributes] operator[=] identifier[self] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[setAttributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[TOTPUser] operator[SEP] identifier[TOTP_KEY_SECRET_ATTRIBUTE_NAME] operator[SEP] operator[||] operator[!] identifier[setAttributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[TOTPUser] operator[SEP] identifier[TOTP_KEY_CONFIRMED_ATTRIBUTE_NAME] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[try] { identifier[context] operator[SEP] identifier[getUserDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[update] operator[SEP] identifier[self] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[GuacamoleSecurityException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] , identifier[self] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[GuacamoleUnsupportedException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void putEDBObjectEntry(String key, Object value, Class<?> type) { putEDBObjectEntry(key, value, type.getName()); }
class class_name[name] begin[{] method[putEDBObjectEntry, return_type[void], modifier[public], parameter[key, value, type]] begin[{] call[.putEDBObjectEntry, parameter[member[.key], member[.value], call[type.getName, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[putEDBObjectEntry] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] , identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] { identifier[putEDBObjectEntry] operator[SEP] identifier[key] , identifier[value] , identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void csv(String file) throws IOException { CsvWriteOptions options = CsvWriteOptions.builder(file).build(); new CsvWriter().write(table, options); }
class class_name[name] begin[{] method[csv, return_type[void], modifier[public], parameter[file]] begin[{] local_variable[type[CsvWriteOptions], options] ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CsvWriter, sub_type=None)) end[}] END[}]
Keyword[public] Keyword[void] identifier[csv] operator[SEP] identifier[String] identifier[file] operator[SEP] Keyword[throws] identifier[IOException] { identifier[CsvWriteOptions] identifier[options] operator[=] identifier[CsvWriteOptions] operator[SEP] identifier[builder] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[CsvWriter] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[table] , identifier[options] operator[SEP] operator[SEP] }
protected final ResponseEntity<Response> setGreetingText(Payload[] greeting) { Event event = new Event().setGreeting(greeting); return restTemplate.postForEntity(fbMessengerProfileUrl, event, Response.class); }
class class_name[name] begin[{] method[setGreetingText, return_type[type[ResponseEntity]], modifier[final protected], parameter[greeting]] begin[{] local_variable[type[Event], event] return[call[restTemplate.postForEntity, parameter[member[.fbMessengerProfileUrl], member[.event], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))]]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[ResponseEntity] operator[<] identifier[Response] operator[>] identifier[setGreetingText] operator[SEP] identifier[Payload] operator[SEP] operator[SEP] identifier[greeting] operator[SEP] { identifier[Event] identifier[event] operator[=] Keyword[new] identifier[Event] operator[SEP] operator[SEP] operator[SEP] identifier[setGreeting] operator[SEP] identifier[greeting] operator[SEP] operator[SEP] Keyword[return] identifier[restTemplate] operator[SEP] identifier[postForEntity] operator[SEP] identifier[fbMessengerProfileUrl] , identifier[event] , identifier[Response] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void printPattern(int[] row, int[] column, int offset) { int size = row.length; if (size != column.length) throw new IllegalArgumentException( "All arrays must be of the same size"); for (int i = 0; i < size; ++i) format(Locale.ENGLISH, "%10d %10d%n", row[i] + offset, column[i] + offset); }
class class_name[name] begin[{] method[printPattern, return_type[void], modifier[public], parameter[row, column, offset]] begin[{] local_variable[type[int], size] if[binary_operation[member[.size], !=, member[column.length]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="All arrays must be of the same size")], 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[}] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENGLISH, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%10d %10d%n"), BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=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) end[}] END[}]
Keyword[public] Keyword[void] identifier[printPattern] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[row] , Keyword[int] operator[SEP] operator[SEP] identifier[column] , Keyword[int] identifier[offset] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[row] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[!=] identifier[column] operator[SEP] identifier[length] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] operator[++] identifier[i] operator[SEP] identifier[format] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] , literal[String] , identifier[row] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[offset] , identifier[column] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[offset] operator[SEP] operator[SEP] }
public static String asTitleCase(String text) { // special for _value, eg we want to let underscore be like a space text = text.replace('_', ' '); // remove double spaces text = text.replaceAll("\\s+", " "); // see: http://stackoverflow.com/questions/2559759/how-do-i-convert-camelcase-into-human-readable-names-in-java text = text.replaceAll( String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])", "(?<=[A-Za-z])(?=[^A-Za-z])" ), " " ); return Character.toUpperCase(text.charAt(0)) + text.substring(1); }
class class_name[name] begin[{] method[asTitleCase, return_type[type[String]], modifier[public static], parameter[text]] begin[{] assign[member[.text], call[text.replace, parameter[literal['_'], literal[' ']]]] assign[member[.text], call[text.replaceAll, parameter[literal["\\s+"], literal[" "]]]] assign[member[.text], call[text.replaceAll, parameter[call[String.format, parameter[literal["%s|%s|%s"], literal["(?<=[A-Z])(?=[A-Z][a-z])"], literal["(?<=[^A-Z])(?=[A-Z])"], literal["(?<=[A-Za-z])(?=[^A-Za-z])"]]], literal[" "]]]] return[binary_operation[call[Character.toUpperCase, parameter[call[text.charAt, parameter[literal[0]]]]], +, call[text.substring, parameter[literal[1]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[asTitleCase] operator[SEP] identifier[String] identifier[text] operator[SEP] { identifier[text] operator[=] identifier[text] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[text] operator[=] identifier[text] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[text] operator[=] identifier[text] operator[SEP] identifier[replaceAll] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , literal[String] , literal[String] , literal[String] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[+] identifier[text] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] }
public static Jar getArchiveTask(Project project) { TaskCollection<Jar> existingArchiveTasks = project.getTasks().withType(Jar.class); Jar customArchiveTask = project.getExtensions().getByType(ThorntailExtension.class).getArchiveTask(); if (customArchiveTask != null) { return existingArchiveTasks.getByName(customArchiveTask.getName()); } else if (existingArchiveTasks.findByName(WarPlugin.WAR_TASK_NAME) != null) { return existingArchiveTasks.getByName(WarPlugin.WAR_TASK_NAME); } else if (existingArchiveTasks.findByName(JavaPlugin.JAR_TASK_NAME) != null) { return existingArchiveTasks.getByName(JavaPlugin.JAR_TASK_NAME); } throw new GradleException("Unable to detect Archive-Task: project contains neither 'war' nor 'jar', " + "nor is custom Archive-Task specified in the \"thorntail\" extension."); }
class class_name[name] begin[{] method[getArchiveTask, return_type[type[Jar]], modifier[public static], parameter[project]] begin[{] local_variable[type[TaskCollection], existingArchiveTasks] local_variable[type[Jar], customArchiveTask] if[binary_operation[member[.customArchiveTask], !=, literal[null]]] begin[{] return[call[existingArchiveTasks.getByName, parameter[call[customArchiveTask.getName, parameter[]]]]] else begin[{] if[binary_operation[call[existingArchiveTasks.findByName, parameter[member[WarPlugin.WAR_TASK_NAME]]], !=, literal[null]]] begin[{] return[call[existingArchiveTasks.getByName, parameter[member[WarPlugin.WAR_TASK_NAME]]]] else begin[{] if[binary_operation[call[existingArchiveTasks.findByName, parameter[member[JavaPlugin.JAR_TASK_NAME]]], !=, literal[null]]] begin[{] return[call[existingArchiveTasks.getByName, parameter[member[JavaPlugin.JAR_TASK_NAME]]]] else begin[{] None end[}] end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to detect Archive-Task: project contains neither 'war' nor 'jar', "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="nor is custom Archive-Task specified in the \"thorntail\" extension."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GradleException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Jar] identifier[getArchiveTask] operator[SEP] identifier[Project] identifier[project] operator[SEP] { identifier[TaskCollection] operator[<] identifier[Jar] operator[>] identifier[existingArchiveTasks] operator[=] identifier[project] operator[SEP] identifier[getTasks] operator[SEP] operator[SEP] operator[SEP] identifier[withType] operator[SEP] identifier[Jar] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Jar] identifier[customArchiveTask] operator[=] identifier[project] operator[SEP] identifier[getExtensions] operator[SEP] operator[SEP] operator[SEP] identifier[getByType] operator[SEP] identifier[ThorntailExtension] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[getArchiveTask] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[customArchiveTask] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[existingArchiveTasks] operator[SEP] identifier[getByName] operator[SEP] identifier[customArchiveTask] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[existingArchiveTasks] operator[SEP] identifier[findByName] operator[SEP] identifier[WarPlugin] operator[SEP] identifier[WAR_TASK_NAME] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[existingArchiveTasks] operator[SEP] identifier[getByName] operator[SEP] identifier[WarPlugin] operator[SEP] identifier[WAR_TASK_NAME] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[existingArchiveTasks] operator[SEP] identifier[findByName] operator[SEP] identifier[JavaPlugin] operator[SEP] identifier[JAR_TASK_NAME] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[existingArchiveTasks] operator[SEP] identifier[getByName] operator[SEP] identifier[JavaPlugin] operator[SEP] identifier[JAR_TASK_NAME] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[GradleException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] }
public boolean isSentenceStart() { return posToken != null && JLanguageTool.SENTENCE_START_TAGNAME.equals(posToken.posTag) && !posToken.negation; }
class class_name[name] begin[{] method[isSentenceStart, return_type[type[boolean]], modifier[public], parameter[]] begin[{] return[binary_operation[binary_operation[binary_operation[member[.posToken], !=, literal[null]], &&, call[JLanguageTool.SENTENCE_START_TAGNAME.equals, parameter[member[posToken.posTag]]]], &&, member[posToken.negation]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isSentenceStart] operator[SEP] operator[SEP] { Keyword[return] identifier[posToken] operator[!=] Other[null] operator[&&] identifier[JLanguageTool] operator[SEP] identifier[SENTENCE_START_TAGNAME] operator[SEP] identifier[equals] operator[SEP] identifier[posToken] operator[SEP] identifier[posTag] operator[SEP] operator[&&] operator[!] identifier[posToken] operator[SEP] identifier[negation] operator[SEP] }
public String getID() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getID"); String id = _streamId.toString(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getID", id); return id; }
class class_name[name] begin[{] method[getID, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["getID"]]] else begin[{] None end[}] local_variable[type[String], id] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["getID"], member[.id]]] else begin[{] None end[}] return[member[.id]] end[}] END[}]
Keyword[public] identifier[String] identifier[getID] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] identifier[_streamId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[id] operator[SEP] operator[SEP] Keyword[return] identifier[id] operator[SEP] }
public void addVisualizationListener(VisualizationListener listener) { for(int i = 0; i < vlistenerList.size(); i++) { if(vlistenerList.get(i) == listener) { return; } } vlistenerList.add(listener); }
class class_name[name] begin[{] method[addVisualizationListener, return_type[void], modifier[public], parameter[listener]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=vlistenerList, selectors=[], type_arguments=None), operandr=MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=vlistenerList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[vlistenerList.add, parameter[member[.listener]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addVisualizationListener] operator[SEP] identifier[VisualizationListener] identifier[listener] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[vlistenerList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[vlistenerList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[listener] operator[SEP] { Keyword[return] operator[SEP] } } identifier[vlistenerList] operator[SEP] identifier[add] operator[SEP] identifier[listener] operator[SEP] operator[SEP] }
public static <S extends Control, V> SkinPropertyBasedCssMetaData<S, V> createSkinMetaData(String property, StyleConverter<?, V> converter, String propertyName, V defaultValue) { return new SkinPropertyBasedCssMetaData<S, V>(property, converter, propertyName, defaultValue); }
class class_name[name] begin[{] method[createSkinMetaData, return_type[type[SkinPropertyBasedCssMetaData]], modifier[public static], parameter[property, converter, propertyName, defaultValue]] begin[{] return[ClassCreator(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=SkinPropertyBasedCssMetaData, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[S] Keyword[extends] identifier[Control] , identifier[V] operator[>] identifier[SkinPropertyBasedCssMetaData] operator[<] identifier[S] , identifier[V] operator[>] identifier[createSkinMetaData] operator[SEP] identifier[String] identifier[property] , identifier[StyleConverter] operator[<] operator[?] , identifier[V] operator[>] identifier[converter] , identifier[String] identifier[propertyName] , identifier[V] identifier[defaultValue] operator[SEP] { Keyword[return] Keyword[new] identifier[SkinPropertyBasedCssMetaData] operator[<] identifier[S] , identifier[V] operator[>] operator[SEP] identifier[property] , identifier[converter] , identifier[propertyName] , identifier[defaultValue] operator[SEP] operator[SEP] }
public ServiceFuture<List<NetworkWatcherInner>> listAsync(final ServiceCallback<List<NetworkWatcherInner>> serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); }
class class_name[name] begin[{] method[listAsync, return_type[type[ServiceFuture]], modifier[public], parameter[serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.listWithServiceResponseAsync, parameter[]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[NetworkWatcherInner] operator[>] operator[>] identifier[listAsync] operator[SEP] Keyword[final] identifier[ServiceCallback] operator[<] identifier[List] operator[<] identifier[NetworkWatcherInner] operator[>] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listWithServiceResponseAsync] operator[SEP] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public StoredChannel setClientToken(String clientToken) { lock.lock(); try { this.clientToken = clientToken; } finally { lock.unlock(); } return this; }
class class_name[name] begin[{] method[setClientToken, return_type[type[StoredChannel]], modifier[public], parameter[clientToken]] begin[{] call[lock.lock, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=clientToken, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=clientToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[StoredChannel] identifier[setClientToken] operator[SEP] identifier[String] identifier[clientToken] operator[SEP] { identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[clientToken] operator[=] identifier[clientToken] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public void stop() { lock.lock(); try { if (process != null) { destroyProcess(); } process = null; } finally { lock.unlock(); } }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public], parameter[]] begin[{] call[lock.lock, parameter[]] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=destroyProcess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] { identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[process] operator[!=] Other[null] operator[SEP] { identifier[destroyProcess] operator[SEP] operator[SEP] operator[SEP] } identifier[process] operator[=] Other[null] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public void put(int key, int value) { if (key < 0) Kit.codeBug(); int index = ensureIndex(key, true); if (ivaluesShift == 0) { int N = 1 << power; // keys.length can be N * 2 after clear which set ivaluesShift to 0 if (keys.length != N * 2) { int[] tmp = new int[N * 2]; System.arraycopy(keys, 0, tmp, 0, N); keys = tmp; } ivaluesShift = N; } keys[ivaluesShift + index] = value; }
class class_name[name] begin[{] method[put, return_type[void], modifier[public], parameter[key, value]] begin[{] if[binary_operation[member[.key], <, literal[0]]] begin[{] call[Kit.codeBug, parameter[]] else begin[{] None end[}] local_variable[type[int], index] if[binary_operation[member[.ivaluesShift], ==, literal[0]]] begin[{] local_variable[type[int], N] if[binary_operation[member[keys.length], !=, binary_operation[member[.N], *, literal[2]]]] begin[{] local_variable[type[int], tmp] call[System.arraycopy, parameter[member[.keys], literal[0], member[.tmp], literal[0], member[.N]]] assign[member[.keys], member[.tmp]] else begin[{] None end[}] assign[member[.ivaluesShift], member[.N]] else begin[{] None end[}] assign[member[.keys], member[.value]] end[}] END[}]
Keyword[public] Keyword[void] identifier[put] operator[SEP] Keyword[int] identifier[key] , Keyword[int] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[<] Other[0] operator[SEP] identifier[Kit] operator[SEP] identifier[codeBug] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[ensureIndex] operator[SEP] identifier[key] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivaluesShift] operator[==] Other[0] operator[SEP] { Keyword[int] identifier[N] operator[=] Other[1] operator[<<] identifier[power] operator[SEP] Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[length] operator[!=] identifier[N] operator[*] Other[2] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[N] operator[*] Other[2] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[keys] , Other[0] , identifier[tmp] , Other[0] , identifier[N] operator[SEP] operator[SEP] identifier[keys] operator[=] identifier[tmp] operator[SEP] } identifier[ivaluesShift] operator[=] identifier[N] operator[SEP] } identifier[keys] operator[SEP] identifier[ivaluesShift] operator[+] identifier[index] operator[SEP] operator[=] identifier[value] operator[SEP] }
private void setModelContext(InstancesHeader ih){ //TODO possibly refactored if ((ih != null) && (ih.classIndex() < 0)) { throw new IllegalArgumentException( "Context for a classifier must include a class to learn"); } //TODO: check flag for checking whether training has started or not //model context is used to describe the model logger.trace("Model context: {}", ih.toString()); }
class class_name[name] begin[{] method[setModelContext, return_type[void], modifier[private], parameter[ih]] begin[{] if[binary_operation[binary_operation[member[.ih], !=, literal[null]], &&, binary_operation[call[ih.classIndex, parameter[]], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Context for a classifier must include a class to learn")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[logger.trace, parameter[literal["Model context: {}"], call[ih.toString, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setModelContext] operator[SEP] identifier[InstancesHeader] identifier[ih] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[ih] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[ih] operator[SEP] identifier[classIndex] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[ih] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void execute() throws HelloSignException { HttpURLConnection connection = getConnection(); try { // Execute the request and save the HTTP status code lastHttpStatusCode = connection.getResponseCode(); // Save the stream object for processing if (lastHttpStatusCode >= 200 && lastHttpStatusCode < 300) { logger.debug("OK!"); lastResponseStream = connection.getInputStream(); } else { logger.error("Error! HTTP Code = " + lastHttpStatusCode); lastResponseStream = connection.getErrorStream(); } } catch (Exception ex) { throw new HelloSignException(ex); } }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[HttpURLConnection], connection] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastHttpStatusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lastHttpStatusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=200), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=lastHttpStatusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=300), operator=<), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error! HTTP Code = "), operandr=MemberReference(member=lastHttpStatusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastResponseStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getErrorStream, postfix_operators=[], prefix_operators=[], qualifier=connection, 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="OK!")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastResponseStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HelloSignException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] Keyword[throws] identifier[HelloSignException] { identifier[HttpURLConnection] identifier[connection] operator[=] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[lastHttpStatusCode] operator[=] identifier[connection] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastHttpStatusCode] operator[>=] Other[200] operator[&&] identifier[lastHttpStatusCode] operator[<] Other[300] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[lastResponseStream] operator[=] identifier[connection] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[lastHttpStatusCode] operator[SEP] operator[SEP] identifier[lastResponseStream] operator[=] identifier[connection] operator[SEP] identifier[getErrorStream] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[HelloSignException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
@Override protected Integer doBase(String name, Object value) { if (value instanceof Number) { return ((Number) value).intValue(); } else if (value instanceof Date) { return SimpleDateSerializer.timeInMillisToDay(((Date) value).getTime()); } else if (value instanceof String) { try { return Double.valueOf((String) value).intValue(); } catch (NumberFormatException e) { throw new IndexException("Field '{}' with value '{}' can not be parsed as integer", name, value); } } throw new IndexException("Field '{}' requires an integer, but found '{}'", name, value); }
class class_name[name] begin[{] method[doBase, return_type[type[Integer]], modifier[protected], parameter[name, value]] begin[{] if[binary_operation[member[.value], instanceof, type[Number]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))] else begin[{] if[binary_operation[member[.value], instanceof, type[Date]]] begin[{] return[call[SimpleDateSerializer.timeInMillisToDay, parameter[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None))]]] else begin[{] if[binary_operation[member[.value], instanceof, type[String]]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[MethodInvocation(arguments=[], member=intValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Field '{}' with value '{}' can not be parsed as integer"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Field '{}' requires an integer, but found '{}'"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Integer] identifier[doBase] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Number] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Date] operator[SEP] { Keyword[return] identifier[SimpleDateSerializer] operator[SEP] identifier[timeInMillisToDay] operator[SEP] operator[SEP] operator[SEP] identifier[Date] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[String] operator[SEP] { Keyword[try] { Keyword[return] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexException] operator[SEP] literal[String] , identifier[name] , identifier[value] operator[SEP] operator[SEP] } } Keyword[throw] Keyword[new] identifier[IndexException] operator[SEP] literal[String] , identifier[name] , identifier[value] operator[SEP] operator[SEP] }
public Set<Resource<L>> getRootResources() { graphLockRead.lock(); try { Set<Resource<L>> roots = new HashSet<>(); Set<Resource<L>> allResources = resourcesGraph.vertexSet(); for (Resource<L> resource : allResources) { if (neighborIndex.predecessorsOf(resource).isEmpty()) { roots.add(resource); } } return Collections.unmodifiableSet(roots); } finally { graphLockRead.unlock(); } }
class class_name[name] begin[{] method[getRootResources, return_type[type[Set]], modifier[public], parameter[]] begin[{] call[graphLockRead.lock, 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=[], dimensions=None, name=HashSet, sub_type=None)), name=roots)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=L, sub_type=None))], dimensions=[], name=Resource, sub_type=None))], dimensions=[], name=Set, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=vertexSet, postfix_operators=[], prefix_operators=[], qualifier=resourcesGraph, selectors=[], type_arguments=None), name=allResources)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=L, sub_type=None))], dimensions=[], name=Resource, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=predecessorsOf, postfix_operators=[], prefix_operators=[], qualifier=neighborIndex, selectors=[MethodInvocation(arguments=[], member=isEmpty, 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=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=roots, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=allResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resource)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=L, sub_type=None))], dimensions=[], name=Resource, sub_type=None))), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=roots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableSet, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=graphLockRead, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[Resource] operator[<] identifier[L] operator[>] operator[>] identifier[getRootResources] operator[SEP] operator[SEP] { identifier[graphLockRead] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Set] operator[<] identifier[Resource] operator[<] identifier[L] operator[>] operator[>] identifier[roots] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Resource] operator[<] identifier[L] operator[>] operator[>] identifier[allResources] operator[=] identifier[resourcesGraph] operator[SEP] identifier[vertexSet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Resource] operator[<] identifier[L] operator[>] identifier[resource] operator[:] identifier[allResources] operator[SEP] { Keyword[if] operator[SEP] identifier[neighborIndex] operator[SEP] identifier[predecessorsOf] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[roots] operator[SEP] identifier[add] operator[SEP] identifier[resource] operator[SEP] operator[SEP] } } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableSet] operator[SEP] identifier[roots] operator[SEP] operator[SEP] } Keyword[finally] { identifier[graphLockRead] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public byte[] getFrameData(String id) { if (frames.containsKey(id)) { return ((ID3v2Frame) frames.get(id)).getFrameData(); } return null; }
class class_name[name] begin[{] method[getFrameData, return_type[type[byte]], modifier[public], parameter[id]] begin[{] if[call[frames.containsKey, parameter[member[.id]]]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=frames, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ID3v2Frame, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getFrameData] operator[SEP] identifier[String] identifier[id] operator[SEP] { Keyword[if] operator[SEP] identifier[frames] operator[SEP] identifier[containsKey] operator[SEP] identifier[id] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[ID3v2Frame] operator[SEP] identifier[frames] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] identifier[getFrameData] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static <T> Maybe<List<T>> values(String key, Class<T> vClazz) { return values(CacheService.CACHE_CONFIG_BEAN, key, vClazz); }
class class_name[name] begin[{] method[values, return_type[type[Maybe]], modifier[public static], parameter[key, vClazz]] begin[{] return[call[.values, parameter[member[CacheService.CACHE_CONFIG_BEAN], member[.key], member[.vClazz]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Maybe] operator[<] identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[values] operator[SEP] identifier[String] identifier[key] , identifier[Class] operator[<] identifier[T] operator[>] identifier[vClazz] operator[SEP] { Keyword[return] identifier[values] operator[SEP] identifier[CacheService] operator[SEP] identifier[CACHE_CONFIG_BEAN] , identifier[key] , identifier[vClazz] operator[SEP] operator[SEP] }
public final WebPage getRootPage() throws IOException, SQLException { WebPage page = this; WebPage parent; while ((parent = page.getParent()) != null) page = parent; return page; }
class class_name[name] begin[{] method[getRootPage, return_type[type[WebPage]], modifier[final public], parameter[]] begin[{] local_variable[type[WebPage], page] local_variable[type[WebPage], parent] while[binary_operation[assign[member[.parent], call[page.getParent, parameter[]]], !=, literal[null]]] begin[{] assign[member[.page], member[.parent]] end[}] return[member[.page]] end[}] END[}]
Keyword[public] Keyword[final] identifier[WebPage] identifier[getRootPage] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[SQLException] { identifier[WebPage] identifier[page] operator[=] Keyword[this] operator[SEP] identifier[WebPage] identifier[parent] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[parent] operator[=] identifier[page] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[page] operator[=] identifier[parent] operator[SEP] Keyword[return] identifier[page] operator[SEP] }
public static <U> Stream<U> takeWhile(final Stream<U> stream, final Predicate<? super U> predicate) { return StreamSupport.stream(new LimitWhileSpliterator<>(stream.spliterator(), predicate),stream.isParallel()); }
class class_name[name] begin[{] method[takeWhile, return_type[type[Stream]], modifier[public static], parameter[stream, predicate]] begin[{] return[call[StreamSupport.stream, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=spliterator, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), MemberReference(member=predicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LimitWhileSpliterator, sub_type=None)), call[stream.isParallel, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[U] operator[>] identifier[Stream] operator[<] identifier[U] operator[>] identifier[takeWhile] operator[SEP] Keyword[final] identifier[Stream] operator[<] identifier[U] operator[>] identifier[stream] , Keyword[final] identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[U] operator[>] identifier[predicate] operator[SEP] { Keyword[return] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] Keyword[new] identifier[LimitWhileSpliterator] operator[<] operator[>] operator[SEP] identifier[stream] operator[SEP] identifier[spliterator] operator[SEP] operator[SEP] , identifier[predicate] operator[SEP] , identifier[stream] operator[SEP] identifier[isParallel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected int getWaitPeriodInSeconds() throws ActivityException { String unit = super.getAttributeValue(WAIT_UNIT); int factor; if (MINUTES.equals(unit)) factor = 60; else if (HOURS.equals(unit)) factor = 3600; else if (DAYS.equals(unit)) factor = 86400; else factor = 1; // Means specified value is already in seconds int retTime; String timeAttr; try { timeAttr = super.getAttributeValueSmart(WorkAttributeConstant.TIMER_WAIT); } catch (PropertyException e) { throw new ActivityException(-1, "failed to evaluate time expression", e); } retTime = StringHelper.getInteger(timeAttr, DEFAULT_WAIT); return retTime*factor; }
class class_name[name] begin[{] method[getWaitPeriodInSeconds, return_type[type[int]], modifier[protected], parameter[]] begin[{] local_variable[type[String], unit] local_variable[type[int], factor] if[call[MINUTES.equals, parameter[member[.unit]]]] begin[{] assign[member[.factor], literal[60]] else begin[{] if[call[HOURS.equals, parameter[member[.unit]]]] begin[{] assign[member[.factor], literal[3600]] else begin[{] if[call[DAYS.equals, parameter[member[.unit]]]] begin[{] assign[member[.factor], literal[86400]] else begin[{] assign[member[.factor], literal[1]] end[}] end[}] end[}] local_variable[type[int], retTime] local_variable[type[String], timeAttr] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeAttr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=SuperMethodInvocation(arguments=[MemberReference(member=TIMER_WAIT, postfix_operators=[], prefix_operators=[], qualifier=WorkAttributeConstant, selectors=[])], member=getAttributeValueSmart, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to evaluate time expression"), 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=ActivityException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PropertyException']))], finally_block=None, label=None, resources=None) assign[member[.retTime], call[StringHelper.getInteger, parameter[member[.timeAttr], member[.DEFAULT_WAIT]]]] return[binary_operation[member[.retTime], *, member[.factor]]] end[}] END[}]
Keyword[protected] Keyword[int] identifier[getWaitPeriodInSeconds] operator[SEP] operator[SEP] Keyword[throws] identifier[ActivityException] { identifier[String] identifier[unit] operator[=] Keyword[super] operator[SEP] identifier[getAttributeValue] operator[SEP] identifier[WAIT_UNIT] operator[SEP] operator[SEP] Keyword[int] identifier[factor] operator[SEP] Keyword[if] operator[SEP] identifier[MINUTES] operator[SEP] identifier[equals] operator[SEP] identifier[unit] operator[SEP] operator[SEP] identifier[factor] operator[=] Other[60] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[HOURS] operator[SEP] identifier[equals] operator[SEP] identifier[unit] operator[SEP] operator[SEP] identifier[factor] operator[=] Other[3600] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[DAYS] operator[SEP] identifier[equals] operator[SEP] identifier[unit] operator[SEP] operator[SEP] identifier[factor] operator[=] Other[86400] operator[SEP] Keyword[else] identifier[factor] operator[=] Other[1] operator[SEP] Keyword[int] identifier[retTime] operator[SEP] identifier[String] identifier[timeAttr] operator[SEP] Keyword[try] { identifier[timeAttr] operator[=] Keyword[super] operator[SEP] identifier[getAttributeValueSmart] operator[SEP] identifier[WorkAttributeConstant] operator[SEP] identifier[TIMER_WAIT] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PropertyException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ActivityException] operator[SEP] operator[-] Other[1] , literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[retTime] operator[=] identifier[StringHelper] operator[SEP] identifier[getInteger] operator[SEP] identifier[timeAttr] , identifier[DEFAULT_WAIT] operator[SEP] operator[SEP] Keyword[return] identifier[retTime] operator[*] identifier[factor] operator[SEP] }
public void remoteGoto(String filename, String name, float llx, float lly, float urx, float ury) { pdf.remoteGoto(filename, name, llx, lly, urx, ury); }
class class_name[name] begin[{] method[remoteGoto, return_type[void], modifier[public], parameter[filename, name, llx, lly, urx, ury]] begin[{] call[pdf.remoteGoto, parameter[member[.filename], member[.name], member[.llx], member[.lly], member[.urx], member[.ury]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[remoteGoto] operator[SEP] identifier[String] identifier[filename] , identifier[String] identifier[name] , Keyword[float] identifier[llx] , Keyword[float] identifier[lly] , Keyword[float] identifier[urx] , Keyword[float] identifier[ury] operator[SEP] { identifier[pdf] operator[SEP] identifier[remoteGoto] operator[SEP] identifier[filename] , identifier[name] , identifier[llx] , identifier[lly] , identifier[urx] , identifier[ury] operator[SEP] operator[SEP] }
private static void collectPrefixes(FieldInfos fieldInfos, String field, ComponentField fieldInfo, Status status) throws IOException { if (fieldInfo.prefix != null) { FieldInfo fi = fieldInfos.fieldInfo(field); if (fi != null) { String singlePositionPrefixes = fi.getAttribute( MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POSITION); String multiplePositionPrefixes = fi.getAttribute( MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_MULTIPLE_POSITION); String setPositionPrefixes = fi.getAttribute( MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SET_POSITION); String intersectingPrefixes = fi.getAttribute( MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_INTERSECTION); if (singlePositionPrefixes != null) { String[] prefixes = singlePositionPrefixes .split(Pattern.quote(MtasToken.DELIMITER)); for (int i = 0; i < prefixes.length; i++) { fieldInfo.prefix.addSinglePosition(prefixes[i]); } } if (multiplePositionPrefixes != null) { String[] prefixes = multiplePositionPrefixes .split(Pattern.quote(MtasToken.DELIMITER)); for (int i = 0; i < prefixes.length; i++) { fieldInfo.prefix.addMultiplePosition(prefixes[i]); } } if (setPositionPrefixes != null) { String[] prefixes = setPositionPrefixes .split(Pattern.quote(MtasToken.DELIMITER)); for (int i = 0; i < prefixes.length; i++) { fieldInfo.prefix.addSetPosition(prefixes[i]); } } if (intersectingPrefixes != null) { String[] prefixes = intersectingPrefixes .split(Pattern.quote(MtasToken.DELIMITER)); for (int i = 0; i < prefixes.length; i++) { fieldInfo.prefix.addIntersecting(prefixes[i]); } } } } }
class class_name[name] begin[{] method[collectPrefixes, return_type[void], modifier[private static], parameter[fieldInfos, field, fieldInfo, status]] begin[{] if[binary_operation[member[fieldInfo.prefix], !=, literal[null]]] begin[{] local_variable[type[FieldInfo], fi] if[binary_operation[member[.fi], !=, literal[null]]] begin[{] local_variable[type[String], singlePositionPrefixes] local_variable[type[String], multiplePositionPrefixes] local_variable[type[String], setPositionPrefixes] local_variable[type[String], intersectingPrefixes] if[binary_operation[member[.singlePositionPrefixes], !=, literal[null]]] begin[{] local_variable[type[String], prefixes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=addSinglePosition, postfix_operators=[], prefix_operators=[], qualifier=fieldInfo.prefix, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=prefixes, 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) else begin[{] None end[}] if[binary_operation[member[.multiplePositionPrefixes], !=, literal[null]]] begin[{] local_variable[type[String], prefixes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=addMultiplePosition, postfix_operators=[], prefix_operators=[], qualifier=fieldInfo.prefix, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=prefixes, 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) else begin[{] None end[}] if[binary_operation[member[.setPositionPrefixes], !=, literal[null]]] begin[{] local_variable[type[String], prefixes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=addSetPosition, postfix_operators=[], prefix_operators=[], qualifier=fieldInfo.prefix, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=prefixes, 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) else begin[{] None end[}] if[binary_operation[member[.intersectingPrefixes], !=, literal[null]]] begin[{] local_variable[type[String], prefixes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=addIntersecting, postfix_operators=[], prefix_operators=[], qualifier=fieldInfo.prefix, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=prefixes, 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) else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[collectPrefixes] operator[SEP] identifier[FieldInfos] identifier[fieldInfos] , identifier[String] identifier[field] , identifier[ComponentField] identifier[fieldInfo] , identifier[Status] identifier[status] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[fieldInfo] operator[SEP] identifier[prefix] operator[!=] Other[null] operator[SEP] { identifier[FieldInfo] identifier[fi] operator[=] identifier[fieldInfos] operator[SEP] identifier[fieldInfo] operator[SEP] identifier[field] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fi] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[singlePositionPrefixes] operator[=] identifier[fi] operator[SEP] identifier[getAttribute] operator[SEP] identifier[MtasCodecPostingsFormat] operator[SEP] identifier[MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POSITION] operator[SEP] operator[SEP] identifier[String] identifier[multiplePositionPrefixes] operator[=] identifier[fi] operator[SEP] identifier[getAttribute] operator[SEP] identifier[MtasCodecPostingsFormat] operator[SEP] identifier[MTAS_FIELDINFO_ATTRIBUTE_PREFIX_MULTIPLE_POSITION] operator[SEP] operator[SEP] identifier[String] identifier[setPositionPrefixes] operator[=] identifier[fi] operator[SEP] identifier[getAttribute] operator[SEP] identifier[MtasCodecPostingsFormat] operator[SEP] identifier[MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SET_POSITION] operator[SEP] operator[SEP] identifier[String] identifier[intersectingPrefixes] operator[=] identifier[fi] operator[SEP] identifier[getAttribute] operator[SEP] identifier[MtasCodecPostingsFormat] operator[SEP] identifier[MTAS_FIELDINFO_ATTRIBUTE_PREFIX_INTERSECTION] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[singlePositionPrefixes] operator[!=] Other[null] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[prefixes] operator[=] identifier[singlePositionPrefixes] operator[SEP] identifier[split] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[MtasToken] operator[SEP] identifier[DELIMITER] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[prefixes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[fieldInfo] operator[SEP] identifier[prefix] operator[SEP] identifier[addSinglePosition] operator[SEP] identifier[prefixes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[multiplePositionPrefixes] operator[!=] Other[null] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[prefixes] operator[=] identifier[multiplePositionPrefixes] operator[SEP] identifier[split] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[MtasToken] operator[SEP] identifier[DELIMITER] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[prefixes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[fieldInfo] operator[SEP] identifier[prefix] operator[SEP] identifier[addMultiplePosition] operator[SEP] identifier[prefixes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[setPositionPrefixes] operator[!=] Other[null] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[prefixes] operator[=] identifier[setPositionPrefixes] operator[SEP] identifier[split] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[MtasToken] operator[SEP] identifier[DELIMITER] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[prefixes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[fieldInfo] operator[SEP] identifier[prefix] operator[SEP] identifier[addSetPosition] operator[SEP] identifier[prefixes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[intersectingPrefixes] operator[!=] Other[null] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[prefixes] operator[=] identifier[intersectingPrefixes] operator[SEP] identifier[split] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[MtasToken] operator[SEP] identifier[DELIMITER] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[prefixes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[fieldInfo] operator[SEP] identifier[prefix] operator[SEP] identifier[addIntersecting] operator[SEP] identifier[prefixes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } } } }
private void processEmbeddableAttribute(Object entity, MetamodelImpl metamodel, Row row, Table schemaTable, EntityMetadata metadata, Attribute attribute) { // process on embeddables. EmbeddableType embeddable = metamodel.embeddable(((AbstractAttribute) attribute).getBindableJavaType()); Set<Attribute> embeddedAttributes = embeddable.getAttributes(); Object embeddedObject = PropertyAccessorHelper.getObject(entity, (Field) attribute.getJavaMember()); for (Attribute embeddedAttrib : embeddedAttributes) { setField(row, schemaTable, embeddedObject, embeddedAttrib); } }
class class_name[name] begin[{] method[processEmbeddableAttribute, return_type[void], modifier[private], parameter[entity, metamodel, row, schemaTable, metadata, attribute]] begin[{] local_variable[type[EmbeddableType], embeddable] local_variable[type[Set], embeddedAttributes] local_variable[type[Object], embeddedObject] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schemaTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddedObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddedAttrib, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=embeddedAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=embeddedAttrib)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[processEmbeddableAttribute] operator[SEP] identifier[Object] identifier[entity] , identifier[MetamodelImpl] identifier[metamodel] , identifier[Row] identifier[row] , identifier[Table] identifier[schemaTable] , identifier[EntityMetadata] identifier[metadata] , identifier[Attribute] identifier[attribute] operator[SEP] { identifier[EmbeddableType] identifier[embeddable] operator[=] identifier[metamodel] operator[SEP] identifier[embeddable] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Attribute] operator[>] identifier[embeddedAttributes] operator[=] identifier[embeddable] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[embeddedObject] operator[=] identifier[PropertyAccessorHelper] operator[SEP] identifier[getObject] operator[SEP] identifier[entity] , operator[SEP] identifier[Field] operator[SEP] identifier[attribute] operator[SEP] identifier[getJavaMember] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Attribute] identifier[embeddedAttrib] operator[:] identifier[embeddedAttributes] operator[SEP] { identifier[setField] operator[SEP] identifier[row] , identifier[schemaTable] , identifier[embeddedObject] , identifier[embeddedAttrib] operator[SEP] operator[SEP] } }
public static <T> VertxCompletableFuture<T> supplyBlockingAsync(Context context, Supplier<T> supplier) { Objects.requireNonNull(supplier); VertxCompletableFuture<T> future = new VertxCompletableFuture<>(context); context.<T>executeBlocking( fut -> { try { fut.complete(supplier.get()); } catch (Throwable e) { fut.fail(e); } }, false, ar -> { if (ar.failed()) { future.completeExceptionally(ar.cause()); } else { future.complete(ar.result()); } } ); return future; }
class class_name[name] begin[{] method[supplyBlockingAsync, return_type[type[VertxCompletableFuture]], modifier[public static], parameter[context, supplier]] begin[{] call[Objects.requireNonNull, parameter[member[.supplier]]] local_variable[type[VertxCompletableFuture], future] call[.context, parameter[LambdaExpression(body=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=supplier, selectors=[], type_arguments=None)], member=complete, postfix_operators=[], prefix_operators=[], qualifier=fut, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fail, postfix_operators=[], prefix_operators=[], qualifier=fut, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)], parameters=[MemberReference(member=fut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), literal[false], LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[], member=failed, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[], type_arguments=None)], member=complete, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=cause, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[], type_arguments=None)], member=completeExceptionally, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None)]))], parameters=[MemberReference(member=ar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] return[member[.future]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[VertxCompletableFuture] operator[<] identifier[T] operator[>] identifier[supplyBlockingAsync] operator[SEP] identifier[Context] identifier[context] , identifier[Supplier] operator[<] identifier[T] operator[>] identifier[supplier] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[supplier] operator[SEP] operator[SEP] identifier[VertxCompletableFuture] operator[<] identifier[T] operator[>] identifier[future] operator[=] Keyword[new] identifier[VertxCompletableFuture] operator[<] operator[>] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[context] operator[SEP] operator[<] identifier[T] operator[>] identifier[executeBlocking] operator[SEP] identifier[fut] operator[->] { Keyword[try] { identifier[fut] operator[SEP] identifier[complete] operator[SEP] identifier[supplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[fut] operator[SEP] identifier[fail] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } , literal[boolean] , identifier[ar] operator[->] { Keyword[if] operator[SEP] identifier[ar] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { identifier[future] operator[SEP] identifier[completeExceptionally] operator[SEP] identifier[ar] operator[SEP] identifier[cause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[future] operator[SEP] identifier[complete] operator[SEP] identifier[ar] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] identifier[future] operator[SEP] }
public Iterable<Integer> index() { return () -> new Iterator<Integer>() { private final Iterator<Integer> it = data.records.keySet().iterator(); /** {@inheritDoc} */ @Override public boolean hasNext() { return it.hasNext(); } /** {@inheritDoc} */ @Override public Integer next() { return it.next(); } /** {@inheritDoc} */ @Override public void remove() { throw new UnsupportedOperationException("This is a read-only iterator, remove operation is not supported."); } }; }
class class_name[name] begin[{] method[index, return_type[type[Iterable]], modifier[public], parameter[]] begin[{] return[LambdaExpression(body=ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=data.records, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], documentation=None, modifiers={'final', 'private'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)], documentation=/** {@inheritDoc} */, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)], documentation=/** {@inheritDoc} */, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This is a read-only iterator, remove operation is not supported.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=/** {@inheritDoc} */, modifiers={'public'}, name=remove, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=Iterator, sub_type=None)), parameters=[])] end[}] END[}]
Keyword[public] identifier[Iterable] operator[<] identifier[Integer] operator[>] identifier[index] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] operator[->] Keyword[new] identifier[Iterator] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] { Keyword[private] Keyword[final] identifier[Iterator] operator[<] identifier[Integer] operator[>] identifier[it] operator[=] identifier[data] operator[SEP] identifier[records] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Integer] identifier[next] operator[SEP] operator[SEP] { Keyword[return] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } operator[SEP] }
private static String escapeXml(final String text, final XmlEscapeSymbols symbols, final XmlEscapeType type, final XmlEscapeLevel level) { if (type == null) { throw new IllegalArgumentException("The 'type' argument cannot be null"); } if (level == null) { throw new IllegalArgumentException("The 'level' argument cannot be null"); } return XmlEscapeUtil.escape(text, symbols, type, level); }
class class_name[name] begin[{] method[escapeXml, return_type[type[String]], modifier[private static], parameter[text, symbols, type, level]] begin[{] if[binary_operation[member[.type], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The 'type' argument cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.level], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The 'level' argument cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[XmlEscapeUtil.escape, parameter[member[.text], member[.symbols], member[.type], member[.level]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[escapeXml] operator[SEP] Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[XmlEscapeSymbols] identifier[symbols] , Keyword[final] identifier[XmlEscapeType] identifier[type] , Keyword[final] identifier[XmlEscapeLevel] identifier[level] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[level] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[XmlEscapeUtil] operator[SEP] identifier[escape] operator[SEP] identifier[text] , identifier[symbols] , identifier[type] , identifier[level] operator[SEP] operator[SEP] }
public Datum<E> add(E x, int y) { if (response == null) { throw new IllegalArgumentException(DATASET_HAS_NO_RESPONSE); } if (response.getType() != Attribute.Type.NOMINAL) { throw new IllegalArgumentException(RESPONSE_NOT_NOMINAL); } return add(new Datum<>(x, y)); }
class class_name[name] begin[{] method[add, return_type[type[Datum]], modifier[public], parameter[x, y]] begin[{] if[binary_operation[member[.response], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=DATASET_HAS_NO_RESPONSE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[response.getType, parameter[]], !=, member[Attribute.Type.NOMINAL]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=RESPONSE_NOT_NOMINAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.add, parameter[ClassCreator(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Datum, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Datum] operator[<] identifier[E] operator[>] identifier[add] operator[SEP] identifier[E] identifier[x] , Keyword[int] identifier[y] operator[SEP] { Keyword[if] operator[SEP] identifier[response] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[DATASET_HAS_NO_RESPONSE] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[!=] identifier[Attribute] operator[SEP] identifier[Type] operator[SEP] identifier[NOMINAL] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[RESPONSE_NOT_NOMINAL] operator[SEP] operator[SEP] } Keyword[return] identifier[add] operator[SEP] Keyword[new] identifier[Datum] operator[<] operator[>] operator[SEP] identifier[x] , identifier[y] operator[SEP] operator[SEP] operator[SEP] }
public Email bcc(final EmailAddress... bccs) { this.bcc = ArraysUtil.join(this.bcc, valueOrEmptyArray(bccs)); return _this(); }
class class_name[name] begin[{] method[bcc, return_type[type[Email]], modifier[public], parameter[bccs]] begin[{] assign[THIS[member[None.bcc]], call[ArraysUtil.join, parameter[THIS[member[None.bcc]], call[.valueOrEmptyArray, parameter[member[.bccs]]]]]] return[call[._this, parameter[]]] end[}] END[}]
Keyword[public] identifier[Email] identifier[bcc] operator[SEP] Keyword[final] identifier[EmailAddress] operator[...] identifier[bccs] operator[SEP] { Keyword[this] operator[SEP] identifier[bcc] operator[=] identifier[ArraysUtil] operator[SEP] identifier[join] operator[SEP] Keyword[this] operator[SEP] identifier[bcc] , identifier[valueOrEmptyArray] operator[SEP] identifier[bccs] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[_this] operator[SEP] operator[SEP] operator[SEP] }
static double computeEuclidean(IntTuple t0, IntTuple t1) { return Math.sqrt(computeEuclideanSquared(t0, t1)); }
class class_name[name] begin[{] method[computeEuclidean, return_type[type[double]], modifier[static], parameter[t0, t1]] begin[{] return[call[Math.sqrt, parameter[call[.computeEuclideanSquared, parameter[member[.t0], member[.t1]]]]]] end[}] END[}]
Keyword[static] Keyword[double] identifier[computeEuclidean] operator[SEP] identifier[IntTuple] identifier[t0] , identifier[IntTuple] identifier[t1] operator[SEP] { Keyword[return] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[computeEuclideanSquared] operator[SEP] identifier[t0] , identifier[t1] operator[SEP] operator[SEP] operator[SEP] }
public static void foreachRandomInt(int streamSize, Random random, int exclusiveBound, IntConsumer eachRandomIntConsumer) { foreachRandomInt(streamSize, () -> random.nextInt(exclusiveBound), eachRandomIntConsumer); }
class class_name[name] begin[{] method[foreachRandomInt, return_type[void], modifier[public static], parameter[streamSize, random, exclusiveBound, eachRandomIntConsumer]] begin[{] call[.foreachRandomInt, parameter[member[.streamSize], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=exclusiveBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=random, selectors=[], type_arguments=None), parameters=[]), member[.eachRandomIntConsumer]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[foreachRandomInt] operator[SEP] Keyword[int] identifier[streamSize] , identifier[Random] identifier[random] , Keyword[int] identifier[exclusiveBound] , identifier[IntConsumer] identifier[eachRandomIntConsumer] operator[SEP] { identifier[foreachRandomInt] operator[SEP] identifier[streamSize] , operator[SEP] operator[SEP] operator[->] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] identifier[exclusiveBound] operator[SEP] , identifier[eachRandomIntConsumer] operator[SEP] operator[SEP] }
public HttpResponse head(String path) throws APIException { final HttpHead request = new HttpHead(getUrl(path)); return executeHead(request); }
class class_name[name] begin[{] method[head, return_type[type[HttpResponse]], modifier[public], parameter[path]] begin[{] local_variable[type[HttpHead], request] return[call[.executeHead, parameter[member[.request]]]] end[}] END[}]
Keyword[public] identifier[HttpResponse] identifier[head] operator[SEP] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[APIException] { Keyword[final] identifier[HttpHead] identifier[request] operator[=] Keyword[new] identifier[HttpHead] operator[SEP] identifier[getUrl] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[executeHead] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public IPAddressSeqRange join(IPAddressSeqRange other) { IPAddress otherLower = other.getLower(); IPAddress otherUpper = other.getUpper(); IPAddress lower = this.getLower(); IPAddress upper = this.getUpper(); int lowerComp = compareLowValues(lower, otherLower); if(!overlaps(other)) { if(lowerComp >= 0) { if(otherUpper.increment(1).equals(lower)) { return create(otherLower, upper); } } else { if(upper.increment(1).equals(otherLower)) { return create(lower, otherUpper); } } return null; } int upperComp = compareLowValues(upper, otherUpper); IPAddress lowestLower, highestUpper; if(lowerComp >= 0) { if(lowerComp == 0 && upperComp == 0) { return this; } lowestLower = otherLower; } else { lowestLower = lower; } highestUpper = upperComp >= 0 ? upper : otherUpper; return create(lowestLower, highestUpper); }
class class_name[name] begin[{] method[join, return_type[type[IPAddressSeqRange]], modifier[public], parameter[other]] begin[{] local_variable[type[IPAddress], otherLower] local_variable[type[IPAddress], otherUpper] local_variable[type[IPAddress], lower] local_variable[type[IPAddress], upper] local_variable[type[int], lowerComp] if[call[.overlaps, parameter[member[.other]]]] begin[{] if[binary_operation[member[.lowerComp], >=, literal[0]]] begin[{] if[call[otherUpper.increment, parameter[literal[1]]]] begin[{] return[call[.create, parameter[member[.otherLower], member[.upper]]]] else begin[{] None end[}] else begin[{] if[call[upper.increment, parameter[literal[1]]]] begin[{] return[call[.create, parameter[member[.lower], member[.otherUpper]]]] else begin[{] None end[}] end[}] return[literal[null]] else begin[{] None end[}] local_variable[type[int], upperComp] local_variable[type[IPAddress], lowestLower] if[binary_operation[member[.lowerComp], >=, literal[0]]] begin[{] if[binary_operation[binary_operation[member[.lowerComp], ==, literal[0]], &&, binary_operation[member[.upperComp], ==, literal[0]]]] begin[{] return[THIS[]] else begin[{] None end[}] assign[member[.lowestLower], member[.otherLower]] else begin[{] assign[member[.lowestLower], member[.lower]] end[}] assign[member[.highestUpper], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=upperComp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), if_false=MemberReference(member=otherUpper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=upper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] return[call[.create, parameter[member[.lowestLower], member[.highestUpper]]]] end[}] END[}]
Keyword[public] identifier[IPAddressSeqRange] identifier[join] operator[SEP] identifier[IPAddressSeqRange] identifier[other] operator[SEP] { identifier[IPAddress] identifier[otherLower] operator[=] identifier[other] operator[SEP] identifier[getLower] operator[SEP] operator[SEP] operator[SEP] identifier[IPAddress] identifier[otherUpper] operator[=] identifier[other] operator[SEP] identifier[getUpper] operator[SEP] operator[SEP] operator[SEP] identifier[IPAddress] identifier[lower] operator[=] Keyword[this] operator[SEP] identifier[getLower] operator[SEP] operator[SEP] operator[SEP] identifier[IPAddress] identifier[upper] operator[=] Keyword[this] operator[SEP] identifier[getUpper] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lowerComp] operator[=] identifier[compareLowValues] operator[SEP] identifier[lower] , identifier[otherLower] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[overlaps] operator[SEP] identifier[other] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[lowerComp] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[otherUpper] operator[SEP] identifier[increment] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[lower] operator[SEP] operator[SEP] { Keyword[return] identifier[create] operator[SEP] identifier[otherLower] , identifier[upper] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[upper] operator[SEP] identifier[increment] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[otherLower] operator[SEP] operator[SEP] { Keyword[return] identifier[create] operator[SEP] identifier[lower] , identifier[otherUpper] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[upperComp] operator[=] identifier[compareLowValues] operator[SEP] identifier[upper] , identifier[otherUpper] operator[SEP] operator[SEP] identifier[IPAddress] identifier[lowestLower] , identifier[highestUpper] operator[SEP] Keyword[if] operator[SEP] identifier[lowerComp] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[lowerComp] operator[==] Other[0] operator[&&] identifier[upperComp] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } identifier[lowestLower] operator[=] identifier[otherLower] operator[SEP] } Keyword[else] { identifier[lowestLower] operator[=] identifier[lower] operator[SEP] } identifier[highestUpper] operator[=] identifier[upperComp] operator[>=] Other[0] operator[?] identifier[upper] operator[:] identifier[otherUpper] operator[SEP] Keyword[return] identifier[create] operator[SEP] identifier[lowestLower] , identifier[highestUpper] operator[SEP] operator[SEP] }
public Matrix4f setPerspectiveLH(float fovy, float aspect, float zNear, float zFar) { return setPerspectiveLH(fovy, aspect, zNear, zFar, false); }
class class_name[name] begin[{] method[setPerspectiveLH, return_type[type[Matrix4f]], modifier[public], parameter[fovy, aspect, zNear, zFar]] begin[{] return[call[.setPerspectiveLH, parameter[member[.fovy], member[.aspect], member[.zNear], member[.zFar], literal[false]]]] end[}] END[}]
Keyword[public] identifier[Matrix4f] identifier[setPerspectiveLH] operator[SEP] Keyword[float] identifier[fovy] , Keyword[float] identifier[aspect] , Keyword[float] identifier[zNear] , Keyword[float] identifier[zFar] operator[SEP] { Keyword[return] identifier[setPerspectiveLH] operator[SEP] identifier[fovy] , identifier[aspect] , identifier[zNear] , identifier[zFar] , literal[boolean] operator[SEP] operator[SEP] }
public static Intent createAuthorizationIntent(Context context, String authorizationUrl, boolean forceThirdPartyApp) { Intent intent; if (!forceThirdPartyApp && EvernoteInstallStatus.INSTALLED.equals(getEvernoteInstallStatus(context, ACTION_AUTHORIZE))) { intent = new Intent(ACTION_AUTHORIZE); intent.setPackage(PACKAGE_NAME); } else { intent = new Intent(context, EvernoteOAuthActivity.class); } intent.putExtra(EXTRA_AUTHORIZATION_URL, authorizationUrl); return intent; }
class class_name[name] begin[{] method[createAuthorizationIntent, return_type[type[Intent]], modifier[public static], parameter[context, authorizationUrl, forceThirdPartyApp]] begin[{] local_variable[type[Intent], intent] if[binary_operation[member[.forceThirdPartyApp], &&, call[EvernoteInstallStatus.INSTALLED.equals, parameter[call[.getEvernoteInstallStatus, parameter[member[.context], member[.ACTION_AUTHORIZE]]]]]]] begin[{] assign[member[.intent], ClassCreator(arguments=[MemberReference(member=ACTION_AUTHORIZE, 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=Intent, sub_type=None))] call[intent.setPackage, parameter[member[.PACKAGE_NAME]]] else begin[{] assign[member[.intent], ClassCreator(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EvernoteOAuthActivity, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Intent, sub_type=None))] end[}] call[intent.putExtra, parameter[member[.EXTRA_AUTHORIZATION_URL], member[.authorizationUrl]]] return[member[.intent]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Intent] identifier[createAuthorizationIntent] operator[SEP] identifier[Context] identifier[context] , identifier[String] identifier[authorizationUrl] , Keyword[boolean] identifier[forceThirdPartyApp] operator[SEP] { identifier[Intent] identifier[intent] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[forceThirdPartyApp] operator[&&] identifier[EvernoteInstallStatus] operator[SEP] identifier[INSTALLED] operator[SEP] identifier[equals] operator[SEP] identifier[getEvernoteInstallStatus] operator[SEP] identifier[context] , identifier[ACTION_AUTHORIZE] operator[SEP] operator[SEP] operator[SEP] { identifier[intent] operator[=] Keyword[new] identifier[Intent] operator[SEP] identifier[ACTION_AUTHORIZE] operator[SEP] operator[SEP] identifier[intent] operator[SEP] identifier[setPackage] operator[SEP] identifier[PACKAGE_NAME] operator[SEP] operator[SEP] } Keyword[else] { identifier[intent] operator[=] Keyword[new] identifier[Intent] operator[SEP] identifier[context] , identifier[EvernoteOAuthActivity] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } identifier[intent] operator[SEP] identifier[putExtra] operator[SEP] identifier[EXTRA_AUTHORIZATION_URL] , identifier[authorizationUrl] operator[SEP] operator[SEP] Keyword[return] identifier[intent] operator[SEP] }
private void validateRecordedMapping() { if (currentMapping.destinationMutators == null || currentMapping.destinationMutators.isEmpty()) errors.missingDestination(); // If mapping a field without a source else if (options.skipType == 0 && (currentMapping.sourceAccessors == null || currentMapping.sourceAccessors.isEmpty()) && currentMapping.destinationMutators.get(currentMapping.destinationMutators.size() - 1) .getPropertyType() .equals(PropertyType.FIELD) && options.converter == null && !options.mapFromSource && sourceConstant == null) errors.missingSource(); else if (options.skipType == 2 && options.condition != null) errors.conditionalSkipWithoutSource(); }
class class_name[name] begin[{] method[validateRecordedMapping, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[binary_operation[member[currentMapping.destinationMutators], ==, literal[null]], ||, call[currentMapping.destinationMutators.isEmpty, parameter[]]]] begin[{] call[errors.missingDestination, parameter[]] else begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[options.skipType], ==, literal[0]], &&, binary_operation[binary_operation[member[currentMapping.sourceAccessors], ==, literal[null]], ||, call[currentMapping.sourceAccessors.isEmpty, parameter[]]]], &&, call[currentMapping.destinationMutators.get, parameter[binary_operation[call[currentMapping.destinationMutators.size, parameter[]], -, literal[1]]]]], &&, binary_operation[member[options.converter], ==, literal[null]]], &&, member[options.mapFromSource]], &&, binary_operation[member[.sourceConstant], ==, literal[null]]]] begin[{] call[errors.missingSource, parameter[]] else begin[{] if[binary_operation[binary_operation[member[options.skipType], ==, literal[2]], &&, binary_operation[member[options.condition], !=, literal[null]]]] begin[{] call[errors.conditionalSkipWithoutSource, parameter[]] else begin[{] None end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[validateRecordedMapping] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[currentMapping] operator[SEP] identifier[destinationMutators] operator[==] Other[null] operator[||] identifier[currentMapping] operator[SEP] identifier[destinationMutators] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[errors] operator[SEP] identifier[missingDestination] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[skipType] operator[==] Other[0] operator[&&] operator[SEP] identifier[currentMapping] operator[SEP] identifier[sourceAccessors] operator[==] Other[null] operator[||] identifier[currentMapping] operator[SEP] identifier[sourceAccessors] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[currentMapping] operator[SEP] identifier[destinationMutators] operator[SEP] identifier[get] operator[SEP] identifier[currentMapping] operator[SEP] identifier[destinationMutators] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[PropertyType] operator[SEP] identifier[FIELD] operator[SEP] operator[&&] identifier[options] operator[SEP] identifier[converter] operator[==] Other[null] operator[&&] operator[!] identifier[options] operator[SEP] identifier[mapFromSource] operator[&&] identifier[sourceConstant] operator[==] Other[null] operator[SEP] identifier[errors] operator[SEP] identifier[missingSource] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[skipType] operator[==] Other[2] operator[&&] identifier[options] operator[SEP] identifier[condition] operator[!=] Other[null] operator[SEP] identifier[errors] operator[SEP] identifier[conditionalSkipWithoutSource] operator[SEP] operator[SEP] operator[SEP] }
public boolean isEdge(final ODocument iRecord) { return iRecord != null ? iRecord.getSchemaClass().isSubClassOf(edgeBaseClass) : false; }
class class_name[name] begin[{] method[isEdge, return_type[type[boolean]], modifier[public], parameter[iRecord]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=iRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), if_true=MethodInvocation(arguments=[], member=getSchemaClass, postfix_operators=[], prefix_operators=[], qualifier=iRecord, selectors=[MethodInvocation(arguments=[MemberReference(member=edgeBaseClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSubClassOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isEdge] operator[SEP] Keyword[final] identifier[ODocument] identifier[iRecord] operator[SEP] { Keyword[return] identifier[iRecord] operator[!=] Other[null] operator[?] identifier[iRecord] operator[SEP] identifier[getSchemaClass] operator[SEP] operator[SEP] operator[SEP] identifier[isSubClassOf] operator[SEP] identifier[edgeBaseClass] operator[SEP] operator[:] literal[boolean] operator[SEP] }
public void setPosition(CmsPositionBean position, CmsPositionBean buttonsPosition, Element containerElement) { m_position = position; Element parent = CmsDomUtil.getPositioningParent(getElement()); Style style = getElement().getStyle(); style.setRight( parent.getOffsetWidth() - ((buttonsPosition.getLeft() + buttonsPosition.getWidth()) - parent.getAbsoluteLeft()), Unit.PX); int top = buttonsPosition.getTop() - parent.getAbsoluteTop(); if (top < 0) { top = 0; } style.setTop(top, Unit.PX); }
class class_name[name] begin[{] method[setPosition, return_type[void], modifier[public], parameter[position, buttonsPosition, containerElement]] begin[{] assign[member[.m_position], member[.position]] local_variable[type[Element], parent] local_variable[type[Style], style] call[style.setRight, parameter[binary_operation[call[parent.getOffsetWidth, parameter[]], -, binary_operation[binary_operation[call[buttonsPosition.getLeft, parameter[]], +, call[buttonsPosition.getWidth, parameter[]]], -, call[parent.getAbsoluteLeft, parameter[]]]], member[Unit.PX]]] local_variable[type[int], top] if[binary_operation[member[.top], <, literal[0]]] begin[{] assign[member[.top], literal[0]] else begin[{] None end[}] call[style.setTop, parameter[member[.top], member[Unit.PX]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPosition] operator[SEP] identifier[CmsPositionBean] identifier[position] , identifier[CmsPositionBean] identifier[buttonsPosition] , identifier[Element] identifier[containerElement] operator[SEP] { identifier[m_position] operator[=] identifier[position] operator[SEP] identifier[Element] identifier[parent] operator[=] identifier[CmsDomUtil] operator[SEP] identifier[getPositioningParent] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Style] identifier[style] operator[=] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[style] operator[SEP] identifier[setRight] operator[SEP] identifier[parent] operator[SEP] identifier[getOffsetWidth] operator[SEP] operator[SEP] operator[-] operator[SEP] operator[SEP] identifier[buttonsPosition] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[+] identifier[buttonsPosition] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[-] identifier[parent] operator[SEP] identifier[getAbsoluteLeft] operator[SEP] operator[SEP] operator[SEP] , identifier[Unit] operator[SEP] identifier[PX] operator[SEP] operator[SEP] Keyword[int] identifier[top] operator[=] identifier[buttonsPosition] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] operator[-] identifier[parent] operator[SEP] identifier[getAbsoluteTop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[top] operator[<] Other[0] operator[SEP] { identifier[top] operator[=] Other[0] operator[SEP] } identifier[style] operator[SEP] identifier[setTop] operator[SEP] identifier[top] , identifier[Unit] operator[SEP] identifier[PX] operator[SEP] operator[SEP] }
public String readString(final String charset) throws IOException { byte ch; int cnt = 0; final byte [] byteArrBuff = new byte[byteBuffer.remaining()]; while (byteBuffer.remaining() > 0 && ((ch = byteBuffer.get()) != 0)) { byteArrBuff[cnt++] = ch; } return new String(byteArrBuff,0,cnt); }
class class_name[name] begin[{] method[readString, return_type[type[String]], modifier[public], parameter[charset]] begin[{] local_variable[type[byte], ch] local_variable[type[int], cnt] local_variable[type[byte], byteArrBuff] while[binary_operation[binary_operation[call[byteBuffer.remaining, parameter[]], >, literal[0]], &&, binary_operation[assign[member[.ch], call[byteBuffer.get, parameter[]]], !=, literal[0]]]] begin[{] assign[member[.byteArrBuff], member[.ch]] end[}] return[ClassCreator(arguments=[MemberReference(member=byteArrBuff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=cnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
Keyword[public] identifier[String] identifier[readString] operator[SEP] Keyword[final] identifier[String] identifier[charset] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[byte] identifier[ch] operator[SEP] Keyword[int] identifier[cnt] operator[=] Other[0] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[byteArrBuff] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[byteBuffer] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[byteBuffer] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[SEP] operator[SEP] identifier[ch] operator[=] identifier[byteBuffer] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] { identifier[byteArrBuff] operator[SEP] identifier[cnt] operator[++] operator[SEP] operator[=] identifier[ch] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[byteArrBuff] , Other[0] , identifier[cnt] operator[SEP] operator[SEP] }
private acolyte.jdbc.Blob createBlob(InputStream stream, long length) throws SQLException { final acolyte.jdbc.Blob blob = acolyte.jdbc.Blob.Nil(); blob.setBytes(0L, createBytes(stream, length)); return blob; }
class class_name[name] begin[{] method[createBlob, return_type[type[acolyte]], modifier[private], parameter[stream, length]] begin[{] local_variable[type[acolyte], blob] call[blob.setBytes, parameter[literal[0L], call[.createBytes, parameter[member[.stream], member[.length]]]]] return[member[.blob]] end[}] END[}]
Keyword[private] identifier[acolyte] operator[SEP] identifier[jdbc] operator[SEP] identifier[Blob] identifier[createBlob] operator[SEP] identifier[InputStream] identifier[stream] , Keyword[long] identifier[length] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[final] identifier[acolyte] operator[SEP] identifier[jdbc] operator[SEP] identifier[Blob] identifier[blob] operator[=] identifier[acolyte] operator[SEP] identifier[jdbc] operator[SEP] identifier[Blob] operator[SEP] identifier[Nil] operator[SEP] operator[SEP] operator[SEP] identifier[blob] operator[SEP] identifier[setBytes] operator[SEP] Other[0L] , identifier[createBytes] operator[SEP] identifier[stream] , identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[blob] operator[SEP] }
private List<Row> run(View from, Predicate<Row> predicate) { return StreamSupport.stream(from.rows().spliterator(), false) .filter(predicate) .collect(Collectors.toList()); }
class class_name[name] begin[{] method[run, return_type[type[List]], modifier[private], parameter[from, predicate]] begin[{] return[call[StreamSupport.stream, parameter[call[from.rows, parameter[]], literal[false]]]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[Row] operator[>] identifier[run] operator[SEP] identifier[View] identifier[from] , identifier[Predicate] operator[<] identifier[Row] operator[>] identifier[predicate] operator[SEP] { Keyword[return] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[from] operator[SEP] identifier[rows] operator[SEP] operator[SEP] operator[SEP] identifier[spliterator] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }