code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public List<Collaborator> listCollaborators(String appName) { return connection.execute(new CollabList(appName), apiKey); }
class class_name[name] begin[{] method[listCollaborators, return_type[type[List]], modifier[public], parameter[appName]] begin[{] return[call[connection.execute, parameter[ClassCreator(arguments=[MemberReference(member=appName, 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=CollabList, sub_type=None)), member[.apiKey]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Collaborator] operator[>] identifier[listCollaborators] operator[SEP] identifier[String] identifier[appName] operator[SEP] { Keyword[return] identifier[connection] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[CollabList] operator[SEP] identifier[appName] operator[SEP] , identifier[apiKey] operator[SEP] operator[SEP] }
public static <K,V> RelationFactory<K,V> mapSet() { return mapSet(MapFacts.<K,Set<V>>hash(), SetFacts.<V>hash()); }
class class_name[name] begin[{] method[mapSet, return_type[type[RelationFactory]], modifier[public static], parameter[]] begin[{] return[call[.mapSet, parameter[call[.MapFacts, parameter[]], call[.SetFacts, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[RelationFactory] operator[<] identifier[K] , identifier[V] operator[>] identifier[mapSet] operator[SEP] operator[SEP] { Keyword[return] identifier[mapSet] operator[SEP] identifier[MapFacts] operator[SEP] operator[<] identifier[K] , identifier[Set] operator[<] identifier[V] operator[>] operator[>] identifier[hash] operator[SEP] operator[SEP] , identifier[SetFacts] operator[SEP] operator[<] identifier[V] operator[>] identifier[hash] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void load(XMLReader r) throws KNXMLException { if (r.getPosition() != XMLReader.START_TAG) r.read(); final Element e = r.getCurrent(); if (r.getPosition() != XMLReader.START_TAG || !e.getName().equals(TAG_DATAPOINTS)) throw new KNXMLException(TAG_DATAPOINTS + " element not found", e != null ? e .getName() : null, r.getLineNumber()); synchronized (points) { while (r.read() == XMLReader.START_TAG) { final Datapoint dp = Datapoint.create(r); if (points.containsKey(dp.getMainAddress())) throw new KNXMLException(TAG_DATAPOINTS + " element contains " + "duplicate datapoint", dp.getMainAddress().toString(), r .getLineNumber()); points.put(dp.getMainAddress(), dp); } } }
class class_name[name] begin[{] method[load, return_type[void], modifier[public], parameter[r]] begin[{] if[binary_operation[call[r.getPosition, parameter[]], !=, member[XMLReader.START_TAG]]] begin[{] call[r.read, parameter[]] else begin[{] None end[}] local_variable[type[Element], e] if[binary_operation[binary_operation[call[r.getPosition, parameter[]], !=, member[XMLReader.START_TAG]], ||, call[e.getName, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=TAG_DATAPOINTS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" element not found"), operator=+), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=e, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)), MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KNXMLException, sub_type=None)), label=None) else begin[{] None end[}] SYNCHRONIZED[member[.points]] BEGIN[{] while[binary_operation[call[r.read, parameter[]], ==, member[XMLReader.START_TAG]]] begin[{] local_variable[type[Datapoint], dp] if[call[points.containsKey, parameter[call[dp.getMainAddress, parameter[]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=TAG_DATAPOINTS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" element contains "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="duplicate datapoint"), operator=+), MethodInvocation(arguments=[], member=getMainAddress, postfix_operators=[], prefix_operators=[], qualifier=dp, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KNXMLException, sub_type=None)), label=None) else begin[{] None end[}] call[points.put, parameter[call[dp.getMainAddress, parameter[]], member[.dp]]] end[}] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[load] operator[SEP] identifier[XMLReader] identifier[r] operator[SEP] Keyword[throws] identifier[KNXMLException] { Keyword[if] operator[SEP] identifier[r] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[!=] identifier[XMLReader] operator[SEP] identifier[START_TAG] operator[SEP] identifier[r] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Element] identifier[e] operator[=] identifier[r] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[!=] identifier[XMLReader] operator[SEP] identifier[START_TAG] operator[||] operator[!] identifier[e] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[TAG_DATAPOINTS] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[KNXMLException] operator[SEP] identifier[TAG_DATAPOINTS] operator[+] literal[String] , identifier[e] operator[!=] Other[null] operator[?] identifier[e] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[:] Other[null] , identifier[r] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[points] operator[SEP] { Keyword[while] operator[SEP] identifier[r] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[==] identifier[XMLReader] operator[SEP] identifier[START_TAG] operator[SEP] { Keyword[final] identifier[Datapoint] identifier[dp] operator[=] identifier[Datapoint] operator[SEP] identifier[create] operator[SEP] identifier[r] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[points] operator[SEP] identifier[containsKey] operator[SEP] identifier[dp] operator[SEP] identifier[getMainAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[KNXMLException] operator[SEP] identifier[TAG_DATAPOINTS] operator[+] literal[String] operator[+] literal[String] , identifier[dp] operator[SEP] identifier[getMainAddress] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[r] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[points] operator[SEP] identifier[put] operator[SEP] identifier[dp] operator[SEP] identifier[getMainAddress] operator[SEP] operator[SEP] , identifier[dp] operator[SEP] operator[SEP] } } }
public FlowStepRule moveFlowStepEntryRuleDown(FlowStepRule flowStepRuleParam) { if(flowStepRuleParam != null && this.serviceTicket != null) { flowStepRuleParam.setServiceTicket(this.serviceTicket); } return new FlowStepRule(this.postJson( flowStepRuleParam, WS.Path.FlowStepRule.Version1.flowStepRuleMoveEntryDown())); }
class class_name[name] begin[{] method[moveFlowStepEntryRuleDown, return_type[type[FlowStepRule]], modifier[public], parameter[flowStepRuleParam]] begin[{] if[binary_operation[binary_operation[member[.flowStepRuleParam], !=, literal[null]], &&, binary_operation[THIS[member[None.serviceTicket]], !=, literal[null]]]] begin[{] call[flowStepRuleParam.setServiceTicket, parameter[THIS[member[None.serviceTicket]]]] else begin[{] None end[}] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=flowStepRuleParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=flowStepRuleMoveEntryDown, postfix_operators=[], prefix_operators=[], qualifier=WS.Path.FlowStepRule.Version1, selectors=[], type_arguments=None)], member=postJson, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FlowStepRule, sub_type=None))] end[}] END[}]
Keyword[public] identifier[FlowStepRule] identifier[moveFlowStepEntryRuleDown] operator[SEP] identifier[FlowStepRule] identifier[flowStepRuleParam] operator[SEP] { Keyword[if] operator[SEP] identifier[flowStepRuleParam] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[serviceTicket] operator[!=] Other[null] operator[SEP] { identifier[flowStepRuleParam] operator[SEP] identifier[setServiceTicket] operator[SEP] Keyword[this] operator[SEP] identifier[serviceTicket] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[FlowStepRule] operator[SEP] Keyword[this] operator[SEP] identifier[postJson] operator[SEP] identifier[flowStepRuleParam] , identifier[WS] operator[SEP] identifier[Path] operator[SEP] identifier[FlowStepRule] operator[SEP] identifier[Version1] operator[SEP] identifier[flowStepRuleMoveEntryDown] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://www.tibco.com/xmlns/ApplicationManagement", name = "bw", substitutionHeadNamespace = "http://www.tibco.com/xmlns/ApplicationManagement", substitutionHeadName = "baseService") public JAXBElement<Bw> createBw(Bw value) { return new JAXBElement<Bw>(_Bw_QNAME, Bw.class, null, value); }
class class_name[name] begin[{] method[createBw, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Bw_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bw, 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=Bw, 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] , identifier[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[Bw] operator[>] identifier[createBw] operator[SEP] identifier[Bw] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[Bw] operator[>] operator[SEP] identifier[_Bw_QNAME] , identifier[Bw] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public List<Build> getBuilds() { if (builds == null) { return Collections.emptyList(); } else { return builds.stream() .map(s -> buildWithClient(s)) .collect(toList()); } }
class class_name[name] begin[{] method[getBuilds, return_type[type[List]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.builds], ==, literal[null]]] begin[{] return[call[Collections.emptyList, parameter[]]] else begin[{] return[call[builds.stream, parameter[]]] end[}] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Build] operator[>] identifier[getBuilds] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[builds] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[builds] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[s] operator[->] identifier[buildWithClient] operator[SEP] identifier[s] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private String forceAscii(StringBuilder source) { int length = source.length(); StringBuilder res = new StringBuilder(length); for (int i = 0; i < length; i++) { char c = source.charAt(i); if ((c >= SAFE_ASCII_LOWER && c <= SAFE_ASCII_UPPER) || Character.isSpaceChar(c)) { res.append(c); } else { res.append("\\u"); String scode = Integer.toHexString(i); while (scode.length() < 4) { scode = "0" + scode; } res.append(scode); } } return res.toString(); }
class class_name[name] begin[{] method[forceAscii, return_type[type[String]], modifier[private], parameter[source]] begin[{] local_variable[type[int], length] local_variable[type[StringBuilder], res] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SAFE_ASCII_LOWER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SAFE_ASCII_UPPER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSpaceChar, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\u")], member=append, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=scode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=scode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0"), operandr=MemberReference(member=scode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=scode, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=<), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=scode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=res, 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=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[res.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[forceAscii] operator[SEP] identifier[StringBuilder] identifier[source] operator[SEP] { Keyword[int] identifier[length] operator[=] identifier[source] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[res] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[source] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[>=] identifier[SAFE_ASCII_LOWER] operator[&&] identifier[c] operator[<=] identifier[SAFE_ASCII_UPPER] operator[SEP] operator[||] identifier[Character] operator[SEP] identifier[isSpaceChar] operator[SEP] identifier[c] operator[SEP] operator[SEP] { identifier[res] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[else] { identifier[res] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[scode] operator[=] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[scode] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] Other[4] operator[SEP] { identifier[scode] operator[=] literal[String] operator[+] identifier[scode] operator[SEP] } identifier[res] operator[SEP] identifier[append] operator[SEP] identifier[scode] operator[SEP] operator[SEP] } } Keyword[return] identifier[res] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public boolean ping(final String anode, final long timeout) { if (anode.equals(node)) { return true; } else if (anode.indexOf('@', 0) < 0 && anode.equals(node.substring(0, node.indexOf('@', 0)))) { return true; } // other node OtpMbox mbox = null; try { mbox = createMbox(); mbox.send("net_kernel", anode, getPingTuple(mbox)); final OtpErlangObject reply = mbox.receive(timeout); final OtpErlangTuple t = (OtpErlangTuple) reply; final OtpErlangAtom a = (OtpErlangAtom) t.elementAt(1); return "yes".equals(a.atomValue()); } catch (final Exception e) { } finally { closeMbox(mbox); } return false; }
class class_name[name] begin[{] method[ping, return_type[type[boolean]], modifier[public], parameter[anode, timeout]] begin[{] if[call[anode.equals, parameter[member[.node]]]] begin[{] return[literal[true]] else begin[{] if[binary_operation[binary_operation[call[anode.indexOf, parameter[literal['@'], literal[0]]], <, literal[0]], &&, call[anode.equals, parameter[call[node.substring, parameter[literal[0], call[node.indexOf, parameter[literal['@'], literal[0]]]]]]]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] local_variable[type[OtpMbox], mbox] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mbox, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=createMbox, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="net_kernel"), MemberReference(member=anode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=mbox, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPingTuple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=send, postfix_operators=[], prefix_operators=[], qualifier=mbox, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=receive, postfix_operators=[], prefix_operators=[], qualifier=mbox, selectors=[], type_arguments=None), name=reply)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OtpErlangObject, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=reply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OtpErlangTuple, sub_type=None)), name=t)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OtpErlangTuple, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=OtpErlangAtom, sub_type=None)), name=a)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OtpErlangAtom, sub_type=None)), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=atomValue, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="yes"), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mbox, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeMbox, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[ping] operator[SEP] Keyword[final] identifier[String] identifier[anode] , Keyword[final] Keyword[long] identifier[timeout] operator[SEP] { Keyword[if] operator[SEP] identifier[anode] operator[SEP] identifier[equals] operator[SEP] identifier[node] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[anode] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , Other[0] operator[SEP] operator[<] Other[0] operator[&&] identifier[anode] operator[SEP] identifier[equals] operator[SEP] identifier[node] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[node] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[OtpMbox] identifier[mbox] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[mbox] operator[=] identifier[createMbox] operator[SEP] operator[SEP] operator[SEP] identifier[mbox] operator[SEP] identifier[send] operator[SEP] literal[String] , identifier[anode] , identifier[getPingTuple] operator[SEP] identifier[mbox] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[OtpErlangObject] identifier[reply] operator[=] identifier[mbox] operator[SEP] identifier[receive] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] Keyword[final] identifier[OtpErlangTuple] identifier[t] operator[=] operator[SEP] identifier[OtpErlangTuple] operator[SEP] identifier[reply] operator[SEP] Keyword[final] identifier[OtpErlangAtom] identifier[a] operator[=] operator[SEP] identifier[OtpErlangAtom] operator[SEP] identifier[t] operator[SEP] identifier[elementAt] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[a] operator[SEP] identifier[atomValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { } Keyword[finally] { identifier[closeMbox] operator[SEP] identifier[mbox] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
static String makeRelative(Path root, Path absPath) { if (!absPath.isAbsolute()) { throw new IllegalArgumentException("!absPath.isAbsolute(), absPath=" + absPath); } String p = absPath.toUri().getPath(); StringTokenizer pathTokens = new StringTokenizer(p, "/"); for(StringTokenizer rootTokens = new StringTokenizer( root.toUri().getPath(), "/"); rootTokens.hasMoreTokens(); ) { if (!rootTokens.nextToken().equals(pathTokens.nextToken())) { return null; } } StringBuilder sb = new StringBuilder(); for(; pathTokens.hasMoreTokens(); ) { sb.append(pathTokens.nextToken()); if (pathTokens.hasMoreTokens()) { sb.append(Path.SEPARATOR); } } return sb.length() == 0? ".": sb.toString(); }
class class_name[name] begin[{] method[makeRelative, return_type[type[String]], modifier[static], parameter[root, absPath]] begin[{] if[call[absPath.isAbsolute, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!absPath.isAbsolute(), absPath="), operandr=MemberReference(member=absPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], p] local_variable[type[StringTokenizer], pathTokens] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=['!'], qualifier=rootTokens, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=pathTokens, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreTokens, postfix_operators=[], prefix_operators=[], qualifier=rootTokens, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toUri, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringTokenizer, sub_type=None)), name=rootTokens)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringTokenizer, sub_type=None)), update=None), label=None) local_variable[type[StringBuilder], sb] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=pathTokens, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=hasMoreTokens, postfix_operators=[], prefix_operators=[], qualifier=pathTokens, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=Path, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreTokens, postfix_operators=[], prefix_operators=[], qualifier=pathTokens, selectors=[], type_arguments=None), init=None, update=None), label=None) return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."))] end[}] END[}]
Keyword[static] identifier[String] identifier[makeRelative] operator[SEP] identifier[Path] identifier[root] , identifier[Path] identifier[absPath] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[absPath] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[absPath] operator[SEP] operator[SEP] } identifier[String] identifier[p] operator[=] identifier[absPath] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[pathTokens] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[p] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StringTokenizer] identifier[rootTokens] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[root] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[rootTokens] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[rootTokens] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pathTokens] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[pathTokens] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[pathTokens] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pathTokens] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Path] operator[SEP] identifier[SEPARATOR] operator[SEP] operator[SEP] } } Keyword[return] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] literal[String] operator[:] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
TreeNode childWithToken(Token token) { for (TreeNode child : m_children) { if (child.getToken().equals(token)) { return child; } } return null; }
class class_name[name] begin[{] method[childWithToken, return_type[type[TreeNode]], modifier[default], parameter[token]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getToken, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=m_children, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TreeNode, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
identifier[TreeNode] identifier[childWithToken] operator[SEP] identifier[Token] identifier[token] operator[SEP] { Keyword[for] operator[SEP] identifier[TreeNode] identifier[child] operator[:] identifier[m_children] operator[SEP] { Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[token] operator[SEP] operator[SEP] { Keyword[return] identifier[child] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static <T1, T2, R> CompletableFuture<R> zip(final CompletableFuture<? extends T1> f, final Iterable<? extends T2> v, final BiFunction<? super T1, ? super T2, ? extends R> fn) { return narrow(Future.of(f) .zip(v, fn) .getFuture()); }
class class_name[name] begin[{] method[zip, return_type[type[CompletableFuture]], modifier[public static], parameter[f, v, fn]] begin[{] return[call[.narrow, parameter[call[Future.of, parameter[member[.f]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[R] operator[>] identifier[CompletableFuture] operator[<] identifier[R] operator[>] identifier[zip] operator[SEP] Keyword[final] identifier[CompletableFuture] operator[<] operator[?] Keyword[extends] identifier[T1] operator[>] identifier[f] , Keyword[final] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T2] operator[>] identifier[v] , Keyword[final] identifier[BiFunction] operator[<] operator[?] Keyword[super] identifier[T1] , operator[?] Keyword[super] identifier[T2] , operator[?] Keyword[extends] identifier[R] operator[>] identifier[fn] operator[SEP] { Keyword[return] identifier[narrow] operator[SEP] identifier[Future] operator[SEP] identifier[of] operator[SEP] identifier[f] operator[SEP] operator[SEP] identifier[zip] operator[SEP] identifier[v] , identifier[fn] operator[SEP] operator[SEP] identifier[getFuture] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static JMethod issetter(FieldOutline fieldOutline) { final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "isSet" + publicName; return theClass.getMethod(name, NONE); }
class class_name[name] begin[{] method[issetter, return_type[type[JMethod]], modifier[public static], parameter[fieldOutline]] begin[{] local_variable[type[JDefinedClass], theClass] local_variable[type[String], publicName] local_variable[type[String], name] return[call[theClass.getMethod, parameter[member[.name], member[.NONE]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JMethod] identifier[issetter] operator[SEP] identifier[FieldOutline] identifier[fieldOutline] operator[SEP] { Keyword[final] identifier[JDefinedClass] identifier[theClass] operator[=] identifier[fieldOutline] operator[SEP] identifier[parent] operator[SEP] operator[SEP] operator[SEP] identifier[implClass] operator[SEP] Keyword[final] identifier[String] identifier[publicName] operator[=] identifier[fieldOutline] operator[SEP] identifier[getPropertyInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[=] literal[String] operator[+] identifier[publicName] operator[SEP] Keyword[return] identifier[theClass] operator[SEP] identifier[getMethod] operator[SEP] identifier[name] , identifier[NONE] operator[SEP] operator[SEP] }
public static void saveAll(final Object obj, final PersistenceStoreType storeType) { try { File file = new File(persistenceStorePath + File.separator + storeType); // create necessary parent directories on file system File directory = file.getParentFile(); if (null != directory && !directory.exists()) { directory.mkdirs(); } log.info("aws-mock: saving to {}", file.getAbsolutePath()); ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file, false)); out.writeObject(obj); out.close(); } catch (FileNotFoundException e) { log.error("FileNotFoundException caught during saving object to file: {}", e.getMessage()); } catch (IOException e) { log.error("IOException caught during saving object to file: {}", e.getMessage()); } }
class class_name[name] begin[{] method[saveAll, return_type[void], modifier[public static], parameter[obj, storeType]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=persistenceStorePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[]), operator=+), operandr=MemberReference(member=storeType, 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=File, sub_type=None)), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParentFile, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), name=directory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=directory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=directory, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=mkdirs, postfix_operators=[], prefix_operators=[], qualifier=directory, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="aws-mock: saving to {}"), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None)), name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FileNotFoundException caught during saving object to file: {}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], 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=['FileNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException caught during saving object to file: {}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], 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=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[saveAll] operator[SEP] Keyword[final] identifier[Object] identifier[obj] , Keyword[final] identifier[PersistenceStoreType] identifier[storeType] operator[SEP] { Keyword[try] { identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[persistenceStorePath] operator[+] identifier[File] operator[SEP] identifier[separator] operator[+] identifier[storeType] operator[SEP] operator[SEP] identifier[File] identifier[directory] operator[=] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[directory] operator[&&] operator[!] identifier[directory] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[directory] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] } identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectOutputStream] identifier[out] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeObject] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static TagValue DecodeCompound(int offset, byte[] encoding) throws CoseException { ArrayList<TagValue> result = new ArrayList<TagValue>(); int retTag = encoding[offset]; // We only decode objects which are compound objects. That means that this bit must be set if ((encoding[offset] & 0x20) != 0x20) throw new CoseException("Invalid structure"); int[] l = DecodeLength(offset+1, encoding); int sequenceLength = l[1]; if (offset + sequenceLength > encoding.length) throw new CoseException("Invalid sequence"); offset += l[0]+1; while (sequenceLength > 0) { int tag = encoding[offset]; l = DecodeLength(offset+1, encoding); if (l[1] > sequenceLength) throw new CoseException("Invalid sequence"); if ((tag & 0x20) != 0) { result.add(DecodeCompound(offset, encoding)); offset += 1 + l[0] + l[1]; sequenceLength -= 1 + l[0] + l[1]; } else { // At some point we might want to fix this. if (tag == 6) { result.add(new TagValue(tag, Arrays.copyOfRange(encoding, offset, offset+l[1]+l[0]+1))); } else { result.add(new TagValue(tag, Arrays.copyOfRange(encoding, offset+l[0]+1, offset+1+l[0]+l[1]))); } offset += 1 + l[0] + l[1]; sequenceLength -= 1 + l[0] + l[1]; } } return new TagValue(retTag, result); }
class class_name[name] begin[{] method[DecodeCompound, return_type[type[TagValue]], modifier[public static], parameter[offset, encoding]] begin[{] local_variable[type[ArrayList], result] local_variable[type[int], retTag] if[binary_operation[binary_operation[member[.encoding], &, literal[0x20]], !=, literal[0x20]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid structure")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CoseException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], l] local_variable[type[int], sequenceLength] if[binary_operation[binary_operation[member[.offset], +, member[.sequenceLength]], >, member[encoding.length]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid sequence")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CoseException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.offset], binary_operation[member[.l], +, literal[1]]] while[binary_operation[member[.sequenceLength], >, literal[0]]] begin[{] local_variable[type[int], tag] assign[member[.l], call[.DecodeLength, parameter[binary_operation[member[.offset], +, literal[1]], member[.encoding]]]] if[binary_operation[member[.l], >, member[.sequenceLength]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid sequence")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CoseException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.tag], &, literal[0x20]], !=, literal[0]]] begin[{] call[result.add, parameter[call[.DecodeCompound, parameter[member[.offset], member[.encoding]]]]] assign[member[.offset], binary_operation[binary_operation[literal[1], +, member[.l]], +, member[.l]]] assign[member[.sequenceLength], binary_operation[binary_operation[literal[1], +, member[.l]], +, member[.l]]] else begin[{] if[binary_operation[member[.tag], ==, literal[6]]] begin[{] call[result.add, parameter[ClassCreator(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=+), operandr=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=copyOfRange, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TagValue, sub_type=None))]] else begin[{] call[result.add, parameter[ClassCreator(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=+), operandr=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=+)], member=copyOfRange, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TagValue, sub_type=None))]] end[}] assign[member[.offset], binary_operation[binary_operation[literal[1], +, member[.l]], +, member[.l]]] assign[member[.sequenceLength], binary_operation[binary_operation[literal[1], +, member[.l]], +, member[.l]]] end[}] end[}] return[ClassCreator(arguments=[MemberReference(member=retTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, 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=TagValue, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[TagValue] identifier[DecodeCompound] operator[SEP] Keyword[int] identifier[offset] , Keyword[byte] operator[SEP] operator[SEP] identifier[encoding] operator[SEP] Keyword[throws] identifier[CoseException] { identifier[ArrayList] operator[<] identifier[TagValue] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[TagValue] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[retTag] operator[=] identifier[encoding] operator[SEP] identifier[offset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[encoding] operator[SEP] identifier[offset] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[!=] literal[Integer] operator[SEP] Keyword[throw] Keyword[new] identifier[CoseException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[DecodeLength] operator[SEP] identifier[offset] operator[+] Other[1] , identifier[encoding] operator[SEP] operator[SEP] Keyword[int] identifier[sequenceLength] operator[=] identifier[l] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[+] identifier[sequenceLength] operator[>] identifier[encoding] operator[SEP] identifier[length] operator[SEP] Keyword[throw] Keyword[new] identifier[CoseException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[sequenceLength] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[tag] operator[=] identifier[encoding] operator[SEP] identifier[offset] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[DecodeLength] operator[SEP] identifier[offset] operator[+] Other[1] , identifier[encoding] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[SEP] Other[1] operator[SEP] operator[>] identifier[sequenceLength] operator[SEP] Keyword[throw] Keyword[new] identifier[CoseException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[tag] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[DecodeCompound] operator[SEP] identifier[offset] , identifier[encoding] operator[SEP] operator[SEP] operator[SEP] identifier[offset] operator[+=] Other[1] operator[+] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] identifier[l] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[sequenceLength] operator[-=] Other[1] operator[+] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] identifier[l] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[tag] operator[==] Other[6] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[TagValue] operator[SEP] identifier[tag] , identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[encoding] , identifier[offset] , identifier[offset] operator[+] identifier[l] operator[SEP] Other[1] operator[SEP] operator[+] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[TagValue] operator[SEP] identifier[tag] , identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[encoding] , identifier[offset] operator[+] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] Other[1] , identifier[offset] operator[+] Other[1] operator[+] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] identifier[l] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[offset] operator[+=] Other[1] operator[+] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] identifier[l] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[sequenceLength] operator[-=] Other[1] operator[+] identifier[l] operator[SEP] Other[0] operator[SEP] operator[+] identifier[l] operator[SEP] Other[1] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[TagValue] operator[SEP] identifier[retTag] , identifier[result] operator[SEP] operator[SEP] }
public void update(String newPath) throws IOException { String id = hostname + Thread.currentThread().getId(); CurrentInProgressMetadataWritable cip = localWritable.get(); cip.set(id, newPath); byte[] data = WritableUtil.writableToByteArray(cip); try { zooKeeper.setData(fullyQualifiedZNode, data, expectedZNodeVersion.get()); if (LOG.isDebugEnabled()) { LOG.debug("Set " + fullyQualifiedZNode + " to point to " + newPath); } } catch (KeeperException.BadVersionException e) { // Throw an exception if we try to update without having read the // current version LOG.error(fullyQualifiedZNode + " has been updated by another process", e); throw new StaleVersionException(fullyQualifiedZNode + "has been updated by another process!"); } catch (KeeperException e) { keeperException("Unrecoverable ZooKeeper error updating " + fullyQualifiedZNode, e); } catch (InterruptedException e) { interruptedException("Interrupted updating " + fullyQualifiedZNode, e); } }
class class_name[name] begin[{] method[update, return_type[void], modifier[public], parameter[newPath]] begin[{] local_variable[type[String], id] local_variable[type[CurrentInProgressMetadataWritable], cip] call[cip.set, parameter[member[.id], member[.newPath]]] local_variable[type[byte], data] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fullyQualifiedZNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=expectedZNodeVersion, selectors=[], type_arguments=None)], member=setData, postfix_operators=[], prefix_operators=[], qualifier=zooKeeper, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Set "), operandr=MemberReference(member=fullyQualifiedZNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to point to "), operator=+), operandr=MemberReference(member=newPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=fullyQualifiedZNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has been updated by another process"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=fullyQualifiedZNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="has been updated by another process!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StaleVersionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeeperException.BadVersionException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecoverable ZooKeeper error updating "), operandr=MemberReference(member=fullyQualifiedZNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keeperException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeeperException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Interrupted updating "), operandr=MemberReference(member=fullyQualifiedZNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=interruptedException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[update] operator[SEP] identifier[String] identifier[newPath] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[id] operator[=] identifier[hostname] operator[+] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[CurrentInProgressMetadataWritable] identifier[cip] operator[=] identifier[localWritable] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[cip] operator[SEP] identifier[set] operator[SEP] identifier[id] , identifier[newPath] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[WritableUtil] operator[SEP] identifier[writableToByteArray] operator[SEP] identifier[cip] operator[SEP] operator[SEP] Keyword[try] { identifier[zooKeeper] operator[SEP] identifier[setData] operator[SEP] identifier[fullyQualifiedZNode] , identifier[data] , identifier[expectedZNodeVersion] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[fullyQualifiedZNode] operator[+] literal[String] operator[+] identifier[newPath] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[KeeperException] operator[SEP] identifier[BadVersionException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[fullyQualifiedZNode] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[StaleVersionException] operator[SEP] identifier[fullyQualifiedZNode] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[KeeperException] identifier[e] operator[SEP] { identifier[keeperException] operator[SEP] literal[String] operator[+] identifier[fullyQualifiedZNode] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[interruptedException] operator[SEP] literal[String] operator[+] identifier[fullyQualifiedZNode] , identifier[e] operator[SEP] operator[SEP] } }
public static List<String> split( final String src, final String delim, final boolean trim ) { if ( delim == null ) { throw new IllegalArgumentException( "delim cannot be null" ); } // // Return an empty array if the string is null // if ( StringUtils.isBlank( src ) ) { return Collections.emptyList(); } List<String> list = new ArrayList<String>(); // // Need to allow splitting strings by spaces // so we don't want to check for Blank strings // as well. // if ( delim.isEmpty() ) { list.add( src ); return list; } int delimLength = delim.length(); int index = 0; int start = 0; String piece; while ( index < src.length() ) { index = src.indexOf( delim, index ); if ( index == -1 ) { break; } // // Add the substring to the list. // piece = src.substring( start, index ); if ( trim ) { list.add( piece.trim() ); } else { list.add( piece ); } // // Skip further along the buffer, past what we // replaced, so we don't end up possibly in an infinite // loop. // start = index + delimLength; index += delimLength; } // // Make sure the end of the string gets added. // if ( trim ) { list.add( src.substring( start ).trim() ); } else { list.add( src.substring( start ) ); } // // Output a list, given our list contents. // return list; }
class class_name[name] begin[{] method[split, return_type[type[List]], modifier[public static], parameter[src, delim, trim]] begin[{] if[binary_operation[member[.delim], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="delim cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[call[StringUtils.isBlank, parameter[member[.src]]]] begin[{] return[call[Collections.emptyList, parameter[]]] else begin[{] None end[}] local_variable[type[List], list] if[call[delim.isEmpty, parameter[]]] begin[{] call[list.add, parameter[member[.src]]] return[member[.list]] else begin[{] None end[}] local_variable[type[int], delimLength] local_variable[type[int], index] local_variable[type[int], start] local_variable[type[String], piece] while[binary_operation[member[.index], <, call[src.length, parameter[]]]] begin[{] assign[member[.index], call[src.indexOf, parameter[member[.delim], member[.index]]]] if[binary_operation[member[.index], ==, literal[1]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.piece], call[src.substring, parameter[member[.start], member[.index]]]] if[member[.trim]] begin[{] call[list.add, parameter[call[piece.trim, parameter[]]]] else begin[{] call[list.add, parameter[member[.piece]]] end[}] assign[member[.start], binary_operation[member[.index], +, member[.delimLength]]] assign[member[.index], member[.delimLength]] end[}] if[member[.trim]] begin[{] call[list.add, parameter[call[src.substring, parameter[member[.start]]]]] else begin[{] call[list.add, parameter[call[src.substring, parameter[member[.start]]]]] end[}] return[member[.list]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[split] operator[SEP] Keyword[final] identifier[String] identifier[src] , Keyword[final] identifier[String] identifier[delim] , Keyword[final] Keyword[boolean] identifier[trim] operator[SEP] { Keyword[if] operator[SEP] identifier[delim] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[src] operator[SEP] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] 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[delim] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[src] operator[SEP] operator[SEP] Keyword[return] identifier[list] operator[SEP] } Keyword[int] identifier[delimLength] operator[=] identifier[delim] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] identifier[String] identifier[piece] operator[SEP] Keyword[while] operator[SEP] identifier[index] operator[<] identifier[src] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[index] operator[=] identifier[src] operator[SEP] identifier[indexOf] operator[SEP] identifier[delim] , identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { Keyword[break] operator[SEP] } identifier[piece] operator[=] identifier[src] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trim] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[piece] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[piece] operator[SEP] operator[SEP] } identifier[start] operator[=] identifier[index] operator[+] identifier[delimLength] operator[SEP] identifier[index] operator[+=] identifier[delimLength] operator[SEP] } Keyword[if] operator[SEP] identifier[trim] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[src] operator[SEP] identifier[substring] operator[SEP] identifier[start] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[src] operator[SEP] identifier[substring] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }
public static double blackScholesOptionTheta( double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike) { if(optionStrike <= 0.0 || optionMaturity <= 0.0) { // The Black-Scholes model does not consider it being an option return 0.0; } else { // Calculate theta double dPlus = (Math.log(initialStockValue / optionStrike) + (riskFreeRate + 0.5 * volatility * volatility) * optionMaturity) / (volatility * Math.sqrt(optionMaturity)); double dMinus = dPlus - volatility * Math.sqrt(optionMaturity); double theta = volatility * Math.exp(-0.5*dPlus*dPlus) / Math.sqrt(2.0 * Math.PI) / Math.sqrt(optionMaturity) / 2 * initialStockValue + riskFreeRate * optionStrike * Math.exp(-riskFreeRate * optionMaturity) * NormalDistribution.cumulativeDistribution(dMinus); return theta; } }
class class_name[name] begin[{] method[blackScholesOptionTheta, return_type[type[double]], modifier[public static], parameter[initialStockValue, riskFreeRate, volatility, optionMaturity, optionStrike]] begin[{] if[binary_operation[binary_operation[member[.optionStrike], <=, literal[0.0]], ||, binary_operation[member[.optionMaturity], <=, literal[0.0]]]] begin[{] return[literal[0.0]] else begin[{] local_variable[type[double], dPlus] local_variable[type[double], dMinus] local_variable[type[double], theta] return[member[.theta]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[blackScholesOptionTheta] operator[SEP] Keyword[double] identifier[initialStockValue] , Keyword[double] identifier[riskFreeRate] , Keyword[double] identifier[volatility] , Keyword[double] identifier[optionMaturity] , Keyword[double] identifier[optionStrike] operator[SEP] { Keyword[if] operator[SEP] identifier[optionStrike] operator[<=] literal[Float] operator[||] identifier[optionMaturity] operator[<=] literal[Float] operator[SEP] { Keyword[return] literal[Float] operator[SEP] } Keyword[else] { Keyword[double] identifier[dPlus] operator[=] operator[SEP] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[initialStockValue] operator[/] identifier[optionStrike] operator[SEP] operator[+] operator[SEP] identifier[riskFreeRate] operator[+] literal[Float] operator[*] identifier[volatility] operator[*] identifier[volatility] operator[SEP] operator[*] identifier[optionMaturity] operator[SEP] operator[/] operator[SEP] identifier[volatility] operator[*] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[optionMaturity] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[dMinus] operator[=] identifier[dPlus] operator[-] identifier[volatility] operator[*] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[optionMaturity] operator[SEP] operator[SEP] Keyword[double] identifier[theta] operator[=] identifier[volatility] operator[*] identifier[Math] operator[SEP] identifier[exp] operator[SEP] operator[-] literal[Float] operator[*] identifier[dPlus] operator[*] identifier[dPlus] operator[SEP] operator[/] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] literal[Float] operator[*] identifier[Math] operator[SEP] identifier[PI] operator[SEP] operator[/] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[optionMaturity] operator[SEP] operator[/] Other[2] operator[*] identifier[initialStockValue] operator[+] identifier[riskFreeRate] operator[*] identifier[optionStrike] operator[*] identifier[Math] operator[SEP] identifier[exp] operator[SEP] operator[-] identifier[riskFreeRate] operator[*] identifier[optionMaturity] operator[SEP] operator[*] identifier[NormalDistribution] operator[SEP] identifier[cumulativeDistribution] operator[SEP] identifier[dMinus] operator[SEP] operator[SEP] Keyword[return] identifier[theta] operator[SEP] } }
@Override void incr0( int b, double y ) { Utils.AtomicDoubleArray.add(_sums,b,y); Utils.AtomicDoubleArray.add(_ssqs,b,y*y); }
class class_name[name] begin[{] method[incr0, return_type[void], modifier[default], parameter[b, y]] begin[{] call[Utils.AtomicDoubleArray.add, parameter[member[._sums], member[.b], member[.y]]] call[Utils.AtomicDoubleArray.add, parameter[member[._ssqs], member[.b], binary_operation[member[.y], *, member[.y]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[void] identifier[incr0] operator[SEP] Keyword[int] identifier[b] , Keyword[double] identifier[y] operator[SEP] { identifier[Utils] operator[SEP] identifier[AtomicDoubleArray] operator[SEP] identifier[add] operator[SEP] identifier[_sums] , identifier[b] , identifier[y] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[AtomicDoubleArray] operator[SEP] identifier[add] operator[SEP] identifier[_ssqs] , identifier[b] , identifier[y] operator[*] identifier[y] operator[SEP] operator[SEP] }
@Override protected void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue) { verbosely(new Runnable() { @Override public void run() { ServerAttribute.super.firePropertyChange(propertyName, oldValue, newValue); } }); }
class class_name[name] begin[{] method[firePropertyChange, return_type[void], modifier[protected], parameter[propertyName, oldValue, newValue]] begin[{] call[.verbosely, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MemberReference(member=ServerAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[SuperMethodInvocation(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firePropertyChange, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], 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=Runnable, sub_type=None))]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[firePropertyChange] operator[SEP] Keyword[final] identifier[String] identifier[propertyName] , Keyword[final] identifier[Object] identifier[oldValue] , Keyword[final] identifier[Object] identifier[newValue] operator[SEP] { identifier[verbosely] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[ServerAttribute] operator[SEP] Keyword[super] operator[SEP] identifier[firePropertyChange] operator[SEP] identifier[propertyName] , identifier[oldValue] , identifier[newValue] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public final void cancel () { cancelRunningChildren(0); Status previousStatus = status; status = Status.CANCELLED; if (tree.listeners != null && tree.listeners.size > 0) tree.notifyStatusUpdated(this, previousStatus); end(); }
class class_name[name] begin[{] method[cancel, return_type[void], modifier[final public], parameter[]] begin[{] call[.cancelRunningChildren, parameter[literal[0]]] local_variable[type[Status], previousStatus] assign[member[.status], member[Status.CANCELLED]] if[binary_operation[binary_operation[member[tree.listeners], !=, literal[null]], &&, binary_operation[member[tree.listeners.size], >, literal[0]]]] begin[{] call[tree.notifyStatusUpdated, parameter[THIS[], member[.previousStatus]]] else begin[{] None end[}] call[.end, parameter[]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[cancel] operator[SEP] operator[SEP] { identifier[cancelRunningChildren] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Status] identifier[previousStatus] operator[=] identifier[status] operator[SEP] identifier[status] operator[=] identifier[Status] operator[SEP] identifier[CANCELLED] operator[SEP] Keyword[if] operator[SEP] identifier[tree] operator[SEP] identifier[listeners] operator[!=] Other[null] operator[&&] identifier[tree] operator[SEP] identifier[listeners] operator[SEP] identifier[size] operator[>] Other[0] operator[SEP] identifier[tree] operator[SEP] identifier[notifyStatusUpdated] operator[SEP] Keyword[this] , identifier[previousStatus] operator[SEP] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] }
private void bindValue(Triple triple, Model model) { if (log.isDebugEnabled()) log.debug(String.valueOf(triple)); BioPAXElement domain = model.getByID(triple.domain); PropertyEditor editor = this.getEditorMap().getEditorForProperty(triple.property, domain.getModelInterface()); bindValue(triple.range, editor, domain, model); }
class class_name[name] begin[{] method[bindValue, return_type[void], modifier[private], parameter[triple, model]] begin[{] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[call[String.valueOf, parameter[member[.triple]]]]] else begin[{] None end[}] local_variable[type[BioPAXElement], domain] local_variable[type[PropertyEditor], editor] call[.bindValue, parameter[member[triple.range], member[.editor], member[.domain], member[.model]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[bindValue] operator[SEP] identifier[Triple] identifier[triple] , identifier[Model] identifier[model] 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[valueOf] operator[SEP] identifier[triple] operator[SEP] operator[SEP] operator[SEP] identifier[BioPAXElement] identifier[domain] operator[=] identifier[model] operator[SEP] identifier[getByID] operator[SEP] identifier[triple] operator[SEP] identifier[domain] operator[SEP] operator[SEP] identifier[PropertyEditor] identifier[editor] operator[=] Keyword[this] operator[SEP] identifier[getEditorMap] operator[SEP] operator[SEP] operator[SEP] identifier[getEditorForProperty] operator[SEP] identifier[triple] operator[SEP] identifier[property] , identifier[domain] operator[SEP] identifier[getModelInterface] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bindValue] operator[SEP] identifier[triple] operator[SEP] identifier[range] , identifier[editor] , identifier[domain] , identifier[model] operator[SEP] operator[SEP] }
@Override public final int getItemViewType(int position) { Log.v(TAG, "getItemCount() position=" + position + " headerItemCount=" + headerItemCount + " contentItemCount=" + contentItemCount + " footerItemCount=" + footerItemCount); // Delegate to proper methods based on the position, but validate first. if (headerItemCount > 0 && position < headerItemCount) { return validateViewType(getHeaderItemViewType(position)) + HEADER_VIEW_TYPE_OFFSET; } else if (contentItemCount > 0 && position - headerItemCount < contentItemCount) { return validateViewType(getContentItemViewType(position - headerItemCount)) + CONTENT_VIEW_TYPE_OFFSET; } else { return validateViewType(getFooterItemViewType(position - headerItemCount - contentItemCount)) + FOOTER_VIEW_TYPE_OFFSET; } }
class class_name[name] begin[{] method[getItemViewType, return_type[type[int]], modifier[final public], parameter[position]] begin[{] call[Log.v, parameter[member[.TAG], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["getItemCount() position="], +, member[.position]], +, literal[" headerItemCount="]], +, member[.headerItemCount]], +, literal[" contentItemCount="]], +, member[.contentItemCount]], +, literal[" footerItemCount="]], +, member[.footerItemCount]]]] if[binary_operation[binary_operation[member[.headerItemCount], >, literal[0]], &&, binary_operation[member[.position], <, member[.headerItemCount]]]] begin[{] return[binary_operation[call[.validateViewType, parameter[call[.getHeaderItemViewType, parameter[member[.position]]]]], +, member[.HEADER_VIEW_TYPE_OFFSET]]] else begin[{] if[binary_operation[binary_operation[member[.contentItemCount], >, literal[0]], &&, binary_operation[binary_operation[member[.position], -, member[.headerItemCount]], <, member[.contentItemCount]]]] begin[{] return[binary_operation[call[.validateViewType, parameter[call[.getContentItemViewType, parameter[binary_operation[member[.position], -, member[.headerItemCount]]]]]], +, member[.CONTENT_VIEW_TYPE_OFFSET]]] else begin[{] return[binary_operation[call[.validateViewType, parameter[call[.getFooterItemViewType, parameter[binary_operation[binary_operation[member[.position], -, member[.headerItemCount]], -, member[.contentItemCount]]]]]], +, member[.FOOTER_VIEW_TYPE_OFFSET]]] end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[int] identifier[getItemViewType] operator[SEP] Keyword[int] identifier[position] operator[SEP] { identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[position] operator[+] literal[String] operator[+] identifier[headerItemCount] operator[+] literal[String] operator[+] identifier[contentItemCount] operator[+] literal[String] operator[+] identifier[footerItemCount] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[headerItemCount] operator[>] Other[0] operator[&&] identifier[position] operator[<] identifier[headerItemCount] operator[SEP] { Keyword[return] identifier[validateViewType] operator[SEP] identifier[getHeaderItemViewType] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[+] identifier[HEADER_VIEW_TYPE_OFFSET] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[contentItemCount] operator[>] Other[0] operator[&&] identifier[position] operator[-] identifier[headerItemCount] operator[<] identifier[contentItemCount] operator[SEP] { Keyword[return] identifier[validateViewType] operator[SEP] identifier[getContentItemViewType] operator[SEP] identifier[position] operator[-] identifier[headerItemCount] operator[SEP] operator[SEP] operator[+] identifier[CONTENT_VIEW_TYPE_OFFSET] operator[SEP] } Keyword[else] { Keyword[return] identifier[validateViewType] operator[SEP] identifier[getFooterItemViewType] operator[SEP] identifier[position] operator[-] identifier[headerItemCount] operator[-] identifier[contentItemCount] operator[SEP] operator[SEP] operator[+] identifier[FOOTER_VIEW_TYPE_OFFSET] operator[SEP] } }
public Annotation[] getRuntimeInvisibleAnnotations() { for (int i = mAttributes.size(); --i >= 0; ) { Attribute attr = mAttributes.get(i); if (attr instanceof RuntimeInvisibleAnnotationsAttr) { return ((AnnotationsAttr) attr).getAnnotations(); } } return new Annotation[0]; }
class class_name[name] begin[{] method[getRuntimeInvisibleAnnotations, return_type[type[Annotation]], modifier[public], parameter[]] 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=mAttributes, selectors=[], type_arguments=None), name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RuntimeInvisibleAnnotationsAttr, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationsAttr, sub_type=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=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=mAttributes, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None) return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Annotation, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Annotation] operator[SEP] operator[SEP] identifier[getRuntimeInvisibleAnnotations] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[mAttributes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[--] identifier[i] operator[>=] Other[0] operator[SEP] operator[SEP] { identifier[Attribute] identifier[attr] operator[=] identifier[mAttributes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] Keyword[instanceof] identifier[RuntimeInvisibleAnnotationsAttr] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[AnnotationsAttr] operator[SEP] identifier[attr] operator[SEP] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[Annotation] operator[SEP] Other[0] operator[SEP] operator[SEP] }
public NotificationChain basicSetTruncatedNormalDistribution(TruncatedNormalDistributionType newTruncatedNormalDistribution, NotificationChain msgs) { return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION, newTruncatedNormalDistribution, msgs); }
class class_name[name] begin[{] method[basicSetTruncatedNormalDistribution, return_type[type[NotificationChain]], modifier[public], parameter[newTruncatedNormalDistribution, msgs]] begin[{] return[Cast(expression=MethodInvocation(arguments=[], member=getMixed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FeatureMap, sub_type=ReferenceType(arguments=None, dimensions=None, name=Internal, sub_type=None)))] end[}] END[}]
Keyword[public] identifier[NotificationChain] identifier[basicSetTruncatedNormalDistribution] operator[SEP] identifier[TruncatedNormalDistributionType] identifier[newTruncatedNormalDistribution] , identifier[NotificationChain] identifier[msgs] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[FeatureMap] operator[SEP] identifier[Internal] operator[SEP] identifier[getMixed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[basicAdd] operator[SEP] identifier[BpsimPackage] operator[SEP] identifier[Literals] operator[SEP] identifier[DOCUMENT_ROOT__TRUNCATED_NORMAL_DISTRIBUTION] , identifier[newTruncatedNormalDistribution] , identifier[msgs] operator[SEP] operator[SEP] }
public static Entry namedObject(Dn dn) { Entry entry = new DefaultEntry(dn); try { entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, SchemaConstants.NAMED_OBJECT_OC); entry.add(SchemaConstants.CN_ATTRIBUTE, dn.getRdn().getName()); } catch (LdapException e) { throw new LdapRuntimeException(e); } return entry; }
class class_name[name] begin[{] method[namedObject, return_type[type[Entry]], modifier[public static], parameter[dn]] begin[{] local_variable[type[Entry], entry] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OBJECT_CLASS_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=SchemaConstants, selectors=[]), MemberReference(member=NAMED_OBJECT_OC, postfix_operators=[], prefix_operators=[], qualifier=SchemaConstants, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CN_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=SchemaConstants, selectors=[]), MethodInvocation(arguments=[], member=getRdn, postfix_operators=[], prefix_operators=[], qualifier=dn, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LdapRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LdapException']))], finally_block=None, label=None, resources=None) return[member[.entry]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Entry] identifier[namedObject] operator[SEP] identifier[Dn] identifier[dn] operator[SEP] { identifier[Entry] identifier[entry] operator[=] Keyword[new] identifier[DefaultEntry] operator[SEP] identifier[dn] operator[SEP] operator[SEP] Keyword[try] { identifier[entry] operator[SEP] identifier[add] operator[SEP] identifier[SchemaConstants] operator[SEP] identifier[OBJECT_CLASS_ATTRIBUTE] , identifier[SchemaConstants] operator[SEP] identifier[NAMED_OBJECT_OC] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[add] operator[SEP] identifier[SchemaConstants] operator[SEP] identifier[CN_ATTRIBUTE] , identifier[dn] operator[SEP] identifier[getRdn] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[LdapException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[LdapRuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[entry] operator[SEP] }
protected int getTypedAttribute(int nodeHandle, int attType) { int type = getNodeType(nodeHandle); if (DTM.ELEMENT_NODE == type) { int identity = makeNodeIdentity(nodeHandle); while (DTM.NULL != (identity = getNextNodeIdentity(identity))) { type = _type(identity); if (type == DTM.ATTRIBUTE_NODE) { if (_exptype(identity) == attType) return makeNodeHandle(identity); } else if (DTM.NAMESPACE_NODE != type) { break; } } } return DTM.NULL; }
class class_name[name] begin[{] method[getTypedAttribute, return_type[type[int]], modifier[protected], parameter[nodeHandle, attType]] begin[{] local_variable[type[int], type] if[binary_operation[member[DTM.ELEMENT_NODE], ==, member[.type]]] begin[{] local_variable[type[int], identity] while[binary_operation[member[DTM.NULL], !=, assign[member[.identity], call[.getNextNodeIdentity, parameter[member[.identity]]]]]] begin[{] assign[member[.type], call[._type, parameter[member[.identity]]]] if[binary_operation[member[.type], ==, member[DTM.ATTRIBUTE_NODE]]] begin[{] if[binary_operation[call[._exptype, parameter[member[.identity]]], ==, member[.attType]]] begin[{] return[call[.makeNodeHandle, parameter[member[.identity]]]] else begin[{] None end[}] else begin[{] if[binary_operation[member[DTM.NAMESPACE_NODE], !=, member[.type]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] return[member[DTM.NULL]] end[}] END[}]
Keyword[protected] Keyword[int] identifier[getTypedAttribute] operator[SEP] Keyword[int] identifier[nodeHandle] , Keyword[int] identifier[attType] operator[SEP] { Keyword[int] identifier[type] operator[=] identifier[getNodeType] operator[SEP] identifier[nodeHandle] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DTM] operator[SEP] identifier[ELEMENT_NODE] operator[==] identifier[type] operator[SEP] { Keyword[int] identifier[identity] operator[=] identifier[makeNodeIdentity] operator[SEP] identifier[nodeHandle] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[DTM] operator[SEP] identifier[NULL] operator[!=] operator[SEP] identifier[identity] operator[=] identifier[getNextNodeIdentity] operator[SEP] identifier[identity] operator[SEP] operator[SEP] operator[SEP] { identifier[type] operator[=] identifier[_type] operator[SEP] identifier[identity] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[DTM] operator[SEP] identifier[ATTRIBUTE_NODE] operator[SEP] { Keyword[if] operator[SEP] identifier[_exptype] operator[SEP] identifier[identity] operator[SEP] operator[==] identifier[attType] operator[SEP] Keyword[return] identifier[makeNodeHandle] operator[SEP] identifier[identity] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[DTM] operator[SEP] identifier[NAMESPACE_NODE] operator[!=] identifier[type] operator[SEP] { Keyword[break] operator[SEP] } } } Keyword[return] identifier[DTM] operator[SEP] identifier[NULL] operator[SEP] }
public static byte[] serialize(Serializable obj, boolean gzipOnSerialize) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out; if (gzipOnSerialize) { out = new ObjectOutputStream(new GZIPOutputStream(baos)); } else { out = new ObjectOutputStream(baos); } out.writeObject(obj); out.flush(); out.close(); return baos.toByteArray(); } catch (IOException e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[serialize, return_type[type[byte]], modifier[public static], parameter[obj, gzipOnSerialize]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=baos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectOutputStream, sub_type=None)), IfStatement(condition=MemberReference(member=gzipOnSerialize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=baos, 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=ObjectOutputStream, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=baos, 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=GZIPOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=baos, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[serialize] operator[SEP] identifier[Serializable] identifier[obj] , Keyword[boolean] identifier[gzipOnSerialize] operator[SEP] { Keyword[try] { identifier[ByteArrayOutputStream] identifier[baos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectOutputStream] identifier[out] operator[SEP] Keyword[if] operator[SEP] identifier[gzipOnSerialize] operator[SEP] { identifier[out] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] Keyword[new] identifier[GZIPOutputStream] operator[SEP] identifier[baos] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[out] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] identifier[baos] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[writeObject] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[baos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public void addPackageNoDefaults(PackageInfo packageInfo) { PackageStats packageStats = new PackageStats(packageInfo.packageName); addPackage(packageInfo, packageStats); }
class class_name[name] begin[{] method[addPackageNoDefaults, return_type[void], modifier[public], parameter[packageInfo]] begin[{] local_variable[type[PackageStats], packageStats] call[.addPackage, parameter[member[.packageInfo], member[.packageStats]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addPackageNoDefaults] operator[SEP] identifier[PackageInfo] identifier[packageInfo] operator[SEP] { identifier[PackageStats] identifier[packageStats] operator[=] Keyword[new] identifier[PackageStats] operator[SEP] identifier[packageInfo] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] identifier[addPackage] operator[SEP] identifier[packageInfo] , identifier[packageStats] operator[SEP] operator[SEP] }
public static <N> Traverser<N> forTree(SuccessorsFunction<N> tree) { checkNotNull(tree); if (tree instanceof BaseGraph) { checkArgument(((BaseGraph<?>) tree).isDirected(), "Undirected graphs can never be trees."); } if (tree instanceof Network) { checkArgument(((Network<?, ?>) tree).isDirected(), "Undirected networks can never be trees."); } return new TreeTraverser<>(tree); }
class class_name[name] begin[{] method[forTree, return_type[type[Traverser]], modifier[public static], parameter[tree]] begin[{] call[.checkNotNull, parameter[member[.tree]]] if[binary_operation[member[.tree], instanceof, type[BaseGraph]]] begin[{] call[.checkArgument, parameter[Cast(expression=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=BaseGraph, sub_type=None)), literal["Undirected graphs can never be trees."]]] else begin[{] None end[}] if[binary_operation[member[.tree], instanceof, type[Network]]] begin[{] call[.checkArgument, parameter[Cast(expression=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Network, sub_type=None)), literal["Undirected networks can never be trees."]]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TreeTraverser, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[N] operator[>] identifier[Traverser] operator[<] identifier[N] operator[>] identifier[forTree] operator[SEP] identifier[SuccessorsFunction] operator[<] identifier[N] operator[>] identifier[tree] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[tree] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tree] Keyword[instanceof] identifier[BaseGraph] operator[SEP] { identifier[checkArgument] operator[SEP] operator[SEP] operator[SEP] identifier[BaseGraph] operator[<] operator[?] operator[>] operator[SEP] identifier[tree] operator[SEP] operator[SEP] identifier[isDirected] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tree] Keyword[instanceof] identifier[Network] operator[SEP] { identifier[checkArgument] operator[SEP] operator[SEP] operator[SEP] identifier[Network] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[tree] operator[SEP] operator[SEP] identifier[isDirected] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[TreeTraverser] operator[<] operator[>] operator[SEP] identifier[tree] operator[SEP] operator[SEP] }
public synchronized void writeLog(String log) throws IOException { if (mFile.length() < mFileMaxSize) { writeLogToFile(log, mFile, true); } else { rotateLogFiles(); createNewFile(); writeLogToFile(log, mFile, false); } }
class class_name[name] begin[{] method[writeLog, return_type[void], modifier[synchronized public], parameter[log]] begin[{] if[binary_operation[call[mFile.length, parameter[]], <, member[.mFileMaxSize]]] begin[{] call[.writeLogToFile, parameter[member[.log], member[.mFile], literal[true]]] else begin[{] call[.rotateLogFiles, parameter[]] call[.createNewFile, parameter[]] call[.writeLogToFile, parameter[member[.log], member[.mFile], literal[false]]] end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[writeLog] operator[SEP] identifier[String] identifier[log] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[mFile] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[mFileMaxSize] operator[SEP] { identifier[writeLogToFile] operator[SEP] identifier[log] , identifier[mFile] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[rotateLogFiles] operator[SEP] operator[SEP] operator[SEP] identifier[createNewFile] operator[SEP] operator[SEP] operator[SEP] identifier[writeLogToFile] operator[SEP] identifier[log] , identifier[mFile] , literal[boolean] operator[SEP] operator[SEP] } }
public Collection<ApplicationInstance> list(long applicationId, List<String> queryParams) { return HTTP.GET(String.format("/v2/applications/%d/instances.json", applicationId), null, queryParams, APPLICATION_INSTANCES).get(); }
class class_name[name] begin[{] method[list, return_type[type[Collection]], modifier[public], parameter[applicationId, queryParams]] begin[{] return[call[HTTP.GET, parameter[call[String.format, parameter[literal["/v2/applications/%d/instances.json"], member[.applicationId]]], literal[null], member[.queryParams], member[.APPLICATION_INSTANCES]]]] end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[ApplicationInstance] operator[>] identifier[list] operator[SEP] Keyword[long] identifier[applicationId] , identifier[List] operator[<] identifier[String] operator[>] identifier[queryParams] operator[SEP] { Keyword[return] identifier[HTTP] operator[SEP] identifier[GET] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[applicationId] operator[SEP] , Other[null] , identifier[queryParams] , identifier[APPLICATION_INSTANCES] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] }
public void openCategories(CmsResource resource) { getRpcProxy(I_CmsGwtDialogClientRpc.class).openCategoriesDialog( resource.getStructureId().toString(), OpenCms.getWorkplaceManager().isDisplayCategorySelectionCollapsed()); }
class class_name[name] begin[{] method[openCategories, return_type[void], modifier[public], parameter[resource]] begin[{] call[.getRpcProxy, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=I_CmsGwtDialogClientRpc, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[openCategories] operator[SEP] identifier[CmsResource] identifier[resource] operator[SEP] { identifier[getRpcProxy] operator[SEP] identifier[I_CmsGwtDialogClientRpc] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[openCategoriesDialog] operator[SEP] identifier[resource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[isDisplayCategorySelectionCollapsed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public List<DbModule> getAncestors(final String gavc, final FiltersHolder filters) { final DbArtifact dbArtifact = getArtifact(gavc); return repositoryHandler.getAncestors(dbArtifact, filters); }
class class_name[name] begin[{] method[getAncestors, return_type[type[List]], modifier[public], parameter[gavc, filters]] begin[{] local_variable[type[DbArtifact], dbArtifact] return[call[repositoryHandler.getAncestors, parameter[member[.dbArtifact], member[.filters]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[DbModule] operator[>] identifier[getAncestors] operator[SEP] Keyword[final] identifier[String] identifier[gavc] , Keyword[final] identifier[FiltersHolder] identifier[filters] operator[SEP] { Keyword[final] identifier[DbArtifact] identifier[dbArtifact] operator[=] identifier[getArtifact] operator[SEP] identifier[gavc] operator[SEP] operator[SEP] Keyword[return] identifier[repositoryHandler] operator[SEP] identifier[getAncestors] operator[SEP] identifier[dbArtifact] , identifier[filters] operator[SEP] operator[SEP] }
public Matcher matcher(char[] data, int start, int end) { Matcher m = new Matcher(this); m.setTarget(data, start, end); return m; }
class class_name[name] begin[{] method[matcher, return_type[type[Matcher]], modifier[public], parameter[data, start, end]] begin[{] local_variable[type[Matcher], m] call[m.setTarget, parameter[member[.data], member[.start], member[.end]]] return[member[.m]] end[}] END[}]
Keyword[public] identifier[Matcher] identifier[matcher] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[data] , Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] { identifier[Matcher] identifier[m] operator[=] Keyword[new] identifier[Matcher] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[m] operator[SEP] identifier[setTarget] operator[SEP] identifier[data] , identifier[start] , identifier[end] operator[SEP] operator[SEP] Keyword[return] identifier[m] operator[SEP] }
public Meter meter(String name, final MetricSupplier<Meter> supplier) { return getOrAdd(name, new MetricBuilder<Meter>() { @Override public Meter newMetric() { return supplier.newMetric(); } @Override public boolean isInstance(Metric metric) { return Meter.class.isInstance(metric); } }); }
class class_name[name] begin[{] method[meter, return_type[type[Meter]], modifier[public], parameter[name, supplier]] begin[{] return[call[.getOrAdd, parameter[member[.name], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=newMetric, postfix_operators=[], prefix_operators=[], qualifier=supplier, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=newMetric, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Meter, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=metric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Meter, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=isInstance, parameters=[FormalParameter(annotations=[], modifiers=set(), name=metric, type=ReferenceType(arguments=None, dimensions=[], name=Metric, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Meter, sub_type=None))], dimensions=None, name=MetricBuilder, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Meter] identifier[meter] operator[SEP] identifier[String] identifier[name] , Keyword[final] identifier[MetricSupplier] operator[<] identifier[Meter] operator[>] identifier[supplier] operator[SEP] { Keyword[return] identifier[getOrAdd] operator[SEP] identifier[name] , Keyword[new] identifier[MetricBuilder] operator[<] identifier[Meter] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Meter] identifier[newMetric] operator[SEP] operator[SEP] { Keyword[return] identifier[supplier] operator[SEP] identifier[newMetric] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isInstance] operator[SEP] identifier[Metric] identifier[metric] operator[SEP] { Keyword[return] identifier[Meter] operator[SEP] Keyword[class] operator[SEP] identifier[isInstance] operator[SEP] identifier[metric] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
protected Content getFrameDetails() { HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame", "top.loadFrames()"); if (noOfPackages <= 1) { addAllClassesFrameTag(frameset); } else if (noOfPackages > 1) { HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames", "top.loadFrames()"); addAllPackagesFrameTag(leftFrameset); addAllClassesFrameTag(leftFrameset); frameset.addContent(leftFrameset); } addClassFrameTag(frameset); addFrameWarning(frameset); return frameset; }
class class_name[name] begin[{] method[getFrameDetails, return_type[type[Content]], modifier[protected], parameter[]] begin[{] local_variable[type[HtmlTree], frameset] if[binary_operation[member[.noOfPackages], <=, literal[1]]] begin[{] call[.addAllClassesFrameTag, parameter[member[.frameset]]] else begin[{] if[binary_operation[member[.noOfPackages], >, literal[1]]] begin[{] local_variable[type[HtmlTree], leftFrameset] call[.addAllPackagesFrameTag, parameter[member[.leftFrameset]]] call[.addAllClassesFrameTag, parameter[member[.leftFrameset]]] call[frameset.addContent, parameter[member[.leftFrameset]]] else begin[{] None end[}] end[}] call[.addClassFrameTag, parameter[member[.frameset]]] call[.addFrameWarning, parameter[member[.frameset]]] return[member[.frameset]] end[}] END[}]
Keyword[protected] identifier[Content] identifier[getFrameDetails] operator[SEP] operator[SEP] { identifier[HtmlTree] identifier[frameset] operator[=] identifier[HtmlTree] operator[SEP] identifier[FRAMESET] operator[SEP] literal[String] , Other[null] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[noOfPackages] operator[<=] Other[1] operator[SEP] { identifier[addAllClassesFrameTag] operator[SEP] identifier[frameset] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[noOfPackages] operator[>] Other[1] operator[SEP] { identifier[HtmlTree] identifier[leftFrameset] operator[=] identifier[HtmlTree] operator[SEP] identifier[FRAMESET] operator[SEP] Other[null] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[addAllPackagesFrameTag] operator[SEP] identifier[leftFrameset] operator[SEP] operator[SEP] identifier[addAllClassesFrameTag] operator[SEP] identifier[leftFrameset] operator[SEP] operator[SEP] identifier[frameset] operator[SEP] identifier[addContent] operator[SEP] identifier[leftFrameset] operator[SEP] operator[SEP] } identifier[addClassFrameTag] operator[SEP] identifier[frameset] operator[SEP] operator[SEP] identifier[addFrameWarning] operator[SEP] identifier[frameset] operator[SEP] operator[SEP] Keyword[return] identifier[frameset] operator[SEP] }
private List<BitcoinScriptWitnessItem> readListOfBitcoinScriptWitnessFromTable(ListObjectInspector loi, Object listOfScriptWitnessItemObject) { int listLength=loi.getListLength(listOfScriptWitnessItemObject); List<BitcoinScriptWitnessItem> result = new ArrayList<>(listLength); StructObjectInspector listOfScriptwitnessItemElementObjectInspector = (StructObjectInspector)loi.getListElementObjectInspector(); for (int i=0;i<listLength;i++) { Object currentlistofscriptwitnessitemObject = loi.getListElement(listOfScriptWitnessItemObject,i); StructField stackitemcounterSF = listOfScriptwitnessItemElementObjectInspector.getStructFieldRef("stackitemcounter"); StructField scriptwitnesslistSF = listOfScriptwitnessItemElementObjectInspector.getStructFieldRef("scriptwitnesslist"); boolean scriptwitnessitemNull = (stackitemcounterSF==null) || (scriptwitnesslistSF==null) ; if (scriptwitnessitemNull) { LOG.warn("Invalid BitcoinScriptWitnessItem detected at position "+i); return new ArrayList<>(); } byte[] stackItemCounter = wboi.getPrimitiveJavaObject(listOfScriptwitnessItemElementObjectInspector.getStructFieldData(currentlistofscriptwitnessitemObject,stackitemcounterSF)); Object listofscriptwitnessObject = soi.getStructFieldData(currentlistofscriptwitnessitemObject,scriptwitnesslistSF); ListObjectInspector loiScriptWitness=(ListObjectInspector)scriptwitnesslistSF.getFieldObjectInspector(); StructObjectInspector listOfScriptwitnessElementObjectInspector = (StructObjectInspector)loiScriptWitness.getListElementObjectInspector(); int listWitnessLength = loiScriptWitness.getListLength(listofscriptwitnessObject); List<BitcoinScriptWitness> currentScriptWitnessList = new ArrayList<>(listWitnessLength); for (int j=0;j<listWitnessLength;j++) { Object currentlistofscriptwitnessObject = loi.getListElement(listofscriptwitnessObject,j); StructField witnessscriptlengthSF = listOfScriptwitnessElementObjectInspector.getStructFieldRef("witnessscriptlength"); StructField witnessscriptSF = listOfScriptwitnessElementObjectInspector.getStructFieldRef("witnessscript"); boolean scriptwitnessNull = (witnessscriptlengthSF==null) || (witnessscriptSF==null); if (scriptwitnessNull) { LOG.warn("Invalid BitcoinScriptWitness detected at position "+j+ "for BitcoinScriptWitnessItem "+i); return new ArrayList<>(); } byte[] scriptWitnessLength = wboi.getPrimitiveJavaObject(listOfScriptwitnessElementObjectInspector.getStructFieldData(currentlistofscriptwitnessObject,witnessscriptlengthSF)); byte[] scriptWitness = wboi.getPrimitiveJavaObject(listOfScriptwitnessElementObjectInspector.getStructFieldData(currentlistofscriptwitnessObject,witnessscriptSF)); currentScriptWitnessList.add(new BitcoinScriptWitness(scriptWitnessLength,scriptWitness)); } BitcoinScriptWitnessItem currentBitcoinScriptWitnessItem = new BitcoinScriptWitnessItem(stackItemCounter,currentScriptWitnessList); result.add(currentBitcoinScriptWitnessItem); } return result; }
class class_name[name] begin[{] method[readListOfBitcoinScriptWitnessFromTable, return_type[type[List]], modifier[private], parameter[loi, listOfScriptWitnessItemObject]] begin[{] local_variable[type[int], listLength] local_variable[type[List], result] local_variable[type[StructObjectInspector], listOfScriptwitnessItemElementObjectInspector] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=listOfScriptWitnessItemObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getListElement, postfix_operators=[], prefix_operators=[], qualifier=loi, selectors=[], type_arguments=None), name=currentlistofscriptwitnessitemObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="stackitemcounter")], member=getStructFieldRef, postfix_operators=[], prefix_operators=[], qualifier=listOfScriptwitnessItemElementObjectInspector, selectors=[], type_arguments=None), name=stackitemcounterSF)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StructField, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="scriptwitnesslist")], member=getStructFieldRef, postfix_operators=[], prefix_operators=[], qualifier=listOfScriptwitnessItemElementObjectInspector, selectors=[], type_arguments=None), name=scriptwitnesslistSF)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StructField, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=stackitemcounterSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=scriptwitnesslistSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), name=scriptwitnessitemNull)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=scriptwitnessitemNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid BitcoinScriptWitnessItem detected at position "), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=currentlistofscriptwitnessitemObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stackitemcounterSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStructFieldData, postfix_operators=[], prefix_operators=[], qualifier=listOfScriptwitnessItemElementObjectInspector, selectors=[], type_arguments=None)], member=getPrimitiveJavaObject, postfix_operators=[], prefix_operators=[], qualifier=wboi, selectors=[], type_arguments=None), name=stackItemCounter)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentlistofscriptwitnessitemObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scriptwitnesslistSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStructFieldData, postfix_operators=[], prefix_operators=[], qualifier=soi, selectors=[], type_arguments=None), name=listofscriptwitnessObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getFieldObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=scriptwitnesslistSF, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ListObjectInspector, sub_type=None)), name=loiScriptWitness)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ListObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getListElementObjectInspector, postfix_operators=[], prefix_operators=[], qualifier=loiScriptWitness, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=StructObjectInspector, sub_type=None)), name=listOfScriptwitnessElementObjectInspector)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StructObjectInspector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=listofscriptwitnessObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getListLength, postfix_operators=[], prefix_operators=[], qualifier=loiScriptWitness, selectors=[], type_arguments=None), name=listWitnessLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=listWitnessLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=currentScriptWitnessList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BitcoinScriptWitness, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=listofscriptwitnessObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getListElement, postfix_operators=[], prefix_operators=[], qualifier=loi, selectors=[], type_arguments=None), name=currentlistofscriptwitnessObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="witnessscriptlength")], member=getStructFieldRef, postfix_operators=[], prefix_operators=[], qualifier=listOfScriptwitnessElementObjectInspector, selectors=[], type_arguments=None), name=witnessscriptlengthSF)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StructField, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="witnessscript")], member=getStructFieldRef, postfix_operators=[], prefix_operators=[], qualifier=listOfScriptwitnessElementObjectInspector, selectors=[], type_arguments=None), name=witnessscriptSF)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StructField, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=witnessscriptlengthSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=witnessscriptSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), name=scriptwitnessNull)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=scriptwitnessNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid BitcoinScriptWitness detected at position "), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="for BitcoinScriptWitnessItem "), operator=+), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=currentlistofscriptwitnessObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=witnessscriptlengthSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStructFieldData, postfix_operators=[], prefix_operators=[], qualifier=listOfScriptwitnessElementObjectInspector, selectors=[], type_arguments=None)], member=getPrimitiveJavaObject, postfix_operators=[], prefix_operators=[], qualifier=wboi, selectors=[], type_arguments=None), name=scriptWitnessLength)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=currentlistofscriptwitnessObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=witnessscriptSF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStructFieldData, postfix_operators=[], prefix_operators=[], qualifier=listOfScriptwitnessElementObjectInspector, selectors=[], type_arguments=None)], member=getPrimitiveJavaObject, postfix_operators=[], prefix_operators=[], qualifier=wboi, selectors=[], type_arguments=None), name=scriptWitness)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=scriptWitnessLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scriptWitness, 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=BitcoinScriptWitness, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=currentScriptWitnessList, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=listWitnessLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=stackItemCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentScriptWitnessList, 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=BitcoinScriptWitnessItem, sub_type=None)), name=currentBitcoinScriptWitnessItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BitcoinScriptWitnessItem, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentBitcoinScriptWitnessItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=listLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[BitcoinScriptWitnessItem] operator[>] identifier[readListOfBitcoinScriptWitnessFromTable] operator[SEP] identifier[ListObjectInspector] identifier[loi] , identifier[Object] identifier[listOfScriptWitnessItemObject] operator[SEP] { Keyword[int] identifier[listLength] operator[=] identifier[loi] operator[SEP] identifier[getListLength] operator[SEP] identifier[listOfScriptWitnessItemObject] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[BitcoinScriptWitnessItem] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[listLength] operator[SEP] operator[SEP] identifier[StructObjectInspector] identifier[listOfScriptwitnessItemElementObjectInspector] operator[=] operator[SEP] identifier[StructObjectInspector] operator[SEP] identifier[loi] operator[SEP] identifier[getListElementObjectInspector] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[listLength] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Object] identifier[currentlistofscriptwitnessitemObject] operator[=] identifier[loi] operator[SEP] identifier[getListElement] operator[SEP] identifier[listOfScriptWitnessItemObject] , identifier[i] operator[SEP] operator[SEP] identifier[StructField] identifier[stackitemcounterSF] operator[=] identifier[listOfScriptwitnessItemElementObjectInspector] operator[SEP] identifier[getStructFieldRef] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StructField] identifier[scriptwitnesslistSF] operator[=] identifier[listOfScriptwitnessItemElementObjectInspector] operator[SEP] identifier[getStructFieldRef] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[scriptwitnessitemNull] operator[=] operator[SEP] identifier[stackitemcounterSF] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[scriptwitnesslistSF] operator[==] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scriptwitnessitemNull] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[i] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[stackItemCounter] operator[=] identifier[wboi] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[listOfScriptwitnessItemElementObjectInspector] operator[SEP] identifier[getStructFieldData] operator[SEP] identifier[currentlistofscriptwitnessitemObject] , identifier[stackitemcounterSF] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[listofscriptwitnessObject] operator[=] identifier[soi] operator[SEP] identifier[getStructFieldData] operator[SEP] identifier[currentlistofscriptwitnessitemObject] , identifier[scriptwitnesslistSF] operator[SEP] operator[SEP] identifier[ListObjectInspector] identifier[loiScriptWitness] operator[=] operator[SEP] identifier[ListObjectInspector] operator[SEP] identifier[scriptwitnesslistSF] operator[SEP] identifier[getFieldObjectInspector] operator[SEP] operator[SEP] operator[SEP] identifier[StructObjectInspector] identifier[listOfScriptwitnessElementObjectInspector] operator[=] operator[SEP] identifier[StructObjectInspector] operator[SEP] identifier[loiScriptWitness] operator[SEP] identifier[getListElementObjectInspector] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[listWitnessLength] operator[=] identifier[loiScriptWitness] operator[SEP] identifier[getListLength] operator[SEP] identifier[listofscriptwitnessObject] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[BitcoinScriptWitness] operator[>] identifier[currentScriptWitnessList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[listWitnessLength] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[listWitnessLength] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[Object] identifier[currentlistofscriptwitnessObject] operator[=] identifier[loi] operator[SEP] identifier[getListElement] operator[SEP] identifier[listofscriptwitnessObject] , identifier[j] operator[SEP] operator[SEP] identifier[StructField] identifier[witnessscriptlengthSF] operator[=] identifier[listOfScriptwitnessElementObjectInspector] operator[SEP] identifier[getStructFieldRef] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StructField] identifier[witnessscriptSF] operator[=] identifier[listOfScriptwitnessElementObjectInspector] operator[SEP] identifier[getStructFieldRef] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[scriptwitnessNull] operator[=] operator[SEP] identifier[witnessscriptlengthSF] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[witnessscriptSF] operator[==] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scriptwitnessNull] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[j] operator[+] literal[String] operator[+] identifier[i] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[scriptWitnessLength] operator[=] identifier[wboi] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[listOfScriptwitnessElementObjectInspector] operator[SEP] identifier[getStructFieldData] operator[SEP] identifier[currentlistofscriptwitnessObject] , identifier[witnessscriptlengthSF] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[scriptWitness] operator[=] identifier[wboi] operator[SEP] identifier[getPrimitiveJavaObject] operator[SEP] identifier[listOfScriptwitnessElementObjectInspector] operator[SEP] identifier[getStructFieldData] operator[SEP] identifier[currentlistofscriptwitnessObject] , identifier[witnessscriptSF] operator[SEP] operator[SEP] operator[SEP] identifier[currentScriptWitnessList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[BitcoinScriptWitness] operator[SEP] identifier[scriptWitnessLength] , identifier[scriptWitness] operator[SEP] operator[SEP] operator[SEP] } identifier[BitcoinScriptWitnessItem] identifier[currentBitcoinScriptWitnessItem] operator[=] Keyword[new] identifier[BitcoinScriptWitnessItem] operator[SEP] identifier[stackItemCounter] , identifier[currentScriptWitnessList] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[currentBitcoinScriptWitnessItem] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public void centerMovedTo(double lat, double lon) { final Coordinate newCenter = new Coordinate(lat, lon); if (logger.isTraceEnabled()) { logger.trace("JS reports center value {}", newCenter); } lastCoordinateFromMap.set(newCenter); setCenter(newCenter); }
class class_name[name] begin[{] method[centerMovedTo, return_type[void], modifier[public], parameter[lat, lon]] begin[{] local_variable[type[Coordinate], newCenter] if[call[logger.isTraceEnabled, parameter[]]] begin[{] call[logger.trace, parameter[literal["JS reports center value {}"], member[.newCenter]]] else begin[{] None end[}] call[lastCoordinateFromMap.set, parameter[member[.newCenter]]] call[.setCenter, parameter[member[.newCenter]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[centerMovedTo] operator[SEP] Keyword[double] identifier[lat] , Keyword[double] identifier[lon] operator[SEP] { Keyword[final] identifier[Coordinate] identifier[newCenter] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] identifier[lat] , identifier[lon] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[newCenter] operator[SEP] operator[SEP] } identifier[lastCoordinateFromMap] operator[SEP] identifier[set] operator[SEP] identifier[newCenter] operator[SEP] operator[SEP] identifier[setCenter] operator[SEP] identifier[newCenter] operator[SEP] operator[SEP] }
public void setComponent(String v) { if (ProcessingStep_Type.featOkTst && ((ProcessingStep_Type)jcasType).casFeat_component == null) jcasType.jcas.throwFeatMissing("component", "edu.cmu.lti.oaqa.framework.types.ProcessingStep"); jcasType.ll_cas.ll_setStringValue(addr, ((ProcessingStep_Type)jcasType).casFeatCode_component, v);}
class class_name[name] begin[{] method[setComponent, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[ProcessingStep_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ProcessingStep_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["component"], literal["edu.cmu.lti.oaqa.framework.types.ProcessingStep"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ProcessingStep_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setComponent] operator[SEP] identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[ProcessingStep_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[ProcessingStep_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_component] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[ProcessingStep_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_component] , identifier[v] operator[SEP] operator[SEP] }
public boolean isMasterSecretValid(final Socket socket) { return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { return privilegedIsMasterSecretValid(socket); } }); }
class class_name[name] begin[{] method[isMasterSecretValid, return_type[type[boolean]], modifier[public], parameter[socket]] begin[{] return[call[AccessController.doPrivileged, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=socket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=privilegedIsMasterSecretValid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=PrivilegedAction, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isMasterSecretValid] operator[SEP] Keyword[final] identifier[Socket] identifier[socket] operator[SEP] { Keyword[return] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Boolean] identifier[run] operator[SEP] operator[SEP] { Keyword[return] identifier[privilegedIsMasterSecretValid] operator[SEP] identifier[socket] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
protected void checkResultSet(int column) throws SQLException { checkClosed(); if (thisRow == null) { throw new PSQLException( GT.tr("ResultSet not positioned properly, perhaps you need to call next."), PSQLState.INVALID_CURSOR_STATE); } checkColumnIndex(column); wasNullFlag = (thisRow[column - 1] == null); }
class class_name[name] begin[{] method[checkResultSet, return_type[void], modifier[protected], parameter[column]] begin[{] call[.checkClosed, parameter[]] if[binary_operation[member[.thisRow], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ResultSet not positioned properly, perhaps you need to call next.")], member=tr, postfix_operators=[], prefix_operators=[], qualifier=GT, selectors=[], type_arguments=None), MemberReference(member=INVALID_CURSOR_STATE, postfix_operators=[], prefix_operators=[], qualifier=PSQLState, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PSQLException, sub_type=None)), label=None) else begin[{] None end[}] call[.checkColumnIndex, parameter[member[.column]]] assign[member[.wasNullFlag], binary_operation[member[.thisRow], ==, literal[null]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[checkResultSet] operator[SEP] Keyword[int] identifier[column] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[checkClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thisRow] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[PSQLException] operator[SEP] identifier[GT] operator[SEP] identifier[tr] operator[SEP] literal[String] operator[SEP] , identifier[PSQLState] operator[SEP] identifier[INVALID_CURSOR_STATE] operator[SEP] operator[SEP] } identifier[checkColumnIndex] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[wasNullFlag] operator[=] operator[SEP] identifier[thisRow] operator[SEP] identifier[column] operator[-] Other[1] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] }
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UserDetails userDetails = usersTable.get(username); if (null == userDetails) { throw new UsernameNotFoundException(username); } return userDetails; }
class class_name[name] begin[{] method[loadUserByUsername, return_type[type[UserDetails]], modifier[public], parameter[username]] begin[{] local_variable[type[UserDetails], userDetails] if[binary_operation[literal[null], ==, member[.userDetails]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=username, 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=UsernameNotFoundException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.userDetails]] end[}] END[}]
Keyword[public] identifier[UserDetails] identifier[loadUserByUsername] operator[SEP] identifier[String] identifier[username] operator[SEP] Keyword[throws] identifier[UsernameNotFoundException] { identifier[UserDetails] identifier[userDetails] operator[=] identifier[usersTable] operator[SEP] identifier[get] operator[SEP] identifier[username] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[userDetails] operator[SEP] { Keyword[throw] Keyword[new] identifier[UsernameNotFoundException] operator[SEP] identifier[username] operator[SEP] operator[SEP] } Keyword[return] identifier[userDetails] operator[SEP] }
public Record getUserRegistration() { Record recUserRegistration = (Record)m_systemRecordOwner.getRecord(UserRegistrationModel.USER_REGISTRATION_FILE); if (recUserRegistration == null) recUserRegistration = Record.makeRecordFromClassName(UserRegistrationModel.THICK_CLASS, m_systemRecordOwner); return recUserRegistration; }
class class_name[name] begin[{] method[getUserRegistration, return_type[type[Record]], modifier[public], parameter[]] begin[{] local_variable[type[Record], recUserRegistration] if[binary_operation[member[.recUserRegistration], ==, literal[null]]] begin[{] assign[member[.recUserRegistration], call[Record.makeRecordFromClassName, parameter[member[UserRegistrationModel.THICK_CLASS], member[.m_systemRecordOwner]]]] else begin[{] None end[}] return[member[.recUserRegistration]] end[}] END[}]
Keyword[public] identifier[Record] identifier[getUserRegistration] operator[SEP] operator[SEP] { identifier[Record] identifier[recUserRegistration] operator[=] operator[SEP] identifier[Record] operator[SEP] identifier[m_systemRecordOwner] operator[SEP] identifier[getRecord] operator[SEP] identifier[UserRegistrationModel] operator[SEP] identifier[USER_REGISTRATION_FILE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recUserRegistration] operator[==] Other[null] operator[SEP] identifier[recUserRegistration] operator[=] identifier[Record] operator[SEP] identifier[makeRecordFromClassName] operator[SEP] identifier[UserRegistrationModel] operator[SEP] identifier[THICK_CLASS] , identifier[m_systemRecordOwner] operator[SEP] operator[SEP] Keyword[return] identifier[recUserRegistration] operator[SEP] }
public static GridCoverage2D coverageValuesMapper( GridCoverage2D valuesMap, GridCoverage2D maskMap ) { RegionMap valuesRegionMap = getRegionParamsFromGridCoverage(valuesMap); int cs = valuesRegionMap.getCols(); int rs = valuesRegionMap.getRows(); RegionMap maskRegionMap = getRegionParamsFromGridCoverage(maskMap); int tmpcs = maskRegionMap.getCols(); int tmprs = maskRegionMap.getRows(); if (cs != tmpcs || rs != tmprs) { throw new IllegalArgumentException("The raster maps have to be of equal size to be mapped."); } RandomIter valuesIter = RandomIterFactory.create(valuesMap.getRenderedImage(), null); RandomIter maskIter = RandomIterFactory.create(maskMap.getRenderedImage(), null); WritableRaster writableRaster = createWritableRaster(cs, rs, null, null, HMConstants.doubleNovalue); WritableRandomIter outIter = RandomIterFactory.createWritable(writableRaster, null); for( int c = 0; c < cs; c++ ) { for( int r = 0; r < rs; r++ ) { if (!isNovalue(maskIter.getSampleDouble(c, r, 0))) { // if not nv, put the value from the valueMap in the new map double value = valuesIter.getSampleDouble(c, r, 0); if (!isNovalue(value)) outIter.setSample(c, r, 0, value); } } } GridCoverage2D outCoverage = buildCoverage("mapped", writableRaster, maskRegionMap, //$NON-NLS-1$ valuesMap.getCoordinateReferenceSystem()); return outCoverage; }
class class_name[name] begin[{] method[coverageValuesMapper, return_type[type[GridCoverage2D]], modifier[public static], parameter[valuesMap, maskMap]] begin[{] local_variable[type[RegionMap], valuesRegionMap] local_variable[type[int], cs] local_variable[type[int], rs] local_variable[type[RegionMap], maskRegionMap] local_variable[type[int], tmpcs] local_variable[type[int], tmprs] if[binary_operation[binary_operation[member[.cs], !=, member[.tmpcs]], ||, binary_operation[member[.rs], !=, member[.tmprs]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The raster maps have to be of equal size to be mapped.")], 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[RandomIter], valuesIter] local_variable[type[RandomIter], maskIter] local_variable[type[WritableRaster], writableRaster] local_variable[type[WritableRandomIter], outIter] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getSampleDouble, postfix_operators=[], prefix_operators=[], qualifier=maskIter, selectors=[], type_arguments=None)], member=isNovalue, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getSampleDouble, postfix_operators=[], prefix_operators=[], qualifier=valuesIter, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNovalue, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=outIter, selectors=[], type_arguments=None), label=None))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rs, 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=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=r, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[GridCoverage2D], outCoverage] return[member[.outCoverage]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GridCoverage2D] identifier[coverageValuesMapper] operator[SEP] identifier[GridCoverage2D] identifier[valuesMap] , identifier[GridCoverage2D] identifier[maskMap] operator[SEP] { identifier[RegionMap] identifier[valuesRegionMap] operator[=] identifier[getRegionParamsFromGridCoverage] operator[SEP] identifier[valuesMap] operator[SEP] operator[SEP] Keyword[int] identifier[cs] operator[=] identifier[valuesRegionMap] operator[SEP] identifier[getCols] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rs] operator[=] identifier[valuesRegionMap] operator[SEP] identifier[getRows] operator[SEP] operator[SEP] operator[SEP] identifier[RegionMap] identifier[maskRegionMap] operator[=] identifier[getRegionParamsFromGridCoverage] operator[SEP] identifier[maskMap] operator[SEP] operator[SEP] Keyword[int] identifier[tmpcs] operator[=] identifier[maskRegionMap] operator[SEP] identifier[getCols] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[tmprs] operator[=] identifier[maskRegionMap] operator[SEP] identifier[getRows] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cs] operator[!=] identifier[tmpcs] operator[||] identifier[rs] operator[!=] identifier[tmprs] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[RandomIter] identifier[valuesIter] operator[=] identifier[RandomIterFactory] operator[SEP] identifier[create] operator[SEP] identifier[valuesMap] operator[SEP] identifier[getRenderedImage] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[RandomIter] identifier[maskIter] operator[=] identifier[RandomIterFactory] operator[SEP] identifier[create] operator[SEP] identifier[maskMap] operator[SEP] identifier[getRenderedImage] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[WritableRaster] identifier[writableRaster] operator[=] identifier[createWritableRaster] operator[SEP] identifier[cs] , identifier[rs] , Other[null] , Other[null] , identifier[HMConstants] operator[SEP] identifier[doubleNovalue] operator[SEP] operator[SEP] identifier[WritableRandomIter] identifier[outIter] operator[=] identifier[RandomIterFactory] operator[SEP] identifier[createWritable] operator[SEP] identifier[writableRaster] , Other[null] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[cs] operator[SEP] identifier[c] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[r] operator[=] Other[0] operator[SEP] identifier[r] operator[<] identifier[rs] operator[SEP] identifier[r] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isNovalue] operator[SEP] identifier[maskIter] operator[SEP] identifier[getSampleDouble] operator[SEP] identifier[c] , identifier[r] , Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[double] identifier[value] operator[=] identifier[valuesIter] operator[SEP] identifier[getSampleDouble] operator[SEP] identifier[c] , identifier[r] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNovalue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[outIter] operator[SEP] identifier[setSample] operator[SEP] identifier[c] , identifier[r] , Other[0] , identifier[value] operator[SEP] operator[SEP] } } } identifier[GridCoverage2D] identifier[outCoverage] operator[=] identifier[buildCoverage] operator[SEP] literal[String] , identifier[writableRaster] , identifier[maskRegionMap] , identifier[valuesMap] operator[SEP] identifier[getCoordinateReferenceSystem] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[outCoverage] operator[SEP] }
@Help(help = "Create the object of type {#}") public T create(final T object) throws SDKException { return (T) requestPost(object); }
class class_name[name] begin[{] method[create, return_type[type[T]], modifier[public], parameter[object]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requestPost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[Help] operator[SEP] identifier[help] operator[=] literal[String] operator[SEP] Keyword[public] identifier[T] identifier[create] operator[SEP] Keyword[final] identifier[T] identifier[object] operator[SEP] Keyword[throws] identifier[SDKException] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[requestPost] operator[SEP] identifier[object] operator[SEP] operator[SEP] }
public void updateDataSegmentPosition(long iPosition, final int iDataSegmentId, final long iDataSegmentPosition) throws IOException { iPosition = iPosition * RECORD_SIZE; acquireExclusiveLock(); try { final long[] pos = fileSegment.getRelativePosition(iPosition); final OFile f = fileSegment.files[(int) pos[0]]; long p = pos[1]; f.writeShort(p, (short) iDataSegmentId); f.writeLong(p += OBinaryProtocol.SIZE_SHORT, iDataSegmentPosition); } finally { releaseExclusiveLock(); } }
class class_name[name] begin[{] method[updateDataSegmentPosition, return_type[void], modifier[public], parameter[iPosition, iDataSegmentId, iDataSegmentPosition]] begin[{] assign[member[.iPosition], binary_operation[member[.iPosition], *, member[.RECORD_SIZE]]] call[.acquireExclusiveLock, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=iPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRelativePosition, postfix_operators=[], prefix_operators=[], qualifier=fileSegment, selectors=[], type_arguments=None), name=pos)], modifiers={'final'}, type=BasicType(dimensions=[None], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=fileSegment, selectors=[ArraySelector(index=Cast(expression=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=BasicType(dimensions=[], name=int)))]), name=f)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OFile, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), name=p)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=iDataSegmentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=short))], member=writeShort, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=SIZE_SHORT, postfix_operators=[], prefix_operators=[], qualifier=OBinaryProtocol, selectors=[])), MemberReference(member=iDataSegmentPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeLong, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=releaseExclusiveLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[updateDataSegmentPosition] operator[SEP] Keyword[long] identifier[iPosition] , Keyword[final] Keyword[int] identifier[iDataSegmentId] , Keyword[final] Keyword[long] identifier[iDataSegmentPosition] operator[SEP] Keyword[throws] identifier[IOException] { identifier[iPosition] operator[=] identifier[iPosition] operator[*] identifier[RECORD_SIZE] operator[SEP] identifier[acquireExclusiveLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[pos] operator[=] identifier[fileSegment] operator[SEP] identifier[getRelativePosition] operator[SEP] identifier[iPosition] operator[SEP] operator[SEP] Keyword[final] identifier[OFile] identifier[f] operator[=] identifier[fileSegment] operator[SEP] identifier[files] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[pos] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[p] operator[=] identifier[pos] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[writeShort] operator[SEP] identifier[p] , operator[SEP] Keyword[short] operator[SEP] identifier[iDataSegmentId] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[writeLong] operator[SEP] identifier[p] operator[+=] identifier[OBinaryProtocol] operator[SEP] identifier[SIZE_SHORT] , identifier[iDataSegmentPosition] operator[SEP] operator[SEP] } Keyword[finally] { identifier[releaseExclusiveLock] operator[SEP] operator[SEP] operator[SEP] } }
public static SpreadSheetCellDAO checkSpreadSheetCellDAO(Object newDAO) throws OfficeWriterException { if (!(newDAO instanceof SpreadSheetCellDAO)) { throw new OfficeWriterException("Objects which are not of the class SpreadSheetCellDAO are not supported for writing."); } SpreadSheetCellDAO sscd = (SpreadSheetCellDAO)newDAO; // check sheetname (needs to be there) if ((sscd.getSheetName()==null) || ("".equals(sscd.getSheetName()))) { throw new OfficeWriterException("Invalid cell specification: empy sheet name not allowed."); } // check celladdress (needs to be there) if ((sscd.getAddress()==null) || ("".equals(sscd.getAddress()))) { throw new OfficeWriterException("Invalid cell specification: empy cell address not allowed."); } // check that either formula or formatted value is filled if ((sscd.getFormula()==null) && (sscd.getFormattedValue()==null)) { throw new OfficeWriterException("Invalid cell specification: either formula or formattedValue needs to be specified for cell."); } return sscd; }
class class_name[name] begin[{] method[checkSpreadSheetCellDAO, return_type[type[SpreadSheetCellDAO]], modifier[public static], parameter[newDAO]] begin[{] if[binary_operation[member[.newDAO], instanceof, type[SpreadSheetCellDAO]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Objects which are not of the class SpreadSheetCellDAO are not supported for writing.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OfficeWriterException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[SpreadSheetCellDAO], sscd] if[binary_operation[binary_operation[call[sscd.getSheetName, parameter[]], ==, literal[null]], ||, literal[""]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid cell specification: empy sheet name not allowed.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OfficeWriterException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[call[sscd.getAddress, parameter[]], ==, literal[null]], ||, literal[""]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid cell specification: empy cell address not allowed.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OfficeWriterException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[call[sscd.getFormula, parameter[]], ==, literal[null]], &&, binary_operation[call[sscd.getFormattedValue, parameter[]], ==, literal[null]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid cell specification: either formula or formattedValue needs to be specified for cell.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OfficeWriterException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.sscd]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SpreadSheetCellDAO] identifier[checkSpreadSheetCellDAO] operator[SEP] identifier[Object] identifier[newDAO] operator[SEP] Keyword[throws] identifier[OfficeWriterException] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[newDAO] Keyword[instanceof] identifier[SpreadSheetCellDAO] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[OfficeWriterException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[SpreadSheetCellDAO] identifier[sscd] operator[=] operator[SEP] identifier[SpreadSheetCellDAO] operator[SEP] identifier[newDAO] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[sscd] operator[SEP] identifier[getSheetName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[sscd] operator[SEP] identifier[getSheetName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[OfficeWriterException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[sscd] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[sscd] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[OfficeWriterException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[sscd] operator[SEP] identifier[getFormula] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[sscd] operator[SEP] identifier[getFormattedValue] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[OfficeWriterException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[sscd] operator[SEP] }
public static TcpClient<ByteBuf, ByteBuf> newClient(String host, int port) { return newClient(new InetSocketAddress(host, port)); }
class class_name[name] begin[{] method[newClient, return_type[type[TcpClient]], modifier[public static], parameter[host, port]] begin[{] return[call[.newClient, parameter[ClassCreator(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[TcpClient] operator[<] identifier[ByteBuf] , identifier[ByteBuf] operator[>] identifier[newClient] operator[SEP] identifier[String] identifier[host] , Keyword[int] identifier[port] operator[SEP] { Keyword[return] identifier[newClient] operator[SEP] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[host] , identifier[port] operator[SEP] operator[SEP] operator[SEP] }
public static Databases parse(final String databases) { Validate.notNull(databases, "Databases must not be null"); if (SPACES.matcher(databases).matches()) { return Databases.ALL; } final Set<String> databasesSet = new LinkedHashSet<String>(Arrays.asList(SEPARATORS.split(databases))); databasesSet.remove(""); if (databasesSet.isEmpty()) { return new Databases(); } if ("*".equals(databasesSet.iterator().next())) { return ALL; } databasesSet.remove("*"); databasesSet.remove(MATCH_NOTHING); return new Databases(databasesSet); }
class class_name[name] begin[{] method[parse, return_type[type[Databases]], modifier[public static], parameter[databases]] begin[{] call[Validate.notNull, parameter[member[.databases], literal["Databases must not be null"]]] if[call[SPACES.matcher, parameter[member[.databases]]]] begin[{] return[member[Databases.ALL]] else begin[{] None end[}] local_variable[type[Set], databasesSet] call[databasesSet.remove, parameter[literal[""]]] if[call[databasesSet.isEmpty, parameter[]]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Databases, sub_type=None))] else begin[{] None end[}] if[literal["*"]] begin[{] return[member[.ALL]] else begin[{] None end[}] call[databasesSet.remove, parameter[literal["*"]]] call[databasesSet.remove, parameter[member[.MATCH_NOTHING]]] return[ClassCreator(arguments=[MemberReference(member=databasesSet, 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=Databases, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Databases] identifier[parse] operator[SEP] Keyword[final] identifier[String] identifier[databases] operator[SEP] { identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[databases] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[SPACES] operator[SEP] identifier[matcher] operator[SEP] identifier[databases] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Databases] operator[SEP] identifier[ALL] operator[SEP] } Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[databasesSet] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[String] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[SEPARATORS] operator[SEP] identifier[split] operator[SEP] identifier[databases] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[databasesSet] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[databasesSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Databases] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[databasesSet] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[ALL] operator[SEP] } identifier[databasesSet] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[databasesSet] operator[SEP] identifier[remove] operator[SEP] identifier[MATCH_NOTHING] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Databases] operator[SEP] identifier[databasesSet] operator[SEP] operator[SEP] }
private Envelope getMaxScreenEnvelope(InternalTile tile, Coordinate panOrigin) { int nrOfTilesX = Math.max(1, MAXIMUM_TILE_COORDINATE / tile.getScreenWidth()); int nrOfTilesY = Math.max(1, MAXIMUM_TILE_COORDINATE / tile.getScreenHeight()); double x1 = panOrigin.x - nrOfTilesX * tile.getTileWidth(); // double x2 = x1 + (nrOfTilesX * tileWidth * 2); double x2 = panOrigin.x + nrOfTilesX * tile.getTileWidth(); double y1 = panOrigin.y - nrOfTilesY * tile.getTileHeight(); // double y2 = y1 + (nrOfTilesY * tileHeight * 2); double y2 = panOrigin.y + nrOfTilesY * tile.getTileHeight(); return new Envelope(x1, x2, y1, y2); }
class class_name[name] begin[{] method[getMaxScreenEnvelope, return_type[type[Envelope]], modifier[private], parameter[tile, panOrigin]] begin[{] local_variable[type[int], nrOfTilesX] local_variable[type[int], nrOfTilesY] local_variable[type[double], x1] local_variable[type[double], x2] local_variable[type[double], y1] local_variable[type[double], y2] return[ClassCreator(arguments=[MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=x2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y2, 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=Envelope, sub_type=None))] end[}] END[}]
Keyword[private] identifier[Envelope] identifier[getMaxScreenEnvelope] operator[SEP] identifier[InternalTile] identifier[tile] , identifier[Coordinate] identifier[panOrigin] operator[SEP] { Keyword[int] identifier[nrOfTilesX] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[1] , identifier[MAXIMUM_TILE_COORDINATE] operator[/] identifier[tile] operator[SEP] identifier[getScreenWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[nrOfTilesY] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[1] , identifier[MAXIMUM_TILE_COORDINATE] operator[/] identifier[tile] operator[SEP] identifier[getScreenHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[x1] operator[=] identifier[panOrigin] operator[SEP] identifier[x] operator[-] identifier[nrOfTilesX] operator[*] identifier[tile] operator[SEP] identifier[getTileWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[x2] operator[=] identifier[panOrigin] operator[SEP] identifier[x] operator[+] identifier[nrOfTilesX] operator[*] identifier[tile] operator[SEP] identifier[getTileWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[y1] operator[=] identifier[panOrigin] operator[SEP] identifier[y] operator[-] identifier[nrOfTilesY] operator[*] identifier[tile] operator[SEP] identifier[getTileHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[y2] operator[=] identifier[panOrigin] operator[SEP] identifier[y] operator[+] identifier[nrOfTilesY] operator[*] identifier[tile] operator[SEP] identifier[getTileHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Envelope] operator[SEP] identifier[x1] , identifier[x2] , identifier[y1] , identifier[y2] operator[SEP] operator[SEP] }
@Override public PaginatedList queryForPaginatedList(String statementName, Object parameterObject, int pageSize) throws DataAccessException { return super.queryForPaginatedList(statementName, parameterObject, pageSize); }
class class_name[name] begin[{] method[queryForPaginatedList, return_type[type[PaginatedList]], modifier[public], parameter[statementName, parameterObject, pageSize]] begin[{] return[SuperMethodInvocation(arguments=[MemberReference(member=statementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pageSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=queryForPaginatedList, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[PaginatedList] identifier[queryForPaginatedList] operator[SEP] identifier[String] identifier[statementName] , identifier[Object] identifier[parameterObject] , Keyword[int] identifier[pageSize] operator[SEP] Keyword[throws] identifier[DataAccessException] { Keyword[return] Keyword[super] operator[SEP] identifier[queryForPaginatedList] operator[SEP] identifier[statementName] , identifier[parameterObject] , identifier[pageSize] operator[SEP] operator[SEP] }
public void onMouseDown(MouseDownEvent event) { Coordinate newCoords = getWorldPosition(event); geometry = factory.createPoint(newCoords); }
class class_name[name] begin[{] method[onMouseDown, return_type[void], modifier[public], parameter[event]] begin[{] local_variable[type[Coordinate], newCoords] assign[member[.geometry], call[factory.createPoint, parameter[member[.newCoords]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[onMouseDown] operator[SEP] identifier[MouseDownEvent] identifier[event] operator[SEP] { identifier[Coordinate] identifier[newCoords] operator[=] identifier[getWorldPosition] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[geometry] operator[=] identifier[factory] operator[SEP] identifier[createPoint] operator[SEP] identifier[newCoords] operator[SEP] operator[SEP] }
private boolean isSubtypeOf(String class1, String class2) { if (class1 == null || class2 == null) { return false; } class1 = convertToNonPrimitiveClass(class1); class2 = convertToNonPrimitiveClass(class2); // TODO add code to take primitive types into account ClassTypeResolver resolver = new ClassTypeResolver(getUniqueImports(), ProjectClassLoader.getProjectClassLoader(getEditor())); try { Class<?> clazz1 = resolver.resolveType(class1); Class<?> clazz2 = resolver.resolveType(class2); if (clazz1 == null || clazz2 == null) { return false; } return clazz2.isAssignableFrom(clazz1); } catch (ClassNotFoundException exc) { return false; } }
class class_name[name] begin[{] method[isSubtypeOf, return_type[type[boolean]], modifier[private], parameter[class1, class2]] begin[{] if[binary_operation[binary_operation[member[.class1], ==, literal[null]], ||, binary_operation[member[.class2], ==, literal[null]]]] begin[{] return[literal[false]] else begin[{] None end[}] assign[member[.class1], call[.convertToNonPrimitiveClass, parameter[member[.class1]]]] assign[member[.class2], call[.convertToNonPrimitiveClass, parameter[member[.class2]]]] local_variable[type[ClassTypeResolver], resolver] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=class1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveType, postfix_operators=[], prefix_operators=[], qualifier=resolver, selectors=[], type_arguments=None), name=clazz1)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=class2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveType, postfix_operators=[], prefix_operators=[], qualifier=resolver, selectors=[], type_arguments=None), name=clazz2)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=clazz1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=clazz2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=clazz1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=clazz2, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isSubtypeOf] operator[SEP] identifier[String] identifier[class1] , identifier[String] identifier[class2] operator[SEP] { Keyword[if] operator[SEP] identifier[class1] operator[==] Other[null] operator[||] identifier[class2] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[class1] operator[=] identifier[convertToNonPrimitiveClass] operator[SEP] identifier[class1] operator[SEP] operator[SEP] identifier[class2] operator[=] identifier[convertToNonPrimitiveClass] operator[SEP] identifier[class2] operator[SEP] operator[SEP] identifier[ClassTypeResolver] identifier[resolver] operator[=] Keyword[new] identifier[ClassTypeResolver] operator[SEP] identifier[getUniqueImports] operator[SEP] operator[SEP] , identifier[ProjectClassLoader] operator[SEP] identifier[getProjectClassLoader] operator[SEP] identifier[getEditor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Class] operator[<] operator[?] operator[>] identifier[clazz1] operator[=] identifier[resolver] operator[SEP] identifier[resolveType] operator[SEP] identifier[class1] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz2] operator[=] identifier[resolver] operator[SEP] identifier[resolveType] operator[SEP] identifier[class2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clazz1] operator[==] Other[null] operator[||] identifier[clazz2] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[clazz2] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[clazz1] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[exc] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
public void createNewFile() throws SmbException { if( getUncPath0().length() == 1 ) { throw new SmbException( "Invalid operation for workgroups, servers, or shares" ); } close( open0( O_RDWR | O_CREAT | O_EXCL, 0, ATTR_NORMAL, 0 ), 0L ); }
class class_name[name] begin[{] method[createNewFile, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[.getUncPath0, parameter[]], ==, literal[1]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid operation for workgroups, servers, or shares")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SmbException, sub_type=None)), label=None) else begin[{] None end[}] call[.close, parameter[call[.open0, parameter[binary_operation[binary_operation[member[.O_RDWR], |, member[.O_CREAT]], |, member[.O_EXCL]], literal[0], member[.ATTR_NORMAL], literal[0]]], literal[0L]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[createNewFile] operator[SEP] operator[SEP] Keyword[throws] identifier[SmbException] { Keyword[if] operator[SEP] identifier[getUncPath0] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[SmbException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[close] operator[SEP] identifier[open0] operator[SEP] identifier[O_RDWR] operator[|] identifier[O_CREAT] operator[|] identifier[O_EXCL] , Other[0] , identifier[ATTR_NORMAL] , Other[0] operator[SEP] , Other[0L] operator[SEP] operator[SEP] }
private static Version getDockerVersion(String serverUrl) { try { DockerClient client = DockerClientBuilder.getInstance(serverUrl).build(); return client.versionCmd().exec(); } catch (Exception e) { return null; } }
class class_name[name] begin[{] method[getDockerVersion, return_type[type[Version]], modifier[private static], parameter[serverUrl]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=serverUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=DockerClientBuilder, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=client)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DockerClient, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=versionCmd, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[MethodInvocation(arguments=[], member=exec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[Version] identifier[getDockerVersion] operator[SEP] identifier[String] identifier[serverUrl] operator[SEP] { Keyword[try] { identifier[DockerClient] identifier[client] operator[=] identifier[DockerClientBuilder] operator[SEP] identifier[getInstance] operator[SEP] identifier[serverUrl] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[versionCmd] operator[SEP] operator[SEP] operator[SEP] identifier[exec] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public static HttpPipeline createDefaultPipeline(Class<?> swaggerInterface, ServiceClientCredentials credentials) { return createDefaultPipeline(swaggerInterface, new CredentialsPolicy(credentials)); }
class class_name[name] begin[{] method[createDefaultPipeline, return_type[type[HttpPipeline]], modifier[public static], parameter[swaggerInterface, credentials]] begin[{] return[call[.createDefaultPipeline, parameter[member[.swaggerInterface], ClassCreator(arguments=[MemberReference(member=credentials, 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=CredentialsPolicy, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HttpPipeline] identifier[createDefaultPipeline] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[swaggerInterface] , identifier[ServiceClientCredentials] identifier[credentials] operator[SEP] { Keyword[return] identifier[createDefaultPipeline] operator[SEP] identifier[swaggerInterface] , Keyword[new] identifier[CredentialsPolicy] operator[SEP] identifier[credentials] operator[SEP] operator[SEP] operator[SEP] }
String prefixError(String s) { return prefix(s, feedback.getErrorPre(), feedback.getErrorPost()); }
class class_name[name] begin[{] method[prefixError, return_type[type[String]], modifier[default], parameter[s]] begin[{] return[call[.prefix, parameter[member[.s], call[feedback.getErrorPre, parameter[]], call[feedback.getErrorPost, parameter[]]]]] end[}] END[}]
identifier[String] identifier[prefixError] operator[SEP] identifier[String] identifier[s] operator[SEP] { Keyword[return] identifier[prefix] operator[SEP] identifier[s] , identifier[feedback] operator[SEP] identifier[getErrorPre] operator[SEP] operator[SEP] , identifier[feedback] operator[SEP] identifier[getErrorPost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@VisibleForTesting static Timestamp convertTimestamp(io.opencensus.common.Timestamp censusTimestamp) { if (censusTimestamp.getSeconds() < 0) { // StackDriver doesn't handle negative timestamps. return Timestamp.newBuilder().build(); } return Timestamp.newBuilder() .setSeconds(censusTimestamp.getSeconds()) .setNanos(censusTimestamp.getNanos()) .build(); }
class class_name[name] begin[{] method[convertTimestamp, return_type[type[Timestamp]], modifier[static], parameter[censusTimestamp]] begin[{] if[binary_operation[call[censusTimestamp.getSeconds, parameter[]], <, literal[0]]] begin[{] return[call[Timestamp.newBuilder, parameter[]]] else begin[{] None end[}] return[call[Timestamp.newBuilder, parameter[]]] end[}] END[}]
annotation[@] identifier[VisibleForTesting] Keyword[static] identifier[Timestamp] identifier[convertTimestamp] operator[SEP] identifier[io] operator[SEP] identifier[opencensus] operator[SEP] identifier[common] operator[SEP] identifier[Timestamp] identifier[censusTimestamp] operator[SEP] { Keyword[if] operator[SEP] identifier[censusTimestamp] operator[SEP] identifier[getSeconds] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] { Keyword[return] identifier[Timestamp] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Timestamp] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setSeconds] operator[SEP] identifier[censusTimestamp] operator[SEP] identifier[getSeconds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setNanos] operator[SEP] identifier[censusTimestamp] operator[SEP] identifier[getNanos] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
private void setNameSpaceID(File storage, String nsid) throws InconsistentFSStateException { if (nsid == null || nsid.equals("")) { throw new InconsistentFSStateException(storage, "file " + STORAGE_FILE_VERSION + " is invalid."); } int newNsId = Integer.parseInt(nsid); if (namespaceID > 0 && namespaceID != newNsId) { throw new InconsistentFSStateException(storage, "Unexepcted namespaceID " + nsid + " . Expected " + namespaceID); } namespaceID = newNsId; }
class class_name[name] begin[{] method[setNameSpaceID, return_type[void], modifier[private], parameter[storage, nsid]] begin[{] if[binary_operation[binary_operation[member[.nsid], ==, literal[null]], ||, call[nsid.equals, parameter[literal[""]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=storage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="file "), operandr=MemberReference(member=STORAGE_FILE_VERSION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is invalid."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InconsistentFSStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], newNsId] if[binary_operation[binary_operation[member[.namespaceID], >, literal[0]], &&, binary_operation[member[.namespaceID], !=, member[.newNsId]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=storage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexepcted namespaceID "), operandr=MemberReference(member=nsid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" . Expected "), operator=+), operandr=MemberReference(member=namespaceID, 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=InconsistentFSStateException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.namespaceID], member[.newNsId]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setNameSpaceID] operator[SEP] identifier[File] identifier[storage] , identifier[String] identifier[nsid] operator[SEP] Keyword[throws] identifier[InconsistentFSStateException] { Keyword[if] operator[SEP] identifier[nsid] operator[==] Other[null] operator[||] identifier[nsid] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InconsistentFSStateException] operator[SEP] identifier[storage] , literal[String] operator[+] identifier[STORAGE_FILE_VERSION] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[newNsId] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[nsid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[namespaceID] operator[>] Other[0] operator[&&] identifier[namespaceID] operator[!=] identifier[newNsId] operator[SEP] { Keyword[throw] Keyword[new] identifier[InconsistentFSStateException] operator[SEP] identifier[storage] , literal[String] operator[+] identifier[nsid] operator[+] literal[String] operator[+] identifier[namespaceID] operator[SEP] operator[SEP] } identifier[namespaceID] operator[=] identifier[newNsId] operator[SEP] }
public void send(TestRun testRun) { try { if (isStarted()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); new JsonSerializer().serializePayload(new OutputStreamWriter(baos), testRun, false); socket.emit("payload", new String(baos.toByteArray())); } else { LOGGER.log(Level.WARNING, "Probe Dock RT is not available to send the test results"); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to send the result to the agent. Cause: " + e.getMessage()); if (LOGGER.getLevel() == Level.FINEST) { LOGGER.log(Level.FINEST, "Exception: ", e); } } }
class class_name[name] begin[{] method[send, return_type[void], modifier[public], parameter[testRun]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isStarted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Probe Dock RT is not available to send the test results")], member=log, postfix_operators=[], prefix_operators=[], qualifier=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=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=baos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), StatementExpression(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=baos, 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=OutputStreamWriter, sub_type=None)), MemberReference(member=testRun, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=serializePayload, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonSerializer, sub_type=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="payload"), ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=baos, 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))], member=emit, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to send the result to the agent. Cause: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLevel, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), operandr=MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception: "), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[send] operator[SEP] identifier[TestRun] identifier[testRun] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[isStarted] operator[SEP] operator[SEP] operator[SEP] { identifier[ByteArrayOutputStream] identifier[baos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[JsonSerializer] operator[SEP] operator[SEP] operator[SEP] identifier[serializePayload] operator[SEP] Keyword[new] identifier[OutputStreamWriter] operator[SEP] identifier[baos] operator[SEP] , identifier[testRun] , literal[boolean] operator[SEP] operator[SEP] identifier[socket] operator[SEP] identifier[emit] operator[SEP] literal[String] , Keyword[new] identifier[String] operator[SEP] identifier[baos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[==] identifier[Level] operator[SEP] identifier[FINEST] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
public List<String> getServiceImplementations(String serviceTypeName) { final List<String> strings = services.get(serviceTypeName); return strings == null ? Collections.<String>emptyList() : Collections.unmodifiableList(strings); }
class class_name[name] begin[{] method[getServiceImplementations, return_type[type[List]], modifier[public], parameter[serviceTypeName]] begin[{] local_variable[type[List], strings] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=strings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=strings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]))] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getServiceImplementations] operator[SEP] identifier[String] identifier[serviceTypeName] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[strings] operator[=] identifier[services] operator[SEP] identifier[get] operator[SEP] identifier[serviceTypeName] operator[SEP] operator[SEP] Keyword[return] identifier[strings] operator[==] Other[null] operator[?] identifier[Collections] operator[SEP] operator[<] identifier[String] operator[>] identifier[emptyList] operator[SEP] operator[SEP] operator[:] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[strings] operator[SEP] operator[SEP] }
private List<NamedArgumentDefinition> validatePluginArgumentValues() { final List<NamedArgumentDefinition> actualArgumentDefinitions = new ArrayList<>(); for (final NamedArgumentDefinition argumentDefinition : namedArgumentDefinitions) { if (!argumentDefinition.isControlledByPlugin()) { actualArgumentDefinitions.add(argumentDefinition); } else { final boolean isAllowed = argumentDefinition.getDescriptorForControllingPlugin().isDependentArgumentAllowed( argumentDefinition.getContainingObject().getClass()); if (argumentDefinition.getHasBeenSet()) { if (!isAllowed) { // dangling dependent argument; a value was specified but it's containing // (predecessor) plugin argument wasn't specified throw new CommandLineException( String.format( "Argument \"%s/%s\" is only valid when the argument \"%s\" is specified", argumentDefinition.getShortName(), argumentDefinition.getLongName(), argumentDefinition.getContainingObject().getClass().getSimpleName())); } actualArgumentDefinitions.add(argumentDefinition); } else if (isAllowed) { // the predecessor argument was seen, so this value is allowed but hasn't been set; keep the // argument definition to allow validation to check for missing required args actualArgumentDefinitions.add(argumentDefinition); } } } // finally, give each plugin a chance to trim down any unseen instances from it's own list pluginDescriptors.entrySet().forEach(e -> e.getValue().validateAndResolvePlugins()); // return the updated list of argument definitions with the new list return actualArgumentDefinitions; }
class class_name[name] begin[{] method[validatePluginArgumentValues, return_type[type[List]], modifier[private], parameter[]] begin[{] local_variable[type[List], actualArgumentDefinitions] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isControlledByPlugin, postfix_operators=[], prefix_operators=['!'], qualifier=argumentDefinition, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDescriptorForControllingPlugin, postfix_operators=[], prefix_operators=[], qualifier=argumentDefinition, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getContainingObject, postfix_operators=[], prefix_operators=[], qualifier=argumentDefinition, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=isDependentArgumentAllowed, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=isAllowed)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MethodInvocation(arguments=[], member=getHasBeenSet, postfix_operators=[], prefix_operators=[], qualifier=argumentDefinition, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MemberReference(member=isAllowed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=argumentDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=actualArgumentDefinitions, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=isAllowed, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Argument \"%s/%s\" is only valid when the argument \"%s\" is specified"), MethodInvocation(arguments=[], member=getShortName, postfix_operators=[], prefix_operators=[], qualifier=argumentDefinition, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLongName, postfix_operators=[], prefix_operators=[], qualifier=argumentDefinition, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getContainingObject, postfix_operators=[], prefix_operators=[], qualifier=argumentDefinition, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommandLineException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=argumentDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=actualArgumentDefinitions, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=argumentDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=actualArgumentDefinitions, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=namedArgumentDefinitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=argumentDefinition)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=NamedArgumentDefinition, sub_type=None))), label=None) call[pluginDescriptors.entrySet, parameter[]] return[member[.actualArgumentDefinitions]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[NamedArgumentDefinition] operator[>] identifier[validatePluginArgumentValues] operator[SEP] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[NamedArgumentDefinition] operator[>] identifier[actualArgumentDefinitions] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[NamedArgumentDefinition] identifier[argumentDefinition] operator[:] identifier[namedArgumentDefinitions] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[argumentDefinition] operator[SEP] identifier[isControlledByPlugin] operator[SEP] operator[SEP] operator[SEP] { identifier[actualArgumentDefinitions] operator[SEP] identifier[add] operator[SEP] identifier[argumentDefinition] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] Keyword[boolean] identifier[isAllowed] operator[=] identifier[argumentDefinition] operator[SEP] identifier[getDescriptorForControllingPlugin] operator[SEP] operator[SEP] operator[SEP] identifier[isDependentArgumentAllowed] operator[SEP] identifier[argumentDefinition] operator[SEP] identifier[getContainingObject] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argumentDefinition] operator[SEP] identifier[getHasBeenSet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isAllowed] operator[SEP] { Keyword[throw] Keyword[new] identifier[CommandLineException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[argumentDefinition] operator[SEP] identifier[getShortName] operator[SEP] operator[SEP] , identifier[argumentDefinition] operator[SEP] identifier[getLongName] operator[SEP] operator[SEP] , identifier[argumentDefinition] operator[SEP] identifier[getContainingObject] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[actualArgumentDefinitions] operator[SEP] identifier[add] operator[SEP] identifier[argumentDefinition] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[isAllowed] operator[SEP] { identifier[actualArgumentDefinitions] operator[SEP] identifier[add] operator[SEP] identifier[argumentDefinition] operator[SEP] operator[SEP] } } } identifier[pluginDescriptors] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[e] operator[->] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[validateAndResolvePlugins] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[actualArgumentDefinitions] operator[SEP] }
static void collectAllExpressions(HsqlList set, Expression e, OrderedIntHashSet typeSet, OrderedIntHashSet stopAtTypeSet) { if (e == null) { return; } if (stopAtTypeSet.contains(e.opType)) { return; } for (int i = 0; i < e.nodes.length; i++) { collectAllExpressions(set, e.nodes[i], typeSet, stopAtTypeSet); } if (typeSet.contains(e.opType)) { set.add(e); } if (e.subQuery != null && e.subQuery.queryExpression != null) { e.subQuery.queryExpression.collectAllExpressions(set, typeSet, stopAtTypeSet); } }
class class_name[name] begin[{] method[collectAllExpressions, return_type[void], modifier[static], parameter[set, e, typeSet, stopAtTypeSet]] begin[{] if[binary_operation[member[.e], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[call[stopAtTypeSet.contains, parameter[member[e.opType]]]] begin[{] return[None] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=typeSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stopAtTypeSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=collectAllExpressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=e.nodes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[call[typeSet.contains, parameter[member[e.opType]]]] begin[{] call[set.add, parameter[member[.e]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[e.subQuery], !=, literal[null]], &&, binary_operation[member[e.subQuery.queryExpression], !=, literal[null]]]] begin[{] call[e.subQuery.queryExpression.collectAllExpressions, parameter[member[.set], member[.typeSet], member[.stopAtTypeSet]]] else begin[{] None end[}] end[}] END[}]
Keyword[static] Keyword[void] identifier[collectAllExpressions] operator[SEP] identifier[HsqlList] identifier[set] , identifier[Expression] identifier[e] , identifier[OrderedIntHashSet] identifier[typeSet] , identifier[OrderedIntHashSet] identifier[stopAtTypeSet] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[stopAtTypeSet] operator[SEP] identifier[contains] operator[SEP] identifier[e] operator[SEP] identifier[opType] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[e] operator[SEP] identifier[nodes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[collectAllExpressions] operator[SEP] identifier[set] , identifier[e] operator[SEP] identifier[nodes] operator[SEP] identifier[i] operator[SEP] , identifier[typeSet] , identifier[stopAtTypeSet] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[typeSet] operator[SEP] identifier[contains] operator[SEP] identifier[e] operator[SEP] identifier[opType] operator[SEP] operator[SEP] { identifier[set] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[subQuery] operator[!=] Other[null] operator[&&] identifier[e] operator[SEP] identifier[subQuery] operator[SEP] identifier[queryExpression] operator[!=] Other[null] operator[SEP] { identifier[e] operator[SEP] identifier[subQuery] operator[SEP] identifier[queryExpression] operator[SEP] identifier[collectAllExpressions] operator[SEP] identifier[set] , identifier[typeSet] , identifier[stopAtTypeSet] operator[SEP] operator[SEP] } }
private void replaceTags(CmsResource resource, Integer totalJobCount, Integer actualJobCount) throws CmsException { I_CmsReport report = getReport(); report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, actualJobCount, totalJobCount)); report.print( Messages.get().container( Messages.RPT_TAGREPLACE_PROCESS_FILE_1, getCms().getRequestContext().removeSiteRoot(resource.getRootPath()))); report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); if (isProcessedBefore(resource)) { report.print( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_SKIPPED_0), I_CmsReport.FORMAT_OK); report.println( Messages.get().container(Messages.RPT_TAGREPLACE_SKIP_REASON_PROPERTY_0), I_CmsReport.FORMAT_OK); return; } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_1, resource.getRootPath())); } try { // checking the lock: if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_LOCK_READ_1, resource.getRootPath())); } CmsLock lock = getCms().getLock(resource); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_LOCK_READ_1, resource.getRootPath())); } boolean myLock = !lock.isNullLock() && lock.isOwnedBy(getCms().getRequestContext().getCurrentUser()); if (lock.isNullLock() || myLock) { if (!myLock) { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_1, resource.getRootPath())); } // obtaining the lock: getCms().lockResource(getCms().getRequestContext().removeSiteRoot(resource.getRootPath())); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_OK_1, resource.getRootPath())); } } } else { // locked by another user: if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_DEBUG_TAGREPLACE_RESOURCE_SKIPPED_1, resource.getRootPath())); LOG.debug(Messages.get().getBundle().key(Messages.RPT_TAGREPLACE_SKIP_REASON_LOCKED_0)); } report.print( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_SKIPPED_0), I_CmsReport.FORMAT_WARNING); try { CmsUser locker = getCms().readUser(lock.getUserId()); report.println( Messages.get().container(Messages.RPT_TAGREPLACE_SKIP_REASON_LOCKED_1, locker.getName()), I_CmsReport.FORMAT_WARNING); } catch (Throwable f) { report.println( Messages.get().container(Messages.RPT_TAGREPLACE_SKIP_REASON_ERR_LOCK_0), I_CmsReport.FORMAT_WARNING); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_DEBUG_TAGREPLACE_RESOURCE_SKIPPED_1, resource.getRootPath())); LOG.debug(Messages.get().getBundle().key(Messages.RPT_TAGREPLACE_SKIP_REASON_ERR_LOCK_0)); } } return; } } catch (CmsException e) { if (LOG.isErrorEnabled()) { LOG.error( Messages.get().getBundle().key( Messages.LOG_WARN_TAGREPLACE_LOCK_RESOURCE_FAILED_1, resource.getRootPath()), e); } report.print( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_SKIPPED_0), I_CmsReport.FORMAT_WARNING); report.println( Messages.get().container(Messages.RPT_TAGREPLACE_SKIP_REASON_LOCKED_0), I_CmsReport.FORMAT_WARNING); return; } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_LOAD_FILE_1, resource.getRootPath())); } CmsFile file = getCms().readFile(resource); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_LOAD_FILE_OK_1, resource.getRootPath())); LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_UNMARSHAL_1, resource.getRootPath())); } CmsXmlContent xmlcontent = CmsXmlContentFactory.unmarshal(getCms(), file); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_UNMARSHAL_OK_1, resource.getRootPath())); } List locales = xmlcontent.getLocales(); Iterator itLocales = locales.iterator(); List elements; Iterator itElements; Locale locale; CmsTagReplaceParser parser = new CmsTagReplaceParser(m_settings); I_CmsXmlContentValue value; int count = 1; while (itLocales.hasNext()) { locale = (Locale)itLocales.next(); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_LOCALE_1, locale.getLanguage())); } elements = xmlcontent.getValues(locale); itElements = elements.iterator(); while (itElements.hasNext()) { value = (I_CmsXmlContentValue)itElements.next(); String content = value.getStringValue(getCms()); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_DEBUG_TAGREPLACE_ELEMENT_2, value.getPath(), content)); } try { parser.process(content, xmlcontent.getEncoding()); value.setStringValue(getCms(), parser.getResult()); } catch (ParserException e) { CmsMessageContainer container = Messages.get().container( Messages.ERR_TAGREPLACE_PARSE_4, new Object[] { getCms().getRequestContext().removeSiteRoot(resource.getRootPath()), locale.getLanguage(), value.getPath(), parser.getResult()}); throw new CmsXmlException(container, e); } } count++; } if (parser.isChangedContent()) { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_MARSHAL_1, resource.getRootPath())); } byte[] content = xmlcontent.marshal(); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_MARSHAL_OK_1, resource.getRootPath())); } // write back the modified xmlcontent: file.setContents(content); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_WRITE_1, resource.getRootPath())); } getCms().writeFile(file); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_WRITE_OK_1, resource.getRootPath())); } try { // set the marker property: if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_DEBUG_TAGREPLACE_PROPERTY_WRITE_3, new Object[] { m_markerProperty.getName(), m_markerProperty.getResourceValue(), resource.getRootPath()})); } getCms().writePropertyObject( getCms().getRequestContext().removeSiteRoot(resource.getRootPath()), m_markerProperty); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_DEBUG_TAGREPLACE_PROPERTY_WRITE_OK_0)); } report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); } catch (CmsException e) { CmsMessageContainer container = Messages.get().container( Messages.LOG_ERROR_TAGREPLACE_PROPERTY_WRITE_3, new Object[] { m_markerProperty.getName(), m_markerProperty.getResourceValue(), resource.getRootPath()}); throw new CmsXmlException(container, e); } } else { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().container(Messages.LOG_DEBUG_TAGREPLACE_UNLOCK_FILE_1, resource.getRootPath())); } getCms().unlockResource(getCms().getRequestContext().removeSiteRoot(resource.getRootPath())); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().container(Messages.LOG_DEBUG_TAGREPLACE_UNLOCK_FILE_OK_0)); } report.print( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_SKIPPED_0), I_CmsReport.FORMAT_OK); report.println( Messages.get().container(Messages.RPT_TAGREPLACE_SKIP_REASON_UNMODIFIED_0), I_CmsReport.FORMAT_OK); } }
class class_name[name] begin[{] method[replaceTags, return_type[void], modifier[private], parameter[resource, totalJobCount, actualJobCount]] begin[{] local_variable[type[I_CmsReport], report] call[report.print, parameter[call[org.opencms.report.Messages.get, parameter[]]]] call[report.print, parameter[call[Messages.get, parameter[]]]] call[report.print, parameter[call[org.opencms.report.Messages.get, parameter[]]]] if[call[.isProcessedBefore, parameter[member[.resource]]]] begin[{] call[report.print, parameter[call[org.opencms.report.Messages.get, parameter[]], member[I_CmsReport.FORMAT_OK]]] call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_OK]]] return[None] else begin[{] None end[}] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_LOCK_READ_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=lock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsLock, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_LOCK_READ_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isNullLock, postfix_operators=[], prefix_operators=['!'], qualifier=lock, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCurrentUser, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=isOwnedBy, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), operator=&&), name=myLock)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isNullLock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), operandr=MemberReference(member=myLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_RESOURCE_SKIPPED_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=RPT_TAGREPLACE_SKIP_REASON_LOCKED_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_SKIPPED_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_WARNING, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUserId, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None)], member=readUser, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=locker)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsUser, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_TAGREPLACE_SKIP_REASON_LOCKED_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=locker, selectors=[], type_arguments=None)], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_WARNING, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_TAGREPLACE_SKIP_REASON_ERR_LOCK_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_WARNING, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_RESOURCE_SKIPPED_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=RPT_TAGREPLACE_SKIP_REASON_ERR_LOCK_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=f, types=['Throwable']))], finally_block=None, label=None, resources=None), ReturnStatement(expression=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=myLock, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=removeSiteRoot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=lockResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_OK_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]))]))], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_WARN_TAGREPLACE_LOCK_RESOURCE_FAILED_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_SKIPPED_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_WARNING, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_TAGREPLACE_SKIP_REASON_LOCKED_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_WARNING, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] local_variable[type[CmsFile], file] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] local_variable[type[CmsXmlContent], xmlcontent] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] local_variable[type[List], locales] local_variable[type[Iterator], itLocales] local_variable[type[List], elements] local_variable[type[Iterator], itElements] local_variable[type[Locale], locale] local_variable[type[CmsTagReplaceParser], parser] local_variable[type[I_CmsXmlContentValue], value] local_variable[type[int], count] while[call[itLocales.hasNext, parameter[]]] begin[{] assign[member[.locale], Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=itLocales, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None))] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] assign[member[.elements], call[xmlcontent.getValues, parameter[member[.locale]]]] assign[member[.itElements], call[elements.iterator, parameter[]]] while[call[itElements.hasNext, parameter[]]] begin[{] assign[member[.value], Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=itElements, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValue, sub_type=None))] local_variable[type[String], content] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEncoding, postfix_operators=[], prefix_operators=[], qualifier=xmlcontent, selectors=[], type_arguments=None)], member=process, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)], member=setStringValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_TAGREPLACE_PARSE_4, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=removeSiteRoot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getLanguage, postfix_operators=[], prefix_operators=[], qualifier=locale, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=container)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsMessageContainer, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsXmlException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParserException']))], finally_block=None, label=None, resources=None) end[}] member[.count] end[}] if[call[parser.isChangedContent, parameter[]]] begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] local_variable[type[byte], content] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] call[file.setContents, parameter[member[.content]]] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] call[.getCms, parameter[]] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_PROPERTY_WRITE_3, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m_markerProperty, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getResourceValue, postfix_operators=[], prefix_operators=[], qualifier=m_markerProperty, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=removeSiteRoot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=m_markerProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writePropertyObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG_TAGREPLACE_PROPERTY_WRITE_OK_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_OK_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_OK, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=LOG_ERROR_TAGREPLACE_PROPERTY_WRITE_3, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m_markerProperty, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getResourceValue, postfix_operators=[], prefix_operators=[], qualifier=m_markerProperty, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=container)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsMessageContainer, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsXmlException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) else begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] call[.getCms, parameter[]] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] call[report.print, parameter[call[org.opencms.report.Messages.get, parameter[]], member[I_CmsReport.FORMAT_OK]]] call[report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_OK]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[replaceTags] operator[SEP] identifier[CmsResource] identifier[resource] , identifier[Integer] identifier[totalJobCount] , identifier[Integer] identifier[actualJobCount] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[I_CmsReport] identifier[report] operator[=] identifier[getReport] operator[SEP] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SUCCESSION_2] , identifier[actualJobCount] , identifier[totalJobCount] operator[SEP] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_PROCESS_FILE_1] , identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[removeSiteRoot] operator[SEP] identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_DOTS_0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isProcessedBefore] operator[SEP] identifier[resource] operator[SEP] operator[SEP] { identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SKIPPED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_SKIP_REASON_PROPERTY_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOCK_READ_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[CmsLock] identifier[lock] operator[=] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getLock] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOCK_READ_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[myLock] operator[=] operator[!] identifier[lock] operator[SEP] identifier[isNullLock] operator[SEP] operator[SEP] operator[&&] identifier[lock] operator[SEP] identifier[isOwnedBy] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentUser] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lock] operator[SEP] identifier[isNullLock] operator[SEP] operator[SEP] operator[||] identifier[myLock] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[myLock] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[lockResource] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[removeSiteRoot] operator[SEP] identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOCK_RESOURCE_OK_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_RESOURCE_SKIPPED_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_SKIP_REASON_LOCKED_0] operator[SEP] operator[SEP] operator[SEP] } identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SKIPPED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_WARNING] operator[SEP] operator[SEP] Keyword[try] { identifier[CmsUser] identifier[locker] operator[=] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[readUser] operator[SEP] identifier[lock] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_SKIP_REASON_LOCKED_1] , identifier[locker] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_WARNING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[f] operator[SEP] { identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_SKIP_REASON_ERR_LOCK_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_WARNING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_RESOURCE_SKIPPED_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_SKIP_REASON_ERR_LOCK_0] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_WARN_TAGREPLACE_LOCK_RESOURCE_FAILED_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SKIPPED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_WARNING] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_SKIP_REASON_LOCKED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_WARNING] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOAD_FILE_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[CmsFile] identifier[file] operator[=] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[readFile] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOAD_FILE_OK_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_UNMARSHAL_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[CmsXmlContent] identifier[xmlcontent] operator[=] identifier[CmsXmlContentFactory] operator[SEP] identifier[unmarshal] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] , identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_UNMARSHAL_OK_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[List] identifier[locales] operator[=] identifier[xmlcontent] operator[SEP] identifier[getLocales] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] identifier[itLocales] operator[=] identifier[locales] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[List] identifier[elements] operator[SEP] identifier[Iterator] identifier[itElements] operator[SEP] identifier[Locale] identifier[locale] operator[SEP] identifier[CmsTagReplaceParser] identifier[parser] operator[=] Keyword[new] identifier[CmsTagReplaceParser] operator[SEP] identifier[m_settings] operator[SEP] operator[SEP] identifier[I_CmsXmlContentValue] identifier[value] operator[SEP] Keyword[int] identifier[count] operator[=] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[itLocales] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[locale] operator[=] operator[SEP] identifier[Locale] operator[SEP] identifier[itLocales] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_LOCALE_1] , identifier[locale] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[elements] operator[=] identifier[xmlcontent] operator[SEP] identifier[getValues] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[itElements] operator[=] identifier[elements] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itElements] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[value] operator[=] operator[SEP] identifier[I_CmsXmlContentValue] operator[SEP] identifier[itElements] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[content] operator[=] identifier[value] operator[SEP] identifier[getStringValue] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_ELEMENT_2] , identifier[value] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[content] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[parser] operator[SEP] identifier[process] operator[SEP] identifier[content] , identifier[xmlcontent] operator[SEP] identifier[getEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[SEP] identifier[setStringValue] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] , identifier[parser] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParserException] identifier[e] operator[SEP] { identifier[CmsMessageContainer] identifier[container] operator[=] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_TAGREPLACE_PARSE_4] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[removeSiteRoot] operator[SEP] identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] , identifier[locale] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] , identifier[value] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[parser] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CmsXmlException] operator[SEP] identifier[container] , identifier[e] operator[SEP] operator[SEP] } } identifier[count] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[parser] operator[SEP] identifier[isChangedContent] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_MARSHAL_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[content] operator[=] identifier[xmlcontent] operator[SEP] identifier[marshal] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_MARSHAL_OK_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[file] operator[SEP] identifier[setContents] operator[SEP] identifier[content] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_WRITE_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[writeFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_WRITE_OK_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_PROPERTY_WRITE_3] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[m_markerProperty] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[m_markerProperty] operator[SEP] identifier[getResourceValue] operator[SEP] operator[SEP] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] operator[SEP] } identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[writePropertyObject] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[removeSiteRoot] operator[SEP] identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] , identifier[m_markerProperty] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_PROPERTY_WRITE_OK_0] operator[SEP] operator[SEP] operator[SEP] } identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_OK_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { identifier[CmsMessageContainer] identifier[container] operator[=] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_ERROR_TAGREPLACE_PROPERTY_WRITE_3] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[m_markerProperty] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[m_markerProperty] operator[SEP] identifier[getResourceValue] operator[SEP] operator[SEP] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CmsXmlException] operator[SEP] identifier[container] , identifier[e] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_UNLOCK_FILE_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[unlockResource] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[removeSiteRoot] operator[SEP] identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_DEBUG_TAGREPLACE_UNLOCK_FILE_OK_0] operator[SEP] operator[SEP] operator[SEP] } identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SKIPPED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_TAGREPLACE_SKIP_REASON_UNMODIFIED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP] } }
public StreamedContent getChart() throws IOException { FacesContext context = FacesContext.getCurrentInstance(); if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) { // So, we're rendering the HTML. Return a stub StreamedContent so // that it will generate right URL. LOG.fine(" return empty chart picture"); return new DefaultStreamedContent(); } else { // So, browser is requesting the image. Return a real // StreamedContent with the image bytes. String chartId = context.getExternalContext() .getRequestParameterMap().get("chartViewId"); BufferedImage bufferedImg = (BufferedImage) FacesContext .getCurrentInstance().getExternalContext() .getSessionMap().get(chartId); ByteArrayOutputStream os = new ByteArrayOutputStream(); ImageIO.write(bufferedImg, "png", os); FacesContext.getCurrentInstance().getExternalContext() .getSessionMap().remove(chartId); return new DefaultStreamedContent(new ByteArrayInputStream( os.toByteArray()), "image/png"); } }
class class_name[name] begin[{] method[getChart, return_type[type[StreamedContent]], modifier[public], parameter[]] begin[{] local_variable[type[FacesContext], context] if[binary_operation[call[context.getCurrentPhaseId, parameter[]], ==, member[PhaseId.RENDER_RESPONSE]]] begin[{] call[LOG.fine, parameter[literal[" return empty chart picture"]]] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultStreamedContent, sub_type=None))] else begin[{] local_variable[type[String], chartId] local_variable[type[BufferedImage], bufferedImg] local_variable[type[ByteArrayOutputStream], os] call[ImageIO.write, parameter[member[.bufferedImg], literal["png"], member[.os]]] call[FacesContext.getCurrentInstance, parameter[]] return[ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="image/png")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultStreamedContent, sub_type=None))] end[}] end[}] END[}]
Keyword[public] identifier[StreamedContent] identifier[getChart] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[FacesContext] identifier[context] operator[=] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getCurrentPhaseId] operator[SEP] operator[SEP] operator[==] identifier[PhaseId] operator[SEP] identifier[RENDER_RESPONSE] operator[SEP] { identifier[LOG] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DefaultStreamedContent] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[chartId] operator[=] identifier[context] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestParameterMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[bufferedImg] operator[=] operator[SEP] identifier[BufferedImage] operator[SEP] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[chartId] operator[SEP] operator[SEP] identifier[ByteArrayOutputStream] identifier[os] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[ImageIO] operator[SEP] identifier[write] operator[SEP] identifier[bufferedImg] , literal[String] , identifier[os] operator[SEP] operator[SEP] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionMap] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[chartId] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DefaultStreamedContent] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[os] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] } }
private int matchTail(int base, int index, String key) { int positionInTailArr = base - TAIL_OFFSET; int keyLength = key.length(); for (int i = 0; i < keyLength; i++) { if (key.charAt(i) != tailBuffer.get(positionInTailArr + i)) { return -1; } } return tailBuffer.get(positionInTailArr + keyLength) == TERMINATING_CHARACTER ? index : 0; }
class class_name[name] begin[{] method[matchTail, return_type[type[int]], modifier[private], parameter[base, index, key]] begin[{] local_variable[type[int], positionInTailArr] local_variable[type[int], keyLength] 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=key, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=positionInTailArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=tailBuffer, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=keyLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=positionInTailArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=keyLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=tailBuffer, selectors=[], type_arguments=None), operandr=MemberReference(member=TERMINATING_CHARACTER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[private] Keyword[int] identifier[matchTail] operator[SEP] Keyword[int] identifier[base] , Keyword[int] identifier[index] , identifier[String] identifier[key] operator[SEP] { Keyword[int] identifier[positionInTailArr] operator[=] identifier[base] operator[-] identifier[TAIL_OFFSET] operator[SEP] Keyword[int] identifier[keyLength] operator[=] identifier[key] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[keyLength] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[!=] identifier[tailBuffer] operator[SEP] identifier[get] operator[SEP] identifier[positionInTailArr] operator[+] identifier[i] operator[SEP] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } } Keyword[return] identifier[tailBuffer] operator[SEP] identifier[get] operator[SEP] identifier[positionInTailArr] operator[+] identifier[keyLength] operator[SEP] operator[==] identifier[TERMINATING_CHARACTER] operator[?] identifier[index] operator[:] Other[0] operator[SEP] }
protected Reader retrieveFromCache(String path, GeneratorContext context, CacheMode cacheMode) { Reader rd = null; String filePath = getTempFilePath(context, cacheMode); FileInputStream fis = null; File file = new File(filePath); if (file.exists()) { try { fis = new FileInputStream(file); } catch (FileNotFoundException e) { throw new BundlingProcessException("An error occured while creating temporary resource for " + filePath, e); } FileChannel inchannel = fis.getChannel(); rd = Channels.newReader(inchannel, context.getConfig().getResourceCharset().newDecoder(), -1); context.setRetrievedFromCache(true); if (LOGGER.isDebugEnabled()) { LOGGER.debug(getName() + " resource '" + path + "' retrieved from cache"); } } return rd; }
class class_name[name] begin[{] method[retrieveFromCache, return_type[type[Reader]], modifier[protected], parameter[path, context, cacheMode]] begin[{] local_variable[type[Reader], rd] local_variable[type[String], filePath] local_variable[type[FileInputStream], fis] local_variable[type[File], file] if[call[file.exists, parameter[]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occured while creating temporary resource for "), operandr=MemberReference(member=filePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=BundlingProcessException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None) local_variable[type[FileChannel], inchannel] assign[member[.rd], call[Channels.newReader, parameter[member[.inchannel], call[context.getConfig, parameter[]], literal[1]]]] call[context.setRetrievedFromCache, parameter[literal[true]]] if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{] call[LOGGER.debug, parameter[binary_operation[binary_operation[binary_operation[call[.getName, parameter[]], +, literal[" resource '"]], +, member[.path]], +, literal["' retrieved from cache"]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.rd]] end[}] END[}]
Keyword[protected] identifier[Reader] identifier[retrieveFromCache] operator[SEP] identifier[String] identifier[path] , identifier[GeneratorContext] identifier[context] , identifier[CacheMode] identifier[cacheMode] operator[SEP] { identifier[Reader] identifier[rd] operator[=] Other[null] operator[SEP] identifier[String] identifier[filePath] operator[=] identifier[getTempFilePath] operator[SEP] identifier[context] , identifier[cacheMode] operator[SEP] operator[SEP] identifier[FileInputStream] identifier[fis] operator[=] Other[null] operator[SEP] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[filePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[fis] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[BundlingProcessException] operator[SEP] literal[String] operator[+] identifier[filePath] , identifier[e] operator[SEP] operator[SEP] } identifier[FileChannel] identifier[inchannel] operator[=] identifier[fis] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] identifier[rd] operator[=] identifier[Channels] operator[SEP] identifier[newReader] operator[SEP] identifier[inchannel] , identifier[context] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceCharset] operator[SEP] operator[SEP] operator[SEP] identifier[newDecoder] operator[SEP] operator[SEP] , operator[-] Other[1] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setRetrievedFromCache] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[path] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[rd] operator[SEP] }
private boolean validateMaxDecimal(Object validationObject, Annotation annotate) { if (validationObject != null) { try { if (checkvalidDeciDigitTypes(validationObject.getClass())) { BigDecimal maxValue = NumberUtils.createBigDecimal(((DecimalMax) annotate).value()); BigDecimal actualValue = NumberUtils.createBigDecimal(toString(validationObject)); int res = actualValue.compareTo(maxValue); if (res > 0) { throwValidationException(((DecimalMax) annotate).message()); } } } catch (NumberFormatException nfe) { throw new RuleValidationException(nfe.getMessage()); } } return true; }
class class_name[name] begin[{] method[validateMaxDecimal, return_type[type[boolean]], modifier[private], parameter[validationObject, annotate]] begin[{] if[binary_operation[member[.validationObject], !=, literal[null]]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=validationObject, selectors=[], type_arguments=None)], member=checkvalidDeciDigitTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=annotate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DecimalMax, sub_type=None))], member=createBigDecimal, postfix_operators=[], prefix_operators=[], qualifier=NumberUtils, selectors=[], type_arguments=None), name=maxValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=validationObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=createBigDecimal, postfix_operators=[], prefix_operators=[], qualifier=NumberUtils, selectors=[], type_arguments=None), name=actualValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=maxValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareTo, postfix_operators=[], prefix_operators=[], qualifier=actualValue, selectors=[], type_arguments=None), name=res)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=annotate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DecimalMax, sub_type=None))], member=throwValidationException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=nfe, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuleValidationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfe, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[validateMaxDecimal] operator[SEP] identifier[Object] identifier[validationObject] , identifier[Annotation] identifier[annotate] operator[SEP] { Keyword[if] operator[SEP] identifier[validationObject] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[checkvalidDeciDigitTypes] operator[SEP] identifier[validationObject] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[BigDecimal] identifier[maxValue] operator[=] identifier[NumberUtils] operator[SEP] identifier[createBigDecimal] operator[SEP] operator[SEP] operator[SEP] identifier[DecimalMax] operator[SEP] identifier[annotate] operator[SEP] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[actualValue] operator[=] identifier[NumberUtils] operator[SEP] identifier[createBigDecimal] operator[SEP] identifier[toString] operator[SEP] identifier[validationObject] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[res] operator[=] identifier[actualValue] operator[SEP] identifier[compareTo] operator[SEP] identifier[maxValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[>] Other[0] operator[SEP] { identifier[throwValidationException] operator[SEP] operator[SEP] operator[SEP] identifier[DecimalMax] operator[SEP] identifier[annotate] operator[SEP] operator[SEP] identifier[message] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfe] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuleValidationException] operator[SEP] identifier[nfe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public void setParameter(final String name, final String filename, final InputStream is) throws IOException { boundary(); writeName(name); write("; filename=\""); write(filename); write('"'); newline(); write("Content-Type: "); String type = URLConnection.guessContentTypeFromName(filename); if (type == null) { type = "application/octet-stream"; } writeln(type); newline(); pipe(is, os); newline(); }
class class_name[name] begin[{] method[setParameter, return_type[void], modifier[public], parameter[name, filename, is]] begin[{] call[.boundary, parameter[]] call[.writeName, parameter[member[.name]]] call[.write, parameter[literal["; filename=\""]]] call[.write, parameter[member[.filename]]] call[.write, parameter[literal['"']]] call[.newline, parameter[]] call[.write, parameter[literal["Content-Type: "]]] local_variable[type[String], type] if[binary_operation[member[.type], ==, literal[null]]] begin[{] assign[member[.type], literal["application/octet-stream"]] else begin[{] None end[}] call[.writeln, parameter[member[.type]]] call[.newline, parameter[]] call[.pipe, parameter[member[.is], member[.os]]] call[.newline, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setParameter] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[filename] , Keyword[final] identifier[InputStream] identifier[is] operator[SEP] Keyword[throws] identifier[IOException] { identifier[boundary] operator[SEP] operator[SEP] operator[SEP] identifier[writeName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[filename] operator[SEP] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[newline] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[type] operator[=] identifier[URLConnection] operator[SEP] identifier[guessContentTypeFromName] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { identifier[type] operator[=] literal[String] operator[SEP] } identifier[writeln] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[newline] operator[SEP] operator[SEP] operator[SEP] identifier[pipe] operator[SEP] identifier[is] , identifier[os] operator[SEP] operator[SEP] identifier[newline] operator[SEP] operator[SEP] operator[SEP] }
@Override public Object touch(Object coll, Collection.Key key) throws PageException { Object o = getCollection(coll, key, null); if (o != null) return o; return set(coll, key, new StructImpl()); }
class class_name[name] begin[{] method[touch, return_type[type[Object]], modifier[public], parameter[coll, key]] begin[{] local_variable[type[Object], o] if[binary_operation[member[.o], !=, literal[null]]] begin[{] return[member[.o]] else begin[{] None end[}] return[call[.set, parameter[member[.coll], member[.key], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StructImpl, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[touch] operator[SEP] identifier[Object] identifier[coll] , identifier[Collection] operator[SEP] identifier[Key] identifier[key] operator[SEP] Keyword[throws] identifier[PageException] { identifier[Object] identifier[o] operator[=] identifier[getCollection] operator[SEP] identifier[coll] , identifier[key] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[o] operator[SEP] Keyword[return] identifier[set] operator[SEP] identifier[coll] , identifier[key] , Keyword[new] identifier[StructImpl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private ParseTree parseDoWhileStatement() { SourcePosition start = getTreeStartLocation(); eat(TokenType.DO); ParseTree body = parseStatement(); eat(TokenType.WHILE); eat(TokenType.OPEN_PAREN); ParseTree condition = parseExpression(); eat(TokenType.CLOSE_PAREN); // The semicolon after the "do-while" is optional. if (peek(TokenType.SEMI_COLON)) { eat(TokenType.SEMI_COLON); } return new DoWhileStatementTree(getTreeLocation(start), body, condition); }
class class_name[name] begin[{] method[parseDoWhileStatement, return_type[type[ParseTree]], modifier[private], parameter[]] begin[{] local_variable[type[SourcePosition], start] call[.eat, parameter[member[TokenType.DO]]] local_variable[type[ParseTree], body] call[.eat, parameter[member[TokenType.WHILE]]] call[.eat, parameter[member[TokenType.OPEN_PAREN]]] local_variable[type[ParseTree], condition] call[.eat, parameter[member[TokenType.CLOSE_PAREN]]] if[call[.peek, parameter[member[TokenType.SEMI_COLON]]]] begin[{] call[.eat, parameter[member[TokenType.SEMI_COLON]]] else begin[{] None end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTreeLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=condition, 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=DoWhileStatementTree, sub_type=None))] end[}] END[}]
Keyword[private] identifier[ParseTree] identifier[parseDoWhileStatement] operator[SEP] operator[SEP] { identifier[SourcePosition] identifier[start] operator[=] identifier[getTreeStartLocation] operator[SEP] operator[SEP] operator[SEP] identifier[eat] operator[SEP] identifier[TokenType] operator[SEP] identifier[DO] operator[SEP] operator[SEP] identifier[ParseTree] identifier[body] operator[=] identifier[parseStatement] operator[SEP] operator[SEP] operator[SEP] identifier[eat] operator[SEP] identifier[TokenType] operator[SEP] identifier[WHILE] operator[SEP] operator[SEP] identifier[eat] operator[SEP] identifier[TokenType] operator[SEP] identifier[OPEN_PAREN] operator[SEP] operator[SEP] identifier[ParseTree] identifier[condition] operator[=] identifier[parseExpression] operator[SEP] operator[SEP] operator[SEP] identifier[eat] operator[SEP] identifier[TokenType] operator[SEP] identifier[CLOSE_PAREN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[peek] operator[SEP] identifier[TokenType] operator[SEP] identifier[SEMI_COLON] operator[SEP] operator[SEP] { identifier[eat] operator[SEP] identifier[TokenType] operator[SEP] identifier[SEMI_COLON] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[DoWhileStatementTree] operator[SEP] identifier[getTreeLocation] operator[SEP] identifier[start] operator[SEP] , identifier[body] , identifier[condition] operator[SEP] operator[SEP] }
@Override public HamtPMap<K, V> minus(K key) { return !isEmpty() ? minus(key, hash(key), null) : this; }
class class_name[name] begin[{] method[minus, return_type[type[HamtPMap]], modifier[public], parameter[key]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), if_false=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=minus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[HamtPMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[minus] operator[SEP] identifier[K] identifier[key] operator[SEP] { Keyword[return] operator[!] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] identifier[minus] operator[SEP] identifier[key] , identifier[hash] operator[SEP] identifier[key] operator[SEP] , Other[null] operator[SEP] operator[:] Keyword[this] operator[SEP] }
PollingState<T> withStatus(String status, int statusCode) throws IllegalArgumentException { if (status == null) { throw new IllegalArgumentException("Status is null."); } this.status = status; this.statusCode = statusCode; return this; }
class class_name[name] begin[{] method[withStatus, return_type[type[PollingState]], modifier[default], parameter[status, statusCode]] begin[{] if[binary_operation[member[.status], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Status is null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.status]], member[.status]] assign[THIS[member[None.statusCode]], member[.statusCode]] return[THIS[]] end[}] END[}]
identifier[PollingState] operator[<] identifier[T] operator[>] identifier[withStatus] operator[SEP] identifier[String] identifier[status] , Keyword[int] identifier[statusCode] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[if] operator[SEP] identifier[status] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[status] operator[=] identifier[status] operator[SEP] Keyword[this] operator[SEP] identifier[statusCode] operator[=] identifier[statusCode] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static FilterTypeHint getTypeHint(String hint) { /* todo: this is static; consider providing on a concrete / overridable object */ if(STRING.getHint().equals(hint)) return STRING; else if(NUMERIC.getHint().equals(hint)) return NUMERIC; else if(DATE.getHint().equals(hint)) return DATE; else throw new IllegalArgumentException(Bundle.getErrorString("FilterTypeHint_UnknownHintString", new Object[] {hint})); }
class class_name[name] begin[{] method[getTypeHint, return_type[type[FilterTypeHint]], modifier[public static], parameter[hint]] begin[{] if[call[STRING.getHint, parameter[]]] begin[{] return[member[.STRING]] else begin[{] if[call[NUMERIC.getHint, parameter[]]] begin[{] return[member[.NUMERIC]] else begin[{] if[call[DATE.getHint, parameter[]]] begin[{] return[member[.DATE]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FilterTypeHint_UnknownHintString"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=hint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=getErrorString, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[FilterTypeHint] identifier[getTypeHint] operator[SEP] identifier[String] identifier[hint] operator[SEP] { Keyword[if] operator[SEP] identifier[STRING] operator[SEP] identifier[getHint] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[hint] operator[SEP] operator[SEP] Keyword[return] identifier[STRING] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[NUMERIC] operator[SEP] identifier[getHint] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[hint] operator[SEP] operator[SEP] Keyword[return] identifier[NUMERIC] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[DATE] operator[SEP] identifier[getHint] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[hint] operator[SEP] operator[SEP] Keyword[return] identifier[DATE] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[Bundle] operator[SEP] identifier[getErrorString] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[hint] } operator[SEP] operator[SEP] operator[SEP] }
protected CoordinateSearchMetadata.Action recordMetadata(FilterJoinNode node, FilterJoinNode parent) { FilterJoinTerms terms = node.getTerms(); final String[] fromIndices = node.getLookupIndices(); final String[] fromTypes = node.getLookupTypes(); final String[] toIndices = parent == null ? null : parent.getLookupIndices(); final String[] toTypes = parent == null ? null : parent.getLookupTypes(); CoordinateSearchMetadata.Relation from = new CoordinateSearchMetadata.Relation(fromIndices, fromTypes, node.getLookupPath()); CoordinateSearchMetadata.Relation to = new CoordinateSearchMetadata.Relation(toIndices, toTypes, node.getField()); CoordinateSearchMetadata.Action action = this.metadata.addAction(from, to); action.setPruned(terms.isPruned()); action.setSize(terms.getSize()); action.setSizeInBytes(terms.getEncodedTerms().length); action.setCacheHit(terms.cacheHit()); action.setTookInMillis(terms.getTookInMillis()); action.setTermsEncoding(node.getTermsEncoding()); action.setOrdering(node.getOrderBy()); action.setMaxTermsPerShard(node.getMaxTermsPerShard()); return action; }
class class_name[name] begin[{] method[recordMetadata, return_type[type[CoordinateSearchMetadata]], modifier[protected], parameter[node, parent]] begin[{] local_variable[type[FilterJoinTerms], terms] local_variable[type[String], fromIndices] local_variable[type[String], fromTypes] local_variable[type[String], toIndices] local_variable[type[String], toTypes] local_variable[type[CoordinateSearchMetadata], from] local_variable[type[CoordinateSearchMetadata], to] local_variable[type[CoordinateSearchMetadata], action] call[action.setPruned, parameter[call[terms.isPruned, parameter[]]]] call[action.setSize, parameter[call[terms.getSize, parameter[]]]] call[action.setSizeInBytes, parameter[call[terms.getEncodedTerms, parameter[]]]] call[action.setCacheHit, parameter[call[terms.cacheHit, parameter[]]]] call[action.setTookInMillis, parameter[call[terms.getTookInMillis, parameter[]]]] call[action.setTermsEncoding, parameter[call[node.getTermsEncoding, parameter[]]]] call[action.setOrdering, parameter[call[node.getOrderBy, parameter[]]]] call[action.setMaxTermsPerShard, parameter[call[node.getMaxTermsPerShard, parameter[]]]] return[member[.action]] end[}] END[}]
Keyword[protected] identifier[CoordinateSearchMetadata] operator[SEP] identifier[Action] identifier[recordMetadata] operator[SEP] identifier[FilterJoinNode] identifier[node] , identifier[FilterJoinNode] identifier[parent] operator[SEP] { identifier[FilterJoinTerms] identifier[terms] operator[=] identifier[node] operator[SEP] identifier[getTerms] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[fromIndices] operator[=] identifier[node] operator[SEP] identifier[getLookupIndices] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[fromTypes] operator[=] identifier[node] operator[SEP] identifier[getLookupTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[toIndices] operator[=] identifier[parent] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[parent] operator[SEP] identifier[getLookupIndices] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[toTypes] operator[=] identifier[parent] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[parent] operator[SEP] identifier[getLookupTypes] operator[SEP] operator[SEP] operator[SEP] identifier[CoordinateSearchMetadata] operator[SEP] identifier[Relation] identifier[from] operator[=] Keyword[new] identifier[CoordinateSearchMetadata] operator[SEP] identifier[Relation] operator[SEP] identifier[fromIndices] , identifier[fromTypes] , identifier[node] operator[SEP] identifier[getLookupPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CoordinateSearchMetadata] operator[SEP] identifier[Relation] identifier[to] operator[=] Keyword[new] identifier[CoordinateSearchMetadata] operator[SEP] identifier[Relation] operator[SEP] identifier[toIndices] , identifier[toTypes] , identifier[node] operator[SEP] identifier[getField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CoordinateSearchMetadata] operator[SEP] identifier[Action] identifier[action] operator[=] Keyword[this] operator[SEP] identifier[metadata] operator[SEP] identifier[addAction] operator[SEP] identifier[from] , identifier[to] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setPruned] operator[SEP] identifier[terms] operator[SEP] identifier[isPruned] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setSize] operator[SEP] identifier[terms] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setSizeInBytes] operator[SEP] identifier[terms] operator[SEP] identifier[getEncodedTerms] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setCacheHit] operator[SEP] identifier[terms] operator[SEP] identifier[cacheHit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setTookInMillis] operator[SEP] identifier[terms] operator[SEP] identifier[getTookInMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setTermsEncoding] operator[SEP] identifier[node] operator[SEP] identifier[getTermsEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setOrdering] operator[SEP] identifier[node] operator[SEP] identifier[getOrderBy] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setMaxTermsPerShard] operator[SEP] identifier[node] operator[SEP] identifier[getMaxTermsPerShard] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[action] operator[SEP] }
public void marshall(RebootRequest rebootRequest, ProtocolMarshaller protocolMarshaller) { if (rebootRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(rebootRequest.getWorkspaceId(), WORKSPACEID_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[rebootRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.rebootRequest], ==, 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=getWorkspaceId, postfix_operators=[], prefix_operators=[], qualifier=rebootRequest, selectors=[], type_arguments=None), MemberReference(member=WORKSPACEID_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[RebootRequest] identifier[rebootRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[rebootRequest] 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[rebootRequest] operator[SEP] identifier[getWorkspaceId] operator[SEP] operator[SEP] , identifier[WORKSPACEID_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static com.liferay.commerce.product.model.CPOption fetchCPOptionByUuidAndGroupId( String uuid, long groupId) { return getService().fetchCPOptionByUuidAndGroupId(uuid, groupId); }
class class_name[name] begin[{] method[fetchCPOptionByUuidAndGroupId, return_type[type[com]], modifier[public static], parameter[uuid, groupId]] begin[{] return[call[.getService, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[model] operator[SEP] identifier[CPOption] identifier[fetchCPOptionByUuidAndGroupId] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] operator[SEP] { Keyword[return] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[fetchCPOptionByUuidAndGroupId] operator[SEP] identifier[uuid] , identifier[groupId] operator[SEP] operator[SEP] }
private void emitProperty( Name propertyName, int propertyType, Object value, ContentHandler contentHandler, boolean skipBinary ) throws RepositoryException, SAXException { ValueFactory<String> strings = session.stringFactory(); // first set the property sv:name attribute AttributesImpl propAtts = new AttributesImpl(); propAtts.addAttribute(JcrSvLexicon.NAME.getNamespaceUri(), JcrSvLexicon.NAME.getLocalName(), getPrefixedName(JcrSvLexicon.NAME), PropertyType.nameFromValue(PropertyType.STRING), strings.create(propertyName)); // and it's sv:type attribute propAtts.addAttribute(JcrSvLexicon.TYPE.getNamespaceUri(), JcrSvLexicon.TYPE.getLocalName(), getPrefixedName(JcrSvLexicon.TYPE), PropertyType.nameFromValue(PropertyType.STRING), org.modeshape.jcr.api.PropertyType.nameFromValue(propertyType)); // output the sv:property element startElement(contentHandler, JcrSvLexicon.PROPERTY, propAtts); // then output a sv:value element for each of its values emitValue(strings.create(value), contentHandler); // end the sv:property element endElement(contentHandler, JcrSvLexicon.PROPERTY); }
class class_name[name] begin[{] method[emitProperty, return_type[void], modifier[private], parameter[propertyName, propertyType, value, contentHandler, skipBinary]] begin[{] local_variable[type[ValueFactory], strings] local_variable[type[AttributesImpl], propAtts] call[propAtts.addAttribute, parameter[call[JcrSvLexicon.NAME.getNamespaceUri, parameter[]], call[JcrSvLexicon.NAME.getLocalName, parameter[]], call[.getPrefixedName, parameter[member[JcrSvLexicon.NAME]]], call[PropertyType.nameFromValue, parameter[member[PropertyType.STRING]]], call[strings.create, parameter[member[.propertyName]]]]] call[propAtts.addAttribute, parameter[call[JcrSvLexicon.TYPE.getNamespaceUri, parameter[]], call[JcrSvLexicon.TYPE.getLocalName, parameter[]], call[.getPrefixedName, parameter[member[JcrSvLexicon.TYPE]]], call[PropertyType.nameFromValue, parameter[member[PropertyType.STRING]]], call[org.modeshape.jcr.api.PropertyType.nameFromValue, parameter[member[.propertyType]]]]] call[.startElement, parameter[member[.contentHandler], member[JcrSvLexicon.PROPERTY], member[.propAtts]]] call[.emitValue, parameter[call[strings.create, parameter[member[.value]]], member[.contentHandler]]] call[.endElement, parameter[member[.contentHandler], member[JcrSvLexicon.PROPERTY]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[emitProperty] operator[SEP] identifier[Name] identifier[propertyName] , Keyword[int] identifier[propertyType] , identifier[Object] identifier[value] , identifier[ContentHandler] identifier[contentHandler] , Keyword[boolean] identifier[skipBinary] operator[SEP] Keyword[throws] identifier[RepositoryException] , identifier[SAXException] { identifier[ValueFactory] operator[<] identifier[String] operator[>] identifier[strings] operator[=] identifier[session] operator[SEP] identifier[stringFactory] operator[SEP] operator[SEP] operator[SEP] identifier[AttributesImpl] identifier[propAtts] operator[=] Keyword[new] identifier[AttributesImpl] operator[SEP] operator[SEP] operator[SEP] identifier[propAtts] operator[SEP] identifier[addAttribute] operator[SEP] identifier[JcrSvLexicon] operator[SEP] identifier[NAME] operator[SEP] identifier[getNamespaceUri] operator[SEP] operator[SEP] , identifier[JcrSvLexicon] operator[SEP] identifier[NAME] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] , identifier[getPrefixedName] operator[SEP] identifier[JcrSvLexicon] operator[SEP] identifier[NAME] operator[SEP] , identifier[PropertyType] operator[SEP] identifier[nameFromValue] operator[SEP] identifier[PropertyType] operator[SEP] identifier[STRING] operator[SEP] , identifier[strings] operator[SEP] identifier[create] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] operator[SEP] identifier[propAtts] operator[SEP] identifier[addAttribute] operator[SEP] identifier[JcrSvLexicon] operator[SEP] identifier[TYPE] operator[SEP] identifier[getNamespaceUri] operator[SEP] operator[SEP] , identifier[JcrSvLexicon] operator[SEP] identifier[TYPE] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] , identifier[getPrefixedName] operator[SEP] identifier[JcrSvLexicon] operator[SEP] identifier[TYPE] operator[SEP] , identifier[PropertyType] operator[SEP] identifier[nameFromValue] operator[SEP] identifier[PropertyType] operator[SEP] identifier[STRING] operator[SEP] , identifier[org] operator[SEP] identifier[modeshape] operator[SEP] identifier[jcr] operator[SEP] identifier[api] operator[SEP] identifier[PropertyType] operator[SEP] identifier[nameFromValue] operator[SEP] identifier[propertyType] operator[SEP] operator[SEP] operator[SEP] identifier[startElement] operator[SEP] identifier[contentHandler] , identifier[JcrSvLexicon] operator[SEP] identifier[PROPERTY] , identifier[propAtts] operator[SEP] operator[SEP] identifier[emitValue] operator[SEP] identifier[strings] operator[SEP] identifier[create] operator[SEP] identifier[value] operator[SEP] , identifier[contentHandler] operator[SEP] operator[SEP] identifier[endElement] operator[SEP] identifier[contentHandler] , identifier[JcrSvLexicon] operator[SEP] identifier[PROPERTY] operator[SEP] operator[SEP] }
public final <R> Ix<R> replay(IxFunction<? super Ix<T>, ? extends Iterable<? extends R>> transform) { return new IxReplaySelector<T, R>(this, nullCheck(transform, "transform is null")); }
class class_name[name] begin[{] method[replay, return_type[type[Ix]], modifier[final public], parameter[transform]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[MemberReference(member=transform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="transform is null")], member=nullCheck, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=IxReplaySelector, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] operator[<] identifier[R] operator[>] identifier[Ix] operator[<] identifier[R] operator[>] identifier[replay] operator[SEP] identifier[IxFunction] operator[<] operator[?] Keyword[super] identifier[Ix] operator[<] identifier[T] operator[>] , operator[?] Keyword[extends] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[R] operator[>] operator[>] identifier[transform] operator[SEP] { Keyword[return] Keyword[new] identifier[IxReplaySelector] operator[<] identifier[T] , identifier[R] operator[>] operator[SEP] Keyword[this] , identifier[nullCheck] operator[SEP] identifier[transform] , literal[String] operator[SEP] operator[SEP] operator[SEP] }
@Override public SSLContext getSSLContext() throws KeyManagementException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException { final SSLContext context = SSLContext.getInstance("TLS"); String httpProtocols = System.getProperty("https.protocols"); System.setProperty("https.protocols", "TLSv1"); if (httpProtocols != null) { System.setProperty("https.protocols", httpProtocols); } final KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory .getDefaultAlgorithm()); keyManagerFactory.init(keystore, keystorePassword.toCharArray()); context.init(keyManagerFactory.getKeyManagers(), new TrustManager[] { new X509TrustManager() { @Override public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[] {}; } @Override public void checkClientTrusted(final X509Certificate[] arg0, final String arg1) { } @Override public void checkServerTrusted(final X509Certificate[] arg0, final String arg1) { } } }, new SecureRandom()); return context; }
class class_name[name] begin[{] method[getSSLContext, return_type[type[SSLContext]], modifier[public], parameter[]] begin[{] local_variable[type[SSLContext], context] local_variable[type[String], httpProtocols] call[System.setProperty, parameter[literal["https.protocols"], literal["TLSv1"]]] if[binary_operation[member[.httpProtocols], !=, literal[null]]] begin[{] call[System.setProperty, parameter[literal["https.protocols"], member[.httpProtocols]]] else begin[{] None end[}] local_variable[type[KeyManagerFactory], keyManagerFactory] call[keyManagerFactory.init, parameter[member[.keystore], call[keystorePassword.toCharArray, parameter[]]]] call[context.init, parameter[call[keyManagerFactory.getKeyManagers, parameter[]], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=X509Certificate, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=getAcceptedIssuers, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[None], name=X509Certificate, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[], documentation=None, modifiers={'public'}, name=checkClientTrusted, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=arg0, type=ReferenceType(arguments=None, dimensions=[None], name=X509Certificate, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=arg1, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[], documentation=None, modifiers={'public'}, name=checkServerTrusted, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=arg0, type=ReferenceType(arguments=None, dimensions=[None], name=X509Certificate, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=arg1, type=ReferenceType(arguments=None, dimensions=[], name=String, 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=X509TrustManager, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TrustManager, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecureRandom, sub_type=None))]] return[member[.context]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[SSLContext] identifier[getSSLContext] operator[SEP] operator[SEP] Keyword[throws] identifier[KeyManagementException] , identifier[UnrecoverableKeyException] , identifier[NoSuchAlgorithmException] , identifier[KeyStoreException] { Keyword[final] identifier[SSLContext] identifier[context] operator[=] identifier[SSLContext] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[httpProtocols] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[httpProtocols] operator[!=] Other[null] operator[SEP] { identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[httpProtocols] operator[SEP] operator[SEP] } Keyword[final] identifier[KeyManagerFactory] identifier[keyManagerFactory] operator[=] identifier[KeyManagerFactory] operator[SEP] identifier[getInstance] operator[SEP] identifier[KeyManagerFactory] operator[SEP] identifier[getDefaultAlgorithm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[keyManagerFactory] operator[SEP] identifier[init] operator[SEP] identifier[keystore] , identifier[keystorePassword] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[init] operator[SEP] identifier[keyManagerFactory] operator[SEP] identifier[getKeyManagers] operator[SEP] operator[SEP] , Keyword[new] identifier[TrustManager] operator[SEP] operator[SEP] { Keyword[new] identifier[X509TrustManager] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[X509Certificate] operator[SEP] operator[SEP] identifier[getAcceptedIssuers] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[X509Certificate] operator[SEP] operator[SEP] { } operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[checkClientTrusted] operator[SEP] Keyword[final] identifier[X509Certificate] operator[SEP] operator[SEP] identifier[arg0] , Keyword[final] identifier[String] identifier[arg1] operator[SEP] { } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[checkServerTrusted] operator[SEP] Keyword[final] identifier[X509Certificate] operator[SEP] operator[SEP] identifier[arg0] , Keyword[final] identifier[String] identifier[arg1] operator[SEP] { } } } , Keyword[new] identifier[SecureRandom] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[context] operator[SEP] }
@Override protected String buildAlreadyClosedMessage() { // no way but big trouble so rich view final ExceptionMessageBuilder br = new ExceptionMessageBuilder(); br.addNotice("Already closed the connection."); br.addItem("Advice"); br.addElement("You cannot use the closed connection. (no way)"); br.addItem("Closing Request"); br.addElement("requestPath: " + closingReallyRequestPath); br.addElement("entryMethod: " + closingReallyEntryExp); br.addElement("userBean: " + closingReallyUserExp); br.addElement("closingMillis: " + closingReallyMillis); br.addItem("Current Request"); if (ThreadCacheContext.exists()) { // e.g. in action br.addElement("requestPath: " + ThreadCacheContext.findRequestPath()); br.addElement("entryMethod: " + convertMethodToMethodExp(ThreadCacheContext.findEntryMethod())); br.addElement("userBean: " + convertUserBeanToUserExp(ThreadCacheContext.findUserBean())); br.addElement("currentMillis: " + currentTimeMillis()); } else { br.addElement("*no info"); } br.addItem("Latest CheckOut"); br.addElement("requestPath: " + checkingOutRequestPath); br.addElement("entryMethod: " + checkingOutEntryExp); br.addElement("userBean: " + checkingOutUserExp); br.addElement("checkOutMillis: " + checkingOutMillis); br.addItem("Latest CheckIn"); br.addElement("requestPath: " + checkingInRequestPath); br.addElement("entryMethod: " + checkingInEntryExp); br.addElement("userBean: " + checkingInUserExp); br.addElement("checkInMillis: " + checkingInMillis); br.addItem("XA Connection"); br.addElement(xaConnection); br.addItem("Transaction"); br.addElement(tx); br.addItem("Connection Wrapper"); br.addElement(toString()); return br.buildExceptionMessage(); }
class class_name[name] begin[{] method[buildAlreadyClosedMessage, return_type[type[String]], modifier[protected], parameter[]] begin[{] local_variable[type[ExceptionMessageBuilder], br] call[br.addNotice, parameter[literal["Already closed the connection."]]] call[br.addItem, parameter[literal["Advice"]]] call[br.addElement, parameter[literal["You cannot use the closed connection. (no way)"]]] call[br.addItem, parameter[literal["Closing Request"]]] call[br.addElement, parameter[binary_operation[literal["requestPath: "], +, member[.closingReallyRequestPath]]]] call[br.addElement, parameter[binary_operation[literal["entryMethod: "], +, member[.closingReallyEntryExp]]]] call[br.addElement, parameter[binary_operation[literal["userBean: "], +, member[.closingReallyUserExp]]]] call[br.addElement, parameter[binary_operation[literal["closingMillis: "], +, member[.closingReallyMillis]]]] call[br.addItem, parameter[literal["Current Request"]]] if[call[ThreadCacheContext.exists, parameter[]]] begin[{] call[br.addElement, parameter[binary_operation[literal["requestPath: "], +, call[ThreadCacheContext.findRequestPath, parameter[]]]]] call[br.addElement, parameter[binary_operation[literal["entryMethod: "], +, call[.convertMethodToMethodExp, parameter[call[ThreadCacheContext.findEntryMethod, parameter[]]]]]]] call[br.addElement, parameter[binary_operation[literal["userBean: "], +, call[.convertUserBeanToUserExp, parameter[call[ThreadCacheContext.findUserBean, parameter[]]]]]]] call[br.addElement, parameter[binary_operation[literal["currentMillis: "], +, call[.currentTimeMillis, parameter[]]]]] else begin[{] call[br.addElement, parameter[literal["*no info"]]] end[}] call[br.addItem, parameter[literal["Latest CheckOut"]]] call[br.addElement, parameter[binary_operation[literal["requestPath: "], +, member[.checkingOutRequestPath]]]] call[br.addElement, parameter[binary_operation[literal["entryMethod: "], +, member[.checkingOutEntryExp]]]] call[br.addElement, parameter[binary_operation[literal["userBean: "], +, member[.checkingOutUserExp]]]] call[br.addElement, parameter[binary_operation[literal["checkOutMillis: "], +, member[.checkingOutMillis]]]] call[br.addItem, parameter[literal["Latest CheckIn"]]] call[br.addElement, parameter[binary_operation[literal["requestPath: "], +, member[.checkingInRequestPath]]]] call[br.addElement, parameter[binary_operation[literal["entryMethod: "], +, member[.checkingInEntryExp]]]] call[br.addElement, parameter[binary_operation[literal["userBean: "], +, member[.checkingInUserExp]]]] call[br.addElement, parameter[binary_operation[literal["checkInMillis: "], +, member[.checkingInMillis]]]] call[br.addItem, parameter[literal["XA Connection"]]] call[br.addElement, parameter[member[.xaConnection]]] call[br.addItem, parameter[literal["Transaction"]]] call[br.addElement, parameter[member[.tx]]] call[br.addItem, parameter[literal["Connection Wrapper"]]] call[br.addElement, parameter[call[.toString, parameter[]]]] return[call[br.buildExceptionMessage, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[String] identifier[buildAlreadyClosedMessage] operator[SEP] operator[SEP] { Keyword[final] identifier[ExceptionMessageBuilder] identifier[br] operator[=] Keyword[new] identifier[ExceptionMessageBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addNotice] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[closingReallyRequestPath] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[closingReallyEntryExp] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[closingReallyUserExp] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[closingReallyMillis] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ThreadCacheContext] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[ThreadCacheContext] operator[SEP] identifier[findRequestPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[convertMethodToMethodExp] operator[SEP] identifier[ThreadCacheContext] operator[SEP] identifier[findEntryMethod] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[convertUserBeanToUserExp] operator[SEP] identifier[ThreadCacheContext] operator[SEP] identifier[findUserBean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingOutRequestPath] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingOutEntryExp] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingOutUserExp] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingOutMillis] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingInRequestPath] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingInEntryExp] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingInUserExp] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] literal[String] operator[+] identifier[checkingInMillis] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] identifier[xaConnection] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] identifier[tx] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[br] operator[SEP] identifier[addElement] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[br] operator[SEP] identifier[buildExceptionMessage] operator[SEP] operator[SEP] operator[SEP] }
private static String filePathToKey(String path) { try { return FileUtil.getDefaultInstance().canonicalPath(path); } catch (Exception e) { return path; } }
class class_name[name] begin[{] method[filePathToKey, return_type[type[String]], modifier[private static], parameter[path]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=FileUtil, selectors=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=canonicalPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[filePathToKey] operator[SEP] identifier[String] identifier[path] operator[SEP] { Keyword[try] { Keyword[return] identifier[FileUtil] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[SEP] identifier[canonicalPath] operator[SEP] identifier[path] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] identifier[path] operator[SEP] } }
public IntStream ints(long streamSize) { if (streamSize < 0L) throw new IllegalArgumentException(BAD_SIZE); return StreamSupport.intStream (new RandomIntsSpliterator (0L, streamSize, Integer.MAX_VALUE, 0), false); }
class class_name[name] begin[{] method[ints, return_type[type[IntStream]], modifier[public], parameter[streamSize]] begin[{] if[binary_operation[member[.streamSize], <, literal[0L]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=BAD_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[StreamSupport.intStream, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), MemberReference(member=streamSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RandomIntsSpliterator, sub_type=None)), literal[false]]]] end[}] END[}]
Keyword[public] identifier[IntStream] identifier[ints] operator[SEP] Keyword[long] identifier[streamSize] operator[SEP] { Keyword[if] operator[SEP] identifier[streamSize] operator[<] Other[0L] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[BAD_SIZE] operator[SEP] operator[SEP] Keyword[return] identifier[StreamSupport] operator[SEP] identifier[intStream] operator[SEP] Keyword[new] identifier[RandomIntsSpliterator] operator[SEP] Other[0L] , identifier[streamSize] , identifier[Integer] operator[SEP] identifier[MAX_VALUE] , Other[0] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] }
public static UserGetShakeInfoResult userGetShakeInfo(String accessToken, UserGetShakeInfo userGetShakeInfo) { return userGetShakeInfo(accessToken, JsonUtil.toJSONString(userGetShakeInfo)); }
class class_name[name] begin[{] method[userGetShakeInfo, return_type[type[UserGetShakeInfoResult]], modifier[public static], parameter[accessToken, userGetShakeInfo]] begin[{] return[call[.userGetShakeInfo, parameter[member[.accessToken], call[JsonUtil.toJSONString, parameter[member[.userGetShakeInfo]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[UserGetShakeInfoResult] identifier[userGetShakeInfo] operator[SEP] identifier[String] identifier[accessToken] , identifier[UserGetShakeInfo] identifier[userGetShakeInfo] operator[SEP] { Keyword[return] identifier[userGetShakeInfo] operator[SEP] identifier[accessToken] , identifier[JsonUtil] operator[SEP] identifier[toJSONString] operator[SEP] identifier[userGetShakeInfo] operator[SEP] operator[SEP] operator[SEP] }
@Override public void setButtonBaseStyle(String baseStyle) { this.setBaseStyle(baseStyle.replace("Button", "DropDownButton")); dropDownPanel.setStyleName(baseStyle.replace("Button", "Panel")); }
class class_name[name] begin[{] method[setButtonBaseStyle, return_type[void], modifier[public], parameter[baseStyle]] begin[{] THIS[call[None.setBaseStyle, parameter[call[baseStyle.replace, parameter[literal["Button"], literal["DropDownButton"]]]]]] call[dropDownPanel.setStyleName, parameter[call[baseStyle.replace, parameter[literal["Button"], literal["Panel"]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setButtonBaseStyle] operator[SEP] identifier[String] identifier[baseStyle] operator[SEP] { Keyword[this] operator[SEP] identifier[setBaseStyle] operator[SEP] identifier[baseStyle] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[dropDownPanel] operator[SEP] identifier[setStyleName] operator[SEP] identifier[baseStyle] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] }
public final Mono<Boolean> any(Predicate<? super T> predicate) { return Mono.onAssembly(new MonoAny<>(this, predicate)); }
class class_name[name] begin[{] method[any, return_type[type[Mono]], modifier[final public], parameter[predicate]] begin[{] return[call[Mono.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=predicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=MonoAny, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Mono] operator[<] identifier[Boolean] operator[>] identifier[any] operator[SEP] identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[predicate] operator[SEP] { Keyword[return] identifier[Mono] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[MonoAny] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[predicate] operator[SEP] operator[SEP] operator[SEP] }
private void encodeHeader(final FacesContext context, final ResponseWriter responseWriter, final Sheet sheet) throws IOException { // header final UIComponent header = sheet.getFacet("header"); if (header != null) { responseWriter.startElement("div", null); responseWriter.writeAttribute("class", "ui-datatable-header ui-widget-header ui-corner-top", null); header.encodeAll(context); responseWriter.endElement("div"); } }
class class_name[name] begin[{] method[encodeHeader, return_type[void], modifier[private], parameter[context, responseWriter, sheet]] begin[{] local_variable[type[UIComponent], header] if[binary_operation[member[.header], !=, literal[null]]] begin[{] call[responseWriter.startElement, parameter[literal["div"], literal[null]]] call[responseWriter.writeAttribute, parameter[literal["class"], literal["ui-datatable-header ui-widget-header ui-corner-top"], literal[null]]] call[header.encodeAll, parameter[member[.context]]] call[responseWriter.endElement, parameter[literal["div"]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[encodeHeader] operator[SEP] Keyword[final] identifier[FacesContext] identifier[context] , Keyword[final] identifier[ResponseWriter] identifier[responseWriter] , Keyword[final] identifier[Sheet] identifier[sheet] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[UIComponent] identifier[header] operator[=] identifier[sheet] operator[SEP] identifier[getFacet] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[header] operator[!=] Other[null] operator[SEP] { identifier[responseWriter] operator[SEP] identifier[startElement] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[responseWriter] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , literal[String] , Other[null] operator[SEP] operator[SEP] identifier[header] operator[SEP] identifier[encodeAll] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[responseWriter] operator[SEP] identifier[endElement] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
protected boolean skip() { return (attribute.isSimplePk() && attribute.getJpa().isAutomaticallyAssigned()) // || attribute.isInFk() // || attribute.isAuditEntityAttribute(); }
class class_name[name] begin[{] method[skip, return_type[type[boolean]], modifier[protected], parameter[]] begin[{] return[binary_operation[binary_operation[binary_operation[call[attribute.isSimplePk, parameter[]], &&, call[attribute.getJpa, parameter[]]], ||, call[attribute.isInFk, parameter[]]], ||, call[attribute.isAuditEntityAttribute, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[skip] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[attribute] operator[SEP] identifier[isSimplePk] operator[SEP] operator[SEP] operator[&&] identifier[attribute] operator[SEP] identifier[getJpa] operator[SEP] operator[SEP] operator[SEP] identifier[isAutomaticallyAssigned] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[attribute] operator[SEP] identifier[isInFk] operator[SEP] operator[SEP] operator[||] identifier[attribute] operator[SEP] identifier[isAuditEntityAttribute] operator[SEP] operator[SEP] operator[SEP] }
public static void renameFiles(String[] filePath, String prefix, String suffix, int start) { renameFiles(getFiles(filePath), prefix, suffix, start); }
class class_name[name] begin[{] method[renameFiles, return_type[void], modifier[public static], parameter[filePath, prefix, suffix, start]] begin[{] call[.renameFiles, parameter[call[.getFiles, parameter[member[.filePath]]], member[.prefix], member[.suffix], member[.start]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[renameFiles] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[filePath] , identifier[String] identifier[prefix] , identifier[String] identifier[suffix] , Keyword[int] identifier[start] operator[SEP] { identifier[renameFiles] operator[SEP] identifier[getFiles] operator[SEP] identifier[filePath] operator[SEP] , identifier[prefix] , identifier[suffix] , identifier[start] operator[SEP] operator[SEP] }
protected static void getRegistrationId(OrtcClient ortcClient){ if (checkPlayServices(ortcClient)) { gcm = GoogleCloudMessaging.getInstance(ortcClient.appContext); if (ortcClient.registrationId.isEmpty()){ String regid = getRegistrationId(ortcClient.appContext); ortcClient.registrationId = regid; if (regid.isEmpty()) { registerInBackground(ortcClient); } } } else { ortcClient.raiseOrtcEvent(EventEnum.OnException, ortcClient, new OrtcGcmException("No valid Google Play Services APK found.")); } }
class class_name[name] begin[{] method[getRegistrationId, return_type[void], modifier[static protected], parameter[ortcClient]] begin[{] if[call[.checkPlayServices, parameter[member[.ortcClient]]]] begin[{] assign[member[.gcm], call[GoogleCloudMessaging.getInstance, parameter[member[ortcClient.appContext]]]] if[call[ortcClient.registrationId.isEmpty, parameter[]]] begin[{] local_variable[type[String], regid] assign[member[ortcClient.registrationId], member[.regid]] if[call[regid.isEmpty, parameter[]]] begin[{] call[.registerInBackground, parameter[member[.ortcClient]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] call[ortcClient.raiseOrtcEvent, parameter[member[EventEnum.OnException], member[.ortcClient], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No valid Google Play Services APK found.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OrtcGcmException, sub_type=None))]] end[}] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[getRegistrationId] operator[SEP] identifier[OrtcClient] identifier[ortcClient] operator[SEP] { Keyword[if] operator[SEP] identifier[checkPlayServices] operator[SEP] identifier[ortcClient] operator[SEP] operator[SEP] { identifier[gcm] operator[=] identifier[GoogleCloudMessaging] operator[SEP] identifier[getInstance] operator[SEP] identifier[ortcClient] operator[SEP] identifier[appContext] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ortcClient] operator[SEP] identifier[registrationId] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[regid] operator[=] identifier[getRegistrationId] operator[SEP] identifier[ortcClient] operator[SEP] identifier[appContext] operator[SEP] operator[SEP] identifier[ortcClient] operator[SEP] identifier[registrationId] operator[=] identifier[regid] operator[SEP] Keyword[if] operator[SEP] identifier[regid] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[registerInBackground] operator[SEP] identifier[ortcClient] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[ortcClient] operator[SEP] identifier[raiseOrtcEvent] operator[SEP] identifier[EventEnum] operator[SEP] identifier[OnException] , identifier[ortcClient] , Keyword[new] identifier[OrtcGcmException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } }
@Override public void expireSession( final String sessionId ) { if ( _log.isDebugEnabled() ) { _log.debug( "expireSession invoked: " + sessionId ); } super.expireSession( sessionId ); _msm.deleteFromMemcached( sessionId ); }
class class_name[name] begin[{] method[expireSession, return_type[void], modifier[public], parameter[sessionId]] begin[{] if[call[_log.isDebugEnabled, parameter[]]] begin[{] call[_log.debug, parameter[binary_operation[literal["expireSession invoked: "], +, member[.sessionId]]]] else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expireSession, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[_msm.deleteFromMemcached, parameter[member[.sessionId]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[expireSession] operator[SEP] Keyword[final] identifier[String] identifier[sessionId] operator[SEP] { Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[_log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[sessionId] operator[SEP] operator[SEP] } Keyword[super] operator[SEP] identifier[expireSession] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] identifier[_msm] operator[SEP] identifier[deleteFromMemcached] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] }
public static <T, D> Flux<T> usingWhen(Publisher<D> resourceSupplier, Function<? super D, ? extends Publisher<? extends T>> resourceClosure, Function<? super D, ? extends Publisher<?>> asyncCleanup) { return usingWhen(resourceSupplier, resourceClosure, asyncCleanup, asyncCleanup); }
class class_name[name] begin[{] method[usingWhen, return_type[type[Flux]], modifier[public static], parameter[resourceSupplier, resourceClosure, asyncCleanup]] begin[{] return[call[.usingWhen, parameter[member[.resourceSupplier], member[.resourceClosure], member[.asyncCleanup], member[.asyncCleanup]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[D] operator[>] identifier[Flux] operator[<] identifier[T] operator[>] identifier[usingWhen] operator[SEP] identifier[Publisher] operator[<] identifier[D] operator[>] identifier[resourceSupplier] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[D] , operator[?] Keyword[extends] identifier[Publisher] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[resourceClosure] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[D] , operator[?] Keyword[extends] identifier[Publisher] operator[<] operator[?] operator[>] operator[>] identifier[asyncCleanup] operator[SEP] { Keyword[return] identifier[usingWhen] operator[SEP] identifier[resourceSupplier] , identifier[resourceClosure] , identifier[asyncCleanup] , identifier[asyncCleanup] operator[SEP] operator[SEP] }
public void onApplicationEvent(AbstractAuthenticationEvent event) { if (!logInteractiveAuthenticationSuccessEvents && event instanceof InteractiveAuthenticationSuccessEvent) { return; } if (logger.isWarnEnabled()) { final StringBuilder builder = new StringBuilder(); builder.append("Authentication event "); builder.append(ClassUtils.getShortName(event.getClass())); builder.append(": "); builder.append(event.getAuthentication().getName()); builder.append("; details: "); builder.append(event.getAuthentication().getDetails()); if (event instanceof AbstractAuthenticationFailureEvent) { builder.append("; exception: "); builder.append(((AbstractAuthenticationFailureEvent) event) .getException().getMessage()); } logger.warn(builder.toString()); } }
class class_name[name] begin[{] method[onApplicationEvent, return_type[void], modifier[public], parameter[event]] begin[{] if[binary_operation[member[.logInteractiveAuthenticationSuccessEvents], &&, binary_operation[member[.event], instanceof, type[InteractiveAuthenticationSuccessEvent]]]] begin[{] return[None] else begin[{] None end[}] if[call[logger.isWarnEnabled, parameter[]]] begin[{] local_variable[type[StringBuilder], builder] call[builder.append, parameter[literal["Authentication event "]]] call[builder.append, parameter[call[ClassUtils.getShortName, parameter[call[event.getClass, parameter[]]]]]] call[builder.append, parameter[literal[": "]]] call[builder.append, parameter[call[event.getAuthentication, parameter[]]]] call[builder.append, parameter[literal["; details: "]]] call[builder.append, parameter[call[event.getAuthentication, parameter[]]]] if[binary_operation[member[.event], instanceof, type[AbstractAuthenticationFailureEvent]]] begin[{] call[builder.append, parameter[literal["; exception: "]]] call[builder.append, parameter[Cast(expression=MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAuthenticationFailureEvent, sub_type=None))]] else begin[{] None end[}] call[logger.warn, parameter[call[builder.toString, parameter[]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[onApplicationEvent] operator[SEP] identifier[AbstractAuthenticationEvent] identifier[event] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[logInteractiveAuthenticationSuccessEvents] operator[&&] identifier[event] Keyword[instanceof] identifier[InteractiveAuthenticationSuccessEvent] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[ClassUtils] operator[SEP] identifier[getShortName] operator[SEP] identifier[event] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[event] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[event] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] identifier[getDetails] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] Keyword[instanceof] identifier[AbstractAuthenticationFailureEvent] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractAuthenticationFailureEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[getException] operator[SEP] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public EndPointInfo defineEndPoint(String name, String host, int port) { try { EndPointInfoImpl ep; synchronized (this.endpoints) { // if the endpoint with the same name already exists, // update it if (this.endpoints.containsKey(name)) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "The new endpoint " + name + "already exists. Update the properties of the registered service"); } ep = updateEndpointMBean(name, host, port); } else { // create and register the end point ep = new EndPointInfoImpl(name, host, port); registerEndpointMBean(name, ep); this.endpoints.put(name, ep); } } return ep; } catch (NotCompliantMBeanException ex) { // This should never happen throw new IllegalStateException("Encountered a situation that should never occur. The EndPointInfo resulted in NotCompliantMBeanException", ex); } }
class class_name[name] begin[{] method[defineEndPoint, return_type[type[EndPointInfo]], modifier[public], parameter[name, host, port]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=ep)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EndPointInfoImpl, sub_type=None)), SynchronizedStatement(block=[IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=endpoints, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=EndPointInfoImpl, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerEndpointMBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=endpoints, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The new endpoint "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="already exists. Update the properties of the registered service"), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateEndpointMBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=endpoints, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), ReturnStatement(expression=MemberReference(member=ep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Encountered a situation that should never occur. The EndPointInfo resulted in NotCompliantMBeanException"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NotCompliantMBeanException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EndPointInfo] identifier[defineEndPoint] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[host] , Keyword[int] identifier[port] operator[SEP] { Keyword[try] { identifier[EndPointInfoImpl] identifier[ep] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[endpoints] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[endpoints] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[ep] operator[=] identifier[updateEndpointMBean] operator[SEP] identifier[name] , identifier[host] , identifier[port] operator[SEP] operator[SEP] } Keyword[else] { identifier[ep] operator[=] Keyword[new] identifier[EndPointInfoImpl] operator[SEP] identifier[name] , identifier[host] , identifier[port] operator[SEP] operator[SEP] identifier[registerEndpointMBean] operator[SEP] identifier[name] , identifier[ep] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[endpoints] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[ep] operator[SEP] operator[SEP] } } Keyword[return] identifier[ep] operator[SEP] } Keyword[catch] operator[SEP] identifier[NotCompliantMBeanException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") @Override public EList<IfcRelSpaceBoundary> getProvidesBoundaries() { return (EList<IfcRelSpaceBoundary>) eGet(Ifc4Package.Literals.IFC_ELEMENT__PROVIDES_BOUNDARIES, true); }
class class_name[name] begin[{] method[getProvidesBoundaries, return_type[type[EList]], modifier[public], parameter[]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_ELEMENT__PROVIDES_BOUNDARIES, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcRelSpaceBoundary, sub_type=None))], dimensions=[], name=EList, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[IfcRelSpaceBoundary] operator[>] identifier[getProvidesBoundaries] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcRelSpaceBoundary] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_ELEMENT__PROVIDES_BOUNDARIES] , literal[boolean] operator[SEP] operator[SEP] }
public void endClipping(ClipArea area) { if (area.noClip()) return; next(); GL11.glDisable(GL11.GL_SCISSOR_TEST); GL11.glPopAttrib(); }
class class_name[name] begin[{] method[endClipping, return_type[void], modifier[public], parameter[area]] begin[{] if[call[area.noClip, parameter[]]] begin[{] return[None] else begin[{] None end[}] call[.next, parameter[]] call[GL11.glDisable, parameter[member[GL11.GL_SCISSOR_TEST]]] call[GL11.glPopAttrib, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[endClipping] operator[SEP] identifier[ClipArea] identifier[area] operator[SEP] { Keyword[if] operator[SEP] identifier[area] operator[SEP] identifier[noClip] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[GL11] operator[SEP] identifier[glDisable] operator[SEP] identifier[GL11] operator[SEP] identifier[GL_SCISSOR_TEST] operator[SEP] operator[SEP] identifier[GL11] operator[SEP] identifier[glPopAttrib] operator[SEP] operator[SEP] operator[SEP] }
@Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { boolean newValue = ((Boolean) event.getNewValue()).booleanValue(); // If the new value is true then we must check all field editors. // If it is false, then the page is invalid in any case. if (newValue) { checkState(); } else { invalidFieldEditor = (FieldEditor) event.getSource(); setValid(newValue); } } }
class class_name[name] begin[{] method[propertyChange, return_type[void], modifier[public], parameter[event]] begin[{] if[call[event.getProperty, parameter[]]] begin[{] local_variable[type[boolean], newValue] if[member[.newValue]] begin[{] call[.checkState, parameter[]] else begin[{] assign[member[.invalidFieldEditor], Cast(expression=MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FieldEditor, sub_type=None))] call[.setValid, parameter[member[.newValue]]] end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[propertyChange] operator[SEP] identifier[PropertyChangeEvent] identifier[event] operator[SEP] { Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getProperty] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[FieldEditor] operator[SEP] identifier[IS_VALID] operator[SEP] operator[SEP] { Keyword[boolean] identifier[newValue] operator[=] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[event] operator[SEP] identifier[getNewValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newValue] operator[SEP] { identifier[checkState] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[invalidFieldEditor] operator[=] operator[SEP] identifier[FieldEditor] operator[SEP] identifier[event] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] identifier[setValid] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] } } }
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
class class_name[name] begin[{] method[appendPath, return_type[void], modifier[public], parameter[p_addToPath]] begin[{] if[binary_operation[binary_operation[member[.p_addToPath], ==, literal[null]], ||, binary_operation[call[p_addToPath.trim, parameter[]], ==, literal[0]]]] begin[{] return[None] else begin[{] None end[}] if[call[.isURIString, parameter[member[.p_addToPath]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ER_PATH_INVALID_CHAR, postfix_operators=[], prefix_operators=[], qualifier=MsgKey, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=p_addToPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=createMessage, postfix_operators=[], prefix_operators=[], qualifier=Utils.messages, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MalformedURIException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.m_path], ==, literal[null]], ||, binary_operation[call[m_path.trim, parameter[]], ==, literal[0]]]] begin[{] if[call[p_addToPath.startsWith, parameter[literal["/"]]]] begin[{] assign[member[.m_path], member[.p_addToPath]] else begin[{] assign[member[.m_path], binary_operation[literal["/"], +, member[.p_addToPath]]] end[}] else begin[{] if[call[m_path.endsWith, parameter[literal["/"]]]] begin[{] if[call[p_addToPath.startsWith, parameter[literal["/"]]]] begin[{] assign[member[.m_path], call[m_path.concat, parameter[call[p_addToPath.substring, parameter[literal[1]]]]]] else begin[{] assign[member[.m_path], call[m_path.concat, parameter[member[.p_addToPath]]]] end[}] else begin[{] if[call[p_addToPath.startsWith, parameter[literal["/"]]]] begin[{] assign[member[.m_path], call[m_path.concat, parameter[member[.p_addToPath]]]] else begin[{] assign[member[.m_path], call[m_path.concat, parameter[binary_operation[literal["/"], +, member[.p_addToPath]]]]] end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[appendPath] operator[SEP] identifier[String] identifier[p_addToPath] operator[SEP] Keyword[throws] identifier[MalformedURIException] { Keyword[if] operator[SEP] identifier[p_addToPath] operator[==] Other[null] operator[||] identifier[p_addToPath] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isURIString] operator[SEP] identifier[p_addToPath] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[MalformedURIException] operator[SEP] identifier[Utils] operator[SEP] identifier[messages] operator[SEP] identifier[createMessage] operator[SEP] identifier[MsgKey] operator[SEP] identifier[ER_PATH_INVALID_CHAR] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[p_addToPath] } operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m_path] operator[==] Other[null] operator[||] identifier[m_path] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[p_addToPath] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[m_path] operator[=] identifier[p_addToPath] operator[SEP] } Keyword[else] { identifier[m_path] operator[=] literal[String] operator[+] identifier[p_addToPath] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[m_path] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[p_addToPath] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[m_path] operator[=] identifier[m_path] operator[SEP] identifier[concat] operator[SEP] identifier[p_addToPath] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_path] operator[=] identifier[m_path] operator[SEP] identifier[concat] operator[SEP] identifier[p_addToPath] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[p_addToPath] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[m_path] operator[=] identifier[m_path] operator[SEP] identifier[concat] operator[SEP] identifier[p_addToPath] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_path] operator[=] identifier[m_path] operator[SEP] identifier[concat] operator[SEP] literal[String] operator[+] identifier[p_addToPath] operator[SEP] operator[SEP] } } }
public final void pinsrd(XMMRegister dst, Register src, Immediate imm8) { emitX86(INST_PINSRD, dst, src, imm8); }
class class_name[name] begin[{] method[pinsrd, return_type[void], modifier[final public], parameter[dst, src, imm8]] begin[{] call[.emitX86, parameter[member[.INST_PINSRD], member[.dst], member[.src], member[.imm8]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[pinsrd] operator[SEP] identifier[XMMRegister] identifier[dst] , identifier[Register] identifier[src] , identifier[Immediate] identifier[imm8] operator[SEP] { identifier[emitX86] operator[SEP] identifier[INST_PINSRD] , identifier[dst] , identifier[src] , identifier[imm8] operator[SEP] operator[SEP] }
public static KeyRange getInputKeyRange(Configuration conf) { String str = conf.get(INPUT_KEYRANGE_CONFIG); return str == null ? null : keyRangeFromString(str); }
class class_name[name] begin[{] method[getInputKeyRange, return_type[type[KeyRange]], modifier[public static], parameter[conf]] begin[{] local_variable[type[String], str] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keyRangeFromString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] Keyword[static] identifier[KeyRange] identifier[getInputKeyRange] operator[SEP] identifier[Configuration] identifier[conf] operator[SEP] { identifier[String] identifier[str] operator[=] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[INPUT_KEYRANGE_CONFIG] operator[SEP] operator[SEP] Keyword[return] identifier[str] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[keyRangeFromString] operator[SEP] identifier[str] operator[SEP] operator[SEP] }