code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void writeFile(String resourceName, String exportpoint, byte[] content) { writeResource(resourceName, exportpoint, content); }
class class_name[name] begin[{] method[writeFile, return_type[void], modifier[public], parameter[resourceName, exportpoint, content]] begin[{] call[.writeResource, parameter[member[.resourceName], member[.exportpoint], member[.content]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[writeFile] operator[SEP] identifier[String] identifier[resourceName] , identifier[String] identifier[exportpoint] , Keyword[byte] operator[SEP] operator[SEP] identifier[content] operator[SEP] { identifier[writeResource] operator[SEP] identifier[resourceName] , identifier[exportpoint] , identifier[content] operator[SEP] operator[SEP] }
private boolean isApplicable(Type.Callable candidate, LifetimeRelation lifetimes, Tuple<? extends SemanticType> args) { Tuple<Type> parameters = candidate.getParameters(); if (parameters.size() != args.size()) { // Differing number of parameters / arguments. Since we don't // support variable-length argument lists (yet), there is nothing // more to consider. return false; } else { // Number of parameters matches number of arguments. Now, check that // each argument is a subtype of its corresponding parameter. for (int i = 0; i != args.size(); ++i) { SemanticType param = parameters.get(i); if (!subtypeOperator.isSubtype(param, args.get(i), lifetimes)) { return false; } } // return true; } }
class class_name[name] begin[{] method[isApplicable, return_type[type[boolean]], modifier[private], parameter[candidate, lifetimes, args]] begin[{] local_variable[type[Tuple], parameters] if[binary_operation[call[parameters.size, parameter[]], !=, call[args.size, parameter[]]]] begin[{] return[literal[false]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None), name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SemanticType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[], type_arguments=None), MemberReference(member=lifetimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSubtype, postfix_operators=[], prefix_operators=['!'], qualifier=subtypeOperator, 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=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[], type_arguments=None), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isApplicable] operator[SEP] identifier[Type] operator[SEP] identifier[Callable] identifier[candidate] , identifier[LifetimeRelation] identifier[lifetimes] , identifier[Tuple] operator[<] operator[?] Keyword[extends] identifier[SemanticType] operator[>] identifier[args] operator[SEP] { identifier[Tuple] operator[<] identifier[Type] operator[>] identifier[parameters] operator[=] identifier[candidate] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[args] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[!=] identifier[args] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[SemanticType] identifier[param] operator[=] identifier[parameters] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[subtypeOperator] operator[SEP] identifier[isSubtype] operator[SEP] identifier[param] , identifier[args] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[lifetimes] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] } }
protected Content codeTagOutput(Tag tag) { Content result = HtmlTree.CODE(new StringContent(utils.normalizeNewlines(tag.text()))); return result; }
class class_name[name] begin[{] method[codeTagOutput, return_type[type[Content]], modifier[protected], parameter[tag]] begin[{] local_variable[type[Content], result] return[member[.result]] end[}] END[}]
Keyword[protected] identifier[Content] identifier[codeTagOutput] operator[SEP] identifier[Tag] identifier[tag] operator[SEP] { identifier[Content] identifier[result] operator[=] identifier[HtmlTree] operator[SEP] identifier[CODE] operator[SEP] Keyword[new] identifier[StringContent] operator[SEP] identifier[utils] operator[SEP] identifier[normalizeNewlines] operator[SEP] identifier[tag] operator[SEP] identifier[text] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static base_response restart(nitro_service client) throws Exception { dbsmonitors restartresource = new dbsmonitors(); return restartresource.perform_operation(client,"restart"); }
class class_name[name] begin[{] method[restart, return_type[type[base_response]], modifier[public static], parameter[client]] begin[{] local_variable[type[dbsmonitors], restartresource] return[call[restartresource.perform_operation, parameter[member[.client], literal["restart"]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[base_response] identifier[restart] operator[SEP] identifier[nitro_service] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] { identifier[dbsmonitors] identifier[restartresource] operator[=] Keyword[new] identifier[dbsmonitors] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[restartresource] operator[SEP] identifier[perform_operation] operator[SEP] identifier[client] , literal[String] operator[SEP] operator[SEP] }
public void multiPartUpload(File file, String bucketName) { AmazonS3 client = new AmazonS3Client(creds); bucketName = ensureValidBucketName(bucketName); List<Bucket> buckets = client.listBuckets(); for (Bucket b : buckets) if (b.getName().equals(bucketName)) { doMultiPart(client, bucketName, file); return; } //bucket didn't exist: create it client.createBucket(bucketName); doMultiPart(client, bucketName, file); }
class class_name[name] begin[{] method[multiPartUpload, return_type[void], modifier[public], parameter[file, bucketName]] begin[{] local_variable[type[AmazonS3], client] assign[member[.bucketName], call[.ensureValidBucketName, parameter[member[.bucketName]]]] local_variable[type[List], buckets] ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[MethodInvocation(arguments=[MemberReference(member=bucketName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucketName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doMultiPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), control=EnhancedForControl(iterable=MemberReference(member=buckets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Bucket, sub_type=None))), label=None) call[client.createBucket, parameter[member[.bucketName]]] call[.doMultiPart, parameter[member[.client], member[.bucketName], member[.file]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[multiPartUpload] operator[SEP] identifier[File] identifier[file] , identifier[String] identifier[bucketName] operator[SEP] { identifier[AmazonS3] identifier[client] operator[=] Keyword[new] identifier[AmazonS3Client] operator[SEP] identifier[creds] operator[SEP] operator[SEP] identifier[bucketName] operator[=] identifier[ensureValidBucketName] operator[SEP] identifier[bucketName] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Bucket] operator[>] identifier[buckets] operator[=] identifier[client] operator[SEP] identifier[listBuckets] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Bucket] identifier[b] operator[:] identifier[buckets] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[bucketName] operator[SEP] operator[SEP] { identifier[doMultiPart] operator[SEP] identifier[client] , identifier[bucketName] , identifier[file] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[client] operator[SEP] identifier[createBucket] operator[SEP] identifier[bucketName] operator[SEP] operator[SEP] identifier[doMultiPart] operator[SEP] identifier[client] , identifier[bucketName] , identifier[file] operator[SEP] operator[SEP] }
@Override public <T extends SolrDataQuery> T setHighlightOptions(HighlightOptions highlightOptions) { return query.setHighlightOptions(highlightOptions); }
class class_name[name] begin[{] method[setHighlightOptions, return_type[type[T]], modifier[public], parameter[highlightOptions]] begin[{] return[call[query.setHighlightOptions, parameter[member[.highlightOptions]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[SolrDataQuery] operator[>] identifier[T] identifier[setHighlightOptions] operator[SEP] identifier[HighlightOptions] identifier[highlightOptions] operator[SEP] { Keyword[return] identifier[query] operator[SEP] identifier[setHighlightOptions] operator[SEP] identifier[highlightOptions] operator[SEP] operator[SEP] }
public Response createSystemProperty(SystemProperty property) { return restClient.post("system/properties", property, new HashMap<String, String>()); }
class class_name[name] begin[{] method[createSystemProperty, return_type[type[Response]], modifier[public], parameter[property]] begin[{] return[call[restClient.post, parameter[literal["system/properties"], member[.property], 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Response] identifier[createSystemProperty] operator[SEP] identifier[SystemProperty] identifier[property] operator[SEP] { Keyword[return] identifier[restClient] operator[SEP] identifier[post] operator[SEP] literal[String] , identifier[property] , Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void contextPath(String context) { if (S.blank(context)) ctx = ""; else { E.illegalArgumentIf(!context.startsWith("/"), "context path should start with \"/\""); if (context.endsWith("/")) { ctx = S.str(context).beforeLast("/").toString(); } } }
class class_name[name] begin[{] method[contextPath, return_type[void], modifier[public static], parameter[context]] begin[{] if[call[S.blank, parameter[member[.context]]]] begin[{] assign[member[.ctx], literal[""]] else begin[{] call[E.illegalArgumentIf, parameter[call[context.startsWith, parameter[literal["/"]]], literal["context path should start with \"/\""]]] if[call[context.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.ctx], call[S.str, parameter[member[.context]]]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[contextPath] operator[SEP] identifier[String] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[S] operator[SEP] identifier[blank] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[ctx] operator[=] literal[String] operator[SEP] Keyword[else] { identifier[E] operator[SEP] identifier[illegalArgumentIf] operator[SEP] operator[!] identifier[context] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[ctx] operator[=] identifier[S] operator[SEP] identifier[str] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[beforeLast] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } } }
public void clear() { if (!validState) { throw new InvalidStateException(); } try { fileChannel.position(0).truncate(0); sync(); } catch (Exception e) { log.error("Exception in clear()", e); } }
class class_name[name] begin[{] method[clear, return_type[void], modifier[public], parameter[]] begin[{] if[member[.validState]] 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=InvalidStateException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=position, postfix_operators=[], prefix_operators=[], qualifier=fileChannel, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=truncate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=sync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception in clear()"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[clear] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[validState] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidStateException] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[fileChannel] operator[SEP] identifier[position] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[truncate] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public boolean writeDefinition(OutputStream out) throws IOException { for(int i = 0; i < chunks.size(); i++) { RtfBasicElement rtfElement = (RtfBasicElement)chunks.get(i); if(rtfElement instanceof RtfList) { RtfList rl = (RtfList)rtfElement; rl.writeDefinition(out); return true; } } return false; }
class class_name[name] begin[{] method[writeDefinition, return_type[type[boolean]], modifier[public], parameter[out]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=chunks, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=RtfBasicElement, sub_type=None)), name=rtfElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RtfBasicElement, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rtfElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RtfList, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=rtfElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RtfList, sub_type=None)), name=rl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RtfList, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeDefinition, postfix_operators=[], prefix_operators=[], qualifier=rl, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=chunks, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[writeDefinition] operator[SEP] identifier[OutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[chunks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[RtfBasicElement] identifier[rtfElement] operator[=] operator[SEP] identifier[RtfBasicElement] operator[SEP] identifier[chunks] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rtfElement] Keyword[instanceof] identifier[RtfList] operator[SEP] { identifier[RtfList] identifier[rl] operator[=] operator[SEP] identifier[RtfList] operator[SEP] identifier[rtfElement] operator[SEP] identifier[rl] operator[SEP] identifier[writeDefinition] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public void unsetResourceAdaptorContext() { this.raContext = null; this.tracer = null; this.sleeEndpoint = null; this.eventLookupFacility = null; this.sbbInterface = null; }
class class_name[name] begin[{] method[unsetResourceAdaptorContext, return_type[void], modifier[public], parameter[]] begin[{] assign[THIS[member[None.raContext]], literal[null]] assign[THIS[member[None.tracer]], literal[null]] assign[THIS[member[None.sleeEndpoint]], literal[null]] assign[THIS[member[None.eventLookupFacility]], literal[null]] assign[THIS[member[None.sbbInterface]], literal[null]] end[}] END[}]
Keyword[public] Keyword[void] identifier[unsetResourceAdaptorContext] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[raContext] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[tracer] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[sleeEndpoint] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[eventLookupFacility] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[sbbInterface] operator[=] Other[null] operator[SEP] }
public static Hasher with(Version version, SecureRandom secureRandom, LongPasswordStrategy longPasswordStrategy) { return new Hasher(version, secureRandom, longPasswordStrategy); }
class class_name[name] begin[{] method[with, return_type[type[Hasher]], modifier[public static], parameter[version, secureRandom, longPasswordStrategy]] begin[{] return[ClassCreator(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=secureRandom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=longPasswordStrategy, 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=Hasher, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Hasher] identifier[with] operator[SEP] identifier[Version] identifier[version] , identifier[SecureRandom] identifier[secureRandom] , identifier[LongPasswordStrategy] identifier[longPasswordStrategy] operator[SEP] { Keyword[return] Keyword[new] identifier[Hasher] operator[SEP] identifier[version] , identifier[secureRandom] , identifier[longPasswordStrategy] operator[SEP] operator[SEP] }
@Override public PutConfigRuleResult putConfigRule(PutConfigRuleRequest request) { request = beforeClientExecution(request); return executePutConfigRule(request); }
class class_name[name] begin[{] method[putConfigRule, return_type[type[PutConfigRuleResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executePutConfigRule, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[PutConfigRuleResult] identifier[putConfigRule] operator[SEP] identifier[PutConfigRuleRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executePutConfigRule] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
protected void firePropertyChanged(PropertyEvent event) { // fire all bound listeners (if any) first if (boundListeners != null) { List list = (List) boundListeners.get(event.getPropertyName()); if (list != null) { firePropertyChanged(list, event); } } // next fire all unbound listeners firePropertyChanged(unboundListeners, event); }
class class_name[name] begin[{] method[firePropertyChanged, return_type[void], modifier[protected], parameter[event]] begin[{] if[binary_operation[member[.boundListeners], !=, literal[null]]] begin[{] local_variable[type[List], list] if[binary_operation[member[.list], !=, literal[null]]] begin[{] call[.firePropertyChanged, parameter[member[.list], member[.event]]] else begin[{] None end[}] else begin[{] None end[}] call[.firePropertyChanged, parameter[member[.unboundListeners], member[.event]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[firePropertyChanged] operator[SEP] identifier[PropertyEvent] identifier[event] operator[SEP] { Keyword[if] operator[SEP] identifier[boundListeners] operator[!=] Other[null] operator[SEP] { identifier[List] identifier[list] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[boundListeners] operator[SEP] identifier[get] operator[SEP] identifier[event] operator[SEP] identifier[getPropertyName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[!=] Other[null] operator[SEP] { identifier[firePropertyChanged] operator[SEP] identifier[list] , identifier[event] operator[SEP] operator[SEP] } } identifier[firePropertyChanged] operator[SEP] identifier[unboundListeners] , identifier[event] operator[SEP] operator[SEP] }
public final void popPair() { m_firstFree -= 2; m_map[m_firstFree] = DTM.NULL; m_map[m_firstFree + 1] = DTM.NULL; }
class class_name[name] begin[{] method[popPair, return_type[void], modifier[final public], parameter[]] begin[{] assign[member[.m_firstFree], literal[2]] assign[member[.m_map], member[DTM.NULL]] assign[member[.m_map], member[DTM.NULL]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[popPair] operator[SEP] operator[SEP] { identifier[m_firstFree] operator[-=] Other[2] operator[SEP] identifier[m_map] operator[SEP] identifier[m_firstFree] operator[SEP] operator[=] identifier[DTM] operator[SEP] identifier[NULL] operator[SEP] identifier[m_map] operator[SEP] identifier[m_firstFree] operator[+] Other[1] operator[SEP] operator[=] identifier[DTM] operator[SEP] identifier[NULL] operator[SEP] }
public static List<String> split(String str, char separatorChar) { List<String> list = new ArrayList<String>(); if (str == null || str.length() == 0) { return list; } if (str.indexOf(separatorChar) == -1) { list.add(str); return list; } int start = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == separatorChar) { String token = str.substring(start, i).trim(); if (token.length() > 0) { list.add(token); } start = i+1; } } String token = str.substring(start, str.length()).trim(); if (token.length() > 0) { list.add(token); } return list; }
class class_name[name] begin[{] method[split, return_type[type[List]], modifier[public static], parameter[str, separatorChar]] begin[{] local_variable[type[List], list] if[binary_operation[binary_operation[member[.str], ==, literal[null]], ||, binary_operation[call[str.length, parameter[]], ==, literal[0]]]] begin[{] return[member[.list]] else begin[{] None end[}] if[binary_operation[call[str.indexOf, parameter[member[.separatorChar]]], ==, literal[1]]] begin[{] call[list.add, parameter[member[.str]]] return[member[.list]] else begin[{] None end[}] local_variable[type[int], start] 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=str, selectors=[], type_arguments=None), operandr=MemberReference(member=separatorChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=token)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=str, 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) local_variable[type[String], token] if[binary_operation[call[token.length, parameter[]], >, literal[0]]] begin[{] call[list.add, parameter[member[.token]]] else begin[{] None end[}] return[member[.list]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[split] operator[SEP] identifier[String] identifier[str] , Keyword[char] identifier[separatorChar] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[||] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[list] operator[SEP] } Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[indexOf] operator[SEP] identifier[separatorChar] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[return] identifier[list] operator[SEP] } Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[separatorChar] operator[SEP] { identifier[String] identifier[token] operator[=] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[i] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP] } identifier[start] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } } identifier[String] identifier[token] operator[=] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }
@Override public boolean handleOption(String current, Iterator<String> remaining) { proc.debug(DBG_FMGR, "handleOption: current: %s\n", current + ", remaining: " + remaining); return stdFileManager.handleOption(current, remaining); }
class class_name[name] begin[{] method[handleOption, return_type[type[boolean]], modifier[public], parameter[current, remaining]] begin[{] call[proc.debug, parameter[member[.DBG_FMGR], literal["handleOption: current: %s\n"], binary_operation[binary_operation[member[.current], +, literal[", remaining: "]], +, member[.remaining]]]] return[call[stdFileManager.handleOption, parameter[member[.current], member[.remaining]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[handleOption] operator[SEP] identifier[String] identifier[current] , identifier[Iterator] operator[<] identifier[String] operator[>] identifier[remaining] operator[SEP] { identifier[proc] operator[SEP] identifier[debug] operator[SEP] identifier[DBG_FMGR] , literal[String] , identifier[current] operator[+] literal[String] operator[+] identifier[remaining] operator[SEP] operator[SEP] Keyword[return] identifier[stdFileManager] operator[SEP] identifier[handleOption] operator[SEP] identifier[current] , identifier[remaining] operator[SEP] operator[SEP] }
public void forEach(final IntObjConsumer<String> consumer) { int counterId = 0; final AtomicBuffer metaDataBuffer = this.metaDataBuffer; for (int i = 0, capacity = metaDataBuffer.capacity(); i < capacity; i += METADATA_LENGTH) { final int recordStatus = metaDataBuffer.getIntVolatile(i); if (RECORD_ALLOCATED == recordStatus) { consumer.accept(counterId, labelValue(metaDataBuffer, i)); } else if (RECORD_UNUSED == recordStatus) { break; } counterId++; } }
class class_name[name] begin[{] method[forEach, return_type[void], modifier[public], parameter[consumer]] begin[{] local_variable[type[int], counterId] local_variable[type[AtomicBuffer], metaDataBuffer] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIntVolatile, postfix_operators=[], prefix_operators=[], qualifier=metaDataBuffer, selectors=[], type_arguments=None), name=recordStatus)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=RECORD_ALLOCATED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=recordStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=RECORD_UNUSED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=recordStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=counterId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=metaDataBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=labelValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=accept, postfix_operators=[], prefix_operators=[], qualifier=consumer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=counterId, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=capacity, 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), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=capacity, postfix_operators=[], prefix_operators=[], qualifier=metaDataBuffer, selectors=[], type_arguments=None), name=capacity)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=METADATA_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[forEach] operator[SEP] Keyword[final] identifier[IntObjConsumer] operator[<] identifier[String] operator[>] identifier[consumer] operator[SEP] { Keyword[int] identifier[counterId] operator[=] Other[0] operator[SEP] Keyword[final] identifier[AtomicBuffer] identifier[metaDataBuffer] operator[=] Keyword[this] operator[SEP] identifier[metaDataBuffer] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[capacity] operator[=] identifier[metaDataBuffer] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[capacity] operator[SEP] identifier[i] operator[+=] identifier[METADATA_LENGTH] operator[SEP] { Keyword[final] Keyword[int] identifier[recordStatus] operator[=] identifier[metaDataBuffer] operator[SEP] identifier[getIntVolatile] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[RECORD_ALLOCATED] operator[==] identifier[recordStatus] operator[SEP] { identifier[consumer] operator[SEP] identifier[accept] operator[SEP] identifier[counterId] , identifier[labelValue] operator[SEP] identifier[metaDataBuffer] , identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[RECORD_UNUSED] operator[==] identifier[recordStatus] operator[SEP] { Keyword[break] operator[SEP] } identifier[counterId] operator[++] operator[SEP] } }
public static IStandardConversionService getConversionService(final IEngineConfiguration configuration) { final Object conversionService = configuration.getExecutionAttributes().get(STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME); if (conversionService == null || (!(conversionService instanceof IStandardConversionService))) { throw new TemplateProcessingException( "No Standard Conversion Service has been registered as an execution argument. " + "This is a requirement for using Standard Expressions, and might happen " + "if neither the Standard or the SpringStandard dialects have " + "been added to the Template Engine and none of the specified dialects registers an " + "attribute of type " + IStandardConversionService.class.getName() + " with name " + "\"" + STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME + "\""); } return (IStandardConversionService) conversionService; }
class class_name[name] begin[{] method[getConversionService, return_type[type[IStandardConversionService]], modifier[public static], parameter[configuration]] begin[{] local_variable[type[Object], conversionService] if[binary_operation[binary_operation[member[.conversionService], ==, literal[null]], ||, binary_operation[member[.conversionService], instanceof, type[IStandardConversionService]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No Standard Conversion Service has been registered as an execution argument. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This is a requirement for using Standard Expressions, and might happen "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="if neither the Standard or the SpringStandard dialects have "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="been added to the Template Engine and none of the specified dialects registers an "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="attribute of type "), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IStandardConversionService, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with name "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+), operandr=MemberReference(member=STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TemplateProcessingException, sub_type=None)), label=None) else begin[{] None end[}] return[Cast(expression=MemberReference(member=conversionService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IStandardConversionService, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[IStandardConversionService] identifier[getConversionService] operator[SEP] Keyword[final] identifier[IEngineConfiguration] identifier[configuration] operator[SEP] { Keyword[final] identifier[Object] identifier[conversionService] operator[=] identifier[configuration] operator[SEP] identifier[getExecutionAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conversionService] operator[==] Other[null] operator[||] operator[SEP] operator[!] operator[SEP] identifier[conversionService] Keyword[instanceof] identifier[IStandardConversionService] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[TemplateProcessingException] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[IStandardConversionService] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[IStandardConversionService] operator[SEP] identifier[conversionService] operator[SEP] }
public org.grails.datastore.mapping.query.api.Criteria order(String propertyName, String direction) { if (criteria == null) { throwRuntimeException(new IllegalArgumentException("Call to [order] with propertyName [" + propertyName + "]not allowed here.")); } propertyName = calculatePropertyName(propertyName); Order o; if (direction.equals(ORDER_DESCENDING)) { o = Order.desc(propertyName); } else { o = Order.asc(propertyName); } if (paginationEnabledList) { orderEntries.add(o); } else { criteria.addOrder(o); } return this; }
class class_name[name] begin[{] method[order, return_type[type[org]], modifier[public], parameter[propertyName, direction]] begin[{] if[binary_operation[member[.criteria], ==, literal[null]]] begin[{] call[.throwRuntimeException, parameter[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Call to [order] with propertyName ["), operandr=MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]not allowed here."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None))]] else begin[{] None end[}] assign[member[.propertyName], call[.calculatePropertyName, parameter[member[.propertyName]]]] local_variable[type[Order], o] if[call[direction.equals, parameter[member[.ORDER_DESCENDING]]]] begin[{] assign[member[.o], call[Order.desc, parameter[member[.propertyName]]]] else begin[{] assign[member[.o], call[Order.asc, parameter[member[.propertyName]]]] end[}] if[member[.paginationEnabledList]] begin[{] call[orderEntries.add, parameter[member[.o]]] else begin[{] call[criteria.addOrder, parameter[member[.o]]] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[org] operator[SEP] identifier[grails] operator[SEP] identifier[datastore] operator[SEP] identifier[mapping] operator[SEP] identifier[query] operator[SEP] identifier[api] operator[SEP] identifier[Criteria] identifier[order] operator[SEP] identifier[String] identifier[propertyName] , identifier[String] identifier[direction] operator[SEP] { Keyword[if] operator[SEP] identifier[criteria] operator[==] Other[null] operator[SEP] { identifier[throwRuntimeException] operator[SEP] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[propertyName] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[propertyName] operator[=] identifier[calculatePropertyName] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] identifier[Order] identifier[o] operator[SEP] Keyword[if] operator[SEP] identifier[direction] operator[SEP] identifier[equals] operator[SEP] identifier[ORDER_DESCENDING] operator[SEP] operator[SEP] { identifier[o] operator[=] identifier[Order] operator[SEP] identifier[desc] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] } Keyword[else] { identifier[o] operator[=] identifier[Order] operator[SEP] identifier[asc] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[paginationEnabledList] operator[SEP] { identifier[orderEntries] operator[SEP] identifier[add] operator[SEP] identifier[o] operator[SEP] operator[SEP] } Keyword[else] { identifier[criteria] operator[SEP] identifier[addOrder] operator[SEP] identifier[o] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static boolean isReservedVariable( String variableName ){ return ReservedVariables.NOW.equalsIgnoreCase( variableName ) || ReservedVariables.WORKFLOW_INSTANCE_ID.equalsIgnoreCase( variableName ); }
class class_name[name] begin[{] method[isReservedVariable, return_type[type[boolean]], modifier[public static], parameter[variableName]] begin[{] return[binary_operation[call[ReservedVariables.NOW.equalsIgnoreCase, parameter[member[.variableName]]], ||, call[ReservedVariables.WORKFLOW_INSTANCE_ID.equalsIgnoreCase, parameter[member[.variableName]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isReservedVariable] operator[SEP] identifier[String] identifier[variableName] operator[SEP] { Keyword[return] identifier[ReservedVariables] operator[SEP] identifier[NOW] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[variableName] operator[SEP] operator[||] identifier[ReservedVariables] operator[SEP] identifier[WORKFLOW_INSTANCE_ID] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[variableName] operator[SEP] operator[SEP] }
private Pair<Integer, Integer> readWebPImageSize() { final Pair<Integer, Integer> dimensions = WebpUtil.getSize(getInputStream()); if (dimensions != null) { mWidth = dimensions.first; mHeight = dimensions.second; } return dimensions; }
class class_name[name] begin[{] method[readWebPImageSize, return_type[type[Pair]], modifier[private], parameter[]] begin[{] local_variable[type[Pair], dimensions] if[binary_operation[member[.dimensions], !=, literal[null]]] begin[{] assign[member[.mWidth], member[dimensions.first]] assign[member[.mHeight], member[dimensions.second]] else begin[{] None end[}] return[member[.dimensions]] end[}] END[}]
Keyword[private] identifier[Pair] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[readWebPImageSize] operator[SEP] operator[SEP] { Keyword[final] identifier[Pair] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[dimensions] operator[=] identifier[WebpUtil] operator[SEP] identifier[getSize] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dimensions] operator[!=] Other[null] operator[SEP] { identifier[mWidth] operator[=] identifier[dimensions] operator[SEP] identifier[first] operator[SEP] identifier[mHeight] operator[=] identifier[dimensions] operator[SEP] identifier[second] operator[SEP] } Keyword[return] identifier[dimensions] operator[SEP] }
protected void ratio(List<MethodDto> performanceVOList, String entryName) { double allTotalTime = this.getAllTotalTime(performanceVOList, entryName); Map<String, Double> interfaceTotalTimeMap = this.getInterfaceTotalTime(performanceVOList); for (MethodDto performanceVO : performanceVOList) { String interfaceName = performanceVO.getInterfaceName(); Double interfaceTotalTime = interfaceTotalTimeMap.get(interfaceName); double interfaceRatio = this.percent(performanceVO.getAllTime(), interfaceTotalTime); double timeRatio = this.percent(performanceVO.getAllTime(), allTotalTime); performanceVO.setInterfaceRatio(interfaceRatio); performanceVO.setTimeRatio(timeRatio); } }
class class_name[name] begin[{] method[ratio, return_type[void], modifier[protected], parameter[performanceVOList, entryName]] begin[{] local_variable[type[double], allTotalTime] local_variable[type[Map], interfaceTotalTimeMap] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInterfaceName, postfix_operators=[], prefix_operators=[], qualifier=performanceVO, selectors=[], type_arguments=None), name=interfaceName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=interfaceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=interfaceTotalTimeMap, selectors=[], type_arguments=None), name=interfaceTotalTime)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAllTime, postfix_operators=[], prefix_operators=[], qualifier=performanceVO, selectors=[], type_arguments=None), MemberReference(member=interfaceTotalTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=percent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=interfaceRatio)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAllTime, postfix_operators=[], prefix_operators=[], qualifier=performanceVO, selectors=[], type_arguments=None), MemberReference(member=allTotalTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=percent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=timeRatio)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=interfaceRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInterfaceRatio, postfix_operators=[], prefix_operators=[], qualifier=performanceVO, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timeRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTimeRatio, postfix_operators=[], prefix_operators=[], qualifier=performanceVO, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=performanceVOList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=performanceVO)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodDto, sub_type=None))), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[ratio] operator[SEP] identifier[List] operator[<] identifier[MethodDto] operator[>] identifier[performanceVOList] , identifier[String] identifier[entryName] operator[SEP] { Keyword[double] identifier[allTotalTime] operator[=] Keyword[this] operator[SEP] identifier[getAllTotalTime] operator[SEP] identifier[performanceVOList] , identifier[entryName] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Double] operator[>] identifier[interfaceTotalTimeMap] operator[=] Keyword[this] operator[SEP] identifier[getInterfaceTotalTime] operator[SEP] identifier[performanceVOList] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MethodDto] identifier[performanceVO] operator[:] identifier[performanceVOList] operator[SEP] { identifier[String] identifier[interfaceName] operator[=] identifier[performanceVO] operator[SEP] identifier[getInterfaceName] operator[SEP] operator[SEP] operator[SEP] identifier[Double] identifier[interfaceTotalTime] operator[=] identifier[interfaceTotalTimeMap] operator[SEP] identifier[get] operator[SEP] identifier[interfaceName] operator[SEP] operator[SEP] Keyword[double] identifier[interfaceRatio] operator[=] Keyword[this] operator[SEP] identifier[percent] operator[SEP] identifier[performanceVO] operator[SEP] identifier[getAllTime] operator[SEP] operator[SEP] , identifier[interfaceTotalTime] operator[SEP] operator[SEP] Keyword[double] identifier[timeRatio] operator[=] Keyword[this] operator[SEP] identifier[percent] operator[SEP] identifier[performanceVO] operator[SEP] identifier[getAllTime] operator[SEP] operator[SEP] , identifier[allTotalTime] operator[SEP] operator[SEP] identifier[performanceVO] operator[SEP] identifier[setInterfaceRatio] operator[SEP] identifier[interfaceRatio] operator[SEP] operator[SEP] identifier[performanceVO] operator[SEP] identifier[setTimeRatio] operator[SEP] identifier[timeRatio] operator[SEP] operator[SEP] } }
public static Set<Class<?>> getAllAnnotatedClasses(final String packagePath, final Class<? extends Annotation> annotationClass) throws ClassNotFoundException, IOException, URISyntaxException { final List<File> directories = ClassExtensions.getDirectoriesFromResources(packagePath, true); final Set<Class<?>> classes = new HashSet<>(); for (final File directory : directories) { classes.addAll(scanForAnnotatedClasses(directory, packagePath, annotationClass)); } return classes; }
class class_name[name] begin[{] method[getAllAnnotatedClasses, return_type[type[Set]], modifier[public static], parameter[packagePath, annotationClass]] begin[{] local_variable[type[List], directories] local_variable[type[Set], classes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=directory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=packagePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scanForAnnotatedClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=classes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=directories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=directory)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) return[member[.classes]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[getAllAnnotatedClasses] operator[SEP] Keyword[final] identifier[String] identifier[packagePath] , Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotationClass] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] , identifier[IOException] , identifier[URISyntaxException] { Keyword[final] identifier[List] operator[<] identifier[File] operator[>] identifier[directories] operator[=] identifier[ClassExtensions] operator[SEP] identifier[getDirectoriesFromResources] operator[SEP] identifier[packagePath] , literal[boolean] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[classes] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[File] identifier[directory] operator[:] identifier[directories] operator[SEP] { identifier[classes] operator[SEP] identifier[addAll] operator[SEP] identifier[scanForAnnotatedClasses] operator[SEP] identifier[directory] , identifier[packagePath] , identifier[annotationClass] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[classes] operator[SEP] }
public boolean checkPackageGroups(String groupname, String pkgNameFormList) { String[] pkgPatterns = pkgNameFormList.split(":"); if (groupList.contains(groupname)) { initMessages(); messages.warning("doclet.Groupname_already_used", groupname); return false; } groupList.add(groupname); for (String pkgPattern : pkgPatterns) { if (pkgPattern.length() == 0) { initMessages(); messages.warning("doclet.Error_in_grouplist", groupname, pkgNameFormList); return false; } if (pkgPattern.endsWith("*")) { pkgPattern = pkgPattern.substring(0, pkgPattern.length() - 1); if (foundGroupFormat(regExpGroupMap, pkgPattern)) { return false; } regExpGroupMap.put(pkgPattern, groupname); sortedRegExpList.add(pkgPattern); } else { if (foundGroupFormat(elementNameGroupMap, pkgPattern)) { return false; } elementNameGroupMap.put(pkgPattern, groupname); } } Collections.sort(sortedRegExpList, new MapKeyComparator()); return true; }
class class_name[name] begin[{] method[checkPackageGroups, return_type[type[boolean]], modifier[public], parameter[groupname, pkgNameFormList]] begin[{] local_variable[type[String], pkgPatterns] if[call[groupList.contains, parameter[member[.groupname]]]] begin[{] call[.initMessages, parameter[]] call[messages.warning, parameter[literal["doclet.Groupname_already_used"], member[.groupname]]] return[literal[false]] else begin[{] None end[}] call[groupList.add, parameter[member[.groupname]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pkgPattern, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=initMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="doclet.Error_in_grouplist"), MemberReference(member=groupname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pkgNameFormList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warning, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=pkgPattern, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=elementNameGroupMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pkgPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=foundGroupFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pkgPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=elementNameGroupMap, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pkgPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pkgPattern, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=pkgPattern, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=regExpGroupMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pkgPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=foundGroupFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pkgPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=regExpGroupMap, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pkgPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=sortedRegExpList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=pkgPatterns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pkgPattern)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[Collections.sort, parameter[member[.sortedRegExpList], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MapKeyComparator, sub_type=None))]] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[checkPackageGroups] operator[SEP] identifier[String] identifier[groupname] , identifier[String] identifier[pkgNameFormList] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[pkgPatterns] operator[=] identifier[pkgNameFormList] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groupList] operator[SEP] identifier[contains] operator[SEP] identifier[groupname] operator[SEP] operator[SEP] { identifier[initMessages] operator[SEP] operator[SEP] operator[SEP] identifier[messages] operator[SEP] identifier[warning] operator[SEP] literal[String] , identifier[groupname] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[groupList] operator[SEP] identifier[add] operator[SEP] identifier[groupname] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[pkgPattern] operator[:] identifier[pkgPatterns] operator[SEP] { Keyword[if] operator[SEP] identifier[pkgPattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[initMessages] operator[SEP] operator[SEP] operator[SEP] identifier[messages] operator[SEP] identifier[warning] operator[SEP] literal[String] , identifier[groupname] , identifier[pkgNameFormList] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[pkgPattern] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[pkgPattern] operator[=] identifier[pkgPattern] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pkgPattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[foundGroupFormat] operator[SEP] identifier[regExpGroupMap] , identifier[pkgPattern] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[regExpGroupMap] operator[SEP] identifier[put] operator[SEP] identifier[pkgPattern] , identifier[groupname] operator[SEP] operator[SEP] identifier[sortedRegExpList] operator[SEP] identifier[add] operator[SEP] identifier[pkgPattern] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[foundGroupFormat] operator[SEP] identifier[elementNameGroupMap] , identifier[pkgPattern] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[elementNameGroupMap] operator[SEP] identifier[put] operator[SEP] identifier[pkgPattern] , identifier[groupname] operator[SEP] operator[SEP] } } identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[sortedRegExpList] , Keyword[new] identifier[MapKeyComparator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
@Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) { Tr.entry(tc, "getObjectInstance" + Util.identity(obj)); } BeanManager bm = null; if (obj instanceof javax.naming.Reference) { javax.naming.Reference objRef = (javax.naming.Reference) obj; String factoryClassName = objRef.getFactoryClassName(); if (this.getClass().getName().equals(factoryClassName)) { CDIService cdiService = getCDIService(); bm = cdiService.getCurrentBeanManager(); } } if (isTraceOn && tc.isEntryEnabled()) { Tr.exit(tc, "getObjectInstance", bm); } return bm; }
class class_name[name] begin[{] method[getObjectInstance, return_type[type[Object]], modifier[public], parameter[obj, name, nameCtx, environment]] begin[{] local_variable[type[boolean], isTraceOn] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], binary_operation[literal["getObjectInstance"], +, call[Util.identity, parameter[member[.obj]]]]]] else begin[{] None end[}] local_variable[type[BeanManager], bm] if[binary_operation[member[.obj], instanceof, type[javax]]] begin[{] local_variable[type[javax], objRef] local_variable[type[String], factoryClassName] if[THIS[call[None.getClass, parameter[]]call[None.getName, parameter[]]call[None.equals, parameter[member[.factoryClassName]]]]] begin[{] local_variable[type[CDIService], cdiService] assign[member[.bm], call[cdiService.getCurrentBeanManager, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["getObjectInstance"], member[.bm]]] else begin[{] None end[}] return[member[.bm]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getObjectInstance] operator[SEP] identifier[Object] identifier[obj] , identifier[Name] identifier[name] , identifier[Context] identifier[nameCtx] , identifier[Hashtable] operator[<] operator[?] , operator[?] operator[>] identifier[environment] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[Util] operator[SEP] identifier[identity] operator[SEP] identifier[obj] operator[SEP] operator[SEP] operator[SEP] } identifier[BeanManager] identifier[bm] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[javax] operator[SEP] identifier[naming] operator[SEP] identifier[Reference] operator[SEP] { identifier[javax] operator[SEP] identifier[naming] operator[SEP] identifier[Reference] identifier[objRef] operator[=] operator[SEP] identifier[javax] operator[SEP] identifier[naming] operator[SEP] identifier[Reference] operator[SEP] identifier[obj] operator[SEP] identifier[String] identifier[factoryClassName] operator[=] identifier[objRef] operator[SEP] identifier[getFactoryClassName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[factoryClassName] operator[SEP] operator[SEP] { identifier[CDIService] identifier[cdiService] operator[=] identifier[getCDIService] operator[SEP] operator[SEP] operator[SEP] identifier[bm] operator[=] identifier[cdiService] operator[SEP] identifier[getCurrentBeanManager] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] 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[bm] operator[SEP] operator[SEP] } Keyword[return] identifier[bm] operator[SEP] }
public void ldapSync(Object groupIdOrPath) throws GitLabApiException { post(Response.Status.NO_CONTENT, (Form)null, "groups", getGroupIdOrPath(groupIdOrPath), "ldap_sync"); }
class class_name[name] begin[{] method[ldapSync, return_type[void], modifier[public], parameter[groupIdOrPath]] begin[{] call[.post, parameter[member[Response.Status.NO_CONTENT], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Form, sub_type=None)), literal["groups"], call[.getGroupIdOrPath, parameter[member[.groupIdOrPath]]], literal["ldap_sync"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[ldapSync] operator[SEP] identifier[Object] identifier[groupIdOrPath] operator[SEP] Keyword[throws] identifier[GitLabApiException] { identifier[post] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[NO_CONTENT] , operator[SEP] identifier[Form] operator[SEP] Other[null] , literal[String] , identifier[getGroupIdOrPath] operator[SEP] identifier[groupIdOrPath] operator[SEP] , literal[String] operator[SEP] operator[SEP] }
@Override public StopTaskResult stopTask(StopTaskRequest request) { request = beforeClientExecution(request); return executeStopTask(request); }
class class_name[name] begin[{] method[stopTask, return_type[type[StopTaskResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeStopTask, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[StopTaskResult] identifier[stopTask] operator[SEP] identifier[StopTaskRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeStopTask] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static String readFile(String string) { InputStream inputStream = getInputStream(string); if (inputStream != null) { return new String(readStream(inputStream)); } return null; }
class class_name[name] begin[{] method[readFile, return_type[type[String]], modifier[public static], parameter[string]] begin[{] local_variable[type[InputStream], inputStream] if[binary_operation[member[.inputStream], !=, literal[null]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[readFile] operator[SEP] identifier[String] identifier[string] operator[SEP] { identifier[InputStream] identifier[inputStream] operator[=] identifier[getInputStream] operator[SEP] identifier[string] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inputStream] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[readStream] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private void writeOffsetsToMainOffsetFile(Map<Integer, Long> partitionToOffsetMap) throws IOException { LOG.info("Saving the following offset {} to {}", partitionToOffsetMap, checkPointFilePath); //Creating a marker file (overwriting if it already exists) to mark that we are going to write offsets out the offsets to the main offset file. try(OutputStream os = fs.create(checkPointMarkerFilePath, true)) { //NOOP } //If the both above passes and writing fails or leaves corrupted file we will have the back file try (OutputStream os = fs.create(checkPointFilePath, true)) { OBJECT_MAPPER.writeValue(os, new ClusterSourceOffsetJson(serializeKafkaPartitionOffset(partitionToOffsetMap), SDC_STREAMING_OFFSET_VERSION)); } //If this fails we are still good, as we will start from the backup offset file. (Not optimal, but deterministic) boolean deleted = fs.delete(checkPointMarkerFilePath, false); LOG.warn("Status {} for Deleting Marker File {}", deleted, checkPointMarkerFilePath); //If the write fails we don't want to touch the timestamp and will error out so not doing this in finally lastOffsetStoredTime = System.currentTimeMillis(); }
class class_name[name] begin[{] method[writeOffsetsToMainOffsetFile, return_type[void], modifier[private], parameter[partitionToOffsetMap]] begin[{] call[LOG.info, parameter[literal["Saving the following offset {} to {}"], member[.partitionToOffsetMap], member[.checkPointFilePath]]] TryStatement(block=[], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=os, type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=checkPointMarkerFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=create, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None))]) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=partitionToOffsetMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serializeKafkaPartitionOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=SDC_STREAMING_OFFSET_VERSION, 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=ClusterSourceOffsetJson, sub_type=None))], member=writeValue, postfix_operators=[], prefix_operators=[], qualifier=OBJECT_MAPPER, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=os, type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=checkPointFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=create, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None))]) local_variable[type[boolean], deleted] call[LOG.warn, parameter[literal["Status {} for Deleting Marker File {}"], member[.deleted], member[.checkPointMarkerFilePath]]] assign[member[.lastOffsetStoredTime], call[System.currentTimeMillis, parameter[]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[writeOffsetsToMainOffsetFile] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Long] operator[>] identifier[partitionToOffsetMap] operator[SEP] Keyword[throws] identifier[IOException] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[partitionToOffsetMap] , identifier[checkPointFilePath] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[OutputStream] identifier[os] operator[=] identifier[fs] operator[SEP] identifier[create] operator[SEP] identifier[checkPointMarkerFilePath] , literal[boolean] operator[SEP] operator[SEP] { } Keyword[try] operator[SEP] identifier[OutputStream] identifier[os] operator[=] identifier[fs] operator[SEP] identifier[create] operator[SEP] identifier[checkPointFilePath] , literal[boolean] operator[SEP] operator[SEP] { identifier[OBJECT_MAPPER] operator[SEP] identifier[writeValue] operator[SEP] identifier[os] , Keyword[new] identifier[ClusterSourceOffsetJson] operator[SEP] identifier[serializeKafkaPartitionOffset] operator[SEP] identifier[partitionToOffsetMap] operator[SEP] , identifier[SDC_STREAMING_OFFSET_VERSION] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[deleted] operator[=] identifier[fs] operator[SEP] identifier[delete] operator[SEP] identifier[checkPointMarkerFilePath] , literal[boolean] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[deleted] , identifier[checkPointMarkerFilePath] operator[SEP] operator[SEP] identifier[lastOffsetStoredTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] }
private static final int getR(final double theta, final double alpha, final double p) { final double split1 = (p * (alpha + 1.0)) / 2.0; if (theta > split1) { return 0; } if (theta > (alpha * split1)) { return 1; } return 2; }
class class_name[name] begin[{] method[getR, return_type[type[int]], modifier[final private static], parameter[theta, alpha, p]] begin[{] local_variable[type[double], split1] if[binary_operation[member[.theta], >, member[.split1]]] begin[{] return[literal[0]] else begin[{] None end[}] if[binary_operation[member[.theta], >, binary_operation[member[.alpha], *, member[.split1]]]] begin[{] return[literal[1]] else begin[{] None end[}] return[literal[2]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[final] Keyword[int] identifier[getR] operator[SEP] Keyword[final] Keyword[double] identifier[theta] , Keyword[final] Keyword[double] identifier[alpha] , Keyword[final] Keyword[double] identifier[p] operator[SEP] { Keyword[final] Keyword[double] identifier[split1] operator[=] operator[SEP] identifier[p] operator[*] operator[SEP] identifier[alpha] operator[+] literal[Float] operator[SEP] operator[SEP] operator[/] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[theta] operator[>] identifier[split1] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[if] operator[SEP] identifier[theta] operator[>] operator[SEP] identifier[alpha] operator[*] identifier[split1] operator[SEP] operator[SEP] { Keyword[return] Other[1] operator[SEP] } Keyword[return] Other[2] operator[SEP] }
public MultipleResultCollectorContext<DPO> collect(Collection<ResultCollector<?, DPO>> resultCollectors) { if (resultCollectors != null) { addedTriggers.addAll(resultCollectors); addedDataProviders.addAll(resultCollectors); } // Change context return new MultipleResultCollectorContext<DPO>(addedTriggers, addedDataProviders); }
class class_name[name] begin[{] method[collect, return_type[type[MultipleResultCollectorContext]], modifier[public], parameter[resultCollectors]] begin[{] if[binary_operation[member[.resultCollectors], !=, literal[null]]] begin[{] call[addedTriggers.addAll, parameter[member[.resultCollectors]]] call[addedDataProviders.addAll, parameter[member[.resultCollectors]]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=addedTriggers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=addedDataProviders, 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=DPO, sub_type=None))], dimensions=None, name=MultipleResultCollectorContext, sub_type=None))] end[}] END[}]
Keyword[public] identifier[MultipleResultCollectorContext] operator[<] identifier[DPO] operator[>] identifier[collect] operator[SEP] identifier[Collection] operator[<] identifier[ResultCollector] operator[<] operator[?] , identifier[DPO] operator[>] operator[>] identifier[resultCollectors] operator[SEP] { Keyword[if] operator[SEP] identifier[resultCollectors] operator[!=] Other[null] operator[SEP] { identifier[addedTriggers] operator[SEP] identifier[addAll] operator[SEP] identifier[resultCollectors] operator[SEP] operator[SEP] identifier[addedDataProviders] operator[SEP] identifier[addAll] operator[SEP] identifier[resultCollectors] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[MultipleResultCollectorContext] operator[<] identifier[DPO] operator[>] operator[SEP] identifier[addedTriggers] , identifier[addedDataProviders] operator[SEP] operator[SEP] }
@SuppressWarnings("deprecation") @Override public ExtensionProcessor createExtensionProcessor(IServletContext iServletContext) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "WAB createExtensionProcessor", iServletContext.getContextPath()); Map<String, WABPathSpecificItemHolder> knownPaths = this.knownPaths; if (knownPaths != null) { //get the known wabs for this path WABPathSpecificItemHolder holder; synchronized (knownPaths) { holder = knownPaths.get(iServletContext.getContextPath()); } if (holder != null) { Collection<WAB> wabs = holder.getWABs(); WAB wab = null; synchronized (holder) { //we might have a long list for (WAB w : wabs) { switch (w.getState()) { case DEPLOYING: case DEPLOYED: wab = w; break; default: break; } } } if (wab != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Found WAB matching context path", iServletContext.getContextPath()); BundleContext wabBC = wab.getBundle().getBundleContext(); //Register the BundleContext as an attribute on the ServletContext iServletContext.setAttribute("osgi-bundlecontext", wabBC); // For Spring DM based applications register BundleContext under attribute that // org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext looks for. iServletContext.setAttribute("org.springframework.osgi.web." + BundleContext.class.getName(), wabBC); //add the OSGi directory protection filter //Add dynamic filter to prevent access to OSGI-INF and OSGI-OPT ExtendedServletContext esc = iServletContext; IFilterConfig fc = esc.getFilterConfig("com.ibm.ws.app.manager.wab.internal.WABInstaller.OSGIDENYCONFIG"); //name is just a unique string. fc.setDescription("Filter protecting OSGI-INF and OSGI-OPT resources"); fc.setName("com.ibm.ws.app.manager.wab.internal.OsgiDirectoryProtectionFilter"); // DO NOT ALLOW TO BE NULL!! (will break WAS) fc.setFilterClassLoader(this.getClass().getClassLoader()); fc.setFilterClassName(OsgiDirectoryProtectionFilter.class.getName()); //The new filter class.. fc.setDisplayName("OSGI Directory protection filter"); fc.setDispatchMode(new int[] { IFilterConfig.FILTER_ERROR, IFilterConfig.FILTER_FORWARD, IFilterConfig.FILTER_INCLUDE, IFilterConfig.FILTER_REQUEST }); fc.setAsyncSupported(true); //Added so that the filter can support Async servlet functionality. It doesn't affect behaviour for Sync Servlets. esc.addMappingFilter("/*", fc); //iServletContext.addFilter("/*", new OsgiDirectoryProtectionFilter()); //Register the ServletContext in the service registry wab.registerServletContext(iServletContext); } return null; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "No WABS matching context path", iServletContext.getContextPath()); Tr.debug(tc, "Known WAB context paths", knownPaths); } return null; } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Not initialized with knownPaths"); } return null; } }
class class_name[name] begin[{] method[createExtensionProcessor, return_type[type[ExtensionProcessor]], modifier[public], parameter[iServletContext]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["WAB createExtensionProcessor"], call[iServletContext.getContextPath, parameter[]]]] else begin[{] None end[}] local_variable[type[Map], knownPaths] if[binary_operation[member[.knownPaths], !=, literal[null]]] begin[{] local_variable[type[WABPathSpecificItemHolder], holder] SYNCHRONIZED[member[.knownPaths]] BEGIN[{] assign[member[.holder], call[knownPaths.get, parameter[call[iServletContext.getContextPath, parameter[]]]]] END[}] if[binary_operation[member[.holder], !=, literal[null]]] begin[{] local_variable[type[Collection], wabs] local_variable[type[WAB], wab] SYNCHRONIZED[member[.holder]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=['DEPLOYING', 'DEPLOYED'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=wab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=wabs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=w)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WAB, sub_type=None))), label=None) END[}] if[binary_operation[member[.wab], !=, literal[null]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["Found WAB matching context path"], call[iServletContext.getContextPath, parameter[]]]] else begin[{] None end[}] local_variable[type[BundleContext], wabBC] call[iServletContext.setAttribute, parameter[literal["osgi-bundlecontext"], member[.wabBC]]] call[iServletContext.setAttribute, parameter[binary_operation[literal["org.springframework.osgi.web."], +, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BundleContext, sub_type=None))], member[.wabBC]]] local_variable[type[ExtendedServletContext], esc] local_variable[type[IFilterConfig], fc] call[fc.setDescription, parameter[literal["Filter protecting OSGI-INF and OSGI-OPT resources"]]] call[fc.setName, parameter[literal["com.ibm.ws.app.manager.wab.internal.OsgiDirectoryProtectionFilter"]]] call[fc.setFilterClassLoader, parameter[THIS[call[None.getClass, parameter[]]call[None.getClassLoader, parameter[]]]]] call[fc.setFilterClassName, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=OsgiDirectoryProtectionFilter, sub_type=None))]] call[fc.setDisplayName, parameter[literal["OSGI Directory protection filter"]]] call[fc.setDispatchMode, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=FILTER_ERROR, postfix_operators=[], prefix_operators=[], qualifier=IFilterConfig, selectors=[]), MemberReference(member=FILTER_FORWARD, postfix_operators=[], prefix_operators=[], qualifier=IFilterConfig, selectors=[]), MemberReference(member=FILTER_INCLUDE, postfix_operators=[], prefix_operators=[], qualifier=IFilterConfig, selectors=[]), MemberReference(member=FILTER_REQUEST, postfix_operators=[], prefix_operators=[], qualifier=IFilterConfig, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]] call[fc.setAsyncSupported, parameter[literal[true]]] call[esc.addMappingFilter, parameter[literal["/*"], member[.fc]]] call[wab.registerServletContext, parameter[member[.iServletContext]]] else begin[{] None end[}] return[literal[null]] else begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["No WABS matching context path"], call[iServletContext.getContextPath, parameter[]]]] call[Tr.debug, parameter[member[.tc], literal["Known WAB context paths"], member[.knownPaths]]] else begin[{] None end[}] return[literal[null]] end[}] else begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["Not initialized with knownPaths"]]] else begin[{] None end[}] return[literal[null]] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[ExtensionProcessor] identifier[createExtensionProcessor] operator[SEP] identifier[IServletContext] identifier[iServletContext] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[iServletContext] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[WABPathSpecificItemHolder] operator[>] identifier[knownPaths] operator[=] Keyword[this] operator[SEP] identifier[knownPaths] operator[SEP] Keyword[if] operator[SEP] identifier[knownPaths] operator[!=] Other[null] operator[SEP] { identifier[WABPathSpecificItemHolder] identifier[holder] operator[SEP] Keyword[synchronized] operator[SEP] identifier[knownPaths] operator[SEP] { identifier[holder] operator[=] identifier[knownPaths] operator[SEP] identifier[get] operator[SEP] identifier[iServletContext] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[holder] operator[!=] Other[null] operator[SEP] { identifier[Collection] operator[<] identifier[WAB] operator[>] identifier[wabs] operator[=] identifier[holder] operator[SEP] identifier[getWABs] operator[SEP] operator[SEP] operator[SEP] identifier[WAB] identifier[wab] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] identifier[holder] operator[SEP] { Keyword[for] operator[SEP] identifier[WAB] identifier[w] operator[:] identifier[wabs] operator[SEP] { Keyword[switch] operator[SEP] identifier[w] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[DEPLOYING] operator[:] Keyword[case] identifier[DEPLOYED] operator[:] identifier[wab] operator[=] identifier[w] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } } } Keyword[if] operator[SEP] identifier[wab] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[iServletContext] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BundleContext] identifier[wabBC] operator[=] identifier[wab] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[getBundleContext] operator[SEP] operator[SEP] operator[SEP] identifier[iServletContext] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[wabBC] operator[SEP] operator[SEP] identifier[iServletContext] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] operator[+] identifier[BundleContext] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[wabBC] operator[SEP] operator[SEP] identifier[ExtendedServletContext] identifier[esc] operator[=] identifier[iServletContext] operator[SEP] identifier[IFilterConfig] identifier[fc] operator[=] identifier[esc] operator[SEP] identifier[getFilterConfig] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setDescription] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setFilterClassLoader] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setFilterClassName] operator[SEP] identifier[OsgiDirectoryProtectionFilter] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setDisplayName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setDispatchMode] operator[SEP] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { identifier[IFilterConfig] operator[SEP] identifier[FILTER_ERROR] , identifier[IFilterConfig] operator[SEP] identifier[FILTER_FORWARD] , identifier[IFilterConfig] operator[SEP] identifier[FILTER_INCLUDE] , identifier[IFilterConfig] operator[SEP] identifier[FILTER_REQUEST] } operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setAsyncSupported] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[esc] operator[SEP] identifier[addMappingFilter] operator[SEP] literal[String] , identifier[fc] operator[SEP] operator[SEP] identifier[wab] operator[SEP] identifier[registerServletContext] operator[SEP] identifier[iServletContext] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[iServletContext] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[knownPaths] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } }
void handlerProcessTask(Task task) { assertDispatcherThread(); SerialTaskQueue taskQueue = mQueuesMap.get(task.subscriberCallback.queue); if (taskQueue == null) { taskQueue = new SerialTaskQueue(task.subscriberCallback.queue); mQueuesMap.put(task.subscriberCallback.queue, taskQueue); mQueuesList.add(taskQueue); } taskQueue.offer(task); processNextTask(); }
class class_name[name] begin[{] method[handlerProcessTask, return_type[void], modifier[default], parameter[task]] begin[{] call[.assertDispatcherThread, parameter[]] local_variable[type[SerialTaskQueue], taskQueue] if[binary_operation[member[.taskQueue], ==, literal[null]]] begin[{] assign[member[.taskQueue], ClassCreator(arguments=[MemberReference(member=queue, postfix_operators=[], prefix_operators=[], qualifier=task.subscriberCallback, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SerialTaskQueue, sub_type=None))] call[mQueuesMap.put, parameter[member[task.subscriberCallback.queue], member[.taskQueue]]] call[mQueuesList.add, parameter[member[.taskQueue]]] else begin[{] None end[}] call[taskQueue.offer, parameter[member[.task]]] call[.processNextTask, parameter[]] end[}] END[}]
Keyword[void] identifier[handlerProcessTask] operator[SEP] identifier[Task] identifier[task] operator[SEP] { identifier[assertDispatcherThread] operator[SEP] operator[SEP] operator[SEP] identifier[SerialTaskQueue] identifier[taskQueue] operator[=] identifier[mQueuesMap] operator[SEP] identifier[get] operator[SEP] identifier[task] operator[SEP] identifier[subscriberCallback] operator[SEP] identifier[queue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[taskQueue] operator[==] Other[null] operator[SEP] { identifier[taskQueue] operator[=] Keyword[new] identifier[SerialTaskQueue] operator[SEP] identifier[task] operator[SEP] identifier[subscriberCallback] operator[SEP] identifier[queue] operator[SEP] operator[SEP] identifier[mQueuesMap] operator[SEP] identifier[put] operator[SEP] identifier[task] operator[SEP] identifier[subscriberCallback] operator[SEP] identifier[queue] , identifier[taskQueue] operator[SEP] operator[SEP] identifier[mQueuesList] operator[SEP] identifier[add] operator[SEP] identifier[taskQueue] operator[SEP] operator[SEP] } identifier[taskQueue] operator[SEP] identifier[offer] operator[SEP] identifier[task] operator[SEP] operator[SEP] identifier[processNextTask] operator[SEP] operator[SEP] operator[SEP] }
static SortedRangeSet copyOf(Type type, Iterable<Range> ranges) { return new Builder(type).addAll(ranges).build(); }
class class_name[name] begin[{] method[copyOf, return_type[type[SortedRangeSet]], modifier[static], parameter[type, ranges]] begin[{] return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=ranges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))] end[}] END[}]
Keyword[static] identifier[SortedRangeSet] identifier[copyOf] operator[SEP] identifier[Type] identifier[type] , identifier[Iterable] operator[<] identifier[Range] operator[>] identifier[ranges] operator[SEP] { Keyword[return] Keyword[new] identifier[Builder] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[ranges] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public List<SqlDesc> createSqlDescs(EntityDesc entityDesc) { List<SqlDesc> results = new ArrayList<SqlDesc>(); if (entityDesc.getIdEntityPropertyDescs().size() > 0) { results.add( createSqlDesc(entityDesc, selectByIdFileName, Constants.SELECT_BY_ID_SQL_TEMPLATE)); if (entityDesc.getVersionEntityPropertyDesc() != null) { results.add( createSqlDesc( entityDesc, selectByIdAndVersionFileName, Constants.SELECT_BY_ID_AND_VERSION_SQL_TEMPLATE)); } } for (String templateName : findTemplateNames()) { String fileName = removeTemplateExtension(templateName); results.add(createSqlDesc(entityDesc, fileName, templateName)); } return results; }
class class_name[name] begin[{] method[createSqlDescs, return_type[type[List]], modifier[public], parameter[entityDesc]] begin[{] local_variable[type[List], results] if[binary_operation[call[entityDesc.getIdEntityPropertyDescs, parameter[]], >, literal[0]]] begin[{] call[results.add, parameter[call[.createSqlDesc, parameter[member[.entityDesc], member[.selectByIdFileName], member[Constants.SELECT_BY_ID_SQL_TEMPLATE]]]]] if[binary_operation[call[entityDesc.getVersionEntityPropertyDesc, parameter[]], !=, literal[null]]] begin[{] call[results.add, parameter[call[.createSqlDesc, parameter[member[.entityDesc], member[.selectByIdAndVersionFileName], member[Constants.SELECT_BY_ID_AND_VERSION_SQL_TEMPLATE]]]]] else begin[{] None end[}] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=templateName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeTemplateExtension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=fileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=entityDesc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=templateName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createSqlDesc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=findTemplateNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=templateName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.results]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[SqlDesc] operator[>] identifier[createSqlDescs] operator[SEP] identifier[EntityDesc] identifier[entityDesc] operator[SEP] { identifier[List] operator[<] identifier[SqlDesc] operator[>] identifier[results] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[SqlDesc] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityDesc] operator[SEP] identifier[getIdEntityPropertyDescs] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[createSqlDesc] operator[SEP] identifier[entityDesc] , identifier[selectByIdFileName] , identifier[Constants] operator[SEP] identifier[SELECT_BY_ID_SQL_TEMPLATE] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityDesc] operator[SEP] identifier[getVersionEntityPropertyDesc] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[createSqlDesc] operator[SEP] identifier[entityDesc] , identifier[selectByIdAndVersionFileName] , identifier[Constants] operator[SEP] identifier[SELECT_BY_ID_AND_VERSION_SQL_TEMPLATE] operator[SEP] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[String] identifier[templateName] operator[:] identifier[findTemplateNames] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[fileName] operator[=] identifier[removeTemplateExtension] operator[SEP] identifier[templateName] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[createSqlDesc] operator[SEP] identifier[entityDesc] , identifier[fileName] , identifier[templateName] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[results] operator[SEP] }
public CompleteMultipartUploadResult onCompletion(List<PartETag> partETags) { return s3.completeMultipartUpload( new CompleteMultipartUploadRequest( req.getBucketName(), req.getKey(), uploadId, partETags)); }
class class_name[name] begin[{] method[onCompletion, return_type[type[CompleteMultipartUploadResult]], modifier[public], parameter[partETags]] begin[{] return[call[s3.completeMultipartUpload, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBucketName, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), MemberReference(member=uploadId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=partETags, 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=CompleteMultipartUploadRequest, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[CompleteMultipartUploadResult] identifier[onCompletion] operator[SEP] identifier[List] operator[<] identifier[PartETag] operator[>] identifier[partETags] operator[SEP] { Keyword[return] identifier[s3] operator[SEP] identifier[completeMultipartUpload] operator[SEP] Keyword[new] identifier[CompleteMultipartUploadRequest] operator[SEP] identifier[req] operator[SEP] identifier[getBucketName] operator[SEP] operator[SEP] , identifier[req] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[uploadId] , identifier[partETags] operator[SEP] operator[SEP] operator[SEP] }
protected final PrcPurchaseReturnLineSave<RS> lazyGetPrcPurchaseReturnLineSave( final Map<String, Object> pAddParam) throws Exception { @SuppressWarnings("unchecked") PrcPurchaseReturnLineSave<RS> proc = (PrcPurchaseReturnLineSave<RS>) this.processorsMap .get(PrcPurchaseReturnLineSave.class.getSimpleName()); if (proc == null) { proc = new PrcPurchaseReturnLineSave<RS>(); proc.setSrvAccSettings(getSrvAccSettings()); proc.setSrvNumberToString(getSrvNumberToString()); proc.setSrvOrm(getSrvOrm()); proc.setSrvI18n(getSrvI18n()); proc.setUtlInvLine(lazyGetUtlPurRetGdLn(pAddParam)); proc.setSrvWarehouseEntry(getSrvWarehouseEntry()); proc.setSrvUseMaterialEntry(getSrvUseMaterialEntry()); //assigning fully initialized object: this.processorsMap .put(PrcPurchaseReturnLineSave.class.getSimpleName(), proc); } return proc; }
class class_name[name] begin[{] method[lazyGetPrcPurchaseReturnLineSave, return_type[type[PrcPurchaseReturnLineSave]], modifier[final protected], parameter[pAddParam]] begin[{] local_variable[type[PrcPurchaseReturnLineSave], proc] if[binary_operation[member[.proc], ==, literal[null]]] begin[{] assign[member[.proc], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RS, sub_type=None))], dimensions=None, name=PrcPurchaseReturnLineSave, sub_type=None))] call[proc.setSrvAccSettings, parameter[call[.getSrvAccSettings, parameter[]]]] call[proc.setSrvNumberToString, parameter[call[.getSrvNumberToString, parameter[]]]] call[proc.setSrvOrm, parameter[call[.getSrvOrm, parameter[]]]] call[proc.setSrvI18n, parameter[call[.getSrvI18n, parameter[]]]] call[proc.setUtlInvLine, parameter[call[.lazyGetUtlPurRetGdLn, parameter[member[.pAddParam]]]]] call[proc.setSrvWarehouseEntry, parameter[call[.getSrvWarehouseEntry, parameter[]]]] call[proc.setSrvUseMaterialEntry, parameter[call[.getSrvUseMaterialEntry, parameter[]]]] THIS[member[None.processorsMap]call[None.put, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcPurchaseReturnLineSave, sub_type=None)), member[.proc]]]] else begin[{] None end[}] return[member[.proc]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[PrcPurchaseReturnLineSave] operator[<] identifier[RS] operator[>] identifier[lazyGetPrcPurchaseReturnLineSave] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pAddParam] operator[SEP] Keyword[throws] identifier[Exception] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[PrcPurchaseReturnLineSave] operator[<] identifier[RS] operator[>] identifier[proc] operator[=] operator[SEP] identifier[PrcPurchaseReturnLineSave] operator[<] identifier[RS] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[get] operator[SEP] identifier[PrcPurchaseReturnLineSave] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proc] operator[==] Other[null] operator[SEP] { identifier[proc] operator[=] Keyword[new] identifier[PrcPurchaseReturnLineSave] operator[<] identifier[RS] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvAccSettings] operator[SEP] identifier[getSrvAccSettings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvNumberToString] operator[SEP] identifier[getSrvNumberToString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvOrm] operator[SEP] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvI18n] operator[SEP] identifier[getSrvI18n] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setUtlInvLine] operator[SEP] identifier[lazyGetUtlPurRetGdLn] operator[SEP] identifier[pAddParam] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvWarehouseEntry] operator[SEP] identifier[getSrvWarehouseEntry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvUseMaterialEntry] operator[SEP] identifier[getSrvUseMaterialEntry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[put] operator[SEP] identifier[PrcPurchaseReturnLineSave] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[proc] operator[SEP] operator[SEP] } Keyword[return] identifier[proc] operator[SEP] }
public SettingsPack uploadRateLimit(int value) { sp.set_int(settings_pack.int_types.upload_rate_limit.swigValue(), value); return this; }
class class_name[name] begin[{] method[uploadRateLimit, return_type[type[SettingsPack]], modifier[public], parameter[value]] begin[{] call[sp.set_int, parameter[call[settings_pack.int_types.upload_rate_limit.swigValue, parameter[]], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[SettingsPack] identifier[uploadRateLimit] operator[SEP] Keyword[int] identifier[value] operator[SEP] { identifier[sp] operator[SEP] identifier[set_int] operator[SEP] identifier[settings_pack] operator[SEP] identifier[int_types] operator[SEP] identifier[upload_rate_limit] operator[SEP] identifier[swigValue] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@XmlElementDecl(namespace = "", name = "fahrradraum") public JAXBElement<Boolean> createFahrradraum(Boolean value) { return new JAXBElement<Boolean>(_Fahrradraum_QNAME, Boolean.class, null, value); }
class class_name[name] begin[{] method[createFahrradraum, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Fahrradraum_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[Boolean] operator[>] identifier[createFahrradraum] operator[SEP] identifier[Boolean] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[Boolean] operator[>] operator[SEP] identifier[_Fahrradraum_QNAME] , identifier[Boolean] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
void doGroupEnd(String group, Object args) { checkOpen(); JsonObject message = createMessage(args) .putString("action", "endGroup") .putString("group", group); if (open && !paused) { if (log.isDebugEnabled()) { log.debug(String.format("%s - Group end: Group[group=%s, args=%s]", this, group, args)); } eventBus.send(inAddress, message); } groups.remove(group); }
class class_name[name] begin[{] method[doGroupEnd, return_type[void], modifier[default], parameter[group, args]] begin[{] call[.checkOpen, parameter[]] local_variable[type[JsonObject], message] if[binary_operation[member[.open], &&, member[.paused]]] begin[{] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[call[String.format, parameter[literal["%s - Group end: Group[group=%s, args=%s]"], THIS[], member[.group], member[.args]]]]] else begin[{] None end[}] call[eventBus.send, parameter[member[.inAddress], member[.message]]] else begin[{] None end[}] call[groups.remove, parameter[member[.group]]] end[}] END[}]
Keyword[void] identifier[doGroupEnd] operator[SEP] identifier[String] identifier[group] , identifier[Object] identifier[args] operator[SEP] { identifier[checkOpen] operator[SEP] operator[SEP] operator[SEP] identifier[JsonObject] identifier[message] operator[=] identifier[createMessage] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , identifier[group] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[open] operator[&&] operator[!] identifier[paused] operator[SEP] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] , identifier[group] , identifier[args] operator[SEP] operator[SEP] operator[SEP] } identifier[eventBus] operator[SEP] identifier[send] operator[SEP] identifier[inAddress] , identifier[message] operator[SEP] operator[SEP] } identifier[groups] operator[SEP] identifier[remove] operator[SEP] identifier[group] operator[SEP] operator[SEP] }
private void setNoValueBorder( WritableRaster pitWR, int width, int height, WritableRaster hillshadeWR ) { for( int y = 2; y < height - 2; y++ ) { for( int x = 2; x < width - 2; x++ ) { if (pitWR.getSampleDouble(x, y, 0) == -9999.0) { hillshadeWR.setSample(x, y, 0, doubleNoValue); } } } // maybe NaN instead of 0 for( int y = 0; y < height; y++ ) { hillshadeWR.setSample(0, y, 0, 0); hillshadeWR.setSample(1, y, 0, 0); hillshadeWR.setSample(width - 2, y, 0, 0); hillshadeWR.setSample(width - 1, y, 0, 0); } for( int x = 2; x < width - 2; x++ ) { hillshadeWR.setSample(x, 0, 0, 0); hillshadeWR.setSample(x, 1, 0, 0); hillshadeWR.setSample(x, height - 2, 0, 0); hillshadeWR.setSample(x, height - 1, 0, 0); } }
class class_name[name] begin[{] method[setNoValueBorder, return_type[void], modifier[private], parameter[pitWR, width, height, hillshadeWR]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getSampleDouble, postfix_operators=[], prefix_operators=[], qualifier=pitWR, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=9999.0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=doubleNoValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=hillshadeWR, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[setNoValueBorder] operator[SEP] identifier[WritableRaster] identifier[pitWR] , Keyword[int] identifier[width] , Keyword[int] identifier[height] , identifier[WritableRaster] identifier[hillshadeWR] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[2] operator[SEP] identifier[y] operator[<] identifier[height] operator[-] Other[2] operator[SEP] identifier[y] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[2] operator[SEP] identifier[x] operator[<] identifier[width] operator[-] Other[2] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[pitWR] operator[SEP] identifier[getSampleDouble] operator[SEP] identifier[x] , identifier[y] , Other[0] operator[SEP] operator[==] operator[-] literal[Float] operator[SEP] { identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] identifier[x] , identifier[y] , Other[0] , identifier[doubleNoValue] operator[SEP] operator[SEP] } } } Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[height] operator[SEP] identifier[y] operator[++] operator[SEP] { identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] Other[0] , identifier[y] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] Other[1] , identifier[y] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] identifier[width] operator[-] Other[2] , identifier[y] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] identifier[width] operator[-] Other[1] , identifier[y] , Other[0] , Other[0] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[2] operator[SEP] identifier[x] operator[<] identifier[width] operator[-] Other[2] operator[SEP] identifier[x] operator[++] operator[SEP] { identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] identifier[x] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] identifier[x] , Other[1] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] identifier[x] , identifier[height] operator[-] Other[2] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[hillshadeWR] operator[SEP] identifier[setSample] operator[SEP] identifier[x] , identifier[height] operator[-] Other[1] , Other[0] , Other[0] operator[SEP] operator[SEP] } }
public void save(File file, String comment, boolean saveDefaults) throws IOException { save(file, comment, saveDefaults, null); }
class class_name[name] begin[{] method[save, return_type[void], modifier[public], parameter[file, comment, saveDefaults]] begin[{] call[.save, parameter[member[.file], member[.comment], member[.saveDefaults], literal[null]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[save] operator[SEP] identifier[File] identifier[file] , identifier[String] identifier[comment] , Keyword[boolean] identifier[saveDefaults] operator[SEP] Keyword[throws] identifier[IOException] { identifier[save] operator[SEP] identifier[file] , identifier[comment] , identifier[saveDefaults] , Other[null] operator[SEP] operator[SEP] }
void smoothScrollTo(int x, int y, int velocity) { if (getChildCount() == 0) { // Nothing to do. setScrollingCacheEnabled(false); return; } int sx = getScrollX(); int sy = getScrollY(); int dx = x - sx; int dy = y - sy; if (dx == 0 && dy == 0) { completeScroll(false); populate(); setScrollState(SCROLL_STATE_IDLE); return; } setScrollingCacheEnabled(true); setScrollState(SCROLL_STATE_SETTLING); final int height = getClientHeight(); final int halfHeight = height / 2; final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dx) / height); final float distance = halfHeight + halfHeight * distanceInfluenceForSnapDuration(distanceRatio); int duration = 0; velocity = Math.abs(velocity); if (velocity > 0) { duration = 4 * Math.round(1000 * Math.abs(distance / velocity)); } else { final float pageHeight = height * mAdapter.getPageWidth(mCurItem); final float pageDelta = (float) Math.abs(dx) / (pageHeight + mPageMargin); duration = (int) ((pageDelta + 1) * 100); } duration = Math.min(duration, MAX_SETTLE_DURATION); mScroller.startScroll(sx, sy, dx, dy, duration); ViewCompat.postInvalidateOnAnimation(this); }
class class_name[name] begin[{] method[smoothScrollTo, return_type[void], modifier[default], parameter[x, y, velocity]] begin[{] if[binary_operation[call[.getChildCount, parameter[]], ==, literal[0]]] begin[{] call[.setScrollingCacheEnabled, parameter[literal[false]]] return[None] else begin[{] None end[}] local_variable[type[int], sx] local_variable[type[int], sy] local_variable[type[int], dx] local_variable[type[int], dy] if[binary_operation[binary_operation[member[.dx], ==, literal[0]], &&, binary_operation[member[.dy], ==, literal[0]]]] begin[{] call[.completeScroll, parameter[literal[false]]] call[.populate, parameter[]] call[.setScrollState, parameter[member[.SCROLL_STATE_IDLE]]] return[None] else begin[{] None end[}] call[.setScrollingCacheEnabled, parameter[literal[true]]] call[.setScrollState, parameter[member[.SCROLL_STATE_SETTLING]]] local_variable[type[int], height] local_variable[type[int], halfHeight] local_variable[type[float], distanceRatio] local_variable[type[float], distance] local_variable[type[int], duration] assign[member[.velocity], call[Math.abs, parameter[member[.velocity]]]] if[binary_operation[member[.velocity], >, literal[0]]] begin[{] assign[member[.duration], binary_operation[literal[4], *, call[Math.round, parameter[binary_operation[literal[1000], *, call[Math.abs, parameter[binary_operation[member[.distance], /, member[.velocity]]]]]]]]] else begin[{] local_variable[type[float], pageHeight] local_variable[type[float], pageDelta] assign[member[.duration], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pageDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), operator=*), type=BasicType(dimensions=[], name=int))] end[}] assign[member[.duration], call[Math.min, parameter[member[.duration], member[.MAX_SETTLE_DURATION]]]] call[mScroller.startScroll, parameter[member[.sx], member[.sy], member[.dx], member[.dy], member[.duration]]] call[ViewCompat.postInvalidateOnAnimation, parameter[THIS[]]] end[}] END[}]
Keyword[void] identifier[smoothScrollTo] operator[SEP] Keyword[int] identifier[x] , Keyword[int] identifier[y] , Keyword[int] identifier[velocity] operator[SEP] { Keyword[if] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[setScrollingCacheEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[int] identifier[sx] operator[=] identifier[getScrollX] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[sy] operator[=] identifier[getScrollY] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[dx] operator[=] identifier[x] operator[-] identifier[sx] operator[SEP] Keyword[int] identifier[dy] operator[=] identifier[y] operator[-] identifier[sy] operator[SEP] Keyword[if] operator[SEP] identifier[dx] operator[==] Other[0] operator[&&] identifier[dy] operator[==] Other[0] operator[SEP] { identifier[completeScroll] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[populate] operator[SEP] operator[SEP] operator[SEP] identifier[setScrollState] operator[SEP] identifier[SCROLL_STATE_IDLE] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[setScrollingCacheEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setScrollState] operator[SEP] identifier[SCROLL_STATE_SETTLING] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[height] operator[=] identifier[getClientHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[halfHeight] operator[=] identifier[height] operator[/] Other[2] operator[SEP] Keyword[final] Keyword[float] identifier[distanceRatio] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] literal[Float] , literal[Float] operator[*] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[dx] operator[SEP] operator[/] identifier[height] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[distance] operator[=] identifier[halfHeight] operator[+] identifier[halfHeight] operator[*] identifier[distanceInfluenceForSnapDuration] operator[SEP] identifier[distanceRatio] operator[SEP] operator[SEP] Keyword[int] identifier[duration] operator[=] Other[0] operator[SEP] identifier[velocity] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[velocity] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[velocity] operator[>] Other[0] operator[SEP] { identifier[duration] operator[=] Other[4] operator[*] identifier[Math] operator[SEP] identifier[round] operator[SEP] Other[1000] operator[*] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[distance] operator[/] identifier[velocity] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] Keyword[float] identifier[pageHeight] operator[=] identifier[height] operator[*] identifier[mAdapter] operator[SEP] identifier[getPageWidth] operator[SEP] identifier[mCurItem] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[pageDelta] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[dx] operator[SEP] operator[/] operator[SEP] identifier[pageHeight] operator[+] identifier[mPageMargin] operator[SEP] operator[SEP] identifier[duration] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[pageDelta] operator[+] Other[1] operator[SEP] operator[*] Other[100] operator[SEP] operator[SEP] } identifier[duration] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[duration] , identifier[MAX_SETTLE_DURATION] operator[SEP] operator[SEP] identifier[mScroller] operator[SEP] identifier[startScroll] operator[SEP] identifier[sx] , identifier[sy] , identifier[dx] , identifier[dy] , identifier[duration] operator[SEP] operator[SEP] identifier[ViewCompat] operator[SEP] identifier[postInvalidateOnAnimation] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
public @Nullable JSONArray getNumericFilters() { try { String value = get(KEY_NUMERIC_FILTERS); if (value != null) { return new JSONArray(value); } } catch (JSONException e) { // Will return null } return null; }
class class_name[name] begin[{] method[getNumericFilters, return_type[type[JSONArray]], modifier[public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=KEY_NUMERIC_FILTERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, 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=[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=JSONArray, sub_type=None)), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JSONException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] annotation[@] identifier[Nullable] identifier[JSONArray] identifier[getNumericFilters] operator[SEP] operator[SEP] { Keyword[try] { identifier[String] identifier[value] operator[=] identifier[get] operator[SEP] identifier[KEY_NUMERIC_FILTERS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[JSONArray] operator[SEP] identifier[value] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[JSONException] identifier[e] operator[SEP] { } Keyword[return] Other[null] operator[SEP] }
static boolean essentiallyEqualsTo(RedisNodeDescription o1, RedisNodeDescription o2) { if (o2 == null) { return false; } if (o1.getRole() != o2.getRole()) { return false; } if (!o1.getUri().equals(o2.getUri())) { return false; } return true; }
class class_name[name] begin[{] method[essentiallyEqualsTo, return_type[type[boolean]], modifier[static], parameter[o1, o2]] begin[{] if[binary_operation[member[.o2], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[call[o1.getRole, parameter[]], !=, call[o2.getRole, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[o1.getUri, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[essentiallyEqualsTo] operator[SEP] identifier[RedisNodeDescription] identifier[o1] , identifier[RedisNodeDescription] identifier[o2] operator[SEP] { Keyword[if] operator[SEP] identifier[o2] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[o1] operator[SEP] identifier[getRole] operator[SEP] operator[SEP] operator[!=] identifier[o2] operator[SEP] identifier[getRole] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[o1] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[o2] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private final void loadFileId(final ToolContext context) { final Integer lastDot; // Location of the extension dot final Object currentFileObj; // File's name as received String currentFile; // File's name if (context.containsKey(ConfigToolConstants.CURRENT_FILE_NAME_KEY)) { currentFileObj = context .get(ConfigToolConstants.CURRENT_FILE_NAME_KEY); if (currentFileObj == null) { setFileId(""); } else { currentFile = String.valueOf(currentFileObj); // Drops the extension lastDot = currentFile.lastIndexOf('.'); if (lastDot >= 0) { currentFile = currentFile.substring(0, lastDot); } // File name is slugged setFileId(slug(currentFile)); } } else { setFileId(""); } }
class class_name[name] begin[{] method[loadFileId, return_type[void], modifier[final private], parameter[context]] begin[{] local_variable[type[Integer], lastDot] local_variable[type[Object], currentFileObj] local_variable[type[String], currentFile] if[call[context.containsKey, parameter[member[ConfigToolConstants.CURRENT_FILE_NAME_KEY]]]] begin[{] assign[member[.currentFileObj], call[context.get, parameter[member[ConfigToolConstants.CURRENT_FILE_NAME_KEY]]]] if[binary_operation[member[.currentFileObj], ==, literal[null]]] begin[{] call[.setFileId, parameter[literal[""]]] else begin[{] assign[member[.currentFile], call[String.valueOf, parameter[member[.currentFileObj]]]] assign[member[.lastDot], call[currentFile.lastIndexOf, parameter[literal['.']]]] if[binary_operation[member[.lastDot], >=, literal[0]]] begin[{] assign[member[.currentFile], call[currentFile.substring, parameter[literal[0], member[.lastDot]]]] else begin[{] None end[}] call[.setFileId, parameter[call[.slug, parameter[member[.currentFile]]]]] end[}] else begin[{] call[.setFileId, parameter[literal[""]]] end[}] end[}] END[}]
Keyword[private] Keyword[final] Keyword[void] identifier[loadFileId] operator[SEP] Keyword[final] identifier[ToolContext] identifier[context] operator[SEP] { Keyword[final] identifier[Integer] identifier[lastDot] operator[SEP] Keyword[final] identifier[Object] identifier[currentFileObj] operator[SEP] identifier[String] identifier[currentFile] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[containsKey] operator[SEP] identifier[ConfigToolConstants] operator[SEP] identifier[CURRENT_FILE_NAME_KEY] operator[SEP] operator[SEP] { identifier[currentFileObj] operator[=] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[ConfigToolConstants] operator[SEP] identifier[CURRENT_FILE_NAME_KEY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentFileObj] operator[==] Other[null] operator[SEP] { identifier[setFileId] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[currentFile] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[currentFileObj] operator[SEP] operator[SEP] identifier[lastDot] operator[=] identifier[currentFile] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastDot] operator[>=] Other[0] operator[SEP] { identifier[currentFile] operator[=] identifier[currentFile] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastDot] operator[SEP] operator[SEP] } identifier[setFileId] operator[SEP] identifier[slug] operator[SEP] identifier[currentFile] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[setFileId] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public void recover(final Workbook wb) { Sheet sheet = wb.getSheet(this.sheetName); this.getSerialCachedCells().recover(sheet); this.getSerialFinalCommentMap().recover(sheet); this.getFormCommand().recover(sheet); if (this.getShiftMap() != null) { for (Map.Entry<String, ConfigRangeAttrs> entry : this .getShiftMap().entrySet()) { entry.getValue().recover(sheet); } } if (this.getCommandIndexMap() != null) { for (Map.Entry<String, Command> entry : this .getCommandIndexMap().entrySet()) { entry.getValue().recover(sheet); } } }
class class_name[name] begin[{] method[recover, return_type[void], modifier[public], parameter[wb]] begin[{] local_variable[type[Sheet], sheet] THIS[call[None.getSerialCachedCells, parameter[]]call[None.recover, parameter[member[.sheet]]]] THIS[call[None.getSerialFinalCommentMap, parameter[]]call[None.recover, parameter[member[.sheet]]]] THIS[call[None.getFormCommand, parameter[]]call[None.recover, parameter[member[.sheet]]]] if[binary_operation[THIS[call[None.getShiftMap, parameter[]]], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MemberReference(member=sheet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getShiftMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ConfigRangeAttrs, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] if[binary_operation[THIS[call[None.getCommandIndexMap, parameter[]]], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MemberReference(member=sheet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getCommandIndexMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Command, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[recover] operator[SEP] Keyword[final] identifier[Workbook] identifier[wb] operator[SEP] { identifier[Sheet] identifier[sheet] operator[=] identifier[wb] operator[SEP] identifier[getSheet] operator[SEP] Keyword[this] operator[SEP] identifier[sheetName] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getSerialCachedCells] operator[SEP] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[sheet] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getSerialFinalCommentMap] operator[SEP] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[sheet] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getFormCommand] operator[SEP] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[sheet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getShiftMap] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ConfigRangeAttrs] operator[>] identifier[entry] operator[:] Keyword[this] operator[SEP] identifier[getShiftMap] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[sheet] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getCommandIndexMap] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Command] operator[>] identifier[entry] operator[:] Keyword[this] operator[SEP] identifier[getCommandIndexMap] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[sheet] operator[SEP] operator[SEP] } } }
public static byte[] hash(InputStream in) throws IOException { if (HASH_DIGEST == null) { throw new EvernoteUtilException(EDAM_HASH_ALGORITHM + " not supported", new NoSuchAlgorithmException(EDAM_HASH_ALGORITHM)); } byte[] buf = new byte[1024]; int n; while ((n = in.read(buf)) != -1) { HASH_DIGEST.update(buf, 0, n); } return HASH_DIGEST.digest(); }
class class_name[name] begin[{] method[hash, return_type[type[byte]], modifier[public static], parameter[in]] begin[{] if[binary_operation[member[.HASH_DIGEST], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=EDAM_HASH_ALGORITHM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not supported"), operator=+), ClassCreator(arguments=[MemberReference(member=EDAM_HASH_ALGORITHM, 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=NoSuchAlgorithmException, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EvernoteUtilException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[byte], buf] local_variable[type[int], n] while[binary_operation[assign[member[.n], call[in.read, parameter[member[.buf]]]], !=, literal[1]]] begin[{] call[HASH_DIGEST.update, parameter[member[.buf], literal[0], member[.n]]] end[}] return[call[HASH_DIGEST.digest, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[hash] operator[SEP] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[HASH_DIGEST] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[EvernoteUtilException] operator[SEP] identifier[EDAM_HASH_ALGORITHM] operator[+] literal[String] , Keyword[new] identifier[NoSuchAlgorithmException] operator[SEP] identifier[EDAM_HASH_ALGORITHM] operator[SEP] operator[SEP] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[1024] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[n] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[HASH_DIGEST] operator[SEP] identifier[update] operator[SEP] identifier[buf] , Other[0] , identifier[n] operator[SEP] operator[SEP] } Keyword[return] identifier[HASH_DIGEST] operator[SEP] identifier[digest] operator[SEP] operator[SEP] operator[SEP] }
public void verifySamlProfileRequestIfNeeded(final RequestAbstractType profileRequest, final MetadataResolver resolver, final HttpServletRequest request, final MessageContext context) throws Exception { val roleDescriptorResolver = getRoleDescriptorResolver(resolver, context, profileRequest); LOGGER.debug("Validating signature for [{}]", profileRequest.getClass().getName()); val signature = profileRequest.getSignature(); if (signature != null) { validateSignatureOnProfileRequest(profileRequest, signature, roleDescriptorResolver); } else { validateSignatureOnAuthenticationRequest(profileRequest, request, context, roleDescriptorResolver); } }
class class_name[name] begin[{] method[verifySamlProfileRequestIfNeeded, return_type[void], modifier[public], parameter[profileRequest, resolver, request, context]] begin[{] local_variable[type[val], roleDescriptorResolver] call[LOGGER.debug, parameter[literal["Validating signature for [{}]"], call[profileRequest.getClass, parameter[]]]] local_variable[type[val], signature] if[binary_operation[member[.signature], !=, literal[null]]] begin[{] call[.validateSignatureOnProfileRequest, parameter[member[.profileRequest], member[.signature], member[.roleDescriptorResolver]]] else begin[{] call[.validateSignatureOnAuthenticationRequest, parameter[member[.profileRequest], member[.request], member[.context], member[.roleDescriptorResolver]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[verifySamlProfileRequestIfNeeded] operator[SEP] Keyword[final] identifier[RequestAbstractType] identifier[profileRequest] , Keyword[final] identifier[MetadataResolver] identifier[resolver] , Keyword[final] identifier[HttpServletRequest] identifier[request] , Keyword[final] identifier[MessageContext] identifier[context] operator[SEP] Keyword[throws] identifier[Exception] { identifier[val] identifier[roleDescriptorResolver] operator[=] identifier[getRoleDescriptorResolver] operator[SEP] identifier[resolver] , identifier[context] , identifier[profileRequest] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[profileRequest] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[signature] operator[=] identifier[profileRequest] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[signature] operator[!=] Other[null] operator[SEP] { identifier[validateSignatureOnProfileRequest] operator[SEP] identifier[profileRequest] , identifier[signature] , identifier[roleDescriptorResolver] operator[SEP] operator[SEP] } Keyword[else] { identifier[validateSignatureOnAuthenticationRequest] operator[SEP] identifier[profileRequest] , identifier[request] , identifier[context] , identifier[roleDescriptorResolver] operator[SEP] operator[SEP] } }
private String getsSupposedError(String text, int position) { int ini; boolean end = false; String word = text; // Indicates where the position of the supposed word begin for (ini = position; ini >= 0; ini--) if (Character.isWhitespace(text.charAt(ini)) || isOpenBracket(text.charAt(ini))) break; // Indicates where the supposed word should end for (int i = position + 1; i < text.length() && end == false; i++) { switch (text.charAt(i)) { // Indicates the end of the supposed error case ' ': case '!': case '?': case ',': case ';': case ')': case ']': case '}': case '”': case '\n': // The supposed e-mail is attributed in its proper variable word = word.substring(ini + 1, i); end = true; break; // Possible end of sentence or just part of the supposed error case '.': if (Character.isWhitespace(text.charAt(i + 1))) { word = word.substring(ini + 1, i); end = true; break; } // Character or digit that is part of the supposed error default: break; } } return word; }
class class_name[name] begin[{] method[getsSupposedError, return_type[type[String]], modifier[private], parameter[text, position]] begin[{] local_variable[type[int], ini] local_variable[type[boolean], end] local_variable[type[String], word] ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ini, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ini, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)], member=isOpenBracket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ini, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=[Assignment(expressionl=MemberReference(member=ini, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[MemberReference(member=ini, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='!'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='?'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=','), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='}'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='”'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=ini, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=ini, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.word]] end[}] END[}]
Keyword[private] identifier[String] identifier[getsSupposedError] operator[SEP] identifier[String] identifier[text] , Keyword[int] identifier[position] operator[SEP] { Keyword[int] identifier[ini] operator[SEP] Keyword[boolean] identifier[end] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[word] operator[=] identifier[text] operator[SEP] Keyword[for] operator[SEP] identifier[ini] operator[=] identifier[position] operator[SEP] identifier[ini] operator[>=] Other[0] operator[SEP] identifier[ini] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[ini] operator[SEP] operator[SEP] operator[||] identifier[isOpenBracket] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[ini] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[position] operator[+] Other[1] operator[SEP] identifier[i] operator[<] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[end] operator[==] literal[boolean] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[switch] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[word] operator[=] identifier[word] operator[SEP] identifier[substring] operator[SEP] identifier[ini] operator[+] Other[1] , identifier[i] operator[SEP] operator[SEP] identifier[end] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] { identifier[word] operator[=] identifier[word] operator[SEP] identifier[substring] operator[SEP] identifier[ini] operator[+] Other[1] , identifier[i] operator[SEP] operator[SEP] identifier[end] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[default] operator[:] Keyword[break] operator[SEP] } } Keyword[return] identifier[word] operator[SEP] }
public static String getDateTime(Date date, Format format) { StringBuffer buf = new StringBuffer(); buf.append(getDate(date, format)); buf.append(" "); buf.append(getTime(date, format)); return buf.toString(); }
class class_name[name] begin[{] method[getDateTime, return_type[type[String]], modifier[public static], parameter[date, format]] begin[{] local_variable[type[StringBuffer], buf] call[buf.append, parameter[call[.getDate, parameter[member[.date], member[.format]]]]] call[buf.append, parameter[literal[" "]]] call[buf.append, parameter[call[.getTime, parameter[member[.date], member[.format]]]]] return[call[buf.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getDateTime] operator[SEP] identifier[Date] identifier[date] , identifier[Format] identifier[format] operator[SEP] { identifier[StringBuffer] identifier[buf] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[getDate] operator[SEP] identifier[date] , identifier[format] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[getTime] operator[SEP] identifier[date] , identifier[format] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public String processHTTPAPIRequest( String urlString, JSONObject request, GenericUser authenticationUser, String requestType, String[] requestParameters, String... requestHedaers) throws CertificateException, IOException, JSONException { log.debug("API request: " + request.toString(4)); String jsonRequest = request.toString(); HttpURLConnection ucon = null; if("POST".equals(requestType)) { URL url = new URL(urlString); log.debug("API request: " + url); ucon = (HttpURLConnection) url.openConnection(); ucon.setRequestMethod("POST"); ucon.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); setRequestHeaders(ucon, authenticationUser, requestHedaers); for(int i = 0 ; i < requestParameters.length; i = i + 2) { ucon.setRequestProperty(getReferenceService().namespaceString(requestParameters[i]), getReferenceService().namespaceString(requestParameters[i+1])); } ucon.setUseCaches (false); ucon.setDoInput(true); ucon.setDoOutput(true); //Send request String encodedPostRequest = "json=" + URLEncoder.encode(jsonRequest, "UTF-8"); ucon.setRequestProperty("Content-Length", Integer.toString(encodedPostRequest.getBytes().length)); DataOutputStream wr = new DataOutputStream (ucon.getOutputStream ()); wr.writeBytes(encodedPostRequest); wr.flush (); wr.close (); } else if ("GET".equals(requestType)) { log.debug("API request: " + request.toString()); StringBuilder builder = new StringBuilder(); builder.append(urlString + "?json=" + URLEncoder.encode(request.toString(), "UTF-8").replaceAll("\"", "%22")); for(int i = 0 ; i < requestParameters.length; i = i + 2) { builder.append("&" + getReferenceService().namespaceString(requestParameters[i]) + "=" + getReferenceService().namespaceString(requestParameters[i+1])); } URL url = new URL(builder.toString()); log.debug("API request: " + url); ucon = (HttpURLConnection) url.openConnection(); setRequestHeaders(ucon, authenticationUser, requestHedaers); ucon.setConnectTimeout(5000); ucon.setFollowRedirects(true); ucon.setDoOutput(true); } else { throw new IllegalArgumentException("Only POST and GET API requests are supported at this stage"); } //Obtain the response StringBuilder responseBuilder = new StringBuilder(); try{ InputStream inputStream = ucon.getInputStream(); BufferedReader in = new BufferedReader(new InputStreamReader(inputStream)); String pre = null; while ((pre = in.readLine()) != null){ responseBuilder.append(pre); responseBuilder.append("\n"); } in.close(); } catch (IOException e) { //on error codes we should not fail but just capture the response code log.debug("Genarating the API call response caused: ", e); } String response = responseBuilder.toString(); log.debug("The generated API call response: " + response); getScenarioGlobals().setAttribute(LAST_SCENARIO_HTTP_RESPONSE_CODE_KEY, ucon.getResponseCode()); return response; }
class class_name[name] begin[{] method[processHTTPAPIRequest, return_type[type[String]], modifier[public], parameter[urlString, request, authenticationUser, requestType, requestParameters, requestHedaers]] begin[{] call[log.debug, parameter[binary_operation[literal["API request: "], +, call[request.toString, parameter[literal[4]]]]]] local_variable[type[String], jsonRequest] local_variable[type[HttpURLConnection], ucon] if[literal["POST"]] begin[{] local_variable[type[URL], url] call[log.debug, parameter[binary_operation[literal["API request: "], +, member[.url]]]] assign[member[.ucon], Cast(expression=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None))] call[ucon.setRequestMethod, parameter[literal["POST"]]] call[ucon.setRequestProperty, parameter[literal["Content-Type"], literal["application/x-www-form-urlencoded"]]] call[.setRequestHeaders, parameter[member[.ucon], member[.authenticationUser], member[.requestHedaers]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReferenceService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=requestParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=namespaceString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getReferenceService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=requestParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])], member=namespaceString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setRequestProperty, postfix_operators=[], prefix_operators=[], qualifier=ucon, 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=requestParameters, 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=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))]), label=None) call[ucon.setUseCaches, parameter[literal[false]]] call[ucon.setDoInput, parameter[literal[true]]] call[ucon.setDoOutput, parameter[literal[true]]] local_variable[type[String], encodedPostRequest] call[ucon.setRequestProperty, parameter[literal["Content-Length"], call[Integer.toString, parameter[call[encodedPostRequest.getBytes, parameter[]]]]]] local_variable[type[DataOutputStream], wr] call[wr.writeBytes, parameter[member[.encodedPostRequest]]] call[wr.flush, parameter[]] call[wr.close, parameter[]] else begin[{] if[literal["GET"]] begin[{] call[log.debug, parameter[binary_operation[literal["API request: "], +, call[request.toString, parameter[]]]]] local_variable[type[StringBuilder], builder] call[builder.append, parameter[binary_operation[binary_operation[member[.urlString], +, literal["?json="]], +, call[URLEncoder.encode, parameter[call[request.toString, parameter[]], literal["UTF-8"]]]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="&"), operandr=MethodInvocation(arguments=[], member=getReferenceService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=requestParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=namespaceString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="="), operator=+), operandr=MethodInvocation(arguments=[], member=getReferenceService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=requestParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])], member=namespaceString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, 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=requestParameters, 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=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))]), label=None) local_variable[type[URL], url] call[log.debug, parameter[binary_operation[literal["API request: "], +, member[.url]]]] assign[member[.ucon], Cast(expression=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None))] call[.setRequestHeaders, parameter[member[.ucon], member[.authenticationUser], member[.requestHedaers]]] call[ucon.setConnectTimeout, parameter[literal[5000]]] call[ucon.setFollowRedirects, parameter[literal[true]]] call[ucon.setDoOutput, parameter[literal[true]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only POST and GET API requests are supported at this stage")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] local_variable[type[StringBuilder], responseBuilder] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=ucon, selectors=[], type_arguments=None), name=inputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=inputStream, 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=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=pre)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pre, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=responseBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=[], prefix_operators=[], qualifier=responseBuilder, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=pre, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Genarating the API call response caused: "), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) local_variable[type[String], response] call[log.debug, parameter[binary_operation[literal["The generated API call response: "], +, member[.response]]]] call[.getScenarioGlobals, parameter[]] return[member[.response]] end[}] END[}]
Keyword[public] identifier[String] identifier[processHTTPAPIRequest] operator[SEP] identifier[String] identifier[urlString] , identifier[JSONObject] identifier[request] , identifier[GenericUser] identifier[authenticationUser] , identifier[String] identifier[requestType] , identifier[String] operator[SEP] operator[SEP] identifier[requestParameters] , identifier[String] operator[...] identifier[requestHedaers] operator[SEP] Keyword[throws] identifier[CertificateException] , identifier[IOException] , identifier[JSONException] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[request] operator[SEP] identifier[toString] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[jsonRequest] operator[=] identifier[request] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[HttpURLConnection] identifier[ucon] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[requestType] operator[SEP] operator[SEP] { identifier[URL] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[urlString] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[url] operator[SEP] operator[SEP] identifier[ucon] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setRequestMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setRequestProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[setRequestHeaders] operator[SEP] identifier[ucon] , identifier[authenticationUser] , identifier[requestHedaers] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[requestParameters] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[=] identifier[i] operator[+] Other[2] operator[SEP] { identifier[ucon] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[getReferenceService] operator[SEP] operator[SEP] operator[SEP] identifier[namespaceString] operator[SEP] identifier[requestParameters] operator[SEP] identifier[i] operator[SEP] operator[SEP] , identifier[getReferenceService] operator[SEP] operator[SEP] operator[SEP] identifier[namespaceString] operator[SEP] identifier[requestParameters] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ucon] operator[SEP] identifier[setUseCaches] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setDoInput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[encodedPostRequest] operator[=] literal[String] operator[+] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[jsonRequest] , literal[String] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setRequestProperty] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[encodedPostRequest] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[DataOutputStream] identifier[wr] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[ucon] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[wr] operator[SEP] identifier[writeBytes] operator[SEP] identifier[encodedPostRequest] operator[SEP] operator[SEP] identifier[wr] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[wr] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[requestType] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[request] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[urlString] operator[+] literal[String] operator[+] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[request] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[requestParameters] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[=] identifier[i] operator[+] Other[2] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[getReferenceService] operator[SEP] operator[SEP] operator[SEP] identifier[namespaceString] operator[SEP] identifier[requestParameters] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getReferenceService] operator[SEP] operator[SEP] operator[SEP] identifier[namespaceString] operator[SEP] identifier[requestParameters] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[URL] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[url] operator[SEP] operator[SEP] identifier[ucon] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[setRequestHeaders] operator[SEP] identifier[ucon] , identifier[authenticationUser] , identifier[requestHedaers] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setConnectTimeout] operator[SEP] Other[5000] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setFollowRedirects] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[ucon] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[responseBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[InputStream] identifier[inputStream] operator[=] identifier[ucon] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[in] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pre] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[pre] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[responseBuilder] operator[SEP] identifier[append] operator[SEP] identifier[pre] operator[SEP] operator[SEP] identifier[responseBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[String] identifier[response] operator[=] identifier[responseBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[response] operator[SEP] operator[SEP] identifier[getScenarioGlobals] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[LAST_SCENARIO_HTTP_RESPONSE_CODE_KEY] , identifier[ucon] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } }
class class_name[name] begin[{] method[lostNodeFound, return_type[void], modifier[synchronized public], parameter[address]] begin[{] call[Preconditions.checkNotNull, parameter[member[.address], literal["address should not be null"]]] call[mLostNodes.remove, parameter[member[.address]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=function, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=mChangeListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=function)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Runnable, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[lostNodeFound] operator[SEP] identifier[Address] identifier[address] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[address] , literal[String] operator[SEP] operator[SEP] identifier[mLostNodes] operator[SEP] identifier[remove] operator[SEP] identifier[address] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Runnable] identifier[function] operator[:] identifier[mChangeListeners] operator[SEP] { identifier[function] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } }
public DescribeClientVpnConnectionsResult withConnections(ClientVpnConnection... connections) { if (this.connections == null) { setConnections(new com.amazonaws.internal.SdkInternalList<ClientVpnConnection>(connections.length)); } for (ClientVpnConnection ele : connections) { this.connections.add(ele); } return this; }
class class_name[name] begin[{] method[withConnections, return_type[type[DescribeClientVpnConnectionsResult]], modifier[public], parameter[connections]] begin[{] if[binary_operation[THIS[member[None.connections]], ==, literal[null]]] begin[{] call[.setConnections, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=connections, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClientVpnConnection, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=connections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=connections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClientVpnConnection, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeClientVpnConnectionsResult] identifier[withConnections] operator[SEP] identifier[ClientVpnConnection] operator[...] identifier[connections] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[connections] operator[==] Other[null] operator[SEP] { identifier[setConnections] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ClientVpnConnection] operator[>] operator[SEP] identifier[connections] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ClientVpnConnection] identifier[ele] operator[:] identifier[connections] operator[SEP] { Keyword[this] operator[SEP] identifier[connections] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Deprecated byte[] createSignatureFor(String algorithm, byte[] secretBytes, byte[] contentBytes) throws NoSuchAlgorithmException, InvalidKeyException { final Mac mac = Mac.getInstance(algorithm); mac.init(new SecretKeySpec(secretBytes, algorithm)); return mac.doFinal(contentBytes); }
class class_name[name] begin[{] method[createSignatureFor, return_type[type[byte]], modifier[default], parameter[algorithm, secretBytes, contentBytes]] begin[{] local_variable[type[Mac], mac] call[mac.init, parameter[ClassCreator(arguments=[MemberReference(member=secretBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=algorithm, 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=SecretKeySpec, sub_type=None))]] return[call[mac.doFinal, parameter[member[.contentBytes]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[byte] operator[SEP] operator[SEP] identifier[createSignatureFor] operator[SEP] identifier[String] identifier[algorithm] , Keyword[byte] operator[SEP] operator[SEP] identifier[secretBytes] , Keyword[byte] operator[SEP] operator[SEP] identifier[contentBytes] operator[SEP] Keyword[throws] identifier[NoSuchAlgorithmException] , identifier[InvalidKeyException] { Keyword[final] identifier[Mac] identifier[mac] operator[=] identifier[Mac] operator[SEP] identifier[getInstance] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] identifier[mac] operator[SEP] identifier[init] operator[SEP] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[secretBytes] , identifier[algorithm] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[mac] operator[SEP] identifier[doFinal] operator[SEP] identifier[contentBytes] operator[SEP] operator[SEP] }
public EClass getIfcRelDecomposes() { if (ifcRelDecomposesEClass == null) { ifcRelDecomposesEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(469); } return ifcRelDecomposesEClass; }
class class_name[name] begin[{] method[getIfcRelDecomposes, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcRelDecomposesEClass], ==, literal[null]]] begin[{] assign[member[.ifcRelDecomposesEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=469)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcRelDecomposesEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcRelDecomposes] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcRelDecomposesEClass] operator[==] Other[null] operator[SEP] { identifier[ifcRelDecomposesEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[469] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcRelDecomposesEClass] operator[SEP] }
public List<Class<Object>> getItemsByScope(final Class<?> scope) { return context.getItems(Filters.enabled().and(Filters.registeredBy(scope))); }
class class_name[name] begin[{] method[getItemsByScope, return_type[type[List]], modifier[public], parameter[scope]] begin[{] return[call[context.getItems, parameter[call[Filters.enabled, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Class] operator[<] identifier[Object] operator[>] operator[>] identifier[getItemsByScope] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[scope] operator[SEP] { Keyword[return] identifier[context] operator[SEP] identifier[getItems] operator[SEP] identifier[Filters] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[Filters] operator[SEP] identifier[registeredBy] operator[SEP] identifier[scope] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static String getSimpleName(final Object object, final String valueIfNull) { return object == null ? valueIfNull : object.getClass().getSimpleName(); }
class class_name[name] begin[{] method[getSimpleName, return_type[type[String]], modifier[public static], parameter[object, valueIfNull]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=MemberReference(member=valueIfNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getSimpleName] operator[SEP] Keyword[final] identifier[Object] identifier[object] , Keyword[final] identifier[String] identifier[valueIfNull] operator[SEP] { Keyword[return] identifier[object] operator[==] Other[null] operator[?] identifier[valueIfNull] operator[:] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] }
@Override public <A extends BasicFileAttributes> A readAttributes(final Path path, final Class<A> type, final LinkOption... options) throws IOException { if (path == null) { throw new IllegalArgumentException("path must be specified"); } if (type == null) { throw new IllegalArgumentException("type must be specified"); } if (!type.isAssignableFrom(ShrinkWrapFileAttributes.class)) { throw new UnsupportedOperationException("Only supports " + ShrinkWrapFileAttributes.class.getSimpleName() + " type"); } if (!(path instanceof ShrinkWrapPath)) { throw new IllegalArgumentException("Only " + ShrinkWrapPath.class.getSimpleName() + " is supported"); } final ShrinkWrapPath swPath = (ShrinkWrapPath) path; if (!((ShrinkWrapFileSystem) swPath.getFileSystem()).getArchive().contains(path.toString())) { throw new NoSuchFileException(path.toString()); } final A attributes = type.cast(new ShrinkWrapFileAttributes((ShrinkWrapPath) path, getArchive(path))); return attributes; }
class class_name[name] begin[{] method[readAttributes, return_type[type[A]], modifier[public], parameter[path, type, options]] begin[{] if[binary_operation[member[.path], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="path must be specified")], 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[.type], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type must be specified")], 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[call[type.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShrinkWrapFileAttributes, sub_type=None))]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only supports "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ShrinkWrapFileAttributes, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" type"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.path], instanceof, type[ShrinkWrapPath]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ShrinkWrapPath, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is supported"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ShrinkWrapPath], swPath] if[Cast(expression=MethodInvocation(arguments=[], member=getFileSystem, postfix_operators=[], prefix_operators=[], qualifier=swPath, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ShrinkWrapFileSystem, sub_type=None))] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchFileException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[A], attributes] return[member[.attributes]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[A] Keyword[extends] identifier[BasicFileAttributes] operator[>] identifier[A] identifier[readAttributes] operator[SEP] Keyword[final] identifier[Path] identifier[path] , Keyword[final] identifier[Class] operator[<] identifier[A] operator[>] identifier[type] , Keyword[final] identifier[LinkOption] operator[...] identifier[options] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] 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] operator[!] identifier[type] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[ShrinkWrapFileAttributes] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[ShrinkWrapFileAttributes] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[path] Keyword[instanceof] identifier[ShrinkWrapPath] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[ShrinkWrapPath] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[ShrinkWrapPath] identifier[swPath] operator[=] operator[SEP] identifier[ShrinkWrapPath] operator[SEP] identifier[path] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[ShrinkWrapFileSystem] operator[SEP] identifier[swPath] operator[SEP] identifier[getFileSystem] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getArchive] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[NoSuchFileException] operator[SEP] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[A] identifier[attributes] operator[=] identifier[type] operator[SEP] identifier[cast] operator[SEP] Keyword[new] identifier[ShrinkWrapFileAttributes] operator[SEP] operator[SEP] identifier[ShrinkWrapPath] operator[SEP] identifier[path] , identifier[getArchive] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attributes] operator[SEP] }
@Override public Response handle() throws Exception { Object p = getRequest().getPayload().get("id"); if (JSONObject.NULL.equals(p)) { getWebDriver().getContext().setCurrentFrame(null, null, null); } else { RemoteWebElement iframe; if (p instanceof String) { iframe = getIframe((String) p); } else if (p instanceof Integer) { iframe = getIframe((Integer) p); } else if (p instanceof JSONObject) { String id = ((JSONObject) p).getString("ELEMENT"); iframe = getWebDriver().createElement(id); } else { throw new UnsupportedCommandException("not supported : frame selection by " + p.getClass()); } RemoteWebElement document = iframe.getContentDocument(); RemoteWebElement window = iframe.getContentWindow(); getWebDriver().getContext().setCurrentFrame(iframe, document, window); } Response res = new Response(); res.setSessionId(getSession().getSessionId()); res.setStatus(0); res.setValue(new JSONObject()); return res; }
class class_name[name] begin[{] method[handle, return_type[type[Response]], modifier[public], parameter[]] begin[{] local_variable[type[Object], p] if[call[JSONObject.NULL.equals, parameter[member[.p]]]] begin[{] call[.getWebDriver, parameter[]] else begin[{] local_variable[type[RemoteWebElement], iframe] if[binary_operation[member[.p], instanceof, type[String]]] begin[{] assign[member[.iframe], call[.getIframe, parameter[Cast(expression=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]] else begin[{] if[binary_operation[member[.p], instanceof, type[Integer]]] begin[{] assign[member[.iframe], call[.getIframe, parameter[Cast(expression=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]]] else begin[{] if[binary_operation[member[.p], instanceof, type[JSONObject]]] begin[{] local_variable[type[String], id] assign[member[.iframe], call[.getWebDriver, parameter[]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not supported : frame selection by "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=p, 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=UnsupportedCommandException, sub_type=None)), label=None) end[}] end[}] end[}] local_variable[type[RemoteWebElement], document] local_variable[type[RemoteWebElement], window] call[.getWebDriver, parameter[]] end[}] local_variable[type[Response], res] call[res.setSessionId, parameter[call[.getSession, parameter[]]]] call[res.setStatus, parameter[literal[0]]] call[res.setValue, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONObject, sub_type=None))]] return[member[.res]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Response] identifier[handle] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Object] identifier[p] operator[=] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[JSONObject] operator[SEP] identifier[NULL] operator[SEP] identifier[equals] operator[SEP] identifier[p] operator[SEP] operator[SEP] { identifier[getWebDriver] operator[SEP] operator[SEP] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setCurrentFrame] operator[SEP] Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[RemoteWebElement] identifier[iframe] operator[SEP] Keyword[if] operator[SEP] identifier[p] Keyword[instanceof] identifier[String] operator[SEP] { identifier[iframe] operator[=] identifier[getIframe] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[p] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[p] Keyword[instanceof] identifier[Integer] operator[SEP] { identifier[iframe] operator[=] identifier[getIframe] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[p] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[p] Keyword[instanceof] identifier[JSONObject] operator[SEP] { identifier[String] identifier[id] operator[=] operator[SEP] operator[SEP] identifier[JSONObject] operator[SEP] identifier[p] operator[SEP] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[iframe] operator[=] identifier[getWebDriver] operator[SEP] operator[SEP] operator[SEP] identifier[createElement] operator[SEP] identifier[id] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UnsupportedCommandException] operator[SEP] literal[String] operator[+] identifier[p] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[RemoteWebElement] identifier[document] operator[=] identifier[iframe] operator[SEP] identifier[getContentDocument] operator[SEP] operator[SEP] operator[SEP] identifier[RemoteWebElement] identifier[window] operator[=] identifier[iframe] operator[SEP] identifier[getContentWindow] operator[SEP] operator[SEP] operator[SEP] identifier[getWebDriver] operator[SEP] operator[SEP] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setCurrentFrame] operator[SEP] identifier[iframe] , identifier[document] , identifier[window] operator[SEP] operator[SEP] } identifier[Response] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setSessionId] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setStatus] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setValue] operator[SEP] Keyword[new] identifier[JSONObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP] }
public static INDArray sinh(INDArray in, boolean copy) { return Nd4j.getExecutioner().execAndReturn(new Sinh((copy ? in.dup() : in))); }
class class_name[name] begin[{] method[sinh, return_type[type[INDArray]], modifier[public static], parameter[in, copy]] begin[{] return[call[Nd4j.getExecutioner, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[INDArray] identifier[sinh] operator[SEP] identifier[INDArray] identifier[in] , Keyword[boolean] identifier[copy] operator[SEP] { Keyword[return] identifier[Nd4j] operator[SEP] identifier[getExecutioner] operator[SEP] operator[SEP] operator[SEP] identifier[execAndReturn] operator[SEP] Keyword[new] identifier[Sinh] operator[SEP] operator[SEP] identifier[copy] operator[?] identifier[in] operator[SEP] identifier[dup] operator[SEP] operator[SEP] operator[:] identifier[in] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static xen_trend_microvpx_image[] get(nitro_service client) throws Exception { xen_trend_microvpx_image resource = new xen_trend_microvpx_image(); resource.validate("get"); return (xen_trend_microvpx_image[]) resource.get_resources(client); }
class class_name[name] begin[{] method[get, return_type[type[xen_trend_microvpx_image]], modifier[public static], parameter[client]] begin[{] local_variable[type[xen_trend_microvpx_image], resource] call[resource.validate, parameter[literal["get"]]] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_resources, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=xen_trend_microvpx_image, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[xen_trend_microvpx_image] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] { identifier[xen_trend_microvpx_image] identifier[resource] operator[=] Keyword[new] identifier[xen_trend_microvpx_image] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[xen_trend_microvpx_image] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[get_resources] operator[SEP] identifier[client] operator[SEP] operator[SEP] }
private void setCommonParameters() { m_checkinBean.setPullBefore(m_pullFirst.getValue().booleanValue()); m_checkinBean.setPullAfter(m_pullAfterCommit.getValue().booleanValue()); m_checkinBean.setPush(m_pushAutomatically.getValue().booleanValue()); m_checkinBean.setExcludeLibs(m_excludeLib.getValue().booleanValue()); m_checkinBean.setCommit(m_addAndCommit.getValue().booleanValue()); m_checkinBean.setIgnoreUnclean(m_ignoreUnclean.getValue().booleanValue()); m_checkinBean.setCopyAndUnzip(m_copyAndUnzip.getValue().booleanValue()); m_checkinBean.setGitUserEmail(m_emailField.getValue()); m_checkinBean.setGitUserName(m_userField.getValue()); String commitMessage = m_commitMessage.getValue(); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(commitMessage)) { m_checkinBean.setCommitMessage(commitMessage); } }
class class_name[name] begin[{] method[setCommonParameters, return_type[void], modifier[private], parameter[]] begin[{] call[m_checkinBean.setPullBefore, parameter[call[m_pullFirst.getValue, parameter[]]]] call[m_checkinBean.setPullAfter, parameter[call[m_pullAfterCommit.getValue, parameter[]]]] call[m_checkinBean.setPush, parameter[call[m_pushAutomatically.getValue, parameter[]]]] call[m_checkinBean.setExcludeLibs, parameter[call[m_excludeLib.getValue, parameter[]]]] call[m_checkinBean.setCommit, parameter[call[m_addAndCommit.getValue, parameter[]]]] call[m_checkinBean.setIgnoreUnclean, parameter[call[m_ignoreUnclean.getValue, parameter[]]]] call[m_checkinBean.setCopyAndUnzip, parameter[call[m_copyAndUnzip.getValue, parameter[]]]] call[m_checkinBean.setGitUserEmail, parameter[call[m_emailField.getValue, parameter[]]]] call[m_checkinBean.setGitUserName, parameter[call[m_userField.getValue, parameter[]]]] local_variable[type[String], commitMessage] if[call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[member[.commitMessage]]]] begin[{] call[m_checkinBean.setCommitMessage, parameter[member[.commitMessage]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[setCommonParameters] operator[SEP] operator[SEP] { identifier[m_checkinBean] operator[SEP] identifier[setPullBefore] operator[SEP] identifier[m_pullFirst] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setPullAfter] operator[SEP] identifier[m_pullAfterCommit] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setPush] operator[SEP] identifier[m_pushAutomatically] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setExcludeLibs] operator[SEP] identifier[m_excludeLib] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setCommit] operator[SEP] identifier[m_addAndCommit] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setIgnoreUnclean] operator[SEP] identifier[m_ignoreUnclean] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setCopyAndUnzip] operator[SEP] identifier[m_copyAndUnzip] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setGitUserEmail] operator[SEP] identifier[m_emailField] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_checkinBean] operator[SEP] identifier[setGitUserName] operator[SEP] identifier[m_userField] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[commitMessage] operator[=] identifier[m_commitMessage] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[commitMessage] operator[SEP] operator[SEP] { identifier[m_checkinBean] operator[SEP] identifier[setCommitMessage] operator[SEP] identifier[commitMessage] operator[SEP] operator[SEP] } }
public static <T> ScopedBindingBuilder createChoice( Binder binder, String property, Key<T> interfaceKey, @Nullable Key<? extends T> defaultKey ) { ConfiggedProvider<T> provider = new ConfiggedProvider<>(interfaceKey, property, defaultKey, null); return binder.bind(interfaceKey).toProvider(provider); }
class class_name[name] begin[{] method[createChoice, return_type[type[ScopedBindingBuilder]], modifier[public static], parameter[binder, property, interfaceKey, defaultKey]] begin[{] local_variable[type[ConfiggedProvider], provider] return[call[binder.bind, parameter[member[.interfaceKey]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[ScopedBindingBuilder] identifier[createChoice] operator[SEP] identifier[Binder] identifier[binder] , identifier[String] identifier[property] , identifier[Key] operator[<] identifier[T] operator[>] identifier[interfaceKey] , annotation[@] identifier[Nullable] identifier[Key] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[defaultKey] operator[SEP] { identifier[ConfiggedProvider] operator[<] identifier[T] operator[>] identifier[provider] operator[=] Keyword[new] identifier[ConfiggedProvider] operator[<] operator[>] operator[SEP] identifier[interfaceKey] , identifier[property] , identifier[defaultKey] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[binder] operator[SEP] identifier[bind] operator[SEP] identifier[interfaceKey] operator[SEP] operator[SEP] identifier[toProvider] operator[SEP] identifier[provider] operator[SEP] operator[SEP] }
public CreateMLModelRequest withParameters(java.util.Map<String, String> parameters) { setParameters(parameters); return this; }
class class_name[name] begin[{] method[withParameters, return_type[type[CreateMLModelRequest]], modifier[public], parameter[parameters]] begin[{] call[.setParameters, parameter[member[.parameters]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[CreateMLModelRequest] identifier[withParameters] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] operator[SEP] { identifier[setParameters] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private static OrderedJSONObject setCommonOpenTypesStructureObject(OrderedJSONObject obj) { obj.put("openTypeClass", "string"); obj.put("className", "string"); obj.put("typeName", "string"); obj.put("description", "string"); return obj; }
class class_name[name] begin[{] method[setCommonOpenTypesStructureObject, return_type[type[OrderedJSONObject]], modifier[private static], parameter[obj]] begin[{] call[obj.put, parameter[literal["openTypeClass"], literal["string"]]] call[obj.put, parameter[literal["className"], literal["string"]]] call[obj.put, parameter[literal["typeName"], literal["string"]]] call[obj.put, parameter[literal["description"], literal["string"]]] return[member[.obj]] end[}] END[}]
Keyword[private] Keyword[static] identifier[OrderedJSONObject] identifier[setCommonOpenTypesStructureObject] operator[SEP] identifier[OrderedJSONObject] identifier[obj] operator[SEP] { identifier[obj] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[obj] operator[SEP] }
public void writeVisibleDataStyles(final XMLUtil util, final Appendable appendable) throws IOException { final Iterable<DataStyle> dataStyles = this.dataStylesContainer .getValues(Dest.STYLES_COMMON_STYLES); for (final DataStyle dataStyle : dataStyles) { assert !dataStyle.isHidden() : dataStyle.toString() + " - " + dataStyle.getName() + TableCellStyle.DEFAULT_CELL_STYLE.toString(); dataStyle.appendXMLContent(util, appendable); } }
class class_name[name] begin[{] method[writeVisibleDataStyles, return_type[void], modifier[public], parameter[util, appendable]] begin[{] local_variable[type[Iterable], dataStyles] ForStatement(body=BlockStatement(label=None, statements=[AssertStatement(condition=MethodInvocation(arguments=[], member=isHidden, postfix_operators=[], prefix_operators=['!'], qualifier=dataStyle, selectors=[], type_arguments=None), label=None, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=dataStyle, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=dataStyle, selectors=[], type_arguments=None), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=TableCellStyle.DEFAULT_CELL_STYLE, selectors=[], type_arguments=None), operator=+)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=util, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=appendable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendXMLContent, postfix_operators=[], prefix_operators=[], qualifier=dataStyle, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=dataStyles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dataStyle)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=DataStyle, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[writeVisibleDataStyles] operator[SEP] Keyword[final] identifier[XMLUtil] identifier[util] , Keyword[final] identifier[Appendable] identifier[appendable] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[Iterable] operator[<] identifier[DataStyle] operator[>] identifier[dataStyles] operator[=] Keyword[this] operator[SEP] identifier[dataStylesContainer] operator[SEP] identifier[getValues] operator[SEP] identifier[Dest] operator[SEP] identifier[STYLES_COMMON_STYLES] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[DataStyle] identifier[dataStyle] operator[:] identifier[dataStyles] operator[SEP] { Keyword[assert] operator[!] identifier[dataStyle] operator[SEP] identifier[isHidden] operator[SEP] operator[SEP] operator[:] identifier[dataStyle] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[dataStyle] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[TableCellStyle] operator[SEP] identifier[DEFAULT_CELL_STYLE] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[dataStyle] operator[SEP] identifier[appendXMLContent] operator[SEP] identifier[util] , identifier[appendable] operator[SEP] operator[SEP] } }
public void registerSearchReplace(Button search, Button replace) { if (getState().m_enableSearchReplace) { throw new RuntimeException("Search/replace already registered."); } search.setId(HTML_ID_PREFIX + m_componentId + "-search"); replace.setId(HTML_ID_PREFIX + m_componentId + "-replace"); getState().m_enableSearchReplace = true; markAsDirty(); }
class class_name[name] begin[{] method[registerSearchReplace, return_type[void], modifier[public], parameter[search, replace]] begin[{] if[call[.getState, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Search/replace already registered.")], 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) else begin[{] None end[}] call[search.setId, parameter[binary_operation[binary_operation[member[.HTML_ID_PREFIX], +, member[.m_componentId]], +, literal["-search"]]]] call[replace.setId, parameter[binary_operation[binary_operation[member[.HTML_ID_PREFIX], +, member[.m_componentId]], +, literal["-replace"]]]] assign[call[.getState, parameter[]], literal[true]] call[.markAsDirty, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerSearchReplace] operator[SEP] identifier[Button] identifier[search] , identifier[Button] identifier[replace] operator[SEP] { Keyword[if] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] identifier[m_enableSearchReplace] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[search] operator[SEP] identifier[setId] operator[SEP] identifier[HTML_ID_PREFIX] operator[+] identifier[m_componentId] operator[+] literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[setId] operator[SEP] identifier[HTML_ID_PREFIX] operator[+] identifier[m_componentId] operator[+] literal[String] operator[SEP] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] identifier[m_enableSearchReplace] operator[=] literal[boolean] operator[SEP] identifier[markAsDirty] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(GetCognitoEventsRequest getCognitoEventsRequest, ProtocolMarshaller protocolMarshaller) { if (getCognitoEventsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getCognitoEventsRequest.getIdentityPoolId(), IDENTITYPOOLID_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[getCognitoEventsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.getCognitoEventsRequest], ==, 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=getIdentityPoolId, postfix_operators=[], prefix_operators=[], qualifier=getCognitoEventsRequest, selectors=[], type_arguments=None), MemberReference(member=IDENTITYPOOLID_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[GetCognitoEventsRequest] identifier[getCognitoEventsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[getCognitoEventsRequest] 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[getCognitoEventsRequest] operator[SEP] identifier[getIdentityPoolId] operator[SEP] operator[SEP] , identifier[IDENTITYPOOLID_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] } }
@Override public EClass getIfcStructuralSurfaceMemberVarying() { if (ifcStructuralSurfaceMemberVaryingEClass == null) { ifcStructuralSurfaceMemberVaryingEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(663); } return ifcStructuralSurfaceMemberVaryingEClass; }
class class_name[name] begin[{] method[getIfcStructuralSurfaceMemberVarying, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcStructuralSurfaceMemberVaryingEClass], ==, literal[null]]] begin[{] assign[member[.ifcStructuralSurfaceMemberVaryingEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=663)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcStructuralSurfaceMemberVaryingEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcStructuralSurfaceMemberVarying] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcStructuralSurfaceMemberVaryingEClass] operator[==] Other[null] operator[SEP] { identifier[ifcStructuralSurfaceMemberVaryingEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[663] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcStructuralSurfaceMemberVaryingEClass] operator[SEP] }
@Override public Object createResource(ResourceInfo refInfo) throws Exception { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "createResource", refInfo); try { BootstrapContextImpl bootstrapContext = bootstrapContextRef.getServiceWithException(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "loading", adminObjectImplClassName); Class<?> adminObjectClass = bootstrapContext.loadClass(adminObjectImplClassName); ComponentMetaData cData = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData(); String currentApp = null; ResourceAdapterMetaData metadata = bootstrapContext.getResourceAdapterMetaData(); // cData is null when its not in an application thread if (cData != null && cData != metadata) { currentApp = cData.getJ2EEName().getApplication(); applications.add(cData.getJ2EEName().getApplication()); } String adapterName = bootstrapContext.getResourceAdapterName(); if (metadata != null && metadata.isEmbedded() && cData != metadata) { // Metadata is null for SIB/WMQ. No check needed if called from activationSpec String embeddedApp = metadata.getJ2EEName().getApplication(); Utils.checkAccessibility(name, adapterName, embeddedApp, currentApp, false); } Object adminObject = adminObjectClass.getConstructor().newInstance(); bootstrapContext.configure(adminObject, name, properties, null, null, null); return adminObject; } catch (Exception x) { throw x; } catch (Error x) { throw x; } finally { if (trace && tc.isEntryEnabled()) Tr.exit(this, tc, "createResource"); } }
class class_name[name] begin[{] method[createResource, return_type[type[Object]], modifier[public], parameter[refInfo]] begin[{] local_variable[type[boolean], trace] if[binary_operation[member[.trace], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[THIS[], member[.tc], literal["createResource"], member[.refInfo]]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getServiceWithException, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContextRef, selectors=[], type_arguments=None), name=bootstrapContext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BootstrapContextImpl, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="loading"), MemberReference(member=adminObjectImplClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=adminObjectImplClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContext, selectors=[], type_arguments=None), name=adminObjectClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getComponentMetaDataAccessor, postfix_operators=[], prefix_operators=[], qualifier=ComponentMetaDataAccessorImpl, selectors=[MethodInvocation(arguments=[], member=getComponentMetaData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=cData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ComponentMetaData, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=currentApp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResourceAdapterMetaData, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContext, selectors=[], type_arguments=None), name=metadata)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceAdapterMetaData, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=cData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getJ2EEName, postfix_operators=[], prefix_operators=[], qualifier=cData, selectors=[MethodInvocation(arguments=[], member=getApplication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getJ2EEName, postfix_operators=[], prefix_operators=[], qualifier=cData, selectors=[MethodInvocation(arguments=[], member=getApplication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=applications, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResourceAdapterName, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContext, selectors=[], type_arguments=None), name=adapterName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmbedded, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=cData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getJ2EEName, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[MethodInvocation(arguments=[], member=getApplication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=embeddedApp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=adapterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddedApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=checkAccessibility, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=adminObjectClass, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=adminObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=adminObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, 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=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=configure, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContext, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=adminObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['Exception'])), CatchClause(block=[ThrowStatement(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['Error']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="createResource")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[createResource] operator[SEP] identifier[ResourceInfo] identifier[refInfo] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] Keyword[boolean] identifier[trace] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[refInfo] operator[SEP] operator[SEP] Keyword[try] { identifier[BootstrapContextImpl] identifier[bootstrapContext] operator[=] identifier[bootstrapContextRef] operator[SEP] identifier[getServiceWithException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[adminObjectImplClassName] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[adminObjectClass] operator[=] identifier[bootstrapContext] operator[SEP] identifier[loadClass] operator[SEP] identifier[adminObjectImplClassName] operator[SEP] operator[SEP] identifier[ComponentMetaData] identifier[cData] operator[=] identifier[ComponentMetaDataAccessorImpl] operator[SEP] identifier[getComponentMetaDataAccessor] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[currentApp] operator[=] Other[null] operator[SEP] identifier[ResourceAdapterMetaData] identifier[metadata] operator[=] identifier[bootstrapContext] operator[SEP] identifier[getResourceAdapterMetaData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cData] operator[!=] Other[null] operator[&&] identifier[cData] operator[!=] identifier[metadata] operator[SEP] { identifier[currentApp] operator[=] identifier[cData] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] identifier[applications] operator[SEP] identifier[add] operator[SEP] identifier[cData] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[adapterName] operator[=] identifier[bootstrapContext] operator[SEP] identifier[getResourceAdapterName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[metadata] operator[!=] Other[null] operator[&&] identifier[metadata] operator[SEP] identifier[isEmbedded] operator[SEP] operator[SEP] operator[&&] identifier[cData] operator[!=] identifier[metadata] operator[SEP] { identifier[String] identifier[embeddedApp] operator[=] identifier[metadata] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[checkAccessibility] operator[SEP] identifier[name] , identifier[adapterName] , identifier[embeddedApp] , identifier[currentApp] , literal[boolean] operator[SEP] operator[SEP] } identifier[Object] identifier[adminObject] operator[=] identifier[adminObjectClass] operator[SEP] identifier[getConstructor] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[bootstrapContext] operator[SEP] identifier[configure] operator[SEP] identifier[adminObject] , identifier[name] , identifier[properties] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[adminObject] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[x] operator[SEP] { Keyword[throw] identifier[x] operator[SEP] } Keyword[catch] operator[SEP] identifier[Error] identifier[x] operator[SEP] { Keyword[throw] identifier[x] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] } }
@Override public synchronized void start(final StartContext context) throws StartException { final ModelController modelController = modelControllerSupplier.get(); final ControlledProcessStateService controlledProcessStateService = controlledProcessStateServiceSupplier.get(); socketBindingManager = socketBindingManagerSupplier != null ? socketBindingManagerSupplier.get() : null; final SecurityRealm securityRealm = securityRealmSupplier != null ? securityRealmSupplier.get() : null; final HttpAuthenticationFactory httpAuthenticationFactory = httpAuthFactorySupplier != null ? httpAuthFactorySupplier.get() : null; SSLContext sslContext = sslContextSupplier != null ? sslContextSupplier.get() : null; final SslClientAuthMode sslClientAuthMode; if (sslContext == null && securityRealm != null) { sslContext = securityRealm.getSSLContext(); sslClientAuthMode = getSslClientAuthMode(securityRealm); } else { sslClientAuthMode = null; } InetSocketAddress bindAddress = null; InetSocketAddress secureBindAddress = null; final SocketBinding basicBinding = socketBindingSupplier != null ? socketBindingSupplier.get() : null; final SocketBinding secureBinding = secureSocketBindingSupplier != null ? secureSocketBindingSupplier.get() : null; final NetworkInterfaceBinding interfaceBinding = interfaceBindingSupplier != null ? interfaceBindingSupplier.get() : null; final NetworkInterfaceBinding secureInterfaceBinding = secureInterfaceBindingSupplier != null ? secureInterfaceBindingSupplier.get() : null; if (interfaceBinding != null) { useUnmanagedBindings = true; assert this.port != null; final int port = this.port; if (port > 0) { bindAddress = new InetSocketAddress(interfaceBinding.getAddress(), port); } assert this.securePort != null; final int securePort = this.securePort; if (securePort > 0) { InetAddress secureAddress = secureInterfaceBinding == null ? interfaceBinding.getAddress() : secureInterfaceBinding.getAddress(); secureBindAddress = new InetSocketAddress(secureAddress, securePort); } } else { if (basicBinding != null) { bindAddress = basicBinding.getSocketAddress(); } if (secureBinding != null) { secureBindAddress = secureBinding.getSocketAddress(); } } List<ListenerRegistry.Listener> listeners = new ArrayList<>(); //TODO: rethink this whole ListenerRegistry business if(bindAddress != null) { ListenerRegistry.Listener http = new ListenerRegistry.Listener("http", HTTP_MANAGEMENT, SERVER_NAME, bindAddress); http.setContextInformation("socket-binding", basicBinding); listeners.add(http); } if(secureBindAddress != null) { ListenerRegistry.Listener https = new ListenerRegistry.Listener("https", HTTPS_MANAGEMENT, SERVER_NAME, bindAddress); https.setContextInformation("socket-binding", secureBinding); listeners.add(https); } final ChannelUpgradeHandler upgradeHandler = new ChannelUpgradeHandler(); final ServiceBuilder<?> builder = context.getChildTarget().addService(HTTP_UPGRADE_SERVICE_NAME); final Consumer<Object> upgradeHandlerConsumer = builder.provides(HTTP_UPGRADE_SERVICE_NAME, HTTPS_UPGRADE_SERVICE_NAME); builder.setInstance(org.jboss.msc.Service.newInstance(upgradeHandlerConsumer, upgradeHandler)); builder.install(); for (ListenerRegistry.Listener listener : listeners) { listener.addHttpUpgradeMetadata(new ListenerRegistry.HttpUpgradeMetadata(JBOSS_REMOTING, MANAGEMENT_ENDPOINT)); } if (listenerRegistrySupplier.get() != null) { for(ListenerRegistry.Listener listener : listeners) { listenerRegistrySupplier.get().addListener(listener); } } try { serverManagement = ManagementHttpServer.builder() .setBindAddress(bindAddress) .setSecureBindAddress(secureBindAddress) .setModelController(modelController) .setSecurityRealm(securityRealm) .setSSLContext(sslContext) .setSSLClientAuthMode(sslClientAuthMode) .setHttpAuthenticationFactory(httpAuthenticationFactory) .setControlledProcessStateService(controlledProcessStateService) .setConsoleMode(consoleMode) .setConsoleSlot(consoleSlot) .setChannelUpgradeHandler(upgradeHandler) .setManagementHttpRequestProcessor(requestProcessorSupplier.get()) .setAllowedOrigins(allowedOrigins) .setWorker(workerSupplier.get()) .setExecutor(executorSupplier.get()) .build(); serverManagement.start(); // Register the now-created sockets with the SBM if (socketBindingManager != null) { if (useUnmanagedBindings) { SocketBindingManager.UnnamedBindingRegistry registry = socketBindingManager.getUnnamedRegistry(); if (bindAddress != null) { final InetSocketAddress boundAddress = serverManagement.getLocalAddress(InetSocketAddress.class); basicManagedBinding = ManagedBinding.Factory.createSimpleManagedBinding("management-http", boundAddress, null); registry.registerBinding(basicManagedBinding); } if (secureBindAddress != null) { final InetSocketAddress boundAddress = serverManagement.getSecureLocalAddress(InetSocketAddress.class); secureManagedBinding = ManagedBinding.Factory.createSimpleManagedBinding("management-https", boundAddress, null); registry.registerBinding(secureManagedBinding); } } else { SocketBindingManager.NamedManagedBindingRegistry registry = socketBindingManager.getNamedRegistry(); if (basicBinding != null) { final InetSocketAddress boundAddress = serverManagement.getLocalAddress(InetSocketAddress.class); basicManagedBinding = ManagedBinding.Factory.createSimpleManagedBinding(basicBinding.getName(), boundAddress, null); registry.registerBinding(basicManagedBinding); } if (secureBinding != null) { final InetSocketAddress boundAddress = serverManagement.getSecureLocalAddress(InetSocketAddress.class); secureManagedBinding = ManagedBinding.Factory.createSimpleManagedBinding(secureBinding.getName(), boundAddress, null); registry.registerBinding(secureManagedBinding); } } } } catch (Exception e) { Throwable cause = e.getCause(); if (e instanceof BindException || cause instanceof BindException) { final StringBuilder sb = new StringBuilder().append(e.getLocalizedMessage()); if (bindAddress != null) sb.append(" ").append(bindAddress); if (secureBindAddress != null) sb.append(" ").append(secureBindAddress); throw new StartException(sb.toString()); } else { throw ServerLogger.ROOT_LOGGER.failedToStartHttpManagementService(e); } } httpManagementConsumer.accept(httpManagement); }
class class_name[name] begin[{] method[start, return_type[void], modifier[synchronized public], parameter[context]] begin[{] local_variable[type[ModelController], modelController] local_variable[type[ControlledProcessStateService], controlledProcessStateService] assign[member[.socketBindingManager], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=socketBindingManagerSupplier, 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=null), if_true=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=socketBindingManagerSupplier, selectors=[], type_arguments=None))] local_variable[type[SecurityRealm], securityRealm] local_variable[type[HttpAuthenticationFactory], httpAuthenticationFactory] local_variable[type[SSLContext], sslContext] local_variable[type[SslClientAuthMode], sslClientAuthMode] if[binary_operation[binary_operation[member[.sslContext], ==, literal[null]], &&, binary_operation[member[.securityRealm], !=, literal[null]]]] begin[{] assign[member[.sslContext], call[securityRealm.getSSLContext, parameter[]]] assign[member[.sslClientAuthMode], call[.getSslClientAuthMode, parameter[member[.securityRealm]]]] else begin[{] assign[member[.sslClientAuthMode], literal[null]] end[}] local_variable[type[InetSocketAddress], bindAddress] local_variable[type[InetSocketAddress], secureBindAddress] local_variable[type[SocketBinding], basicBinding] local_variable[type[SocketBinding], secureBinding] local_variable[type[NetworkInterfaceBinding], interfaceBinding] local_variable[type[NetworkInterfaceBinding], secureInterfaceBinding] if[binary_operation[member[.interfaceBinding], !=, literal[null]]] begin[{] assign[member[.useUnmanagedBindings], literal[true]] AssertStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=port, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) local_variable[type[int], port] if[binary_operation[member[.port], >, literal[0]]] begin[{] assign[member[.bindAddress], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAddress, postfix_operators=[], prefix_operators=[], qualifier=interfaceBinding, selectors=[], type_arguments=None), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))] else begin[{] None end[}] AssertStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=securePort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) local_variable[type[int], securePort] if[binary_operation[member[.securePort], >, literal[0]]] begin[{] local_variable[type[InetAddress], secureAddress] assign[member[.secureBindAddress], ClassCreator(arguments=[MemberReference(member=secureAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=securePort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))] else begin[{] None end[}] else begin[{] if[binary_operation[member[.basicBinding], !=, literal[null]]] begin[{] assign[member[.bindAddress], call[basicBinding.getSocketAddress, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.secureBinding], !=, literal[null]]] begin[{] assign[member[.secureBindAddress], call[secureBinding.getSocketAddress, parameter[]]] else begin[{] None end[}] end[}] local_variable[type[List], listeners] if[binary_operation[member[.bindAddress], !=, literal[null]]] begin[{] local_variable[type[ListenerRegistry], http] call[http.setContextInformation, parameter[literal["socket-binding"], member[.basicBinding]]] call[listeners.add, parameter[member[.http]]] else begin[{] None end[}] if[binary_operation[member[.secureBindAddress], !=, literal[null]]] begin[{] local_variable[type[ListenerRegistry], https] call[https.setContextInformation, parameter[literal["socket-binding"], member[.secureBinding]]] call[listeners.add, parameter[member[.https]]] else begin[{] None end[}] local_variable[type[ChannelUpgradeHandler], upgradeHandler] local_variable[type[ServiceBuilder], builder] local_variable[type[Consumer], upgradeHandlerConsumer] call[builder.setInstance, parameter[call[org.jboss.msc.Service.newInstance, parameter[member[.upgradeHandlerConsumer], member[.upgradeHandler]]]]] call[builder.install, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=JBOSS_REMOTING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MANAGEMENT_ENDPOINT, 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=ListenerRegistry, sub_type=ReferenceType(arguments=None, dimensions=None, name=HttpUpgradeMetadata, sub_type=None)))], member=addHttpUpgradeMetadata, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=listeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ListenerRegistry, sub_type=ReferenceType(arguments=None, dimensions=None, name=Listener, sub_type=None)))), label=None) if[binary_operation[call[listenerRegistrySupplier.get, parameter[]], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=listenerRegistrySupplier, selectors=[MethodInvocation(arguments=[MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=listeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ListenerRegistry, sub_type=ReferenceType(arguments=None, dimensions=None, name=Listener, sub_type=None)))), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=serverManagement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=builder, postfix_operators=[], prefix_operators=[], qualifier=ManagementHttpServer, selectors=[MethodInvocation(arguments=[MemberReference(member=bindAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setBindAddress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=secureBindAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSecureBindAddress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=modelController, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setModelController, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=securityRealm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSecurityRealm, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=sslContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSSLContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=sslClientAuthMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSSLClientAuthMode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=httpAuthenticationFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHttpAuthenticationFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=controlledProcessStateService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setControlledProcessStateService, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=consoleMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConsoleMode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=consoleSlot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConsoleSlot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=upgradeHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setChannelUpgradeHandler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=requestProcessorSupplier, selectors=[], type_arguments=None)], member=setManagementHttpRequestProcessor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=allowedOrigins, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAllowedOrigins, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=workerSupplier, selectors=[], type_arguments=None)], member=setWorker, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=executorSupplier, selectors=[], type_arguments=None)], member=setExecutor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=serverManagement, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=socketBindingManager, 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=MemberReference(member=useUnmanagedBindings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNamedRegistry, postfix_operators=[], prefix_operators=[], qualifier=socketBindingManager, selectors=[], type_arguments=None), name=registry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SocketBindingManager, sub_type=ReferenceType(arguments=None, dimensions=None, name=NamedManagedBindingRegistry, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=basicBinding, 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=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))], member=getLocalAddress, postfix_operators=[], prefix_operators=[], qualifier=serverManagement, selectors=[], type_arguments=None), name=boundAddress)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=basicManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=basicBinding, selectors=[], type_arguments=None), MemberReference(member=boundAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createSimpleManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=ManagedBinding.Factory, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=basicManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerBinding, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=secureBinding, 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=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))], member=getSecureLocalAddress, postfix_operators=[], prefix_operators=[], qualifier=serverManagement, selectors=[], type_arguments=None), name=boundAddress)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=secureManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=secureBinding, selectors=[], type_arguments=None), MemberReference(member=boundAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createSimpleManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=ManagedBinding.Factory, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=secureManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerBinding, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUnnamedRegistry, postfix_operators=[], prefix_operators=[], qualifier=socketBindingManager, selectors=[], type_arguments=None), name=registry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SocketBindingManager, sub_type=ReferenceType(arguments=None, dimensions=None, name=UnnamedBindingRegistry, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bindAddress, 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=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))], member=getLocalAddress, postfix_operators=[], prefix_operators=[], qualifier=serverManagement, selectors=[], type_arguments=None), name=boundAddress)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=basicManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="management-http"), MemberReference(member=boundAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createSimpleManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=ManagedBinding.Factory, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=basicManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerBinding, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=secureBindAddress, 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=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetSocketAddress, sub_type=None))], member=getSecureLocalAddress, postfix_operators=[], prefix_operators=[], qualifier=serverManagement, selectors=[], type_arguments=None), name=boundAddress)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=secureManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="management-https"), MemberReference(member=boundAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createSimpleManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=ManagedBinding.Factory, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=secureManagedBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerBinding, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None), label=None)]))]))]))], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=cause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BindException, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BindException, sub_type=None), operator=instanceof), operator=||), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=failedToStartHttpManagementService, postfix_operators=[], prefix_operators=[], qualifier=ServerLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bindAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=bindAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=secureBindAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=secureBindAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StartException, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[httpManagementConsumer.accept, parameter[member[.httpManagement]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[start] operator[SEP] Keyword[final] identifier[StartContext] identifier[context] operator[SEP] Keyword[throws] identifier[StartException] { Keyword[final] identifier[ModelController] identifier[modelController] operator[=] identifier[modelControllerSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ControlledProcessStateService] identifier[controlledProcessStateService] operator[=] identifier[controlledProcessStateServiceSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[socketBindingManager] operator[=] identifier[socketBindingManagerSupplier] operator[!=] Other[null] operator[?] identifier[socketBindingManagerSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[SecurityRealm] identifier[securityRealm] operator[=] identifier[securityRealmSupplier] operator[!=] Other[null] operator[?] identifier[securityRealmSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[HttpAuthenticationFactory] identifier[httpAuthenticationFactory] operator[=] identifier[httpAuthFactorySupplier] operator[!=] Other[null] operator[?] identifier[httpAuthFactorySupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] identifier[SSLContext] identifier[sslContext] operator[=] identifier[sslContextSupplier] operator[!=] Other[null] operator[?] identifier[sslContextSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[SslClientAuthMode] identifier[sslClientAuthMode] operator[SEP] Keyword[if] operator[SEP] identifier[sslContext] operator[==] Other[null] operator[&&] identifier[securityRealm] operator[!=] Other[null] operator[SEP] { identifier[sslContext] operator[=] identifier[securityRealm] operator[SEP] identifier[getSSLContext] operator[SEP] operator[SEP] operator[SEP] identifier[sslClientAuthMode] operator[=] identifier[getSslClientAuthMode] operator[SEP] identifier[securityRealm] operator[SEP] operator[SEP] } Keyword[else] { identifier[sslClientAuthMode] operator[=] Other[null] operator[SEP] } identifier[InetSocketAddress] identifier[bindAddress] operator[=] Other[null] operator[SEP] identifier[InetSocketAddress] identifier[secureBindAddress] operator[=] Other[null] operator[SEP] Keyword[final] identifier[SocketBinding] identifier[basicBinding] operator[=] identifier[socketBindingSupplier] operator[!=] Other[null] operator[?] identifier[socketBindingSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[SocketBinding] identifier[secureBinding] operator[=] identifier[secureSocketBindingSupplier] operator[!=] Other[null] operator[?] identifier[secureSocketBindingSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[NetworkInterfaceBinding] identifier[interfaceBinding] operator[=] identifier[interfaceBindingSupplier] operator[!=] Other[null] operator[?] identifier[interfaceBindingSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[NetworkInterfaceBinding] identifier[secureInterfaceBinding] operator[=] identifier[secureInterfaceBindingSupplier] operator[!=] Other[null] operator[?] identifier[secureInterfaceBindingSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[interfaceBinding] operator[!=] Other[null] operator[SEP] { identifier[useUnmanagedBindings] operator[=] literal[boolean] operator[SEP] Keyword[assert] Keyword[this] operator[SEP] identifier[port] operator[!=] Other[null] operator[SEP] Keyword[final] Keyword[int] identifier[port] operator[=] Keyword[this] operator[SEP] identifier[port] operator[SEP] Keyword[if] operator[SEP] identifier[port] operator[>] Other[0] operator[SEP] { identifier[bindAddress] operator[=] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[interfaceBinding] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] , identifier[port] operator[SEP] operator[SEP] } Keyword[assert] Keyword[this] operator[SEP] identifier[securePort] operator[!=] Other[null] operator[SEP] Keyword[final] Keyword[int] identifier[securePort] operator[=] Keyword[this] operator[SEP] identifier[securePort] operator[SEP] Keyword[if] operator[SEP] identifier[securePort] operator[>] Other[0] operator[SEP] { identifier[InetAddress] identifier[secureAddress] operator[=] identifier[secureInterfaceBinding] operator[==] Other[null] operator[?] identifier[interfaceBinding] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[:] identifier[secureInterfaceBinding] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] identifier[secureBindAddress] operator[=] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[secureAddress] , identifier[securePort] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[basicBinding] operator[!=] Other[null] operator[SEP] { identifier[bindAddress] operator[=] identifier[basicBinding] operator[SEP] identifier[getSocketAddress] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[secureBinding] operator[!=] Other[null] operator[SEP] { identifier[secureBindAddress] operator[=] identifier[secureBinding] operator[SEP] identifier[getSocketAddress] operator[SEP] operator[SEP] operator[SEP] } } identifier[List] operator[<] identifier[ListenerRegistry] operator[SEP] identifier[Listener] operator[>] identifier[listeners] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bindAddress] operator[!=] Other[null] operator[SEP] { identifier[ListenerRegistry] operator[SEP] identifier[Listener] identifier[http] operator[=] Keyword[new] identifier[ListenerRegistry] operator[SEP] identifier[Listener] operator[SEP] literal[String] , identifier[HTTP_MANAGEMENT] , identifier[SERVER_NAME] , identifier[bindAddress] operator[SEP] operator[SEP] identifier[http] operator[SEP] identifier[setContextInformation] operator[SEP] literal[String] , identifier[basicBinding] operator[SEP] operator[SEP] identifier[listeners] operator[SEP] identifier[add] operator[SEP] identifier[http] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[secureBindAddress] operator[!=] Other[null] operator[SEP] { identifier[ListenerRegistry] operator[SEP] identifier[Listener] identifier[https] operator[=] Keyword[new] identifier[ListenerRegistry] operator[SEP] identifier[Listener] operator[SEP] literal[String] , identifier[HTTPS_MANAGEMENT] , identifier[SERVER_NAME] , identifier[bindAddress] operator[SEP] operator[SEP] identifier[https] operator[SEP] identifier[setContextInformation] operator[SEP] literal[String] , identifier[secureBinding] operator[SEP] operator[SEP] identifier[listeners] operator[SEP] identifier[add] operator[SEP] identifier[https] operator[SEP] operator[SEP] } Keyword[final] identifier[ChannelUpgradeHandler] identifier[upgradeHandler] operator[=] Keyword[new] identifier[ChannelUpgradeHandler] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ServiceBuilder] operator[<] operator[?] operator[>] identifier[builder] operator[=] identifier[context] operator[SEP] identifier[getChildTarget] operator[SEP] operator[SEP] operator[SEP] identifier[addService] operator[SEP] identifier[HTTP_UPGRADE_SERVICE_NAME] operator[SEP] operator[SEP] Keyword[final] identifier[Consumer] operator[<] identifier[Object] operator[>] identifier[upgradeHandlerConsumer] operator[=] identifier[builder] operator[SEP] identifier[provides] operator[SEP] identifier[HTTP_UPGRADE_SERVICE_NAME] , identifier[HTTPS_UPGRADE_SERVICE_NAME] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[setInstance] operator[SEP] identifier[org] operator[SEP] identifier[jboss] operator[SEP] identifier[msc] operator[SEP] identifier[Service] operator[SEP] identifier[newInstance] operator[SEP] identifier[upgradeHandlerConsumer] , identifier[upgradeHandler] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[install] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ListenerRegistry] operator[SEP] identifier[Listener] identifier[listener] operator[:] identifier[listeners] operator[SEP] { identifier[listener] operator[SEP] identifier[addHttpUpgradeMetadata] operator[SEP] Keyword[new] identifier[ListenerRegistry] operator[SEP] identifier[HttpUpgradeMetadata] operator[SEP] identifier[JBOSS_REMOTING] , identifier[MANAGEMENT_ENDPOINT] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[listenerRegistrySupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[ListenerRegistry] operator[SEP] identifier[Listener] identifier[listener] operator[:] identifier[listeners] operator[SEP] { identifier[listenerRegistrySupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[listener] operator[SEP] operator[SEP] } } Keyword[try] { identifier[serverManagement] operator[=] identifier[ManagementHttpServer] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[setBindAddress] operator[SEP] identifier[bindAddress] operator[SEP] operator[SEP] identifier[setSecureBindAddress] operator[SEP] identifier[secureBindAddress] operator[SEP] operator[SEP] identifier[setModelController] operator[SEP] identifier[modelController] operator[SEP] operator[SEP] identifier[setSecurityRealm] operator[SEP] identifier[securityRealm] operator[SEP] operator[SEP] identifier[setSSLContext] operator[SEP] identifier[sslContext] operator[SEP] operator[SEP] identifier[setSSLClientAuthMode] operator[SEP] identifier[sslClientAuthMode] operator[SEP] operator[SEP] identifier[setHttpAuthenticationFactory] operator[SEP] identifier[httpAuthenticationFactory] operator[SEP] operator[SEP] identifier[setControlledProcessStateService] operator[SEP] identifier[controlledProcessStateService] operator[SEP] operator[SEP] identifier[setConsoleMode] operator[SEP] identifier[consoleMode] operator[SEP] operator[SEP] identifier[setConsoleSlot] operator[SEP] identifier[consoleSlot] operator[SEP] operator[SEP] identifier[setChannelUpgradeHandler] operator[SEP] identifier[upgradeHandler] operator[SEP] operator[SEP] identifier[setManagementHttpRequestProcessor] operator[SEP] identifier[requestProcessorSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAllowedOrigins] operator[SEP] identifier[allowedOrigins] operator[SEP] operator[SEP] identifier[setWorker] operator[SEP] identifier[workerSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setExecutor] operator[SEP] identifier[executorSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[serverManagement] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[socketBindingManager] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[useUnmanagedBindings] operator[SEP] { identifier[SocketBindingManager] operator[SEP] identifier[UnnamedBindingRegistry] identifier[registry] operator[=] identifier[socketBindingManager] operator[SEP] identifier[getUnnamedRegistry] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bindAddress] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[InetSocketAddress] identifier[boundAddress] operator[=] identifier[serverManagement] operator[SEP] identifier[getLocalAddress] operator[SEP] identifier[InetSocketAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[basicManagedBinding] operator[=] identifier[ManagedBinding] operator[SEP] identifier[Factory] operator[SEP] identifier[createSimpleManagedBinding] operator[SEP] literal[String] , identifier[boundAddress] , Other[null] operator[SEP] operator[SEP] identifier[registry] operator[SEP] identifier[registerBinding] operator[SEP] identifier[basicManagedBinding] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[secureBindAddress] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[InetSocketAddress] identifier[boundAddress] operator[=] identifier[serverManagement] operator[SEP] identifier[getSecureLocalAddress] operator[SEP] identifier[InetSocketAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[secureManagedBinding] operator[=] identifier[ManagedBinding] operator[SEP] identifier[Factory] operator[SEP] identifier[createSimpleManagedBinding] operator[SEP] literal[String] , identifier[boundAddress] , Other[null] operator[SEP] operator[SEP] identifier[registry] operator[SEP] identifier[registerBinding] operator[SEP] identifier[secureManagedBinding] operator[SEP] operator[SEP] } } Keyword[else] { identifier[SocketBindingManager] operator[SEP] identifier[NamedManagedBindingRegistry] identifier[registry] operator[=] identifier[socketBindingManager] operator[SEP] identifier[getNamedRegistry] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[basicBinding] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[InetSocketAddress] identifier[boundAddress] operator[=] identifier[serverManagement] operator[SEP] identifier[getLocalAddress] operator[SEP] identifier[InetSocketAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[basicManagedBinding] operator[=] identifier[ManagedBinding] operator[SEP] identifier[Factory] operator[SEP] identifier[createSimpleManagedBinding] operator[SEP] identifier[basicBinding] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[boundAddress] , Other[null] operator[SEP] operator[SEP] identifier[registry] operator[SEP] identifier[registerBinding] operator[SEP] identifier[basicManagedBinding] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[secureBinding] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[InetSocketAddress] identifier[boundAddress] operator[=] identifier[serverManagement] operator[SEP] identifier[getSecureLocalAddress] operator[SEP] identifier[InetSocketAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[secureManagedBinding] operator[=] identifier[ManagedBinding] operator[SEP] identifier[Factory] operator[SEP] identifier[createSimpleManagedBinding] operator[SEP] identifier[secureBinding] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[boundAddress] , Other[null] operator[SEP] operator[SEP] identifier[registry] operator[SEP] identifier[registerBinding] operator[SEP] identifier[secureManagedBinding] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[Throwable] identifier[cause] operator[=] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[BindException] operator[||] identifier[cause] Keyword[instanceof] identifier[BindException] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bindAddress] operator[!=] Other[null] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[bindAddress] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[secureBindAddress] operator[!=] Other[null] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[secureBindAddress] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[StartException] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] identifier[ServerLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[failedToStartHttpManagementService] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } identifier[httpManagementConsumer] operator[SEP] identifier[accept] operator[SEP] identifier[httpManagement] operator[SEP] operator[SEP] }
public static DTree getDTreeFromCoNLLXString(final String input) { if (input == null || input.trim().isEmpty()) { return null; } Map<Integer, Map<Integer, String>> semanticHeadsMap = new HashMap<>(); String[] dNodesString = input.split(System.lineSeparator()); DTree tree = new DTree(); Arrays.stream(dNodesString) .map(s -> s.split("\t")) .forEachOrdered(fields -> { int currentIndex = 0; int id = Integer.parseInt(fields[currentIndex++]); String form = fields[currentIndex++]; String lemma = fields[currentIndex++]; String cPOSTag = fields[currentIndex++]; String pos = fields[currentIndex++]; String feats = fields[currentIndex++]; Map<String, String> featsMap = null; if (!feats.equals("_")) { featsMap = Arrays.stream(feats.split("\\|")) .map(entry -> entry.split("=")) .collect(Collectors.toMap(e -> e[0], e -> e.length > 1 ? e[1] : StringUtils.EMPTY)); } else { featsMap = new HashMap<>(); } String headIndex = fields[currentIndex++]; String depLabel = fields[currentIndex++]; String dump1 = fields[currentIndex++]; String dump2 = fields[currentIndex++]; String semanticHeadsString = currentIndex >= fields.length ? "_" : fields[currentIndex]; if (!semanticHeadsString.equals("_")) { Map<Integer, String> semanticHeads = Arrays.stream(semanticHeadsString.split("\\|")) .map(entry -> entry.split(":")) .collect(Collectors.toMap(e -> Integer.parseInt(e[0]), e -> (e.length > 1) ? e[1] : StringUtils.EMPTY)); semanticHeadsMap.put(id, semanticHeads); } DNode node = id == 0 ? tree.getPaddingNode() : new DNode(id, form, lemma, cPOSTag, pos, depLabel); if (id == 0 && !featsMap.containsKey("uuid")) { featsMap.put("uuid", tree.getUUID().toString()); } node.setFeats(featsMap); node.addFeature("head", headIndex); // by the time head might not be generated! if (node.getId() == 0) { tree.getPaddingNode().setFeats(node.getFeats());// Substitute padding with actual 0 node from CoNLLX } else { tree.add(node); } }); tree.getPaddingNode().getFeats().remove("head"); for (int i = 1; i < tree.size(); i++) { DNode node = tree.get(i); int headIndex = Integer.parseInt(node.getFeature("head")); DNode head = tree.get(headIndex); head.addChild(node); node.getFeats().remove("head"); node.setHead(head); } // Recover semantic heads. semanticHeadsMap.entrySet().parallelStream().map(e -> { DNode node = tree.get(e.getKey()); Map<Integer, String> nodeSemanticInfo = e.getValue(); for (Integer id : nodeSemanticInfo.keySet()) { node.addSemanticHead(tree.get(id), nodeSemanticInfo.get(id)); tree.get(id).getSemanticChildren().add(node); } return null; }).collect(Collectors.toList()); return tree; }
class class_name[name] begin[{] method[getDTreeFromCoNLLXString, return_type[type[DTree]], modifier[public static], parameter[input]] begin[{] if[binary_operation[binary_operation[member[.input], ==, literal[null]], ||, call[input.trim, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Map], semanticHeadsMap] local_variable[type[String], dNodesString] local_variable[type[DTree], tree] call[Arrays.stream, parameter[member[.dNodesString]]] call[tree.getPaddingNode, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="head")], member=getFeature, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=headIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=headIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), name=head)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=head, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getFeats, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="head")], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=head, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHead, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=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=tree, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[semanticHeadsMap.entrySet, parameter[]] return[member[.tree]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DTree] identifier[getDTreeFromCoNLLXString] operator[SEP] Keyword[final] identifier[String] identifier[input] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[||] identifier[input] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Map] operator[<] identifier[Integer] , identifier[Map] operator[<] identifier[Integer] , identifier[String] operator[>] operator[>] identifier[semanticHeadsMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[dNodesString] operator[=] identifier[input] operator[SEP] identifier[split] operator[SEP] identifier[System] operator[SEP] identifier[lineSeparator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DTree] identifier[tree] operator[=] Keyword[new] identifier[DTree] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[dNodesString] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[s] operator[->] identifier[s] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[forEachOrdered] operator[SEP] identifier[fields] operator[->] { Keyword[int] identifier[currentIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[id] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[form] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[lemma] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[cPOSTag] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[pos] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[feats] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[featsMap] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[feats] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[featsMap] operator[=] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[feats] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[entry] operator[->] identifier[entry] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toMap] operator[SEP] identifier[e] operator[->] identifier[e] operator[SEP] Other[0] operator[SEP] , identifier[e] operator[->] identifier[e] operator[SEP] identifier[length] operator[>] Other[1] operator[?] identifier[e] operator[SEP] Other[1] operator[SEP] operator[:] identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[featsMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[headIndex] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[depLabel] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[dump1] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[dump2] operator[=] identifier[fields] operator[SEP] identifier[currentIndex] operator[++] operator[SEP] operator[SEP] identifier[String] identifier[semanticHeadsString] operator[=] identifier[currentIndex] operator[>=] identifier[fields] operator[SEP] identifier[length] operator[?] literal[String] operator[:] identifier[fields] operator[SEP] identifier[currentIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[semanticHeadsString] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[Integer] , identifier[String] operator[>] identifier[semanticHeads] operator[=] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[semanticHeadsString] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[entry] operator[->] identifier[entry] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toMap] operator[SEP] identifier[e] operator[->] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[e] operator[SEP] Other[0] operator[SEP] operator[SEP] , identifier[e] operator[->] operator[SEP] identifier[e] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] operator[?] identifier[e] operator[SEP] Other[1] operator[SEP] operator[:] identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] operator[SEP] identifier[semanticHeadsMap] operator[SEP] identifier[put] operator[SEP] identifier[id] , identifier[semanticHeads] operator[SEP] operator[SEP] } identifier[DNode] identifier[node] operator[=] identifier[id] operator[==] Other[0] operator[?] identifier[tree] operator[SEP] identifier[getPaddingNode] operator[SEP] operator[SEP] operator[:] Keyword[new] identifier[DNode] operator[SEP] identifier[id] , identifier[form] , identifier[lemma] , identifier[cPOSTag] , identifier[pos] , identifier[depLabel] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[==] Other[0] operator[&&] operator[!] identifier[featsMap] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[featsMap] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[tree] operator[SEP] identifier[getUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[node] operator[SEP] identifier[setFeats] operator[SEP] identifier[featsMap] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[addFeature] operator[SEP] literal[String] , identifier[headIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[tree] operator[SEP] identifier[getPaddingNode] operator[SEP] operator[SEP] operator[SEP] identifier[setFeats] operator[SEP] identifier[node] operator[SEP] identifier[getFeats] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[tree] operator[SEP] identifier[add] operator[SEP] identifier[node] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[tree] operator[SEP] identifier[getPaddingNode] operator[SEP] operator[SEP] operator[SEP] identifier[getFeats] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[tree] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[DNode] identifier[node] operator[=] identifier[tree] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[headIndex] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[node] operator[SEP] identifier[getFeature] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[DNode] identifier[head] operator[=] identifier[tree] operator[SEP] identifier[get] operator[SEP] identifier[headIndex] operator[SEP] operator[SEP] identifier[head] operator[SEP] identifier[addChild] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[getFeats] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[setHead] operator[SEP] identifier[head] operator[SEP] operator[SEP] } identifier[semanticHeadsMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[parallelStream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[e] operator[->] { identifier[DNode] identifier[node] operator[=] identifier[tree] operator[SEP] identifier[get] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[String] operator[>] identifier[nodeSemanticInfo] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[id] operator[:] identifier[nodeSemanticInfo] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[node] operator[SEP] identifier[addSemanticHead] operator[SEP] identifier[tree] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] , identifier[nodeSemanticInfo] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] identifier[tree] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[getSemanticChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[node] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[tree] operator[SEP] }
public CallActivityMock onExecutionSetVariables(final VariableMap variables){ return this.onExecutionDo("setVariablesServiceMock_"+ randomUUID(), (execution) -> execution.setVariables(variables) ); }
class class_name[name] begin[{] method[onExecutionSetVariables, return_type[type[CallActivityMock]], modifier[public], parameter[variables]] begin[{] return[THIS[call[None.onExecutionDo, parameter[binary_operation[literal["setVariablesServiceMock_"], +, call[.randomUUID, parameter[]]], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=variables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setVariables, postfix_operators=[], prefix_operators=[], qualifier=execution, selectors=[], type_arguments=None), parameters=[MemberReference(member=execution, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]] end[}] END[}]
Keyword[public] identifier[CallActivityMock] identifier[onExecutionSetVariables] operator[SEP] Keyword[final] identifier[VariableMap] identifier[variables] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[onExecutionDo] operator[SEP] literal[String] operator[+] identifier[randomUUID] operator[SEP] operator[SEP] , operator[SEP] identifier[execution] operator[SEP] operator[->] identifier[execution] operator[SEP] identifier[setVariables] operator[SEP] identifier[variables] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") // public static <E> ImmutableMultiset<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E... others) { return new Builder<E>().add(e1).add(e2).add(e3).add(e4).add(e5).add(e6).add(others).build(); }
class class_name[name] begin[{] method[of, return_type[type[ImmutableMultiset]], modifier[public static], parameter[e1, e2, e3, e4, e5, e6, others]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=e1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e6, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=others, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=None, name=Builder, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[ImmutableMultiset] operator[<] identifier[E] operator[>] identifier[of] operator[SEP] identifier[E] identifier[e1] , identifier[E] identifier[e2] , identifier[E] identifier[e3] , identifier[E] identifier[e4] , identifier[E] identifier[e5] , identifier[E] identifier[e6] , identifier[E] operator[...] identifier[others] operator[SEP] { Keyword[return] Keyword[new] identifier[Builder] operator[<] identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[e1] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[e2] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[e3] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[e4] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[e5] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[e6] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[others] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId) { return getJobWithServiceResponseAsync(resourceGroupName, resourceName, jobId).toBlocking().single().body(); }
class class_name[name] begin[{] method[getJob, return_type[type[JobResponseInner]], modifier[public], parameter[resourceGroupName, resourceName, jobId]] begin[{] return[call[.getJobWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.resourceName], member[.jobId]]]] end[}] END[}]
Keyword[public] identifier[JobResponseInner] identifier[getJob] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[resourceName] , identifier[String] identifier[jobId] operator[SEP] { Keyword[return] identifier[getJobWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[resourceName] , identifier[jobId] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public static Namespaces getNamespaces(Element element) { Assert.isNotNull(element); Node parent = element.getParentNode(); while (parent != null && !isElement(parent)) parent = parent.getParentNode(); Namespaces namespaces = null; if (parent != null) namespaces = getNamespaces((Element) parent); return getNamespaces(element, namespaces, false); }
class class_name[name] begin[{] method[getNamespaces, return_type[type[Namespaces]], modifier[public static], parameter[element]] begin[{] call[Assert.isNotNull, parameter[member[.element]]] local_variable[type[Node], parent] while[binary_operation[binary_operation[member[.parent], !=, literal[null]], &&, call[.isElement, parameter[member[.parent]]]]] begin[{] assign[member[.parent], call[parent.getParentNode, parameter[]]] end[}] local_variable[type[Namespaces], namespaces] if[binary_operation[member[.parent], !=, literal[null]]] begin[{] assign[member[.namespaces], call[.getNamespaces, parameter[Cast(expression=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))]]] else begin[{] None end[}] return[call[.getNamespaces, parameter[member[.element], member[.namespaces], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Namespaces] identifier[getNamespaces] operator[SEP] identifier[Element] identifier[element] operator[SEP] { identifier[Assert] operator[SEP] identifier[isNotNull] operator[SEP] identifier[element] operator[SEP] operator[SEP] identifier[Node] identifier[parent] operator[=] identifier[element] operator[SEP] identifier[getParentNode] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[parent] operator[!=] Other[null] operator[&&] operator[!] identifier[isElement] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[parent] operator[=] identifier[parent] operator[SEP] identifier[getParentNode] operator[SEP] operator[SEP] operator[SEP] identifier[Namespaces] identifier[namespaces] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] identifier[namespaces] operator[=] identifier[getNamespaces] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[parent] operator[SEP] operator[SEP] Keyword[return] identifier[getNamespaces] operator[SEP] identifier[element] , identifier[namespaces] , literal[boolean] operator[SEP] operator[SEP] }
public static <T extends Comparable<T>> List<T> topp(final T[] a, final int fromIndex, final int toIndex, final int n) { return topp(a, fromIndex, toIndex, n, N.NATURAL_ORDER); }
class class_name[name] begin[{] method[topp, return_type[type[List]], modifier[public static], parameter[a, fromIndex, toIndex, n]] begin[{] return[call[.topp, parameter[member[.a], member[.fromIndex], member[.toIndex], member[.n], member[N.NATURAL_ORDER]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Comparable] operator[<] identifier[T] operator[>] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[topp] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[a] , Keyword[final] Keyword[int] identifier[fromIndex] , Keyword[final] Keyword[int] identifier[toIndex] , Keyword[final] Keyword[int] identifier[n] operator[SEP] { Keyword[return] identifier[topp] operator[SEP] identifier[a] , identifier[fromIndex] , identifier[toIndex] , identifier[n] , identifier[N] operator[SEP] identifier[NATURAL_ORDER] operator[SEP] operator[SEP] }
public static int maxBucketsPerElement(long numElements) { numElements = Math.max(1, numElements); double v = (Long.MAX_VALUE - EXCESS) / (double)numElements; if (v < 1.0) { throw new UnsupportedOperationException("Cannot compute probabilities for " + numElements + " elements."); } return Math.min(BloomCalculations.probs.length - 1, (int)v); }
class class_name[name] begin[{] method[maxBucketsPerElement, return_type[type[int]], modifier[public static], parameter[numElements]] begin[{] assign[member[.numElements], call[Math.max, parameter[literal[1], member[.numElements]]]] local_variable[type[double], v] if[binary_operation[member[.v], <, literal[1.0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot compute probabilities for "), operandr=MemberReference(member=numElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" elements."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] return[call[Math.min, parameter[binary_operation[member[BloomCalculations.probs.length], -, literal[1]], Cast(expression=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[maxBucketsPerElement] operator[SEP] Keyword[long] identifier[numElements] operator[SEP] { identifier[numElements] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[1] , identifier[numElements] operator[SEP] operator[SEP] Keyword[double] identifier[v] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[-] identifier[EXCESS] operator[SEP] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[numElements] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[<] literal[Float] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[numElements] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[BloomCalculations] operator[SEP] identifier[probs] operator[SEP] identifier[length] operator[-] Other[1] , operator[SEP] Keyword[int] operator[SEP] identifier[v] operator[SEP] operator[SEP] }
public JvmOperation getJvmOperation(IMethod method, XtendTypeDeclaration context) throws JavaModelException { if (!method.isConstructor() && !method.isLambdaMethod() && !method.isMainMethod()) { final JvmType type = this.typeReferences.findDeclaredType( method.getDeclaringType().getFullyQualifiedName(), context); return getJvmOperation(method, type); } return null; }
class class_name[name] begin[{] method[getJvmOperation, return_type[type[JvmOperation]], modifier[public], parameter[method, context]] begin[{] if[binary_operation[binary_operation[call[method.isConstructor, parameter[]], &&, call[method.isLambdaMethod, parameter[]]], &&, call[method.isMainMethod, parameter[]]]] begin[{] local_variable[type[JvmType], type] return[call[.getJvmOperation, parameter[member[.method], member[.type]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[JvmOperation] identifier[getJvmOperation] operator[SEP] identifier[IMethod] identifier[method] , identifier[XtendTypeDeclaration] identifier[context] operator[SEP] Keyword[throws] identifier[JavaModelException] { Keyword[if] operator[SEP] operator[!] identifier[method] operator[SEP] identifier[isConstructor] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[method] operator[SEP] identifier[isLambdaMethod] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[method] operator[SEP] identifier[isMainMethod] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[JvmType] identifier[type] operator[=] Keyword[this] operator[SEP] identifier[typeReferences] operator[SEP] identifier[findDeclaredType] operator[SEP] identifier[method] operator[SEP] identifier[getDeclaringType] operator[SEP] operator[SEP] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] Keyword[return] identifier[getJvmOperation] operator[SEP] identifier[method] , identifier[type] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
protected static IJavaClassMethod findMethod( IJavaClassInfo cls, String name, int numArgs ) { IJavaClassMethod match = findUniqueMethodInList( cls.getDeclaredMethods(), cls, name, numArgs ); if (match != null) { return match; } match = findDeclaredMethod( cls, name, numArgs ); if (match != null) { return match; } if ( name.equals("toString") || name.equals("equals") || name.equals("hashCode")) { return findMethod( JavaTypes.OBJECT().getBackingClassInfo(), name, numArgs ); } throw new IllegalArgumentException("No method named " + name + " with " + numArgs + " arguments found starting from class " + cls); }
class class_name[name] begin[{] method[findMethod, return_type[type[IJavaClassMethod]], modifier[static protected], parameter[cls, name, numArgs]] begin[{] local_variable[type[IJavaClassMethod], match] if[binary_operation[member[.match], !=, literal[null]]] begin[{] return[member[.match]] else begin[{] None end[}] assign[member[.match], call[.findDeclaredMethod, parameter[member[.cls], member[.name], member[.numArgs]]]] if[binary_operation[member[.match], !=, literal[null]]] begin[{] return[member[.match]] else begin[{] None end[}] if[binary_operation[binary_operation[call[name.equals, parameter[literal["toString"]]], ||, call[name.equals, parameter[literal["equals"]]]], ||, call[name.equals, parameter[literal["hashCode"]]]]] begin[{] return[call[.findMethod, parameter[call[JavaTypes.OBJECT, parameter[]], member[.name], member[.numArgs]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No method named "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with "), operator=+), operandr=MemberReference(member=numArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" arguments found starting from class "), operator=+), operandr=MemberReference(member=cls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
Keyword[protected] Keyword[static] identifier[IJavaClassMethod] identifier[findMethod] operator[SEP] identifier[IJavaClassInfo] identifier[cls] , identifier[String] identifier[name] , Keyword[int] identifier[numArgs] operator[SEP] { identifier[IJavaClassMethod] identifier[match] operator[=] identifier[findUniqueMethodInList] operator[SEP] identifier[cls] operator[SEP] identifier[getDeclaredMethods] operator[SEP] operator[SEP] , identifier[cls] , identifier[name] , identifier[numArgs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[match] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[match] operator[SEP] } identifier[match] operator[=] identifier[findDeclaredMethod] operator[SEP] identifier[cls] , identifier[name] , identifier[numArgs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[match] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[match] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[findMethod] operator[SEP] identifier[JavaTypes] operator[SEP] identifier[OBJECT] operator[SEP] operator[SEP] operator[SEP] identifier[getBackingClassInfo] operator[SEP] operator[SEP] , identifier[name] , identifier[numArgs] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[numArgs] operator[+] literal[String] operator[+] identifier[cls] operator[SEP] operator[SEP] }
private static Class<?>[] getFields(Class<?> clz) { List<Class<?>> result = new ArrayList<Class<?>>(); Class<?> c = clz; while (!c.equals(Object.class)) { try { Field[] fields = SecurityActions.getDeclaredFields(c); if (fields.length > 0) { for (Field f : fields) { Class<?> defClz = f.getType(); String defClzName = defClz.getName(); if (!defClz.isPrimitive() && !defClz.isArray() && !defClzName.startsWith("java") && !defClzName.startsWith("javax") && !result.contains(defClz)) { if (trace) log.tracef("Adding field: %s", defClzName); result.add(defClz); } } } } catch (Throwable t) { // Ignore } c = c.getSuperclass(); } return result.toArray(new Class<?>[result.size()]); }
class class_name[name] begin[{] method[getFields, return_type[type[Class]], modifier[private static], parameter[clz]] begin[{] local_variable[type[List], result] local_variable[type[Class], c] while[call[c.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredFields, postfix_operators=[], prefix_operators=[], qualifier=SecurityActions, selectors=[], type_arguments=None), name=fields)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Field, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), name=defClz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=defClz, selectors=[], type_arguments=None), name=defClzName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isPrimitive, postfix_operators=[], prefix_operators=['!'], qualifier=defClz, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isArray, postfix_operators=[], prefix_operators=['!'], qualifier=defClz, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java")], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=defClzName, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="javax")], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=defClzName, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=defClz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=result, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding field: %s"), MemberReference(member=defClzName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tracef, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=defClz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) assign[member[.c], call[c.getSuperclass, parameter[]]] end[}] return[call[result.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Class, sub_type=None))]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[getFields] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clz] operator[SEP] { identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[=] identifier[clz] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[c] operator[SEP] identifier[equals] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[try] { identifier[Field] operator[SEP] operator[SEP] identifier[fields] operator[=] identifier[SecurityActions] operator[SEP] identifier[getDeclaredFields] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fields] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[Field] identifier[f] operator[:] identifier[fields] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[defClz] operator[=] identifier[f] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[defClzName] operator[=] identifier[defClz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[defClz] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[defClz] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[defClzName] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[defClzName] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[result] operator[SEP] identifier[contains] operator[SEP] identifier[defClz] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[trace] operator[SEP] identifier[log] operator[SEP] identifier[tracef] operator[SEP] literal[String] , identifier[defClzName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[defClz] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { } identifier[c] operator[=] identifier[c] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void beforeCompletion() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "beforeCompletion"); becomePreparing(); // Change the state to PREPARRING if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "beforeCompletion"); }
class class_name[name] begin[{] method[beforeCompletion, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[boolean], isTraceOn] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["beforeCompletion"]]] else begin[{] None end[}] call[.becomePreparing, parameter[]] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["beforeCompletion"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[beforeCompletion] operator[SEP] operator[SEP] { Keyword[final] Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[becomePreparing] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public static nspbr6[] get(nitro_service service, nspbr6_args args) throws Exception{ nspbr6 obj = new nspbr6(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nspbr6[] response = (nspbr6[])obj.get_resources(service, option); return response; }
class class_name[name] begin[{] method[get, return_type[type[nspbr6]], modifier[public static], parameter[service, args]] begin[{] local_variable[type[nspbr6], obj] local_variable[type[options], option] call[option.set_args, parameter[call[nitro_util.object_to_string_withoutquotes, parameter[member[.args]]]]] local_variable[type[nspbr6], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[nspbr6] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[nspbr6_args] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[nspbr6] identifier[obj] operator[=] Keyword[new] identifier[nspbr6] operator[SEP] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_args] operator[SEP] identifier[nitro_util] operator[SEP] identifier[object_to_string_withoutquotes] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] identifier[nspbr6] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[nspbr6] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
private void getHdotVFiniteDifference(double[] x, double[] v, double[] curDerivative){ double h = finiteDifferenceStepSize; double hInv = 1/h; // this avoids dividing too much since it's a bit more expensive than multiplying if (gradPerturbed == null) { gradPerturbed = new double[x.length]; System.out.println("Setting approximate gradient."); } if (xPerturbed == null){ xPerturbed = new double[x.length]; System.out.println("Setting perturbed."); } if (HdotV == null) { HdotV = new double[x.length]; System.out.println("Setting H dot V."); } // This adds h*v to x ---> x = x + h*v for( int i = 0;i<x.length;i++){ xPerturbed[i] = x[i] + h*v[i]; } double prevValue = value; recalculatePrevBatch = true; calculateStochastic(xPerturbed,null,thisBatch); // Call the calculate function without updating the batch // System.arraycopy(derivative, 0, gradPerturbed, 0, gradPerturbed.length); // This comes up with the approximate difference, and renormalizes it on h. for( int i = 0;i<x.length;i++){ double tmp = (derivative[i]-curDerivative[i]); HdotV[i] = hInv*(tmp); } //Make sure the original derivative is in place System.arraycopy(curDerivative,0,derivative,0,derivative.length); value = prevValue; hasNewVals = false; recalculatePrevBatch = false; returnPreviousValues = false; }
class class_name[name] begin[{] method[getHdotVFiniteDifference, return_type[void], modifier[private], parameter[x, v, curDerivative]] begin[{] local_variable[type[double], h] local_variable[type[double], hInv] if[binary_operation[member[.gradPerturbed], ==, literal[null]]] begin[{] assign[member[.gradPerturbed], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] call[System.out.println, parameter[literal["Setting approximate gradient."]]] else begin[{] None end[}] if[binary_operation[member[.xPerturbed], ==, literal[null]]] begin[{] assign[member[.xPerturbed], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] call[System.out.println, parameter[literal["Setting perturbed."]]] else begin[{] None end[}] if[binary_operation[member[.HdotV], ==, literal[null]]] begin[{] assign[member[.HdotV], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] call[System.out.println, parameter[literal["Setting H dot V."]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=xPerturbed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=BinaryOperation(operandl=MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), operator=+)), 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=x, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[double], prevValue] assign[member[.recalculatePrevBatch], literal[true]] call[.calculateStochastic, parameter[member[.xPerturbed], literal[null], member[.thisBatch]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=derivative, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=curDerivative, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-), name=tmp)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=HdotV, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=hInv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), 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=x, 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[System.arraycopy, parameter[member[.curDerivative], literal[0], member[.derivative], literal[0], member[derivative.length]]] assign[member[.value], member[.prevValue]] assign[member[.hasNewVals], literal[false]] assign[member[.recalculatePrevBatch], literal[false]] assign[member[.returnPreviousValues], literal[false]] end[}] END[}]
Keyword[private] Keyword[void] identifier[getHdotVFiniteDifference] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[x] , Keyword[double] operator[SEP] operator[SEP] identifier[v] , Keyword[double] operator[SEP] operator[SEP] identifier[curDerivative] operator[SEP] { Keyword[double] identifier[h] operator[=] identifier[finiteDifferenceStepSize] operator[SEP] Keyword[double] identifier[hInv] operator[=] Other[1] operator[/] identifier[h] operator[SEP] Keyword[if] operator[SEP] identifier[gradPerturbed] operator[==] Other[null] operator[SEP] { identifier[gradPerturbed] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[x] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[xPerturbed] operator[==] Other[null] operator[SEP] { identifier[xPerturbed] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[x] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[HdotV] operator[==] Other[null] operator[SEP] { identifier[HdotV] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[x] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] 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[x] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[xPerturbed] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[h] operator[*] identifier[v] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[double] identifier[prevValue] operator[=] identifier[value] operator[SEP] identifier[recalculatePrevBatch] operator[=] literal[boolean] operator[SEP] identifier[calculateStochastic] operator[SEP] identifier[xPerturbed] , Other[null] , identifier[thisBatch] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[x] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[tmp] operator[=] operator[SEP] identifier[derivative] operator[SEP] identifier[i] operator[SEP] operator[-] identifier[curDerivative] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[HdotV] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[hInv] operator[*] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[curDerivative] , Other[0] , identifier[derivative] , Other[0] , identifier[derivative] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[prevValue] operator[SEP] identifier[hasNewVals] operator[=] literal[boolean] operator[SEP] identifier[recalculatePrevBatch] operator[=] literal[boolean] operator[SEP] identifier[returnPreviousValues] operator[=] literal[boolean] operator[SEP] }
private ClockAndCount[] getCurrentValues(List<CounterUpdateCell> counterUpdateCells, ColumnFamilyStore cfs) { ClockAndCount[] currentValues = new ClockAndCount[counterUpdateCells.size()]; int remaining = counterUpdateCells.size(); if (CacheService.instance.counterCache.getCapacity() != 0) { Tracing.trace("Fetching {} counter values from cache", counterUpdateCells.size()); remaining = getCurrentValuesFromCache(counterUpdateCells, cfs, currentValues); if (remaining == 0) return currentValues; } Tracing.trace("Reading {} counter values from the CF", remaining); getCurrentValuesFromCFS(counterUpdateCells, cfs, currentValues); return currentValues; }
class class_name[name] begin[{] method[getCurrentValues, return_type[type[ClockAndCount]], modifier[private], parameter[counterUpdateCells, cfs]] begin[{] local_variable[type[ClockAndCount], currentValues] local_variable[type[int], remaining] if[binary_operation[call[CacheService.instance.counterCache.getCapacity, parameter[]], !=, literal[0]]] begin[{] call[Tracing.trace, parameter[literal["Fetching {} counter values from cache"], call[counterUpdateCells.size, parameter[]]]] assign[member[.remaining], call[.getCurrentValuesFromCache, parameter[member[.counterUpdateCells], member[.cfs], member[.currentValues]]]] if[binary_operation[member[.remaining], ==, literal[0]]] begin[{] return[member[.currentValues]] else begin[{] None end[}] else begin[{] None end[}] call[Tracing.trace, parameter[literal["Reading {} counter values from the CF"], member[.remaining]]] call[.getCurrentValuesFromCFS, parameter[member[.counterUpdateCells], member[.cfs], member[.currentValues]]] return[member[.currentValues]] end[}] END[}]
Keyword[private] identifier[ClockAndCount] operator[SEP] operator[SEP] identifier[getCurrentValues] operator[SEP] identifier[List] operator[<] identifier[CounterUpdateCell] operator[>] identifier[counterUpdateCells] , identifier[ColumnFamilyStore] identifier[cfs] operator[SEP] { identifier[ClockAndCount] operator[SEP] operator[SEP] identifier[currentValues] operator[=] Keyword[new] identifier[ClockAndCount] operator[SEP] identifier[counterUpdateCells] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[remaining] operator[=] identifier[counterUpdateCells] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CacheService] operator[SEP] identifier[instance] operator[SEP] identifier[counterCache] operator[SEP] identifier[getCapacity] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[Tracing] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[counterUpdateCells] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[remaining] operator[=] identifier[getCurrentValuesFromCache] operator[SEP] identifier[counterUpdateCells] , identifier[cfs] , identifier[currentValues] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remaining] operator[==] Other[0] operator[SEP] Keyword[return] identifier[currentValues] operator[SEP] } identifier[Tracing] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[remaining] operator[SEP] operator[SEP] identifier[getCurrentValuesFromCFS] operator[SEP] identifier[counterUpdateCells] , identifier[cfs] , identifier[currentValues] operator[SEP] operator[SEP] Keyword[return] identifier[currentValues] operator[SEP] }
public static String getRunningDockerContainerId( Session session, String containerName ) throws JSchException, IOException { String command = "docker ps | grep " + containerName; String remoteResponseStr = launchACommand(session, command); if (remoteResponseStr.length() == 0) { return null; } List<String> containerIdsList = new ArrayList<>(); String[] linesSplit = remoteResponseStr.split("\n"); for( String line : linesSplit ) { String[] psSplit = line.split("\\s+"); if (psSplit.length < 3) { throw new JSchException("Could not retrieve container data. Result was: " + line); } String cid = psSplit[0]; containerIdsList.add(cid); } if (containerIdsList.size() > 1) { throw new JSchException("More than one container was identified with the given filters. Check your filters."); } else if (containerIdsList.size() == 0) { return null; } return containerIdsList.get(0); }
class class_name[name] begin[{] method[getRunningDockerContainerId, return_type[type[String]], modifier[public static], parameter[session, containerName]] begin[{] local_variable[type[String], command] local_variable[type[String], remoteResponseStr] if[binary_operation[call[remoteResponseStr.length, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], containerIdsList] local_variable[type[String], linesSplit] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\s+")], member=split, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=psSplit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=psSplit, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not retrieve container data. Result was: "), operandr=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSchException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=psSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), name=cid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=containerIdsList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=linesSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[binary_operation[call[containerIdsList.size, parameter[]], >, literal[1]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="More than one container was identified with the given filters. Check your filters.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSchException, sub_type=None)), label=None) else begin[{] if[binary_operation[call[containerIdsList.size, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] end[}] return[call[containerIdsList.get, parameter[literal[0]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getRunningDockerContainerId] operator[SEP] identifier[Session] identifier[session] , identifier[String] identifier[containerName] operator[SEP] Keyword[throws] identifier[JSchException] , identifier[IOException] { identifier[String] identifier[command] operator[=] literal[String] operator[+] identifier[containerName] operator[SEP] identifier[String] identifier[remoteResponseStr] operator[=] identifier[launchACommand] operator[SEP] identifier[session] , identifier[command] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remoteResponseStr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[containerIdsList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[linesSplit] operator[=] identifier[remoteResponseStr] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[line] operator[:] identifier[linesSplit] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[psSplit] operator[=] identifier[line] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[psSplit] operator[SEP] identifier[length] operator[<] Other[3] operator[SEP] { Keyword[throw] Keyword[new] identifier[JSchException] operator[SEP] literal[String] operator[+] identifier[line] operator[SEP] operator[SEP] } identifier[String] identifier[cid] operator[=] identifier[psSplit] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[containerIdsList] operator[SEP] identifier[add] operator[SEP] identifier[cid] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[containerIdsList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[JSchException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[containerIdsList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[containerIdsList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] }
public static Nature convertStringToNature(String name, LinkedHashSet<Nature> customNatureCollector) { Nature nature = Nature.fromString(name); if (nature == null) { nature = Nature.create(name); if (customNatureCollector != null) customNatureCollector.add(nature); } return nature; }
class class_name[name] begin[{] method[convertStringToNature, return_type[type[Nature]], modifier[public static], parameter[name, customNatureCollector]] begin[{] local_variable[type[Nature], nature] if[binary_operation[member[.nature], ==, literal[null]]] begin[{] assign[member[.nature], call[Nature.create, parameter[member[.name]]]] if[binary_operation[member[.customNatureCollector], !=, literal[null]]] begin[{] call[customNatureCollector.add, parameter[member[.nature]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.nature]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Nature] identifier[convertStringToNature] operator[SEP] identifier[String] identifier[name] , identifier[LinkedHashSet] operator[<] identifier[Nature] operator[>] identifier[customNatureCollector] operator[SEP] { identifier[Nature] identifier[nature] operator[=] identifier[Nature] operator[SEP] identifier[fromString] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nature] operator[==] Other[null] operator[SEP] { identifier[nature] operator[=] identifier[Nature] operator[SEP] identifier[create] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[customNatureCollector] operator[!=] Other[null] operator[SEP] identifier[customNatureCollector] operator[SEP] identifier[add] operator[SEP] identifier[nature] operator[SEP] operator[SEP] } Keyword[return] identifier[nature] operator[SEP] }
@Bean WsConfigurerAdapter traceeWsConfigurerAdapter(final TraceeEndpointInterceptor traceeEndpointInterceptor) { return new WsConfigurerAdapter() { @Override public void addInterceptors(List<EndpointInterceptor> interceptors) { super.addInterceptors(Collections.<EndpointInterceptor>singletonList(traceeEndpointInterceptor)); } }; }
class class_name[name] begin[{] method[traceeWsConfigurerAdapter, return_type[type[WsConfigurerAdapter]], modifier[default], parameter[traceeEndpointInterceptor]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=SuperMethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=traceeEndpointInterceptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EndpointInterceptor, sub_type=None))])], member=addInterceptors, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=addInterceptors, parameters=[FormalParameter(annotations=[], modifiers=set(), name=interceptors, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EndpointInterceptor, sub_type=None))], dimensions=[], name=List, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WsConfigurerAdapter, sub_type=None))] end[}] END[}]
annotation[@] identifier[Bean] identifier[WsConfigurerAdapter] identifier[traceeWsConfigurerAdapter] operator[SEP] Keyword[final] identifier[TraceeEndpointInterceptor] identifier[traceeEndpointInterceptor] operator[SEP] { Keyword[return] Keyword[new] identifier[WsConfigurerAdapter] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addInterceptors] operator[SEP] identifier[List] operator[<] identifier[EndpointInterceptor] operator[>] identifier[interceptors] operator[SEP] { Keyword[super] operator[SEP] identifier[addInterceptors] operator[SEP] identifier[Collections] operator[SEP] operator[<] identifier[EndpointInterceptor] operator[>] identifier[singletonList] operator[SEP] identifier[traceeEndpointInterceptor] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
@XmlElementDecl(namespace = "", name = "anbieternr") public JAXBElement<String> createAnbieternr(String value) { return new JAXBElement<String>(_Anbieternr_QNAME, String.class, null, value); }
class class_name[name] begin[{] method[createAnbieternr, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Anbieternr_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[String] operator[>] identifier[createAnbieternr] operator[SEP] identifier[String] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[String] operator[>] operator[SEP] identifier[_Anbieternr_QNAME] , identifier[String] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
private CachedProviderServiceInstance getCachedServiceInstance( String serviceName, String providerId) { try { read.lock(); ServiceInstanceId id = new ServiceInstanceId(serviceName, providerId); return getCacheServiceInstances().get(id); } finally { read.unlock(); } }
class class_name[name] begin[{] method[getCachedServiceInstance, return_type[type[CachedProviderServiceInstance]], modifier[private], parameter[serviceName, providerId]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=lock, postfix_operators=[], prefix_operators=[], qualifier=read, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=serviceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=providerId, 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=ServiceInstanceId, sub_type=None)), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServiceInstanceId, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=getCacheServiceInstances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=read, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[private] identifier[CachedProviderServiceInstance] identifier[getCachedServiceInstance] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[providerId] operator[SEP] { Keyword[try] { identifier[read] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceInstanceId] identifier[id] operator[=] Keyword[new] identifier[ServiceInstanceId] operator[SEP] identifier[serviceName] , identifier[providerId] operator[SEP] operator[SEP] Keyword[return] identifier[getCacheServiceInstances] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] } Keyword[finally] { identifier[read] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public LocalDate minusYears(long yearsToSubtract) { return (yearsToSubtract == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-yearsToSubtract)); }
class class_name[name] begin[{] method[minusYears, return_type[type[LocalDate]], modifier[public], parameter[yearsToSubtract]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=yearsToSubtract, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=yearsToSubtract, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[])], member=plusYears, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[])], member=plusYears, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=plusYears, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[LocalDate] identifier[minusYears] operator[SEP] Keyword[long] identifier[yearsToSubtract] operator[SEP] { Keyword[return] operator[SEP] identifier[yearsToSubtract] operator[==] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[?] identifier[plusYears] operator[SEP] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[plusYears] operator[SEP] Other[1] operator[SEP] operator[:] identifier[plusYears] operator[SEP] operator[-] identifier[yearsToSubtract] operator[SEP] operator[SEP] operator[SEP] }
public boolean accept(File pathname) { boolean ret = false; // search for extension without dot. StringTokenizer tokenizer = new StringTokenizer(pathname.getAbsolutePath(), "."); String extension = "no.txt"; // a dot, because verify will not allow these tokens: won't accept, if no extension in pathname. while (tokenizer.hasMoreElements()) { extension = tokenizer.nextToken(); } for (int i = this.m_extensions.length - 1; i >= 0; i--) { if (this.m_extensions[i].equals(extension)) { ret = true; break; } } return ret; }
class class_name[name] begin[{] method[accept, return_type[type[boolean]], modifier[public], parameter[pathname]] begin[{] local_variable[type[boolean], ret] local_variable[type[StringTokenizer], tokenizer] local_variable[type[String], extension] while[call[tokenizer.hasMoreElements, parameter[]]] begin[{] assign[member[.extension], call[tokenizer.nextToken, parameter[]]] end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=m_extensions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=extension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=m_extensions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[File] identifier[pathname] operator[SEP] { Keyword[boolean] identifier[ret] operator[=] literal[boolean] operator[SEP] identifier[StringTokenizer] identifier[tokenizer] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[pathname] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[extension] operator[=] literal[String] operator[SEP] Keyword[while] operator[SEP] identifier[tokenizer] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[extension] operator[=] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Keyword[this] operator[SEP] identifier[m_extensions] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[m_extensions] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[extension] operator[SEP] operator[SEP] { identifier[ret] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[ret] operator[SEP] }
public void importStatic(final Class<?> clas) { this.importedStatic.remove(clas); this.importedStatic.add(0, clas); this.nameSpaceChanged(); }
class class_name[name] begin[{] method[importStatic, return_type[void], modifier[public], parameter[clas]] begin[{] THIS[member[None.importedStatic]call[None.remove, parameter[member[.clas]]]] THIS[member[None.importedStatic]call[None.add, parameter[literal[0], member[.clas]]]] THIS[call[None.nameSpaceChanged, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[importStatic] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[clas] operator[SEP] { Keyword[this] operator[SEP] identifier[importedStatic] operator[SEP] identifier[remove] operator[SEP] identifier[clas] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[importedStatic] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[clas] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[nameSpaceChanged] operator[SEP] operator[SEP] operator[SEP] }
public static <V> LinkedList<ResultTerm<V>> segment(String text, AhoCorasickDoubleArrayTrie<V> trie) { return segment(text.toCharArray(), trie); }
class class_name[name] begin[{] method[segment, return_type[type[LinkedList]], modifier[public static], parameter[text, trie]] begin[{] return[call[.segment, parameter[call[text.toCharArray, parameter[]], member[.trie]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[LinkedList] operator[<] identifier[ResultTerm] operator[<] identifier[V] operator[>] operator[>] identifier[segment] operator[SEP] identifier[String] identifier[text] , identifier[AhoCorasickDoubleArrayTrie] operator[<] identifier[V] operator[>] identifier[trie] operator[SEP] { Keyword[return] identifier[segment] operator[SEP] identifier[text] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] , identifier[trie] operator[SEP] operator[SEP] }
public static int transactionFromString(String txIsolation) throws SQLException { switch (txIsolation) { //tx_isolation case "READ-UNCOMMITTED": return Connection.TRANSACTION_READ_UNCOMMITTED; case "READ-COMMITTED": return Connection.TRANSACTION_READ_COMMITTED; case "REPEATABLE-READ": return Connection.TRANSACTION_REPEATABLE_READ; case "SERIALIZABLE": return Connection.TRANSACTION_SERIALIZABLE; default: throw new SQLException("unknown transaction isolation level"); } }
class class_name[name] begin[{] method[transactionFromString, return_type[type[int]], modifier[public static], parameter[txIsolation]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="READ-UNCOMMITTED")], statements=[ReturnStatement(expression=MemberReference(member=TRANSACTION_READ_UNCOMMITTED, postfix_operators=[], prefix_operators=[], qualifier=Connection, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="READ-COMMITTED")], statements=[ReturnStatement(expression=MemberReference(member=TRANSACTION_READ_COMMITTED, postfix_operators=[], prefix_operators=[], qualifier=Connection, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="REPEATABLE-READ")], statements=[ReturnStatement(expression=MemberReference(member=TRANSACTION_REPEATABLE_READ, postfix_operators=[], prefix_operators=[], qualifier=Connection, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SERIALIZABLE")], statements=[ReturnStatement(expression=MemberReference(member=TRANSACTION_SERIALIZABLE, postfix_operators=[], prefix_operators=[], qualifier=Connection, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown transaction isolation level")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None)])], expression=MemberReference(member=txIsolation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[transactionFromString] operator[SEP] identifier[String] identifier[txIsolation] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[switch] operator[SEP] identifier[txIsolation] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[return] identifier[Connection] operator[SEP] identifier[TRANSACTION_READ_UNCOMMITTED] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Connection] operator[SEP] identifier[TRANSACTION_READ_COMMITTED] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Connection] operator[SEP] identifier[TRANSACTION_REPEATABLE_READ] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Connection] operator[SEP] identifier[TRANSACTION_SERIALIZABLE] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
private void processSwatch(Bitmap image) { final Map<Integer, Integer> colorHistogram = processLuminanceData(image); extractFgBgData(colorHistogram); // Two-decimal digits of precision for the contrast ratio mContrastRatio = Math.round( ContrastUtils.calculateContrastRatio(mBackgroundLuminance, mForegroundLuminance) * 100.0d) / 100.0d; }
class class_name[name] begin[{] method[processSwatch, return_type[void], modifier[private], parameter[image]] begin[{] local_variable[type[Map], colorHistogram] call[.extractFgBgData, parameter[member[.colorHistogram]]] assign[member[.mContrastRatio], binary_operation[call[Math.round, parameter[binary_operation[call[ContrastUtils.calculateContrastRatio, parameter[member[.mBackgroundLuminance], member[.mForegroundLuminance]]], *, literal[100.0d]]]], /, literal[100.0d]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[processSwatch] operator[SEP] identifier[Bitmap] identifier[image] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[colorHistogram] operator[=] identifier[processLuminanceData] operator[SEP] identifier[image] operator[SEP] operator[SEP] identifier[extractFgBgData] operator[SEP] identifier[colorHistogram] operator[SEP] operator[SEP] identifier[mContrastRatio] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[ContrastUtils] operator[SEP] identifier[calculateContrastRatio] operator[SEP] identifier[mBackgroundLuminance] , identifier[mForegroundLuminance] operator[SEP] operator[*] literal[Float] operator[SEP] operator[/] literal[Float] operator[SEP] }
private static List<ManifestEntry> asManifestEntryList( final Map<String, String> entries ) { final List<ManifestEntry> manifestEntries = new ArrayList<ManifestEntry>(); if( entries != null && !entries.isEmpty() ) { for( Map.Entry<String, String> entry : entries.entrySet() ) { manifestEntries.add( new ManifestEntry( entry.getKey(), entry.getValue() ) ); } } return manifestEntries; }
class class_name[name] begin[{] method[asManifestEntryList, return_type[type[List]], modifier[private static], parameter[entries]] begin[{] local_variable[type[List], manifestEntries] if[binary_operation[binary_operation[member[.entries], !=, literal[null]], &&, call[entries.isEmpty, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ManifestEntry, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=manifestEntries, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] return[member[.manifestEntries]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[ManifestEntry] operator[>] identifier[asManifestEntryList] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[entries] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[ManifestEntry] operator[>] identifier[manifestEntries] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ManifestEntry] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entries] operator[!=] Other[null] operator[&&] operator[!] identifier[entries] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[entries] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[manifestEntries] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ManifestEntry] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[manifestEntries] operator[SEP] }
public static void outputImage(int w, int h, File outputFile, String code) throws IOException{ if(outputFile == null){ return; } File dir = outputFile.getParentFile(); if(!dir.exists()){ dir.mkdirs(); } try{ outputFile.createNewFile(); FileOutputStream fos = new FileOutputStream(outputFile); outputImage(w, h, fos, code); fos.close(); } catch(IOException e){ throw e; } }
class class_name[name] begin[{] method[outputImage, return_type[void], modifier[public static], parameter[w, h, outputFile, code]] begin[{] if[binary_operation[member[.outputFile], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[File], dir] if[call[dir.exists, parameter[]]] begin[{] call[dir.mkdirs, parameter[]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=createNewFile, postfix_operators=[], prefix_operators=[], qualifier=outputFile, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=outputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)), name=fos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=outputImage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=fos, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[outputImage] operator[SEP] Keyword[int] identifier[w] , Keyword[int] identifier[h] , identifier[File] identifier[outputFile] , identifier[String] identifier[code] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[outputFile] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[File] identifier[dir] operator[=] identifier[outputFile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[dir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[dir] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[outputFile] operator[SEP] identifier[createNewFile] operator[SEP] operator[SEP] operator[SEP] identifier[FileOutputStream] identifier[fos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[outputFile] operator[SEP] operator[SEP] identifier[outputImage] operator[SEP] identifier[w] , identifier[h] , identifier[fos] , identifier[code] operator[SEP] operator[SEP] identifier[fos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } }