code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static double optionalDoubleAttribute( final XMLStreamReader reader, final String namespace, final String localName, final double defaultValue) { final String value = reader.getAttributeValue(namespace, localName); if (value != null) { return Double.parseDouble(value); } return defaultValue; }
class class_name[name] begin[{] method[optionalDoubleAttribute, return_type[type[double]], modifier[public static], parameter[reader, namespace, localName, defaultValue]] begin[{] local_variable[type[String], value] if[binary_operation[member[.value], !=, literal[null]]] begin[{] return[call[Double.parseDouble, parameter[member[.value]]]] else begin[{] None end[}] return[member[.defaultValue]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[optionalDoubleAttribute] operator[SEP] Keyword[final] identifier[XMLStreamReader] identifier[reader] , Keyword[final] identifier[String] identifier[namespace] , Keyword[final] identifier[String] identifier[localName] , Keyword[final] Keyword[double] identifier[defaultValue] operator[SEP] { Keyword[final] identifier[String] identifier[value] operator[=] identifier[reader] operator[SEP] identifier[getAttributeValue] operator[SEP] identifier[namespace] , identifier[localName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[defaultValue] operator[SEP] }
private IGatewayLink createGatewayLink(String gatewayId) throws StorageException { if (gatewayLinkCache.containsKey(gatewayId)) { return gatewayLinkCache.get(gatewayId); } try { GatewayBean gateway = storage.getGateway(gatewayId); if (gateway == null) { throw new Exception("Gateway not found: " + gatewayId); //$NON-NLS-1$ } IGatewayLink link = gatewayLinks.create(gateway); gatewayLinkCache.put(gatewayId, link); return link; } catch (Exception e) { throw new StorageException(e); } }
class class_name[name] begin[{] method[createGatewayLink, return_type[type[IGatewayLink]], modifier[private], parameter[gatewayId]] begin[{] if[call[gatewayLinkCache.containsKey, parameter[member[.gatewayId]]]] begin[{] return[call[gatewayLinkCache.get, parameter[member[.gatewayId]]]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=gatewayId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGateway, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), name=gateway)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GatewayBean, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=gateway, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Gateway not found: "), operandr=MemberReference(member=gatewayId, 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=Exception, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=gateway, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=gatewayLinks, selectors=[], type_arguments=None), name=link)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IGatewayLink, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gatewayId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=link, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=gatewayLinkCache, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=link, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=StorageException, 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[private] identifier[IGatewayLink] identifier[createGatewayLink] operator[SEP] identifier[String] identifier[gatewayId] operator[SEP] Keyword[throws] identifier[StorageException] { Keyword[if] operator[SEP] identifier[gatewayLinkCache] operator[SEP] identifier[containsKey] operator[SEP] identifier[gatewayId] operator[SEP] operator[SEP] { Keyword[return] identifier[gatewayLinkCache] operator[SEP] identifier[get] operator[SEP] identifier[gatewayId] operator[SEP] operator[SEP] } Keyword[try] { identifier[GatewayBean] identifier[gateway] operator[=] identifier[storage] operator[SEP] identifier[getGateway] operator[SEP] identifier[gatewayId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gateway] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[gatewayId] operator[SEP] operator[SEP] } identifier[IGatewayLink] identifier[link] operator[=] identifier[gatewayLinks] operator[SEP] identifier[create] operator[SEP] identifier[gateway] operator[SEP] operator[SEP] identifier[gatewayLinkCache] operator[SEP] identifier[put] operator[SEP] identifier[gatewayId] , identifier[link] operator[SEP] operator[SEP] Keyword[return] identifier[link] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[StorageException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static String inputStreamToString(InputStream in) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(in)); StringBuffer buffer = new StringBuffer(); String line; while ((line = br.readLine()) != null) { buffer.append(line); } return buffer.toString(); }
class class_name[name] begin[{] method[inputStreamToString, return_type[type[String]], modifier[public static], parameter[in]] begin[{] local_variable[type[BufferedReader], br] local_variable[type[StringBuffer], buffer] local_variable[type[String], line] while[binary_operation[assign[member[.line], call[br.readLine, parameter[]]], !=, literal[null]]] begin[{] call[buffer.append, parameter[member[.line]]] end[}] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[inputStreamToString] operator[SEP] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[Exception] { identifier[BufferedReader] identifier[br] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[in] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isValid( EastAsianYear year, EastAsianMonth month, int dayOfMonth ) { int cycle = year.getCycle(); int yearOfCycle = year.getYearOfCycle().getNumber(); return CALSYS.isValid(cycle, yearOfCycle, month, dayOfMonth); }
class class_name[name] begin[{] method[isValid, return_type[type[boolean]], modifier[public static], parameter[year, month, dayOfMonth]] begin[{] local_variable[type[int], cycle] local_variable[type[int], yearOfCycle] return[call[CALSYS.isValid, parameter[member[.cycle], member[.yearOfCycle], member[.month], member[.dayOfMonth]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isValid] operator[SEP] identifier[EastAsianYear] identifier[year] , identifier[EastAsianMonth] identifier[month] , Keyword[int] identifier[dayOfMonth] operator[SEP] { Keyword[int] identifier[cycle] operator[=] identifier[year] operator[SEP] identifier[getCycle] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[yearOfCycle] operator[=] identifier[year] operator[SEP] identifier[getYearOfCycle] operator[SEP] operator[SEP] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[CALSYS] operator[SEP] identifier[isValid] operator[SEP] identifier[cycle] , identifier[yearOfCycle] , identifier[month] , identifier[dayOfMonth] operator[SEP] operator[SEP] }
private void generateAttributesGroupInterface(Map<String, List<XsdAttribute>> createdAttributes, String attributeGroupName, AttributeHierarchyItem attributeHierarchyItem, String apiName){ String baseClassNameCamelCase = firstToUpper(attributeGroupName); String[] interfaces = getAttributeGroupObjectInterfaces(attributeHierarchyItem.getParentsName()); StringBuilder signature = getAttributeGroupSignature(interfaces, apiName); ClassWriter interfaceWriter = generateClass(baseClassNameCamelCase, JAVA_OBJECT, interfaces, signature.toString(), ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, apiName); attributeHierarchyItem.getOwnElements().forEach(elementAttribute -> { if (createdAttributes.keySet().stream().anyMatch(createdAttributeName -> createdAttributeName.equalsIgnoreCase(elementAttribute.getName()))){ elementAttribute.setName(elementAttribute.getName() + ATTRIBUTE_CASE_SENSITIVE_DIFFERENCE); } generateMethodsAndCreateAttribute(createdAttributes, interfaceWriter, elementAttribute, elementTypeDesc, baseClassNameCamelCase, apiName); }); writeClassToFile(baseClassNameCamelCase, interfaceWriter, apiName); }
class class_name[name] begin[{] method[generateAttributesGroupInterface, return_type[void], modifier[private], parameter[createdAttributes, attributeGroupName, attributeHierarchyItem, apiName]] begin[{] local_variable[type[String], baseClassNameCamelCase] local_variable[type[String], interfaces] local_variable[type[StringBuilder], signature] local_variable[type[ClassWriter], interfaceWriter] call[attributeHierarchyItem.getOwnElements, parameter[]] call[.writeClassToFile, parameter[member[.baseClassNameCamelCase], member[.interfaceWriter], member[.apiName]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[generateAttributesGroupInterface] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[XsdAttribute] operator[>] operator[>] identifier[createdAttributes] , identifier[String] identifier[attributeGroupName] , identifier[AttributeHierarchyItem] identifier[attributeHierarchyItem] , identifier[String] identifier[apiName] operator[SEP] { identifier[String] identifier[baseClassNameCamelCase] operator[=] identifier[firstToUpper] operator[SEP] identifier[attributeGroupName] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[interfaces] operator[=] identifier[getAttributeGroupObjectInterfaces] operator[SEP] identifier[attributeHierarchyItem] operator[SEP] identifier[getParentsName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[signature] operator[=] identifier[getAttributeGroupSignature] operator[SEP] identifier[interfaces] , identifier[apiName] operator[SEP] operator[SEP] identifier[ClassWriter] identifier[interfaceWriter] operator[=] identifier[generateClass] operator[SEP] identifier[baseClassNameCamelCase] , identifier[JAVA_OBJECT] , identifier[interfaces] , identifier[signature] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[ACC_PUBLIC] operator[+] identifier[ACC_ABSTRACT] operator[+] identifier[ACC_INTERFACE] , identifier[apiName] operator[SEP] operator[SEP] identifier[attributeHierarchyItem] operator[SEP] identifier[getOwnElements] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[elementAttribute] operator[->] { Keyword[if] operator[SEP] identifier[createdAttributes] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[createdAttributeName] operator[->] identifier[createdAttributeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[elementAttribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[elementAttribute] operator[SEP] identifier[setName] operator[SEP] identifier[elementAttribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[ATTRIBUTE_CASE_SENSITIVE_DIFFERENCE] operator[SEP] operator[SEP] } identifier[generateMethodsAndCreateAttribute] operator[SEP] identifier[createdAttributes] , identifier[interfaceWriter] , identifier[elementAttribute] , identifier[elementTypeDesc] , identifier[baseClassNameCamelCase] , identifier[apiName] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[writeClassToFile] operator[SEP] identifier[baseClassNameCamelCase] , identifier[interfaceWriter] , identifier[apiName] operator[SEP] operator[SEP] }
private static int order(Method method) { final Order order = findFirst(method, Order.class).orElse(null); return order != null ? order.value() : 0; }
class class_name[name] begin[{] method[order, return_type[type[int]], modifier[private static], parameter[method]] begin[{] local_variable[type[Order], order] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=order, 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=0), if_true=MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=order, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[order] operator[SEP] identifier[Method] identifier[method] operator[SEP] { Keyword[final] identifier[Order] identifier[order] operator[=] identifier[findFirst] operator[SEP] identifier[method] , identifier[Order] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[order] operator[!=] Other[null] operator[?] identifier[order] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] }
public int[] getReordering(int[] linebreaks) { validateLineBreaks(linebreaks, textLength); byte[] levels = getLevels(linebreaks); return computeMultilineReordering(levels, linebreaks); }
class class_name[name] begin[{] method[getReordering, return_type[type[int]], modifier[public], parameter[linebreaks]] begin[{] call[.validateLineBreaks, parameter[member[.linebreaks], member[.textLength]]] local_variable[type[byte], levels] return[call[.computeMultilineReordering, parameter[member[.levels], member[.linebreaks]]]] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[getReordering] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[linebreaks] operator[SEP] { identifier[validateLineBreaks] operator[SEP] identifier[linebreaks] , identifier[textLength] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[levels] operator[=] identifier[getLevels] operator[SEP] identifier[linebreaks] operator[SEP] operator[SEP] Keyword[return] identifier[computeMultilineReordering] operator[SEP] identifier[levels] , identifier[linebreaks] operator[SEP] operator[SEP] }
public boolean overlaps(ReadableInterval interval) { long thisStart = getStartMillis(); long thisEnd = getEndMillis(); if (interval == null) { long now = DateTimeUtils.currentTimeMillis(); return (thisStart < now && now < thisEnd); } else { long otherStart = interval.getStartMillis(); long otherEnd = interval.getEndMillis(); return (thisStart < otherEnd && otherStart < thisEnd); } }
class class_name[name] begin[{] method[overlaps, return_type[type[boolean]], modifier[public], parameter[interval]] begin[{] local_variable[type[long], thisStart] local_variable[type[long], thisEnd] if[binary_operation[member[.interval], ==, literal[null]]] begin[{] local_variable[type[long], now] return[binary_operation[binary_operation[member[.thisStart], <, member[.now]], &&, binary_operation[member[.now], <, member[.thisEnd]]]] else begin[{] local_variable[type[long], otherStart] local_variable[type[long], otherEnd] return[binary_operation[binary_operation[member[.thisStart], <, member[.otherEnd]], &&, binary_operation[member[.otherStart], <, member[.thisEnd]]]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[overlaps] operator[SEP] identifier[ReadableInterval] identifier[interval] operator[SEP] { Keyword[long] identifier[thisStart] operator[=] identifier[getStartMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[thisEnd] operator[=] identifier[getEndMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interval] operator[==] Other[null] operator[SEP] { Keyword[long] identifier[now] operator[=] identifier[DateTimeUtils] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[thisStart] operator[<] identifier[now] operator[&&] identifier[now] operator[<] identifier[thisEnd] operator[SEP] operator[SEP] } Keyword[else] { Keyword[long] identifier[otherStart] operator[=] identifier[interval] operator[SEP] identifier[getStartMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[otherEnd] operator[=] identifier[interval] operator[SEP] identifier[getEndMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[thisStart] operator[<] identifier[otherEnd] operator[&&] identifier[otherStart] operator[<] identifier[thisEnd] operator[SEP] operator[SEP] } }
public static String[] trim(final String... aStringArray) { final ArrayList<String> list = new ArrayList<>(); for (final String string : aStringArray) { if (string != null && !"".equals(string)) { list.add(string); } } return list.toArray(new String[0]); }
class class_name[name] begin[{] method[trim, return_type[type[String]], modifier[public static], parameter[aStringArray]] begin[{] local_variable[type[ArrayList], list] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=aStringArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=string)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[list.toArray, parameter[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=String, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[trim] operator[SEP] Keyword[final] identifier[String] operator[...] identifier[aStringArray] operator[SEP] { Keyword[final] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[string] operator[:] identifier[aStringArray] operator[SEP] { Keyword[if] operator[SEP] identifier[string] operator[!=] Other[null] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[string] operator[SEP] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[string] operator[SEP] operator[SEP] } } Keyword[return] identifier[list] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] }
public static Reader createReader(InputStream inputStream,String encoding) { //get encoding String updatedEncoding=IOHelper.getEncodingToUse(encoding); //create reader Reader reader=null; try { reader=new InputStreamReader(inputStream,updatedEncoding); } catch(UnsupportedEncodingException exception) { throw new FaxException("Unable to create reader, unsupported encoding: "+encoding,exception); } return reader; }
class class_name[name] begin[{] method[createReader, return_type[type[Reader]], modifier[public static], parameter[inputStream, encoding]] begin[{] local_variable[type[String], updatedEncoding] local_variable[type[Reader], reader] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=updatedEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to create reader, unsupported encoding: "), operandr=MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=exception, 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=FaxException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) return[member[.reader]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Reader] identifier[createReader] operator[SEP] identifier[InputStream] identifier[inputStream] , identifier[String] identifier[encoding] operator[SEP] { identifier[String] identifier[updatedEncoding] operator[=] identifier[IOHelper] operator[SEP] identifier[getEncodingToUse] operator[SEP] identifier[encoding] operator[SEP] operator[SEP] identifier[Reader] identifier[reader] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[reader] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[inputStream] , identifier[updatedEncoding] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[exception] operator[SEP] { Keyword[throw] Keyword[new] identifier[FaxException] operator[SEP] literal[String] operator[+] identifier[encoding] , identifier[exception] operator[SEP] operator[SEP] } Keyword[return] identifier[reader] operator[SEP] }
private void setDateTimeNow() { final Date dt = new Date(); this.dateTime = MetaElement.DF_DATE.format(dt) + "T" + MetaElement.DF_TIME.format(dt); }
class class_name[name] begin[{] method[setDateTimeNow, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Date], dt] assign[THIS[member[None.dateTime]], binary_operation[binary_operation[call[MetaElement.DF_DATE.format, parameter[member[.dt]]], +, literal["T"]], +, call[MetaElement.DF_TIME.format, parameter[member[.dt]]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setDateTimeNow] operator[SEP] operator[SEP] { Keyword[final] identifier[Date] identifier[dt] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[dateTime] operator[=] identifier[MetaElement] operator[SEP] identifier[DF_DATE] operator[SEP] identifier[format] operator[SEP] identifier[dt] operator[SEP] operator[+] literal[String] operator[+] identifier[MetaElement] operator[SEP] identifier[DF_TIME] operator[SEP] identifier[format] operator[SEP] identifier[dt] operator[SEP] operator[SEP] }
public EList<XExpression> getArguments() { if (arguments == null) { arguments = new EObjectContainmentEList<XExpression>(XExpression.class, this, XbasePackage.XCONSTRUCTOR_CALL__ARGUMENTS); } return arguments; }
class class_name[name] begin[{] method[getArguments, return_type[type[EList]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.arguments], ==, literal[null]]] begin[{] assign[member[.arguments], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XExpression, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=XCONSTRUCTOR_CALL__ARGUMENTS, postfix_operators=[], prefix_operators=[], qualifier=XbasePackage, 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=XExpression, sub_type=None))], dimensions=None, name=EObjectContainmentEList, sub_type=None))] else begin[{] None end[}] return[member[.arguments]] end[}] END[}]
Keyword[public] identifier[EList] operator[<] identifier[XExpression] operator[>] identifier[getArguments] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[arguments] operator[==] Other[null] operator[SEP] { identifier[arguments] operator[=] Keyword[new] identifier[EObjectContainmentEList] operator[<] identifier[XExpression] operator[>] operator[SEP] identifier[XExpression] operator[SEP] Keyword[class] , Keyword[this] , identifier[XbasePackage] operator[SEP] identifier[XCONSTRUCTOR_CALL__ARGUMENTS] operator[SEP] operator[SEP] } Keyword[return] identifier[arguments] operator[SEP] }
protected MethodVisitor makeDelegateCall(final String name, final String desc, final String signature, final String[] exceptions, final int accessFlags) { MethodVisitor mv = super.visitMethod(accessFlags, name, desc, signature, exceptions); mv.visitVarInsn(ALOAD, 0); // load this mv.visitFieldInsn(GETFIELD, proxyName, DELEGATE_OBJECT_FIELD, BytecodeHelper.getTypeDescription(delegateClass)); // load delegate // using InvokerHelper to allow potential intercepted calls int size; mv.visitLdcInsn(name); // method name Type[] args = Type.getArgumentTypes(desc); BytecodeHelper.pushConstant(mv, args.length); mv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); size = 6; int idx = 1; for (int i = 0; i < args.length; i++) { Type arg = args[i]; mv.visitInsn(DUP); BytecodeHelper.pushConstant(mv, i); // primitive types must be boxed if (isPrimitive(arg)) { mv.visitIntInsn(getLoadInsn(arg), idx); String wrappedType = getWrappedClassDescriptor(arg); mv.visitMethodInsn(INVOKESTATIC, wrappedType, "valueOf", "(" + arg.getDescriptor() + ")L" + wrappedType + ";", false); } else { mv.visitVarInsn(ALOAD, idx); // load argument i } size = Math.max(size, 5+registerLen(arg)); idx += registerLen(arg); mv.visitInsn(AASTORE); // store value into array } mv.visitMethodInsn(INVOKESTATIC, "org/codehaus/groovy/runtime/InvokerHelper", "invokeMethod", "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;", false); unwrapResult(mv, desc); mv.visitMaxs(size, registerLen(args) + 1); return mv; }
class class_name[name] begin[{] method[makeDelegateCall, return_type[type[MethodVisitor]], modifier[protected], parameter[name, desc, signature, exceptions, accessFlags]] begin[{] local_variable[type[MethodVisitor], mv] call[mv.visitVarInsn, parameter[member[.ALOAD], literal[0]]] call[mv.visitFieldInsn, parameter[member[.GETFIELD], member[.proxyName], member[.DELEGATE_OBJECT_FIELD], call[BytecodeHelper.getTypeDescription, parameter[member[.delegateClass]]]]] local_variable[type[int], size] call[mv.visitLdcInsn, parameter[member[.name]]] local_variable[type[Type], args] call[BytecodeHelper.pushConstant, parameter[member[.mv], member[args.length]]] call[mv.visitTypeInsn, parameter[member[.ANEWARRAY], literal["java/lang/Object"]]] assign[member[.size], literal[6]] local_variable[type[int], idx] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DUP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitInsn, postfix_operators=[], prefix_operators=[], qualifier=mv, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushConstant, postfix_operators=[], prefix_operators=[], qualifier=BytecodeHelper, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPrimitive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ALOAD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitVarInsn, postfix_operators=[], prefix_operators=[], qualifier=mv, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLoadInsn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitIntInsn, postfix_operators=[], prefix_operators=[], qualifier=mv, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWrappedClassDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=wrappedType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INVOKESTATIC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wrappedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="valueOf"), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="("), operandr=MethodInvocation(arguments=[], member=getDescriptor, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")L"), operator=+), operandr=MemberReference(member=wrappedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=visitMethodInsn, postfix_operators=[], prefix_operators=[], qualifier=mv, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operandr=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=AASTORE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitInsn, postfix_operators=[], prefix_operators=[], qualifier=mv, 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=args, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[mv.visitMethodInsn, parameter[member[.INVOKESTATIC], literal["org/codehaus/groovy/runtime/InvokerHelper"], literal["invokeMethod"], literal["(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;"], literal[false]]] call[.unwrapResult, parameter[member[.mv], member[.desc]]] call[mv.visitMaxs, parameter[member[.size], binary_operation[call[.registerLen, parameter[member[.args]]], +, literal[1]]]] return[member[.mv]] end[}] END[}]
Keyword[protected] identifier[MethodVisitor] identifier[makeDelegateCall] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[desc] , Keyword[final] identifier[String] identifier[signature] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[exceptions] , Keyword[final] Keyword[int] identifier[accessFlags] operator[SEP] { identifier[MethodVisitor] identifier[mv] operator[=] Keyword[super] operator[SEP] identifier[visitMethod] operator[SEP] identifier[accessFlags] , identifier[name] , identifier[desc] , identifier[signature] , identifier[exceptions] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitVarInsn] operator[SEP] identifier[ALOAD] , Other[0] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitFieldInsn] operator[SEP] identifier[GETFIELD] , identifier[proxyName] , identifier[DELEGATE_OBJECT_FIELD] , identifier[BytecodeHelper] operator[SEP] identifier[getTypeDescription] operator[SEP] identifier[delegateClass] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[SEP] identifier[mv] operator[SEP] identifier[visitLdcInsn] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[args] operator[=] identifier[Type] operator[SEP] identifier[getArgumentTypes] operator[SEP] identifier[desc] operator[SEP] operator[SEP] identifier[BytecodeHelper] operator[SEP] identifier[pushConstant] operator[SEP] identifier[mv] , identifier[args] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitTypeInsn] operator[SEP] identifier[ANEWARRAY] , literal[String] operator[SEP] operator[SEP] identifier[size] operator[=] Other[6] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[args] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Type] identifier[arg] operator[=] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitInsn] operator[SEP] identifier[DUP] operator[SEP] operator[SEP] identifier[BytecodeHelper] operator[SEP] identifier[pushConstant] operator[SEP] identifier[mv] , identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPrimitive] operator[SEP] identifier[arg] operator[SEP] operator[SEP] { identifier[mv] operator[SEP] identifier[visitIntInsn] operator[SEP] identifier[getLoadInsn] operator[SEP] identifier[arg] operator[SEP] , identifier[idx] operator[SEP] operator[SEP] identifier[String] identifier[wrappedType] operator[=] identifier[getWrappedClassDescriptor] operator[SEP] identifier[arg] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitMethodInsn] operator[SEP] identifier[INVOKESTATIC] , identifier[wrappedType] , literal[String] , literal[String] operator[+] identifier[arg] operator[SEP] identifier[getDescriptor] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[wrappedType] operator[+] literal[String] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[mv] operator[SEP] identifier[visitVarInsn] operator[SEP] identifier[ALOAD] , identifier[idx] operator[SEP] operator[SEP] } identifier[size] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[size] , Other[5] operator[+] identifier[registerLen] operator[SEP] identifier[arg] operator[SEP] operator[SEP] operator[SEP] identifier[idx] operator[+=] identifier[registerLen] operator[SEP] identifier[arg] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitInsn] operator[SEP] identifier[AASTORE] operator[SEP] operator[SEP] } identifier[mv] operator[SEP] identifier[visitMethodInsn] operator[SEP] identifier[INVOKESTATIC] , literal[String] , literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[unwrapResult] operator[SEP] identifier[mv] , identifier[desc] operator[SEP] operator[SEP] identifier[mv] operator[SEP] identifier[visitMaxs] operator[SEP] identifier[size] , identifier[registerLen] operator[SEP] identifier[args] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[mv] operator[SEP] }
@SuppressWarnings("unchecked") public <V extends View> V findView(View containerView, int id) { return (V)containerView.findViewById(id); }
class class_name[name] begin[{] method[findView, return_type[type[V]], modifier[public], parameter[containerView, id]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findViewById, postfix_operators=[], prefix_operators=[], qualifier=containerView, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[V] Keyword[extends] identifier[View] operator[>] identifier[V] identifier[findView] operator[SEP] identifier[View] identifier[containerView] , Keyword[int] identifier[id] operator[SEP] { Keyword[return] operator[SEP] identifier[V] operator[SEP] identifier[containerView] operator[SEP] identifier[findViewById] operator[SEP] identifier[id] operator[SEP] operator[SEP] }
public static void assertHeaderPresent(String msg, SipMessage sipMessage, String header) { assertNotNull("Null assert object passed in", sipMessage); assertTrue(msg, sipMessage.getHeaders(header).hasNext()); }
class class_name[name] begin[{] method[assertHeaderPresent, return_type[void], modifier[public static], parameter[msg, sipMessage, header]] begin[{] call[.assertNotNull, parameter[literal["Null assert object passed in"], member[.sipMessage]]] call[.assertTrue, parameter[member[.msg], call[sipMessage.getHeaders, parameter[member[.header]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[assertHeaderPresent] operator[SEP] identifier[String] identifier[msg] , identifier[SipMessage] identifier[sipMessage] , identifier[String] identifier[header] operator[SEP] { identifier[assertNotNull] operator[SEP] literal[String] , identifier[sipMessage] operator[SEP] operator[SEP] identifier[assertTrue] operator[SEP] identifier[msg] , identifier[sipMessage] operator[SEP] identifier[getHeaders] operator[SEP] identifier[header] operator[SEP] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected TagRenderingBase renderSelectionLink(AbstractRenderAppender writer, TreeElement node, String nodeName, AttributeRenderer attrs, InheritableState state) throws JspException { // calculate the selection link for this node String selectionLink = getSelectionlink(node, nodeName, state); TagRenderingBase endRender = null; // if there is a selection link we need to put an anchor out. if (selectionLink != null) { _anchorState.clear(); _anchorState.href = selectionLink; String target = node.getTarget(); if (target == null) { target = state.getSelectionTarget(); } _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, TARGET, target); String title = node.getTitle(); _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, TITLE, title); // set the selection styles if (node.isSelected()) { _anchorState.style = _trs.selectedStyle; _anchorState.styleClass = _trs.selectedStyleClass; } else { _anchorState.style = _trs.unselectedStyle; _anchorState.styleClass = _trs.unselectedStyleClass; } if (_anchorState.style == null && _anchorState.styleClass == null) { _anchorState.style = "text-decoration: none"; } // render any attributes applied to the HTML attrs.renderSelectionLink(_anchorState, node); // render the runAtClient attributes if (_trs.runAtClient) { String action = node.getClientAction(); if (action != null) { action = HtmlUtils.escapeEscapes(action); action = ScriptRequestState.getString("netuiAction", new Object[]{action}); } _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, ONCLICK, action); // Jira 299 //_anchorState.onClick = action; } // actually render the anchor. renderSelectionLinkPrefix(writer, node); _anchorRenderer.doStartTag(writer, _anchorState); endRender = _anchorRenderer; } else { // This node doesn's support selection. This means we consider it disabled. We will // put a span around it and set the style/class to indicate that it is disabled. _spanState.clear(); _spanState.styleClass = _trs.disabledStyleClass; _spanState.style = _trs.disabledStyle; renderSelectionLinkPrefix(writer, node); _spanRenderer.doStartTag(writer, _spanState); endRender = _spanRenderer; } return endRender; }
class class_name[name] begin[{] method[renderSelectionLink, return_type[type[TagRenderingBase]], modifier[protected], parameter[writer, node, nodeName, attrs, state]] begin[{] local_variable[type[String], selectionLink] local_variable[type[TagRenderingBase], endRender] if[binary_operation[member[.selectionLink], !=, literal[null]]] begin[{] call[_anchorState.clear, parameter[]] assign[member[_anchorState.href], member[.selectionLink]] local_variable[type[String], target] if[binary_operation[member[.target], ==, literal[null]]] begin[{] assign[member[.target], call[state.getSelectionTarget, parameter[]]] else begin[{] None end[}] call[_anchorState.registerAttribute, parameter[member[AbstractHtmlState.ATTR_GENERAL], member[.TARGET], member[.target]]] local_variable[type[String], title] call[_anchorState.registerAttribute, parameter[member[AbstractHtmlState.ATTR_GENERAL], member[.TITLE], member[.title]]] if[call[node.isSelected, parameter[]]] begin[{] assign[member[_anchorState.style], member[_trs.selectedStyle]] assign[member[_anchorState.styleClass], member[_trs.selectedStyleClass]] else begin[{] assign[member[_anchorState.style], member[_trs.unselectedStyle]] assign[member[_anchorState.styleClass], member[_trs.unselectedStyleClass]] end[}] if[binary_operation[binary_operation[member[_anchorState.style], ==, literal[null]], &&, binary_operation[member[_anchorState.styleClass], ==, literal[null]]]] begin[{] assign[member[_anchorState.style], literal["text-decoration: none"]] else begin[{] None end[}] call[attrs.renderSelectionLink, parameter[member[._anchorState], member[.node]]] if[member[_trs.runAtClient]] begin[{] local_variable[type[String], action] if[binary_operation[member[.action], !=, literal[null]]] begin[{] assign[member[.action], call[HtmlUtils.escapeEscapes, parameter[member[.action]]]] assign[member[.action], call[ScriptRequestState.getString, parameter[literal["netuiAction"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] else begin[{] None end[}] call[_anchorState.registerAttribute, parameter[member[AbstractHtmlState.ATTR_JAVASCRIPT], member[.ONCLICK], member[.action]]] else begin[{] None end[}] call[.renderSelectionLinkPrefix, parameter[member[.writer], member[.node]]] call[_anchorRenderer.doStartTag, parameter[member[.writer], member[._anchorState]]] assign[member[.endRender], member[._anchorRenderer]] else begin[{] call[_spanState.clear, parameter[]] assign[member[_spanState.styleClass], member[_trs.disabledStyleClass]] assign[member[_spanState.style], member[_trs.disabledStyle]] call[.renderSelectionLinkPrefix, parameter[member[.writer], member[.node]]] call[_spanRenderer.doStartTag, parameter[member[.writer], member[._spanState]]] assign[member[.endRender], member[._spanRenderer]] end[}] return[member[.endRender]] end[}] END[}]
Keyword[protected] identifier[TagRenderingBase] identifier[renderSelectionLink] operator[SEP] identifier[AbstractRenderAppender] identifier[writer] , identifier[TreeElement] identifier[node] , identifier[String] identifier[nodeName] , identifier[AttributeRenderer] identifier[attrs] , identifier[InheritableState] identifier[state] operator[SEP] Keyword[throws] identifier[JspException] { identifier[String] identifier[selectionLink] operator[=] identifier[getSelectionlink] operator[SEP] identifier[node] , identifier[nodeName] , identifier[state] operator[SEP] operator[SEP] identifier[TagRenderingBase] identifier[endRender] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[selectionLink] operator[!=] Other[null] operator[SEP] { identifier[_anchorState] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[_anchorState] operator[SEP] identifier[href] operator[=] identifier[selectionLink] operator[SEP] identifier[String] identifier[target] operator[=] identifier[node] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] { identifier[target] operator[=] identifier[state] operator[SEP] identifier[getSelectionTarget] operator[SEP] operator[SEP] operator[SEP] } identifier[_anchorState] operator[SEP] identifier[registerAttribute] operator[SEP] identifier[AbstractHtmlState] operator[SEP] identifier[ATTR_GENERAL] , identifier[TARGET] , identifier[target] operator[SEP] operator[SEP] identifier[String] identifier[title] operator[=] identifier[node] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] identifier[_anchorState] operator[SEP] identifier[registerAttribute] operator[SEP] identifier[AbstractHtmlState] operator[SEP] identifier[ATTR_GENERAL] , identifier[TITLE] , identifier[title] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] { identifier[_anchorState] operator[SEP] identifier[style] operator[=] identifier[_trs] operator[SEP] identifier[selectedStyle] operator[SEP] identifier[_anchorState] operator[SEP] identifier[styleClass] operator[=] identifier[_trs] operator[SEP] identifier[selectedStyleClass] operator[SEP] } Keyword[else] { identifier[_anchorState] operator[SEP] identifier[style] operator[=] identifier[_trs] operator[SEP] identifier[unselectedStyle] operator[SEP] identifier[_anchorState] operator[SEP] identifier[styleClass] operator[=] identifier[_trs] operator[SEP] identifier[unselectedStyleClass] operator[SEP] } Keyword[if] operator[SEP] identifier[_anchorState] operator[SEP] identifier[style] operator[==] Other[null] operator[&&] identifier[_anchorState] operator[SEP] identifier[styleClass] operator[==] Other[null] operator[SEP] { identifier[_anchorState] operator[SEP] identifier[style] operator[=] literal[String] operator[SEP] } identifier[attrs] operator[SEP] identifier[renderSelectionLink] operator[SEP] identifier[_anchorState] , identifier[node] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_trs] operator[SEP] identifier[runAtClient] operator[SEP] { identifier[String] identifier[action] operator[=] identifier[node] operator[SEP] identifier[getClientAction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[action] operator[!=] Other[null] operator[SEP] { identifier[action] operator[=] identifier[HtmlUtils] operator[SEP] identifier[escapeEscapes] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[action] operator[=] identifier[ScriptRequestState] operator[SEP] identifier[getString] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[action] } operator[SEP] operator[SEP] } identifier[_anchorState] operator[SEP] identifier[registerAttribute] operator[SEP] identifier[AbstractHtmlState] operator[SEP] identifier[ATTR_JAVASCRIPT] , identifier[ONCLICK] , identifier[action] operator[SEP] operator[SEP] } identifier[renderSelectionLinkPrefix] operator[SEP] identifier[writer] , identifier[node] operator[SEP] operator[SEP] identifier[_anchorRenderer] operator[SEP] identifier[doStartTag] operator[SEP] identifier[writer] , identifier[_anchorState] operator[SEP] operator[SEP] identifier[endRender] operator[=] identifier[_anchorRenderer] operator[SEP] } Keyword[else] { identifier[_spanState] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[_spanState] operator[SEP] identifier[styleClass] operator[=] identifier[_trs] operator[SEP] identifier[disabledStyleClass] operator[SEP] identifier[_spanState] operator[SEP] identifier[style] operator[=] identifier[_trs] operator[SEP] identifier[disabledStyle] operator[SEP] identifier[renderSelectionLinkPrefix] operator[SEP] identifier[writer] , identifier[node] operator[SEP] operator[SEP] identifier[_spanRenderer] operator[SEP] identifier[doStartTag] operator[SEP] identifier[writer] , identifier[_spanState] operator[SEP] operator[SEP] identifier[endRender] operator[=] identifier[_spanRenderer] operator[SEP] } Keyword[return] identifier[endRender] operator[SEP] }
public CloudPlatform start(String... args) { LOG.debug("About to start CloudPlatform with arguments: {}", asList(args)); System.setProperty(CAMEL_SPRINGBOOT_TYPE_CONVERSION, false + ""); System.setProperty(BANNER_LOCATION, META_INF_RHIOT_BANNER_TXT); applicationContext = new SpringApplicationBuilder(CloudPlatform.class).web(false).build().run(args); return this; }
class class_name[name] begin[{] method[start, return_type[type[CloudPlatform]], modifier[public], parameter[args]] begin[{] call[LOG.debug, parameter[literal["About to start CloudPlatform with arguments: {}"], call[.asList, parameter[member[.args]]]]] call[System.setProperty, parameter[member[.CAMEL_SPRINGBOOT_TYPE_CONVERSION], binary_operation[literal[false], +, literal[""]]]] call[System.setProperty, parameter[member[.BANNER_LOCATION], member[.META_INF_RHIOT_BANNER_TXT]]] assign[member[.applicationContext], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudPlatform, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=web, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=run, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SpringApplicationBuilder, sub_type=None))] return[THIS[]] end[}] END[}]
Keyword[public] identifier[CloudPlatform] identifier[start] operator[SEP] identifier[String] operator[...] identifier[args] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[asList] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] identifier[CAMEL_SPRINGBOOT_TYPE_CONVERSION] , literal[boolean] operator[+] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] identifier[BANNER_LOCATION] , identifier[META_INF_RHIOT_BANNER_TXT] operator[SEP] operator[SEP] identifier[applicationContext] operator[=] Keyword[new] identifier[SpringApplicationBuilder] operator[SEP] identifier[CloudPlatform] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[web] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[run] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static Is24CsvRecord createRecord(CSVRecord record) { Immobilienart art = Is24CsvRecord.getImmobilienart(record); if (Immobilienart.ANLAGE.equals(art)) return Anlageobjekt.newRecord(record); else if (Immobilienart.GEWERBE_BUERO_PRAXEN.equals(art)) return GewerbeBueroPraxis.newRecord(record); else if (Immobilienart.GEWERBE_EINZELHANDEL.equals(art)) return GewerbeEinzelhandel.newRecord(record); else if (Immobilienart.GEWERBE_GASTRONOMIE_HOTEL.equals(art)) return GewerbeGastronomieHotel.newRecord(record); else if (Immobilienart.GEWERBE_HALLE_PRODUKTION.equals(art)) return GewerbeHalleProduktion.newRecord(record); else if (Immobilienart.GEWERBE_SONSTIGES.equals(art)) return GewerbeSonstiges.newRecord(record); else if (Immobilienart.HAUS_KAUF.equals(art)) return HausKauf.newRecord(record); else if (Immobilienart.HAUS_MIETE.equals(art)) return HausMiete.newRecord(record); else if (Immobilienart.STELLPLATZ_KAUF.equals(art)) return StellplatzKauf.newRecord(record); else if (Immobilienart.STELLPLATZ_MIETE.equals(art)) return StellplatzMiete.newRecord(record); else if (Immobilienart.WOHNEN_AUF_ZEIT.equals(art)) return WohnenAufZeit.newRecord(record); else if (Immobilienart.WOHNUNG_KAUF.equals(art)) return WohnungKauf.newRecord(record); else if (Immobilienart.WOHNUNG_MIETE.equals(art)) return WohnungMiete.newRecord(record); // Immobilienart für Grundstücke wird abhängig zur Objektkategorie erzeugt else if (Immobilienart.GRUNDSTUECKE.equals(art)) { ObjektkategorieGrundstueck cat = Grundstueck.getObjektkategorie(record); if (ObjektkategorieGrundstueck.WOHNEN.equals(cat)) return GrundstueckWohnen.newRecord(record); else return GrundstueckGewerbe.newRecord(record); } LOGGER.warn("Unsupported 'Immobilienart' value: " + record.get(Is24CsvRecord.FIELD_IMMOBILIENART)); return null; }
class class_name[name] begin[{] method[createRecord, return_type[type[Is24CsvRecord]], modifier[public static], parameter[record]] begin[{] local_variable[type[Immobilienart], art] if[call[Immobilienart.ANLAGE.equals, parameter[member[.art]]]] begin[{] return[call[Anlageobjekt.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.GEWERBE_BUERO_PRAXEN.equals, parameter[member[.art]]]] begin[{] return[call[GewerbeBueroPraxis.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.GEWERBE_EINZELHANDEL.equals, parameter[member[.art]]]] begin[{] return[call[GewerbeEinzelhandel.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.GEWERBE_GASTRONOMIE_HOTEL.equals, parameter[member[.art]]]] begin[{] return[call[GewerbeGastronomieHotel.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.GEWERBE_HALLE_PRODUKTION.equals, parameter[member[.art]]]] begin[{] return[call[GewerbeHalleProduktion.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.GEWERBE_SONSTIGES.equals, parameter[member[.art]]]] begin[{] return[call[GewerbeSonstiges.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.HAUS_KAUF.equals, parameter[member[.art]]]] begin[{] return[call[HausKauf.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.HAUS_MIETE.equals, parameter[member[.art]]]] begin[{] return[call[HausMiete.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.STELLPLATZ_KAUF.equals, parameter[member[.art]]]] begin[{] return[call[StellplatzKauf.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.STELLPLATZ_MIETE.equals, parameter[member[.art]]]] begin[{] return[call[StellplatzMiete.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.WOHNEN_AUF_ZEIT.equals, parameter[member[.art]]]] begin[{] return[call[WohnenAufZeit.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.WOHNUNG_KAUF.equals, parameter[member[.art]]]] begin[{] return[call[WohnungKauf.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.WOHNUNG_MIETE.equals, parameter[member[.art]]]] begin[{] return[call[WohnungMiete.newRecord, parameter[member[.record]]]] else begin[{] if[call[Immobilienart.GRUNDSTUECKE.equals, parameter[member[.art]]]] begin[{] local_variable[type[ObjektkategorieGrundstueck], cat] if[call[ObjektkategorieGrundstueck.WOHNEN.equals, parameter[member[.cat]]]] begin[{] return[call[GrundstueckWohnen.newRecord, parameter[member[.record]]]] else begin[{] return[call[GrundstueckGewerbe.newRecord, parameter[member[.record]]]] end[}] else begin[{] None end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] call[LOGGER.warn, parameter[binary_operation[literal["Unsupported 'Immobilienart' value: "], +, call[record.get, parameter[member[Is24CsvRecord.FIELD_IMMOBILIENART]]]]]] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Is24CsvRecord] identifier[createRecord] operator[SEP] identifier[CSVRecord] identifier[record] operator[SEP] { identifier[Immobilienart] identifier[art] operator[=] identifier[Is24CsvRecord] operator[SEP] identifier[getImmobilienart] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[ANLAGE] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[Anlageobjekt] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[GEWERBE_BUERO_PRAXEN] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[GewerbeBueroPraxis] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[GEWERBE_EINZELHANDEL] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[GewerbeEinzelhandel] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[GEWERBE_GASTRONOMIE_HOTEL] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[GewerbeGastronomieHotel] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[GEWERBE_HALLE_PRODUKTION] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[GewerbeHalleProduktion] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[GEWERBE_SONSTIGES] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[GewerbeSonstiges] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[HAUS_KAUF] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[HausKauf] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[HAUS_MIETE] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[HausMiete] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[STELLPLATZ_KAUF] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[StellplatzKauf] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[STELLPLATZ_MIETE] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[StellplatzMiete] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[WOHNEN_AUF_ZEIT] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[WohnenAufZeit] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[WOHNUNG_KAUF] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[WohnungKauf] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[WOHNUNG_MIETE] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] Keyword[return] identifier[WohnungMiete] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[Immobilienart] operator[SEP] identifier[GRUNDSTUECKE] operator[SEP] identifier[equals] operator[SEP] identifier[art] operator[SEP] operator[SEP] { identifier[ObjektkategorieGrundstueck] identifier[cat] operator[=] identifier[Grundstueck] operator[SEP] identifier[getObjektkategorie] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ObjektkategorieGrundstueck] operator[SEP] identifier[WOHNEN] operator[SEP] identifier[equals] operator[SEP] identifier[cat] operator[SEP] operator[SEP] Keyword[return] identifier[GrundstueckWohnen] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[GrundstueckGewerbe] operator[SEP] identifier[newRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[record] operator[SEP] identifier[get] operator[SEP] identifier[Is24CsvRecord] operator[SEP] identifier[FIELD_IMMOBILIENART] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public String deduceLanguageFromUri(String uri) throws LanguagesNotSetException, NotSupportedLanguageException { if ( ! areLanguagesSet()) throw new LanguagesNotSetException(); int start = uri.charAt(0) == '/' ? 1 : 0, end = uri.indexOf('/', 1); if (end < 1) end = uri.length(); String lang = uri.substring(start, end); if(isLanguageSupported(lang)) return lang; throw new NotSupportedLanguageException(); }
class class_name[name] begin[{] method[deduceLanguageFromUri, return_type[type[String]], modifier[public], parameter[uri]] begin[{] if[call[.areLanguagesSet, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LanguagesNotSetException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], start] if[binary_operation[member[.end], <, literal[1]]] begin[{] assign[member[.end], call[uri.length, parameter[]]] else begin[{] None end[}] local_variable[type[String], lang] if[call[.isLanguageSupported, parameter[member[.lang]]]] begin[{] return[member[.lang]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotSupportedLanguageException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] identifier[String] identifier[deduceLanguageFromUri] operator[SEP] identifier[String] identifier[uri] operator[SEP] Keyword[throws] identifier[LanguagesNotSetException] , identifier[NotSupportedLanguageException] { Keyword[if] operator[SEP] operator[!] identifier[areLanguagesSet] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[LanguagesNotSetException] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[start] operator[=] identifier[uri] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[?] Other[1] operator[:] Other[0] , identifier[end] operator[=] identifier[uri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[<] Other[1] operator[SEP] identifier[end] operator[=] identifier[uri] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[lang] operator[=] identifier[uri] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isLanguageSupported] operator[SEP] identifier[lang] operator[SEP] operator[SEP] Keyword[return] identifier[lang] operator[SEP] Keyword[throw] Keyword[new] identifier[NotSupportedLanguageException] operator[SEP] operator[SEP] operator[SEP] }
@Command(name = "SetLoggingLevel", inTypeDesc = "Lg[i]=Logging Level. Str[i]=Device name.") public void setLoggingLevel(final DevVarLongStringArray dvlsa) throws DevFailed { final int[] levels = dvlsa.lvalue; final String[] deviceNames = dvlsa.svalue; if (deviceNames.length != levels.length) { throw DevFailedUtils.newDevFailed(INPUT_ERROR, "argin must be of same size for string and long "); } for (int i = 0; i < levels.length; i++) { LoggingManager.getInstance().setLoggingLevel(deviceNames[i], levels[i]); } }
class class_name[name] begin[{] method[setLoggingLevel, return_type[void], modifier[public], parameter[dvlsa]] begin[{] local_variable[type[int], levels] local_variable[type[String], deviceNames] if[binary_operation[member[deviceNames.length], !=, member[levels.length]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=INPUT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="argin must be of same size for string and long ")], member=newDevFailed, postfix_operators=[], prefix_operators=[], qualifier=DevFailedUtils, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=LoggingManager, selectors=[MethodInvocation(arguments=[MemberReference(member=deviceNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=levels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=setLoggingLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=levels, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
annotation[@] identifier[Command] operator[SEP] identifier[name] operator[=] literal[String] , identifier[inTypeDesc] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[setLoggingLevel] operator[SEP] Keyword[final] identifier[DevVarLongStringArray] identifier[dvlsa] operator[SEP] Keyword[throws] identifier[DevFailed] { Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[levels] operator[=] identifier[dvlsa] operator[SEP] identifier[lvalue] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[deviceNames] operator[=] identifier[dvlsa] operator[SEP] identifier[svalue] operator[SEP] Keyword[if] operator[SEP] identifier[deviceNames] operator[SEP] identifier[length] operator[!=] identifier[levels] operator[SEP] identifier[length] operator[SEP] { Keyword[throw] identifier[DevFailedUtils] operator[SEP] identifier[newDevFailed] operator[SEP] identifier[INPUT_ERROR] , literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[levels] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[LoggingManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[setLoggingLevel] operator[SEP] identifier[deviceNames] operator[SEP] identifier[i] operator[SEP] , identifier[levels] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } }
public static Date getLastDayFromCurrentMonth(Date d) { Calendar cal = Calendar.getInstance(); cal.setTime(d); cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE)); cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.MINUTE, 59); cal.set(Calendar.SECOND, 59); cal.set(Calendar.MILLISECOND, 999); return cal.getTime(); }
class class_name[name] begin[{] method[getLastDayFromCurrentMonth, return_type[type[Date]], modifier[public static], parameter[d]] begin[{] local_variable[type[Calendar], cal] call[cal.setTime, parameter[member[.d]]] call[cal.set, parameter[member[Calendar.DAY_OF_MONTH], call[cal.getActualMaximum, parameter[member[Calendar.DATE]]]]] call[cal.set, parameter[member[Calendar.HOUR_OF_DAY], literal[23]]] call[cal.set, parameter[member[Calendar.MINUTE], literal[59]]] call[cal.set, parameter[member[Calendar.SECOND], literal[59]]] call[cal.set, parameter[member[Calendar.MILLISECOND], literal[999]]] return[call[cal.getTime, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[getLastDayFromCurrentMonth] operator[SEP] identifier[Date] identifier[d] operator[SEP] { identifier[Calendar] identifier[cal] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[setTime] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_MONTH] , identifier[cal] operator[SEP] identifier[getActualMaximum] operator[SEP] identifier[Calendar] operator[SEP] identifier[DATE] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] , Other[23] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] , Other[59] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] , Other[59] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] , Other[999] operator[SEP] operator[SEP] Keyword[return] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] }
@Override public RequestBody visitRequestBody(Context context, String key, RequestBody rb) { visitor.visitRequestBody(context, key, rb); return rb; }
class class_name[name] begin[{] method[visitRequestBody, return_type[type[RequestBody]], modifier[public], parameter[context, key, rb]] begin[{] call[visitor.visitRequestBody, parameter[member[.context], member[.key], member[.rb]]] return[member[.rb]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[RequestBody] identifier[visitRequestBody] operator[SEP] identifier[Context] identifier[context] , identifier[String] identifier[key] , identifier[RequestBody] identifier[rb] operator[SEP] { identifier[visitor] operator[SEP] identifier[visitRequestBody] operator[SEP] identifier[context] , identifier[key] , identifier[rb] operator[SEP] operator[SEP] Keyword[return] identifier[rb] operator[SEP] }
@Processor public Object logError( @Optional @FriendlyName("Log Message") String message, @Optional String integrationScenario, @Optional String messageType, @Optional String contractId, @Optional String correlationId, @Optional @FriendlyName("Extra Info") Map<String, String> extraInfo) { return doLog(LogLevelType.ERROR, message, integrationScenario, contractId, correlationId, extraInfo); }
class class_name[name] begin[{] method[logError, return_type[type[Object]], modifier[public], parameter[message, integrationScenario, messageType, contractId, correlationId, extraInfo]] begin[{] return[call[.doLog, parameter[member[LogLevelType.ERROR], member[.message], member[.integrationScenario], member[.contractId], member[.correlationId], member[.extraInfo]]]] end[}] END[}]
annotation[@] identifier[Processor] Keyword[public] identifier[Object] identifier[logError] operator[SEP] annotation[@] identifier[Optional] annotation[@] identifier[FriendlyName] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[message] , annotation[@] identifier[Optional] identifier[String] identifier[integrationScenario] , annotation[@] identifier[Optional] identifier[String] identifier[messageType] , annotation[@] identifier[Optional] identifier[String] identifier[contractId] , annotation[@] identifier[Optional] identifier[String] identifier[correlationId] , annotation[@] identifier[Optional] annotation[@] identifier[FriendlyName] operator[SEP] literal[String] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[extraInfo] operator[SEP] { Keyword[return] identifier[doLog] operator[SEP] identifier[LogLevelType] operator[SEP] identifier[ERROR] , identifier[message] , identifier[integrationScenario] , identifier[contractId] , identifier[correlationId] , identifier[extraInfo] operator[SEP] operator[SEP] }
public static String valueFromXPath(Document parsedXml, String path) { XPath xPath = XPathFactory.newInstance().newXPath(); try { return xPath.evaluate(path, parsedXml.getDocumentElement()); } catch (XPathExpressionException exception) { LOG.error("Incorrect xpath provided: " + path, exception); throw new IllegalArgumentException(); } }
class class_name[name] begin[{] method[valueFromXPath, return_type[type[String]], modifier[public static], parameter[parsedXml, path]] begin[{] local_variable[type[XPath], xPath] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDocumentElement, postfix_operators=[], prefix_operators=[], qualifier=parsedXml, selectors=[], type_arguments=None)], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=xPath, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Incorrect xpath provided: "), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['XPathExpressionException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[valueFromXPath] operator[SEP] identifier[Document] identifier[parsedXml] , identifier[String] identifier[path] operator[SEP] { identifier[XPath] identifier[xPath] operator[=] identifier[XPathFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[newXPath] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[xPath] operator[SEP] identifier[evaluate] operator[SEP] identifier[path] , identifier[parsedXml] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[XPathExpressionException] identifier[exception] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[path] , identifier[exception] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } }
@Override public UnitValue convert(UnitValue value) { Unit src = value.unit(); switch (src.category()) { case CONCENTR: case LIGHT: // Not available break; case ACCELERATION: return convert(value, Unit.METER_PER_SECOND_SQUARED, UnitFactors.ACCELERATION); case ANGLE: return convert(value, UnitFactorSets.ANGLE); case AREA: return convert(value, areaFactors()); case CONSUMPTION: return convert(value, consumptionUnit()); case DIGITAL: return convert(value, UnitFactorSets.DIGITAL_BYTES); case DURATION: return convert(value, UnitFactorSets.DURATION); case ELECTRIC: return convert(value, UnitFactorSets.ELECTRIC); case ENERGY: return convert(value, energyFactors()); case FREQUENCY: return convert(value, UnitFactorSets.FREQUENCY); case LENGTH: return convert(value, lengthFactors()); case MASS: return convert(value, massFactors()); case POWER: return convert(value, UnitFactorSets.POWER); case PRESSURE: return convert(value, Unit.MILLIBAR); case SPEED: return convert(value, speedUnit()); case TEMPERATURE: return convert(value, temperatureUnit()); case VOLUME: return convert(value, volumeFactors()); } return value; }
class class_name[name] begin[{] method[convert, return_type[type[UnitValue]], modifier[public], parameter[value]] begin[{] local_variable[type[Unit], src] SwitchStatement(cases=[SwitchStatementCase(case=['CONCENTR', 'LIGHT'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ACCELERATION'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=METER_PER_SECOND_SQUARED, postfix_operators=[], prefix_operators=[], qualifier=Unit, selectors=[]), MemberReference(member=ACCELERATION, postfix_operators=[], prefix_operators=[], qualifier=UnitFactors, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['ANGLE'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ANGLE, postfix_operators=[], prefix_operators=[], qualifier=UnitFactorSets, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['AREA'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=areaFactors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['CONSUMPTION'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=consumptionUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['DIGITAL'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DIGITAL_BYTES, postfix_operators=[], prefix_operators=[], qualifier=UnitFactorSets, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['DURATION'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DURATION, postfix_operators=[], prefix_operators=[], qualifier=UnitFactorSets, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['ELECTRIC'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ELECTRIC, postfix_operators=[], prefix_operators=[], qualifier=UnitFactorSets, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['ENERGY'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=energyFactors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['FREQUENCY'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FREQUENCY, postfix_operators=[], prefix_operators=[], qualifier=UnitFactorSets, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['LENGTH'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=lengthFactors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['MASS'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=massFactors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['POWER'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=POWER, postfix_operators=[], prefix_operators=[], qualifier=UnitFactorSets, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['PRESSURE'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MILLIBAR, postfix_operators=[], prefix_operators=[], qualifier=Unit, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['SPEED'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=speedUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['TEMPERATURE'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=temperatureUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['VOLUME'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=volumeFactors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MethodInvocation(arguments=[], member=category, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), label=None) return[member[.value]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[UnitValue] identifier[convert] operator[SEP] identifier[UnitValue] identifier[value] operator[SEP] { identifier[Unit] identifier[src] operator[=] identifier[value] operator[SEP] identifier[unit] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[src] operator[SEP] identifier[category] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[CONCENTR] operator[:] Keyword[case] identifier[LIGHT] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[ACCELERATION] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[Unit] operator[SEP] identifier[METER_PER_SECOND_SQUARED] , identifier[UnitFactors] operator[SEP] identifier[ACCELERATION] operator[SEP] operator[SEP] Keyword[case] identifier[ANGLE] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[UnitFactorSets] operator[SEP] identifier[ANGLE] operator[SEP] operator[SEP] Keyword[case] identifier[AREA] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[areaFactors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[CONSUMPTION] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[consumptionUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[DIGITAL] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[UnitFactorSets] operator[SEP] identifier[DIGITAL_BYTES] operator[SEP] operator[SEP] Keyword[case] identifier[DURATION] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[UnitFactorSets] operator[SEP] identifier[DURATION] operator[SEP] operator[SEP] Keyword[case] identifier[ELECTRIC] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[UnitFactorSets] operator[SEP] identifier[ELECTRIC] operator[SEP] operator[SEP] Keyword[case] identifier[ENERGY] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[energyFactors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[FREQUENCY] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[UnitFactorSets] operator[SEP] identifier[FREQUENCY] operator[SEP] operator[SEP] Keyword[case] identifier[LENGTH] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[lengthFactors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[MASS] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[massFactors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[POWER] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[UnitFactorSets] operator[SEP] identifier[POWER] operator[SEP] operator[SEP] Keyword[case] identifier[PRESSURE] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[Unit] operator[SEP] identifier[MILLIBAR] operator[SEP] operator[SEP] Keyword[case] identifier[SPEED] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[speedUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TEMPERATURE] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[temperatureUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[VOLUME] operator[:] Keyword[return] identifier[convert] operator[SEP] identifier[value] , identifier[volumeFactors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
public SwaptionDataLattice convertLattice(QuotingConvention targetConvention, double displacement, AnalyticModel model) { if(displacement != 0 && targetConvention != QuotingConvention.PAYERVOLATILITYLOGNORMAL) { throw new IllegalArgumentException("SwaptionDataLattice only supports displacement, when using QuotingCOnvention.PAYERVOLATILITYLOGNORMAL."); } //Reverse sign of moneyness, if switching between payer and receiver convention. int reverse = ((targetConvention == QuotingConvention.RECEIVERPRICE) ^ (quotingConvention == QuotingConvention.RECEIVERPRICE)) ? -1 : 1; List<Integer> maturities = new ArrayList<>(); List<Integer> tenors = new ArrayList<>(); List<Integer> moneynesss = new ArrayList<>(); List<Double> values = new ArrayList<>(); for(DataKey key : entryMap.keySet()) { maturities.add(key.maturity); tenors.add(key.tenor); moneynesss.add(key.moneyness * reverse); values.add(getValue(key.maturity, key.tenor, key.moneyness, targetConvention, displacement, model)); } return new SwaptionDataLattice(referenceDate, targetConvention, displacement, forwardCurveName, discountCurveName, floatMetaSchedule, fixMetaSchedule, maturities.stream().mapToInt(Integer::intValue).toArray(), tenors.stream().mapToInt(Integer::intValue).toArray(), moneynesss.stream().mapToInt(Integer::intValue).toArray(), values.stream().mapToDouble(Double::doubleValue).toArray()); }
class class_name[name] begin[{] method[convertLattice, return_type[type[SwaptionDataLattice]], modifier[public], parameter[targetConvention, displacement, model]] begin[{] if[binary_operation[binary_operation[member[.displacement], !=, literal[0]], &&, binary_operation[member[.targetConvention], !=, member[QuotingConvention.PAYERVOLATILITYLOGNORMAL]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SwaptionDataLattice only supports displacement, when using QuotingCOnvention.PAYERVOLATILITYLOGNORMAL.")], 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[int], reverse] local_variable[type[List], maturities] local_variable[type[List], tenors] local_variable[type[List], moneynesss] local_variable[type[List], values] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=maturity, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=maturities, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tenor, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=tenors, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=moneyness, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), operandr=MemberReference(member=reverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=add, postfix_operators=[], prefix_operators=[], qualifier=moneynesss, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=maturity, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), MemberReference(member=tenor, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), MemberReference(member=moneyness, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), MemberReference(member=targetConvention, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=displacement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=entryMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataKey, sub_type=None))), label=None) return[ClassCreator(arguments=[MemberReference(member=referenceDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetConvention, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=displacement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=forwardCurveName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=discountCurveName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=floatMetaSchedule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fixMetaSchedule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=maturities, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=Integer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=intValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=mapToInt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=tenors, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=Integer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=intValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=mapToInt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=moneynesss, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=Integer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=intValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=mapToInt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=Double, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=mapToDouble, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SwaptionDataLattice, sub_type=None))] end[}] END[}]
Keyword[public] identifier[SwaptionDataLattice] identifier[convertLattice] operator[SEP] identifier[QuotingConvention] identifier[targetConvention] , Keyword[double] identifier[displacement] , identifier[AnalyticModel] identifier[model] operator[SEP] { Keyword[if] operator[SEP] identifier[displacement] operator[!=] Other[0] operator[&&] identifier[targetConvention] operator[!=] identifier[QuotingConvention] operator[SEP] identifier[PAYERVOLATILITYLOGNORMAL] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[reverse] operator[=] operator[SEP] operator[SEP] identifier[targetConvention] operator[==] identifier[QuotingConvention] operator[SEP] identifier[RECEIVERPRICE] operator[SEP] operator[^] operator[SEP] identifier[quotingConvention] operator[==] identifier[QuotingConvention] operator[SEP] identifier[RECEIVERPRICE] operator[SEP] operator[SEP] operator[?] operator[-] Other[1] operator[:] Other[1] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[maturities] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[tenors] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[moneynesss] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Double] operator[>] identifier[values] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DataKey] identifier[key] operator[:] identifier[entryMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[maturities] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] identifier[maturity] operator[SEP] operator[SEP] identifier[tenors] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] identifier[tenor] operator[SEP] operator[SEP] identifier[moneynesss] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] identifier[moneyness] operator[*] identifier[reverse] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[getValue] operator[SEP] identifier[key] operator[SEP] identifier[maturity] , identifier[key] operator[SEP] identifier[tenor] , identifier[key] operator[SEP] identifier[moneyness] , identifier[targetConvention] , identifier[displacement] , identifier[model] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[SwaptionDataLattice] operator[SEP] identifier[referenceDate] , identifier[targetConvention] , identifier[displacement] , identifier[forwardCurveName] , identifier[discountCurveName] , identifier[floatMetaSchedule] , identifier[fixMetaSchedule] , identifier[maturities] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[mapToInt] operator[SEP] identifier[Integer] operator[::] identifier[intValue] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] , identifier[tenors] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[mapToInt] operator[SEP] identifier[Integer] operator[::] identifier[intValue] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] , identifier[moneynesss] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[mapToInt] operator[SEP] identifier[Integer] operator[::] identifier[intValue] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] , identifier[values] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[mapToDouble] operator[SEP] identifier[Double] operator[::] identifier[doubleValue] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public BaseField setupField(int iFieldSeq) { BaseField field = null; //if (iFieldSeq == 0) //{ // field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null); // field.setHidden(true); //} //if (iFieldSeq == 1) //{ // field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null); // field.setHidden(true); //} //if (iFieldSeq == 2) //{ // field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false)); // field.setHidden(true); //} if (iFieldSeq == 3) field = new ReferenceField(this, CLASS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 4) field = new StringField(this, CLASS_INCLUDES_CLASS, 128, null, null); if (field == null) field = super.setupField(iFieldSeq); return field; }
class class_name[name] begin[{] method[setupField, return_type[type[BaseField]], modifier[public], parameter[iFieldSeq]] begin[{] local_variable[type[BaseField], field] if[binary_operation[member[.iFieldSeq], ==, literal[3]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=CLASS_INFO_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReferenceField, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.iFieldSeq], ==, literal[4]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=CLASS_INCLUDES_CLASS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=128), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringField, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.field], ==, literal[null]]] begin[{] assign[member[.field], SuperMethodInvocation(arguments=[MemberReference(member=iFieldSeq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setupField, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] else begin[{] None end[}] return[member[.field]] end[}] END[}]
Keyword[public] identifier[BaseField] identifier[setupField] operator[SEP] Keyword[int] identifier[iFieldSeq] operator[SEP] { identifier[BaseField] identifier[field] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[3] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ReferenceField] operator[SEP] Keyword[this] , identifier[CLASS_INFO_ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[4] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[StringField] operator[SEP] Keyword[this] , identifier[CLASS_INCLUDES_CLASS] , Other[128] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] identifier[field] operator[=] Keyword[super] operator[SEP] identifier[setupField] operator[SEP] identifier[iFieldSeq] operator[SEP] operator[SEP] Keyword[return] identifier[field] operator[SEP] }
private void addCommaSeparatedChildren(Template template){ LazyNode next=child; boolean first=true; while(next!=null){ if(first){ first=false; }else{ template.addConstant(","); } next.addSegments(template); next=next.next; } }
class class_name[name] begin[{] method[addCommaSeparatedChildren, return_type[void], modifier[private], parameter[template]] begin[{] local_variable[type[LazyNode], next] local_variable[type[boolean], first] while[binary_operation[member[.next], !=, literal[null]]] begin[{] if[member[.first]] begin[{] assign[member[.first], literal[false]] else begin[{] call[template.addConstant, parameter[literal[","]]] end[}] call[next.addSegments, parameter[member[.template]]] assign[member[.next], member[next.next]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addCommaSeparatedChildren] operator[SEP] identifier[Template] identifier[template] operator[SEP] { identifier[LazyNode] identifier[next] operator[=] identifier[child] operator[SEP] Keyword[boolean] identifier[first] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[first] operator[SEP] { identifier[first] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[template] operator[SEP] identifier[addConstant] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[next] operator[SEP] identifier[addSegments] operator[SEP] identifier[template] operator[SEP] operator[SEP] identifier[next] operator[=] identifier[next] operator[SEP] identifier[next] operator[SEP] } }
public long getPerInstanceUniqueValue() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getPerInstanceUniqueValue"); long retval; synchronized(_instanceUniqueLock) { retval = _instanceUnique--; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getPerInstanceUniqueValue", "return="+retval); return retval; }
class class_name[name] begin[{] method[getPerInstanceUniqueValue, return_type[type[long]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["getPerInstanceUniqueValue"]]] else begin[{] None end[}] local_variable[type[long], retval] SYNCHRONIZED[member[._instanceUniqueLock]] BEGIN[{] assign[member[.retval], member[._instanceUnique]] END[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["getPerInstanceUniqueValue"], binary_operation[literal["return="], +, member[.retval]]]] else begin[{] None end[}] return[member[.retval]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getPerInstanceUniqueValue] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[long] identifier[retval] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_instanceUniqueLock] operator[SEP] { identifier[retval] operator[=] identifier[_instanceUnique] operator[--] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[retval] operator[SEP] operator[SEP] Keyword[return] identifier[retval] operator[SEP] }
@RequirePOST public HttpResponse doForward(@QueryParameter String fix, @QueryParameter String configure) { if (fix != null) { return HttpResponses.redirectViaContextPath("pluginManager"); } if (configure != null) { return HttpResponses.redirectViaContextPath("configureSecurity"); } // shouldn't happen return HttpResponses.redirectViaContextPath("/"); }
class class_name[name] begin[{] method[doForward, return_type[type[HttpResponse]], modifier[public], parameter[fix, configure]] begin[{] if[binary_operation[member[.fix], !=, literal[null]]] begin[{] return[call[HttpResponses.redirectViaContextPath, parameter[literal["pluginManager"]]]] else begin[{] None end[}] if[binary_operation[member[.configure], !=, literal[null]]] begin[{] return[call[HttpResponses.redirectViaContextPath, parameter[literal["configureSecurity"]]]] else begin[{] None end[}] return[call[HttpResponses.redirectViaContextPath, parameter[literal["/"]]]] end[}] END[}]
annotation[@] identifier[RequirePOST] Keyword[public] identifier[HttpResponse] identifier[doForward] operator[SEP] annotation[@] identifier[QueryParameter] identifier[String] identifier[fix] , annotation[@] identifier[QueryParameter] identifier[String] identifier[configure] operator[SEP] { Keyword[if] operator[SEP] identifier[fix] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[HttpResponses] operator[SEP] identifier[redirectViaContextPath] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[configure] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[HttpResponses] operator[SEP] identifier[redirectViaContextPath] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[HttpResponses] operator[SEP] identifier[redirectViaContextPath] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public static void flattenCookies(final HttpServerExchange exchange) { Map<String, Cookie> cookies = exchange.getResponseCookiesInternal(); boolean enableRfc6265Validation = exchange.getConnection().getUndertowOptions().get(UndertowOptions.ENABLE_RFC6265_COOKIE_VALIDATION, UndertowOptions.DEFAULT_ENABLE_RFC6265_COOKIE_VALIDATION); if (cookies != null) { for (Map.Entry<String, Cookie> entry : cookies.entrySet()) { exchange.getResponseHeaders().add(Headers.SET_COOKIE, getCookieString(entry.getValue(), enableRfc6265Validation)); } } }
class class_name[name] begin[{] method[flattenCookies, return_type[void], modifier[public static], parameter[exchange]] begin[{] local_variable[type[Map], cookies] local_variable[type[boolean], enableRfc6265Validation] if[binary_operation[member[.cookies], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getResponseHeaders, postfix_operators=[], prefix_operators=[], qualifier=exchange, selectors=[MethodInvocation(arguments=[MemberReference(member=SET_COOKIE, postfix_operators=[], prefix_operators=[], qualifier=Headers, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=enableRfc6265Validation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCookieString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=cookies, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cookie, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[flattenCookies] operator[SEP] Keyword[final] identifier[HttpServerExchange] identifier[exchange] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Cookie] operator[>] identifier[cookies] operator[=] identifier[exchange] operator[SEP] identifier[getResponseCookiesInternal] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[enableRfc6265Validation] operator[=] identifier[exchange] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[getUndertowOptions] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[UndertowOptions] operator[SEP] identifier[ENABLE_RFC6265_COOKIE_VALIDATION] , identifier[UndertowOptions] operator[SEP] identifier[DEFAULT_ENABLE_RFC6265_COOKIE_VALIDATION] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cookies] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Cookie] operator[>] identifier[entry] operator[:] identifier[cookies] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[exchange] operator[SEP] identifier[getResponseHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[Headers] operator[SEP] identifier[SET_COOKIE] , identifier[getCookieString] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[enableRfc6265Validation] operator[SEP] operator[SEP] operator[SEP] } } }
public <T, S> Future<CallResults<T, S>> call(final InputHandler<T> inputHandler, final OutputHandler<S> outputHandler, final String catalog, final String schema, final boolean useCache) throws SQLException { return executorService.submit(new Callable<CallResults<T, S>>() { /** * {@inheritDoc} */ public CallResults<T, S> call() throws Exception { return queryRunner.call(inputHandler, outputHandler, catalog, schema, useCache); } }); }
class class_name[name] begin[{] method[call, return_type[type[Future]], modifier[public], parameter[inputHandler, outputHandler, catalog, schema, useCache]] begin[{] return[call[executorService.submit, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=inputHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outputHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=catalog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=useCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=call, postfix_operators=[], prefix_operators=[], qualifier=queryRunner, selectors=[], type_arguments=None), label=None)], documentation=/** * {@inheritDoc} */, modifiers={'public'}, name=call, parameters=[], return_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=S, sub_type=None))], dimensions=[], name=CallResults, sub_type=None), throws=['Exception'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None))], dimensions=[], name=CallResults, sub_type=None))], dimensions=None, name=Callable, sub_type=None))]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] , identifier[S] operator[>] identifier[Future] operator[<] identifier[CallResults] operator[<] identifier[T] , identifier[S] operator[>] operator[>] identifier[call] operator[SEP] Keyword[final] identifier[InputHandler] operator[<] identifier[T] operator[>] identifier[inputHandler] , Keyword[final] identifier[OutputHandler] operator[<] identifier[S] operator[>] identifier[outputHandler] , Keyword[final] identifier[String] identifier[catalog] , Keyword[final] identifier[String] identifier[schema] , Keyword[final] Keyword[boolean] identifier[useCache] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[return] identifier[executorService] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Callable] operator[<] identifier[CallResults] operator[<] identifier[T] , identifier[S] operator[>] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[CallResults] operator[<] identifier[T] , identifier[S] operator[>] identifier[call] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[return] identifier[queryRunner] operator[SEP] identifier[call] operator[SEP] identifier[inputHandler] , identifier[outputHandler] , identifier[catalog] , identifier[schema] , identifier[useCache] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void marshall(TableDescription tableDescription, ProtocolMarshaller protocolMarshaller) { if (tableDescription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(tableDescription.getAttributeDefinitions(), ATTRIBUTEDEFINITIONS_BINDING); protocolMarshaller.marshall(tableDescription.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(tableDescription.getKeySchema(), KEYSCHEMA_BINDING); protocolMarshaller.marshall(tableDescription.getTableStatus(), TABLESTATUS_BINDING); protocolMarshaller.marshall(tableDescription.getCreationDateTime(), CREATIONDATETIME_BINDING); protocolMarshaller.marshall(tableDescription.getProvisionedThroughput(), PROVISIONEDTHROUGHPUT_BINDING); protocolMarshaller.marshall(tableDescription.getTableSizeBytes(), TABLESIZEBYTES_BINDING); protocolMarshaller.marshall(tableDescription.getItemCount(), ITEMCOUNT_BINDING); protocolMarshaller.marshall(tableDescription.getTableArn(), TABLEARN_BINDING); protocolMarshaller.marshall(tableDescription.getTableId(), TABLEID_BINDING); protocolMarshaller.marshall(tableDescription.getBillingModeSummary(), BILLINGMODESUMMARY_BINDING); protocolMarshaller.marshall(tableDescription.getLocalSecondaryIndexes(), LOCALSECONDARYINDEXES_BINDING); protocolMarshaller.marshall(tableDescription.getGlobalSecondaryIndexes(), GLOBALSECONDARYINDEXES_BINDING); protocolMarshaller.marshall(tableDescription.getStreamSpecification(), STREAMSPECIFICATION_BINDING); protocolMarshaller.marshall(tableDescription.getLatestStreamLabel(), LATESTSTREAMLABEL_BINDING); protocolMarshaller.marshall(tableDescription.getLatestStreamArn(), LATESTSTREAMARN_BINDING); protocolMarshaller.marshall(tableDescription.getRestoreSummary(), RESTORESUMMARY_BINDING); protocolMarshaller.marshall(tableDescription.getSSEDescription(), SSEDESCRIPTION_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[tableDescription, protocolMarshaller]] begin[{] if[binary_operation[member[.tableDescription], ==, 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=getAttributeDefinitions, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=ATTRIBUTEDEFINITIONS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTableName, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=TABLENAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeySchema, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=KEYSCHEMA_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTableStatus, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=TABLESTATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCreationDateTime, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=CREATIONDATETIME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProvisionedThroughput, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=PROVISIONEDTHROUGHPUT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTableSizeBytes, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=TABLESIZEBYTES_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getItemCount, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=ITEMCOUNT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTableArn, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=TABLEARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTableId, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=TABLEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBillingModeSummary, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=BILLINGMODESUMMARY_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalSecondaryIndexes, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=LOCALSECONDARYINDEXES_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGlobalSecondaryIndexes, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=GLOBALSECONDARYINDEXES_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStreamSpecification, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=STREAMSPECIFICATION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLatestStreamLabel, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=LATESTSTREAMLABEL_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLatestStreamArn, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=LATESTSTREAMARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRestoreSummary, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=RESTORESUMMARY_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSSEDescription, postfix_operators=[], prefix_operators=[], qualifier=tableDescription, selectors=[], type_arguments=None), MemberReference(member=SSEDESCRIPTION_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[TableDescription] identifier[tableDescription] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[tableDescription] 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[tableDescription] operator[SEP] identifier[getAttributeDefinitions] operator[SEP] operator[SEP] , identifier[ATTRIBUTEDEFINITIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[TABLENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getKeySchema] operator[SEP] operator[SEP] , identifier[KEYSCHEMA_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getTableStatus] operator[SEP] operator[SEP] , identifier[TABLESTATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getCreationDateTime] operator[SEP] operator[SEP] , identifier[CREATIONDATETIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getProvisionedThroughput] operator[SEP] operator[SEP] , identifier[PROVISIONEDTHROUGHPUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getTableSizeBytes] operator[SEP] operator[SEP] , identifier[TABLESIZEBYTES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getItemCount] operator[SEP] operator[SEP] , identifier[ITEMCOUNT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getTableArn] operator[SEP] operator[SEP] , identifier[TABLEARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getTableId] operator[SEP] operator[SEP] , identifier[TABLEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getBillingModeSummary] operator[SEP] operator[SEP] , identifier[BILLINGMODESUMMARY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getLocalSecondaryIndexes] operator[SEP] operator[SEP] , identifier[LOCALSECONDARYINDEXES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getGlobalSecondaryIndexes] operator[SEP] operator[SEP] , identifier[GLOBALSECONDARYINDEXES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getStreamSpecification] operator[SEP] operator[SEP] , identifier[STREAMSPECIFICATION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getLatestStreamLabel] operator[SEP] operator[SEP] , identifier[LATESTSTREAMLABEL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getLatestStreamArn] operator[SEP] operator[SEP] , identifier[LATESTSTREAMARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getRestoreSummary] operator[SEP] operator[SEP] , identifier[RESTORESUMMARY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tableDescription] operator[SEP] identifier[getSSEDescription] operator[SEP] operator[SEP] , identifier[SSEDESCRIPTION_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] } }
private void _addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__addActionPerformed JFileChooser fc = new JFileChooser(); fc.setMultiSelectionEnabled(true); fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setFileFilter(new FileFilter() { @Override public boolean accept(File f) { return f.isDirectory() || f.getName().endsWith(".R") || f.getName().endsWith(".Rdata"); } @Override public String getDescription() { return "R object file"; } }); if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION && fc.getSelectedFiles() != null) { File[] files = fc.getSelectedFiles(); for (File file : files) { if (file.getName().endsWith(".R")) { if (R != null) { R.source(file); } } else if (file.getName().endsWith(".Rdata")) { if (R != null) { R.load(file); } } else { Log.Out.println("Not loading/sourcing " + file.getName()); } } } update(); }
class class_name[name] begin[{] method[_addActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{] local_variable[type[JFileChooser], fc] call[fc.setMultiSelectionEnabled, parameter[literal[true]]] call[fc.setFileSelectionMode, parameter[member[JFileChooser.FILES_ONLY]]] call[fc.setFileFilter, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".R")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".Rdata")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), label=None)], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers=set(), name=f, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="R object file"), label=None)], documentation=None, modifiers={'public'}, name=getDescription, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileFilter, sub_type=None))]] if[binary_operation[binary_operation[call[fc.showOpenDialog, parameter[THIS[]]], ==, member[JFileChooser.APPROVE_OPTION]], &&, binary_operation[call[fc.getSelectedFiles, parameter[]], !=, literal[null]]]] begin[{] local_variable[type[File], files] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".R")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".Rdata")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not loading/sourcing "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=Log.Out, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=R, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=R, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=R, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=source, postfix_operators=[], prefix_operators=[], qualifier=R, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) else begin[{] None end[}] call[.update, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[_addActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { identifier[JFileChooser] identifier[fc] operator[=] Keyword[new] identifier[JFileChooser] operator[SEP] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setMultiSelectionEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setFileSelectionMode] operator[SEP] identifier[JFileChooser] operator[SEP] identifier[FILES_ONLY] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setFileFilter] operator[SEP] Keyword[new] identifier[FileFilter] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[File] identifier[f] operator[SEP] { Keyword[return] identifier[f] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[||] identifier[f] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[f] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getDescription] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fc] operator[SEP] identifier[showOpenDialog] operator[SEP] Keyword[this] operator[SEP] operator[==] identifier[JFileChooser] operator[SEP] identifier[APPROVE_OPTION] operator[&&] identifier[fc] operator[SEP] identifier[getSelectedFiles] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[File] operator[SEP] operator[SEP] identifier[files] operator[=] identifier[fc] operator[SEP] identifier[getSelectedFiles] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[file] operator[:] identifier[files] operator[SEP] { Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[R] operator[!=] Other[null] operator[SEP] { identifier[R] operator[SEP] identifier[source] operator[SEP] identifier[file] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[R] operator[!=] Other[null] operator[SEP] { identifier[R] operator[SEP] identifier[load] operator[SEP] identifier[file] operator[SEP] operator[SEP] } } Keyword[else] { identifier[Log] operator[SEP] identifier[Out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } identifier[update] operator[SEP] operator[SEP] operator[SEP] }
public Request<List<Factor>> listFactors() { String url = baseUrl .newBuilder() .addPathSegments("api/v2/guardian/factors") .build() .toString(); CustomRequest<List<Factor>> request = new CustomRequest<>(client, url, "GET", new TypeReference<List<Factor>>() { }); request.addHeader("Authorization", "Bearer " + apiToken); return request; }
class class_name[name] begin[{] method[listFactors, return_type[type[Request]], modifier[public], parameter[]] begin[{] local_variable[type[String], url] local_variable[type[CustomRequest], request] call[request.addHeader, parameter[literal["Authorization"], binary_operation[literal["Bearer "], +, member[.apiToken]]]] return[member[.request]] end[}] END[}]
Keyword[public] identifier[Request] operator[<] identifier[List] operator[<] identifier[Factor] operator[>] operator[>] identifier[listFactors] operator[SEP] operator[SEP] { identifier[String] identifier[url] operator[=] identifier[baseUrl] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addPathSegments] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[CustomRequest] operator[<] identifier[List] operator[<] identifier[Factor] operator[>] operator[>] identifier[request] operator[=] Keyword[new] identifier[CustomRequest] operator[<] operator[>] operator[SEP] identifier[client] , identifier[url] , literal[String] , Keyword[new] identifier[TypeReference] operator[<] identifier[List] operator[<] identifier[Factor] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[apiToken] operator[SEP] operator[SEP] Keyword[return] identifier[request] operator[SEP] }
public PCA setProjection(int p) { if (p < 1 || p > n) { throw new IllegalArgumentException("Invalid dimension of feature space: " + p); } this.p = p; projection = Matrix.zeros(p, n); for (int i = 0; i < n; i++) { for (int j = 0; j < p; j++) { projection.set(j, i, eigvectors.get(i, j)); } } pmu = new double[p]; projection.ax(mu, pmu); return this; }
class class_name[name] begin[{] method[setProjection, return_type[type[PCA]], modifier[public], parameter[p]] begin[{] if[binary_operation[binary_operation[member[.p], <, literal[1]], ||, binary_operation[member[.p], >, member[.n]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid dimension of feature space: "), operandr=MemberReference(member=p, 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[}] assign[THIS[member[None.p]], member[.p]] assign[member[.projection], call[Matrix.zeros, parameter[member[.p], member[.n]]]] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=eigvectors, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=projection, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=p, 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)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.pmu], ArrayCreator(dimensions=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] call[projection.ax, parameter[member[.mu], member[.pmu]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[PCA] identifier[setProjection] operator[SEP] Keyword[int] identifier[p] operator[SEP] { Keyword[if] operator[SEP] identifier[p] operator[<] Other[1] operator[||] identifier[p] operator[>] identifier[n] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[p] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[p] operator[=] identifier[p] operator[SEP] identifier[projection] operator[=] identifier[Matrix] operator[SEP] identifier[zeros] operator[SEP] identifier[p] , identifier[n] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[p] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[projection] operator[SEP] identifier[set] operator[SEP] identifier[j] , identifier[i] , identifier[eigvectors] operator[SEP] identifier[get] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] operator[SEP] } } identifier[pmu] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[p] operator[SEP] operator[SEP] identifier[projection] operator[SEP] identifier[ax] operator[SEP] identifier[mu] , identifier[pmu] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static JulianDay ofMeanSolarTime(Moment moment) { return new JulianDay(getValue(moment, TimeScale.UT), TimeScale.UT); }
class class_name[name] begin[{] method[ofMeanSolarTime, return_type[type[JulianDay]], modifier[public static], parameter[moment]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=moment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UT, postfix_operators=[], prefix_operators=[], qualifier=TimeScale, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=UT, postfix_operators=[], prefix_operators=[], qualifier=TimeScale, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JulianDay, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[JulianDay] identifier[ofMeanSolarTime] operator[SEP] identifier[Moment] identifier[moment] operator[SEP] { Keyword[return] Keyword[new] identifier[JulianDay] operator[SEP] identifier[getValue] operator[SEP] identifier[moment] , identifier[TimeScale] operator[SEP] identifier[UT] operator[SEP] , identifier[TimeScale] operator[SEP] identifier[UT] operator[SEP] operator[SEP] }
public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType) { Enum<?>[] universe = getUniverse(elementType); if (universe == null) throw new ClassCastException(elementType + " not an enum"); if (universe.length <= 64) return new RegularEnumSet<>(elementType, universe); else return new JumboEnumSet<>(elementType, universe); }
class class_name[name] begin[{] method[noneOf, return_type[type[EnumSet]], modifier[public static], parameter[elementType]] begin[{] local_variable[type[Enum], universe] if[binary_operation[member[.universe], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=elementType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not an enum"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassCastException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[universe.length], <=, literal[64]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=elementType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=universe, 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=RegularEnumSet, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=elementType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=universe, 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=JumboEnumSet, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[Enum] operator[<] identifier[E] operator[>] operator[>] identifier[EnumSet] operator[<] identifier[E] operator[>] identifier[noneOf] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[elementType] operator[SEP] { identifier[Enum] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[universe] operator[=] identifier[getUniverse] operator[SEP] identifier[elementType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[universe] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[ClassCastException] operator[SEP] identifier[elementType] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[universe] operator[SEP] identifier[length] operator[<=] Other[64] operator[SEP] Keyword[return] Keyword[new] identifier[RegularEnumSet] operator[<] operator[>] operator[SEP] identifier[elementType] , identifier[universe] operator[SEP] operator[SEP] Keyword[else] Keyword[return] Keyword[new] identifier[JumboEnumSet] operator[<] operator[>] operator[SEP] identifier[elementType] , identifier[universe] operator[SEP] operator[SEP] }
public static File createFileIfNoExists(String path) throws IOException { String thePath = Disks.absolute(path); if (null == thePath) thePath = Disks.normalize(path); File f = new File(thePath); if (!f.exists()) Files.createNewFile(f); if (!f.isFile()) throw Lang.makeThrow("'%s' should be a file!", path); return f; }
class class_name[name] begin[{] method[createFileIfNoExists, return_type[type[File]], modifier[public static], parameter[path]] begin[{] local_variable[type[String], thePath] if[binary_operation[literal[null], ==, member[.thePath]]] begin[{] assign[member[.thePath], call[Disks.normalize, parameter[member[.path]]]] else begin[{] None end[}] local_variable[type[File], f] if[call[f.exists, parameter[]]] begin[{] call[Files.createNewFile, parameter[member[.f]]] else begin[{] None end[}] if[call[f.isFile, parameter[]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'%s' should be a file!"), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeThrow, postfix_operators=[], prefix_operators=[], qualifier=Lang, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] return[member[.f]] end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[createFileIfNoExists] operator[SEP] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[thePath] operator[=] identifier[Disks] operator[SEP] identifier[absolute] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[thePath] operator[SEP] identifier[thePath] operator[=] identifier[Disks] operator[SEP] identifier[normalize] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[thePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[createNewFile] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[f] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[Lang] operator[SEP] identifier[makeThrow] operator[SEP] literal[String] , identifier[path] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP] }
void record_task_answer( RPC.RPCCall rpcall ) { assert rpcall._started == 0 || rpcall._dt.hasException(); rpcall._started = System.currentTimeMillis(); rpcall._retry = RPC.RETRY_MS; // Start the timer on when to resend AckAckTimeOutThread.PENDING.add(rpcall); }
class class_name[name] begin[{] method[record_task_answer, return_type[void], modifier[default], parameter[rpcall]] begin[{] AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=_started, postfix_operators=[], prefix_operators=[], qualifier=rpcall, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=MethodInvocation(arguments=[], member=hasException, postfix_operators=[], prefix_operators=[], qualifier=rpcall._dt, selectors=[], type_arguments=None), operator=||), label=None, value=None) assign[member[rpcall._started], call[System.currentTimeMillis, parameter[]]] assign[member[rpcall._retry], member[RPC.RETRY_MS]] call[AckAckTimeOutThread.PENDING.add, parameter[member[.rpcall]]] end[}] END[}]
Keyword[void] identifier[record_task_answer] operator[SEP] identifier[RPC] operator[SEP] identifier[RPCCall] identifier[rpcall] operator[SEP] { Keyword[assert] identifier[rpcall] operator[SEP] identifier[_started] operator[==] Other[0] operator[||] identifier[rpcall] operator[SEP] identifier[_dt] operator[SEP] identifier[hasException] operator[SEP] operator[SEP] operator[SEP] identifier[rpcall] operator[SEP] identifier[_started] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[rpcall] operator[SEP] identifier[_retry] operator[=] identifier[RPC] operator[SEP] identifier[RETRY_MS] operator[SEP] identifier[AckAckTimeOutThread] operator[SEP] identifier[PENDING] operator[SEP] identifier[add] operator[SEP] identifier[rpcall] operator[SEP] operator[SEP] }
public UpdateAppRequest withServerGroups(ServerGroup... serverGroups) { if (this.serverGroups == null) { setServerGroups(new java.util.ArrayList<ServerGroup>(serverGroups.length)); } for (ServerGroup ele : serverGroups) { this.serverGroups.add(ele); } return this; }
class class_name[name] begin[{] method[withServerGroups, return_type[type[UpdateAppRequest]], modifier[public], parameter[serverGroups]] begin[{] if[binary_operation[THIS[member[None.serverGroups]], ==, literal[null]]] begin[{] call[.setServerGroups, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=serverGroups, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServerGroup, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serverGroups, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=serverGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServerGroup, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[UpdateAppRequest] identifier[withServerGroups] operator[SEP] identifier[ServerGroup] operator[...] identifier[serverGroups] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[serverGroups] operator[==] Other[null] operator[SEP] { identifier[setServerGroups] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ServerGroup] operator[>] operator[SEP] identifier[serverGroups] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ServerGroup] identifier[ele] operator[:] identifier[serverGroups] operator[SEP] { Keyword[this] operator[SEP] identifier[serverGroups] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private void continueProcessing() { try { while (!Thread.currentThread().isInterrupted()) { HashMap<String, String> changes = new HashMap<>(); //load all changes already in the queue getAvailableChanges(changes); if (changes.isEmpty()) { if (inProcess.isEmpty()) { //no pending operations, signalling no new state changes will occur workflowEngine.event( WorkflowSystemEventType.EndOfChanges, "No more state changes expected, finishing workflow." ); return; } if (Thread.currentThread().isInterrupted()) { break; } waitForChanges(changes); } if (changes.isEmpty()) { //no changes within sleep time, try again continue; } getContextGlobalData(changes); //handle state changes processStateChanges(changes); if (workflowEngine.isWorkflowEndState(workflowEngine.getState())) { workflowEngine.event(WorkflowSystemEventType.WorkflowEndState, "Workflow end state reached."); return; } processOperations(results::add); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } if (Thread.currentThread().isInterrupted()) { workflowEngine.event(WorkflowSystemEventType.Interrupted, "Engine interrupted, stopping engine..."); cancelFutures(); interrupted = Thread.interrupted(); } awaitFutures(); }
class class_name[name] begin[{] method[continueProcessing, return_type[void], modifier[private], parameter[]] begin[{] TryStatement(block=[WhileStatement(body=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=[], dimensions=None, name=HashMap, sub_type=None)), name=changes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashMap, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=changes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAvailableChanges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=changes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=inProcess, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EndOfChanges, postfix_operators=[], prefix_operators=[], qualifier=WorkflowSystemEventType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No more state changes expected, finishing workflow.")], member=event, postfix_operators=[], prefix_operators=[], qualifier=workflowEngine, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=isInterrupted, 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=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=changes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=waitForChanges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=changes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=changes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getContextGlobalData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=changes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processStateChanges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=workflowEngine, selectors=[], type_arguments=None)], member=isWorkflowEndState, postfix_operators=[], prefix_operators=[], qualifier=workflowEngine, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WorkflowEndState, postfix_operators=[], prefix_operators=[], qualifier=WorkflowSystemEventType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Workflow end state reached.")], member=event, postfix_operators=[], prefix_operators=[], qualifier=workflowEngine, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=processOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=['!'], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=isInterrupted, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) if[call[Thread.currentThread, parameter[]]] begin[{] call[workflowEngine.event, parameter[member[WorkflowSystemEventType.Interrupted], literal["Engine interrupted, stopping engine..."]]] call[.cancelFutures, parameter[]] assign[member[.interrupted], call[Thread.interrupted, parameter[]]] else begin[{] None end[}] call[.awaitFutures, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[continueProcessing] operator[SEP] operator[SEP] { Keyword[try] { Keyword[while] operator[SEP] operator[!] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[isInterrupted] operator[SEP] operator[SEP] operator[SEP] { identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[changes] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[getAvailableChanges] operator[SEP] identifier[changes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[changes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[inProcess] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[workflowEngine] operator[SEP] identifier[event] operator[SEP] identifier[WorkflowSystemEventType] operator[SEP] identifier[EndOfChanges] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[isInterrupted] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } identifier[waitForChanges] operator[SEP] identifier[changes] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[changes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[getContextGlobalData] operator[SEP] identifier[changes] operator[SEP] operator[SEP] identifier[processStateChanges] operator[SEP] identifier[changes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[workflowEngine] operator[SEP] identifier[isWorkflowEndState] operator[SEP] identifier[workflowEngine] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[workflowEngine] operator[SEP] identifier[event] operator[SEP] identifier[WorkflowSystemEventType] operator[SEP] identifier[WorkflowEndState] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[processOperations] operator[SEP] identifier[results] operator[::] identifier[add] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[isInterrupted] operator[SEP] operator[SEP] operator[SEP] { identifier[workflowEngine] operator[SEP] identifier[event] operator[SEP] identifier[WorkflowSystemEventType] operator[SEP] identifier[Interrupted] , literal[String] operator[SEP] operator[SEP] identifier[cancelFutures] operator[SEP] operator[SEP] operator[SEP] identifier[interrupted] operator[=] identifier[Thread] operator[SEP] identifier[interrupted] operator[SEP] operator[SEP] operator[SEP] } identifier[awaitFutures] operator[SEP] operator[SEP] operator[SEP] }
public static List<String> readLinesWithRestOrClasspathOrFilePath( String resourceWithRestOrClasspathOrFilePath, String charsetName) { return JMCollections .buildListByLine(getStringWithRestOrClasspathOrFilePath( resourceWithRestOrClasspathOrFilePath, charsetName)); }
class class_name[name] begin[{] method[readLinesWithRestOrClasspathOrFilePath, return_type[type[List]], modifier[public static], parameter[resourceWithRestOrClasspathOrFilePath, charsetName]] begin[{] return[call[JMCollections.buildListByLine, parameter[call[.getStringWithRestOrClasspathOrFilePath, parameter[member[.resourceWithRestOrClasspathOrFilePath], member[.charsetName]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[readLinesWithRestOrClasspathOrFilePath] operator[SEP] identifier[String] identifier[resourceWithRestOrClasspathOrFilePath] , identifier[String] identifier[charsetName] operator[SEP] { Keyword[return] identifier[JMCollections] operator[SEP] identifier[buildListByLine] operator[SEP] identifier[getStringWithRestOrClasspathOrFilePath] operator[SEP] identifier[resourceWithRestOrClasspathOrFilePath] , identifier[charsetName] operator[SEP] operator[SEP] operator[SEP] }
public void subtract(final DoubleHistogram otherHistogram) { int arrayLength = otherHistogram.integerValuesHistogram.countsArrayLength; AbstractHistogram otherIntegerHistogram = otherHistogram.integerValuesHistogram; for (int i = 0; i < arrayLength; i++) { long otherCount = otherIntegerHistogram.getCountAtIndex(i); if (otherCount > 0) { double otherValue = otherIntegerHistogram.valueFromIndex(i) * otherHistogram.integerToDoubleValueConversionRatio; if (getCountAtValue(otherValue) < otherCount) { throw new IllegalArgumentException("otherHistogram count (" + otherCount + ") at value " + otherValue + " is larger than this one's (" + getCountAtValue(otherValue) + ")"); } recordValueWithCount(otherValue, -otherCount); } } }
class class_name[name] begin[{] method[subtract, return_type[void], modifier[public], parameter[otherHistogram]] begin[{] local_variable[type[int], arrayLength] local_variable[type[AbstractHistogram], otherIntegerHistogram] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCountAtIndex, postfix_operators=[], prefix_operators=[], qualifier=otherIntegerHistogram, selectors=[], type_arguments=None), name=otherCount)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=otherCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueFromIndex, postfix_operators=[], prefix_operators=[], qualifier=otherIntegerHistogram, selectors=[], type_arguments=None), operandr=MemberReference(member=integerToDoubleValueConversionRatio, postfix_operators=[], prefix_operators=[], qualifier=otherHistogram, selectors=[]), operator=*), name=otherValue)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=otherValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCountAtValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=otherCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="otherHistogram count ("), operandr=MemberReference(member=otherCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") at value "), operator=+), operandr=MemberReference(member=otherValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is larger than this one's ("), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=otherValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCountAtValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=otherValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=otherCount, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[])], member=recordValueWithCount, 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=arrayLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[subtract] operator[SEP] Keyword[final] identifier[DoubleHistogram] identifier[otherHistogram] operator[SEP] { Keyword[int] identifier[arrayLength] operator[=] identifier[otherHistogram] operator[SEP] identifier[integerValuesHistogram] operator[SEP] identifier[countsArrayLength] operator[SEP] identifier[AbstractHistogram] identifier[otherIntegerHistogram] operator[=] identifier[otherHistogram] operator[SEP] identifier[integerValuesHistogram] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[arrayLength] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[long] identifier[otherCount] operator[=] identifier[otherIntegerHistogram] operator[SEP] identifier[getCountAtIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[otherCount] operator[>] Other[0] operator[SEP] { Keyword[double] identifier[otherValue] operator[=] identifier[otherIntegerHistogram] operator[SEP] identifier[valueFromIndex] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[otherHistogram] operator[SEP] identifier[integerToDoubleValueConversionRatio] operator[SEP] Keyword[if] operator[SEP] identifier[getCountAtValue] operator[SEP] identifier[otherValue] operator[SEP] operator[<] identifier[otherCount] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[otherCount] operator[+] literal[String] operator[+] identifier[otherValue] operator[+] literal[String] operator[+] identifier[getCountAtValue] operator[SEP] identifier[otherValue] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[recordValueWithCount] operator[SEP] identifier[otherValue] , operator[-] identifier[otherCount] operator[SEP] operator[SEP] } } }
private String setterName(String fieldName) { return new StringBuilder(SET_PREFIX) .append(fieldName.substring(0, 1).toUpperCase(Locale.ENGLISH)) .append(fieldName.substring(1)) .toString(); }
class class_name[name] begin[{] method[setterName, return_type[type[String]], modifier[private], parameter[fieldName]] begin[{] return[ClassCreator(arguments=[MemberReference(member=SET_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fieldName, selectors=[MethodInvocation(arguments=[MemberReference(member=ENGLISH, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[])], member=toUpperCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fieldName, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))] end[}] END[}]
Keyword[private] identifier[String] identifier[setterName] operator[SEP] identifier[String] identifier[fieldName] operator[SEP] { Keyword[return] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[SET_PREFIX] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[fieldName] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[fieldName] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static byte[] toBcd(String address) throws NullPointerException, IllegalArgumentException { if (address == null) { throw new NullPointerException("Address cannot be null for BCD encoding"); } if (!StringUtil.containsOnlyDigits(address)) { throw new IllegalArgumentException("Address must only contain digits"); } // make sure this address is always an even length if (address.length() % 2 != 0) { // add an extra F onto the end address = address + "F"; } // calculate length of final byte[] int bytes_len = address.length() / 2; byte[] bcd = new byte[bytes_len]; for (int i = 0; i < bytes_len; i++) { StringBuilder chunk = new StringBuilder(address.substring(i * 2, (i * 2) + 2)); // reverse the digits since its BCD encoded chunk.reverse(); // get the byte byte[] bytes = HexUtil.toByteArray(chunk.toString()); //byte[] bytes = ByteUtil.decodeHex(chunk.toString(), 2); // add this byte onto our total bcd[i] = bytes[0]; } return bcd; }
class class_name[name] begin[{] method[toBcd, return_type[type[byte]], modifier[public static], parameter[address]] begin[{] if[binary_operation[member[.address], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Address cannot be null for BCD encoding")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[call[StringUtil.containsOnlyDigits, parameter[member[.address]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Address must only contain digits")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[call[address.length, parameter[]], %, literal[2]], !=, literal[0]]] begin[{] assign[member[.address], binary_operation[member[.address], +, literal["F"]]] else begin[{] None end[}] local_variable[type[int], bytes_len] local_variable[type[byte], bcd] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=address, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=chunk)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=reverse, postfix_operators=[], prefix_operators=[], qualifier=chunk, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=chunk, selectors=[], type_arguments=None)], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=HexUtil, selectors=[], type_arguments=None), name=bytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bcd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bytes_len, 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[.bcd]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[toBcd] operator[SEP] identifier[String] identifier[address] operator[SEP] Keyword[throws] identifier[NullPointerException] , identifier[IllegalArgumentException] { Keyword[if] operator[SEP] identifier[address] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[StringUtil] operator[SEP] identifier[containsOnlyDigits] operator[SEP] identifier[address] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[address] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[%] Other[2] operator[!=] Other[0] operator[SEP] { identifier[address] operator[=] identifier[address] operator[+] literal[String] operator[SEP] } Keyword[int] identifier[bytes_len] operator[=] identifier[address] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[/] Other[2] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bcd] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[bytes_len] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[bytes_len] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[StringBuilder] identifier[chunk] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[address] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[*] Other[2] , operator[SEP] identifier[i] operator[*] Other[2] operator[SEP] operator[+] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[chunk] operator[SEP] identifier[reverse] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[HexUtil] operator[SEP] identifier[toByteArray] operator[SEP] identifier[chunk] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bcd] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[bytes] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] identifier[bcd] operator[SEP] }
public void marshall(CreateAssociationRequest createAssociationRequest, ProtocolMarshaller protocolMarshaller) { if (createAssociationRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createAssociationRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createAssociationRequest.getDocumentVersion(), DOCUMENTVERSION_BINDING); protocolMarshaller.marshall(createAssociationRequest.getInstanceId(), INSTANCEID_BINDING); protocolMarshaller.marshall(createAssociationRequest.getParameters(), PARAMETERS_BINDING); protocolMarshaller.marshall(createAssociationRequest.getTargets(), TARGETS_BINDING); protocolMarshaller.marshall(createAssociationRequest.getScheduleExpression(), SCHEDULEEXPRESSION_BINDING); protocolMarshaller.marshall(createAssociationRequest.getOutputLocation(), OUTPUTLOCATION_BINDING); protocolMarshaller.marshall(createAssociationRequest.getAssociationName(), ASSOCIATIONNAME_BINDING); protocolMarshaller.marshall(createAssociationRequest.getAutomationTargetParameterName(), AUTOMATIONTARGETPARAMETERNAME_BINDING); protocolMarshaller.marshall(createAssociationRequest.getMaxErrors(), MAXERRORS_BINDING); protocolMarshaller.marshall(createAssociationRequest.getMaxConcurrency(), MAXCONCURRENCY_BINDING); protocolMarshaller.marshall(createAssociationRequest.getComplianceSeverity(), COMPLIANCESEVERITY_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[createAssociationRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createAssociationRequest], ==, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDocumentVersion, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=DOCUMENTVERSION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInstanceId, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=INSTANCEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=PARAMETERS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTargets, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=TARGETS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getScheduleExpression, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=SCHEDULEEXPRESSION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOutputLocation, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=OUTPUTLOCATION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAssociationName, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=ASSOCIATIONNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAutomationTargetParameterName, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=AUTOMATIONTARGETPARAMETERNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMaxErrors, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=MAXERRORS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMaxConcurrency, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=MAXCONCURRENCY_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getComplianceSeverity, postfix_operators=[], prefix_operators=[], qualifier=createAssociationRequest, selectors=[], type_arguments=None), MemberReference(member=COMPLIANCESEVERITY_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[CreateAssociationRequest] identifier[createAssociationRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createAssociationRequest] 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[createAssociationRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getDocumentVersion] operator[SEP] operator[SEP] , identifier[DOCUMENTVERSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getInstanceId] operator[SEP] operator[SEP] , identifier[INSTANCEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] , identifier[PARAMETERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getTargets] operator[SEP] operator[SEP] , identifier[TARGETS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getScheduleExpression] operator[SEP] operator[SEP] , identifier[SCHEDULEEXPRESSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getOutputLocation] operator[SEP] operator[SEP] , identifier[OUTPUTLOCATION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getAssociationName] operator[SEP] operator[SEP] , identifier[ASSOCIATIONNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getAutomationTargetParameterName] operator[SEP] operator[SEP] , identifier[AUTOMATIONTARGETPARAMETERNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getMaxErrors] operator[SEP] operator[SEP] , identifier[MAXERRORS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getMaxConcurrency] operator[SEP] operator[SEP] , identifier[MAXCONCURRENCY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAssociationRequest] operator[SEP] identifier[getComplianceSeverity] operator[SEP] operator[SEP] , identifier[COMPLIANCESEVERITY_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 <T1, T2, T3> TriPredicate<T1, T2, T3> and(TriPredicate<T1, T2, T3> first, TriPredicate<T1, T2, T3> second) { dbc.precondition(first != null, "first predicate is null"); dbc.precondition(second != null, "second predicate is null"); return Logic.Ternary.and(Iterations.iterable(first, second)); }
class class_name[name] begin[{] method[and, return_type[type[TriPredicate]], modifier[public static], parameter[first, second]] begin[{] call[dbc.precondition, parameter[binary_operation[member[.first], !=, literal[null]], literal["first predicate is null"]]] call[dbc.precondition, parameter[binary_operation[member[.second], !=, literal[null]], literal["second predicate is null"]]] return[call[Logic.Ternary.and, parameter[call[Iterations.iterable, parameter[member[.first], member[.second]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[TriPredicate] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[and] operator[SEP] identifier[TriPredicate] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[first] , identifier[TriPredicate] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[second] operator[SEP] { identifier[dbc] operator[SEP] identifier[precondition] operator[SEP] identifier[first] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[dbc] operator[SEP] identifier[precondition] operator[SEP] identifier[second] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[Logic] operator[SEP] identifier[Ternary] operator[SEP] identifier[and] operator[SEP] identifier[Iterations] operator[SEP] identifier[iterable] operator[SEP] identifier[first] , identifier[second] operator[SEP] operator[SEP] operator[SEP] }
public ComputeNodeAddUserHeaders withLastModified(DateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { this.lastModified = new DateTimeRfc1123(lastModified); } return this; }
class class_name[name] begin[{] method[withLastModified, return_type[type[ComputeNodeAddUserHeaders]], modifier[public], parameter[lastModified]] begin[{] if[binary_operation[member[.lastModified], ==, literal[null]]] begin[{] assign[THIS[member[None.lastModified]], literal[null]] else begin[{] assign[THIS[member[None.lastModified]], ClassCreator(arguments=[MemberReference(member=lastModified, 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=DateTimeRfc1123, sub_type=None))] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ComputeNodeAddUserHeaders] identifier[withLastModified] operator[SEP] identifier[DateTime] identifier[lastModified] operator[SEP] { Keyword[if] operator[SEP] identifier[lastModified] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[lastModified] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[lastModified] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void readArray(long[] data) throws IOException { int size = data.length; for (int i = 0; i < size; ++i) data[i] = getLong(); }
class class_name[name] begin[{] method[readArray, return_type[void], modifier[public], parameter[data]] begin[{] local_variable[type[int], size] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[readArray] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[data] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[size] operator[=] identifier[data] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] operator[++] identifier[i] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[getLong] operator[SEP] operator[SEP] operator[SEP] }
public void eInit(SarlScript script, String name, IJvmTypeProvider context) { setTypeResolutionContext(context); if (this.sarlArtifact == null) { this.sarlArtifact = SarlFactory.eINSTANCE.createSarlArtifact(); script.getXtendTypes().add(this.sarlArtifact); this.sarlArtifact.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration()); if (!Strings.isEmpty(name)) { this.sarlArtifact.setName(name); } } }
class class_name[name] begin[{] method[eInit, return_type[void], modifier[public], parameter[script, name, context]] begin[{] call[.setTypeResolutionContext, parameter[member[.context]]] if[binary_operation[THIS[member[None.sarlArtifact]], ==, literal[null]]] begin[{] assign[THIS[member[None.sarlArtifact]], call[SarlFactory.eINSTANCE.createSarlArtifact, parameter[]]] call[script.getXtendTypes, parameter[]] THIS[member[None.sarlArtifact]call[None.setAnnotationInfo, parameter[call[XtendFactory.eINSTANCE.createXtendTypeDeclaration, parameter[]]]]] if[call[Strings.isEmpty, parameter[member[.name]]]] begin[{] THIS[member[None.sarlArtifact]call[None.setName, parameter[member[.name]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[eInit] operator[SEP] identifier[SarlScript] identifier[script] , identifier[String] identifier[name] , identifier[IJvmTypeProvider] identifier[context] operator[SEP] { identifier[setTypeResolutionContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[sarlArtifact] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[sarlArtifact] operator[=] identifier[SarlFactory] operator[SEP] identifier[eINSTANCE] operator[SEP] identifier[createSarlArtifact] operator[SEP] operator[SEP] operator[SEP] identifier[script] operator[SEP] identifier[getXtendTypes] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[this] operator[SEP] identifier[sarlArtifact] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[sarlArtifact] operator[SEP] identifier[setAnnotationInfo] operator[SEP] identifier[XtendFactory] operator[SEP] identifier[eINSTANCE] operator[SEP] identifier[createXtendTypeDeclaration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Strings] operator[SEP] identifier[isEmpty] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[sarlArtifact] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] } } }
public List<? extends Annotation> getRestrictionsForPhase(PhaseIdType currentPhase, String viewId) { List<? extends Annotation> allSecurityAnnotations = viewConfigStore.getAllQualifierData(viewId, SecurityBindingType.class); List<Annotation> applicableSecurityAnnotations = null; for (Annotation annotation : allSecurityAnnotations) { PhaseIdType[] defaultPhases = getDefaultPhases(viewId); if (isAnnotationApplicableToPhase(annotation, currentPhase, defaultPhases)) { if (applicableSecurityAnnotations == null) { // avoid spawning arrays at all phases of the lifecycle applicableSecurityAnnotations = new ArrayList<Annotation>(); } applicableSecurityAnnotations.add(annotation); } } return applicableSecurityAnnotations; }
class class_name[name] begin[{] method[getRestrictionsForPhase, return_type[type[List]], modifier[public], parameter[currentPhase, viewId]] begin[{] local_variable[type[List], allSecurityAnnotations] local_variable[type[List], applicableSecurityAnnotations] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=viewId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDefaultPhases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=defaultPhases)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=PhaseIdType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentPhase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultPhases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAnnotationApplicableToPhase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=applicableSecurityAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=applicableSecurityAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=applicableSecurityAnnotations, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=allSecurityAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None) return[member[.applicableSecurityAnnotations]] end[}] END[}]
Keyword[public] identifier[List] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[getRestrictionsForPhase] operator[SEP] identifier[PhaseIdType] identifier[currentPhase] , identifier[String] identifier[viewId] operator[SEP] { identifier[List] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[allSecurityAnnotations] operator[=] identifier[viewConfigStore] operator[SEP] identifier[getAllQualifierData] operator[SEP] identifier[viewId] , identifier[SecurityBindingType] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Annotation] operator[>] identifier[applicableSecurityAnnotations] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Annotation] identifier[annotation] operator[:] identifier[allSecurityAnnotations] operator[SEP] { identifier[PhaseIdType] operator[SEP] operator[SEP] identifier[defaultPhases] operator[=] identifier[getDefaultPhases] operator[SEP] identifier[viewId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isAnnotationApplicableToPhase] operator[SEP] identifier[annotation] , identifier[currentPhase] , identifier[defaultPhases] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[applicableSecurityAnnotations] operator[==] Other[null] operator[SEP] { identifier[applicableSecurityAnnotations] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Annotation] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[applicableSecurityAnnotations] operator[SEP] identifier[add] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] } } Keyword[return] identifier[applicableSecurityAnnotations] operator[SEP] }
private void sieveSingle(int limit, int start, int step) { while(start < limit) { set(start); start += step; } }
class class_name[name] begin[{] method[sieveSingle, return_type[void], modifier[private], parameter[limit, start, step]] begin[{] while[binary_operation[member[.start], <, member[.limit]]] begin[{] call[.set, parameter[member[.start]]] assign[member[.start], member[.step]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[sieveSingle] operator[SEP] Keyword[int] identifier[limit] , Keyword[int] identifier[start] , Keyword[int] identifier[step] operator[SEP] { Keyword[while] operator[SEP] identifier[start] operator[<] identifier[limit] operator[SEP] { identifier[set] operator[SEP] identifier[start] operator[SEP] operator[SEP] identifier[start] operator[+=] identifier[step] operator[SEP] } }
public static byte packParametersByte(final int registerWidth, final int registerCountLog2) { final int widthBits = ((registerWidth - 1) & REGISTER_WIDTH_MASK); final int countBits = (registerCountLog2 & LOG2_REGISTER_COUNT_MASK); return (byte)((widthBits << LOG2_REGISTER_COUNT_BITS) | countBits); }
class class_name[name] begin[{] method[packParametersByte, return_type[type[byte]], modifier[public static], parameter[registerWidth, registerCountLog2]] begin[{] local_variable[type[int], widthBits] local_variable[type[int], countBits] return[Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=widthBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LOG2_REGISTER_COUNT_BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), operandr=MemberReference(member=countBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), type=BasicType(dimensions=[], name=byte))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] identifier[packParametersByte] operator[SEP] Keyword[final] Keyword[int] identifier[registerWidth] , Keyword[final] Keyword[int] identifier[registerCountLog2] operator[SEP] { Keyword[final] Keyword[int] identifier[widthBits] operator[=] operator[SEP] operator[SEP] identifier[registerWidth] operator[-] Other[1] operator[SEP] operator[&] identifier[REGISTER_WIDTH_MASK] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[countBits] operator[=] operator[SEP] identifier[registerCountLog2] operator[&] identifier[LOG2_REGISTER_COUNT_MASK] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[widthBits] operator[<<] identifier[LOG2_REGISTER_COUNT_BITS] operator[SEP] operator[|] identifier[countBits] operator[SEP] operator[SEP] }
@Override public final boolean hasNext() { resetToLastKey(); // a predicate has to evaluate to true only once. if (mIsFirst) { mIsFirst = false; if (mPredicate.hasNext()) { if (isBooleanFalse()) { resetToStartKey(); return false; } // reset is needed, because a predicate works more like a // filter. It // does // not change the current transaction. resetToLastKey(); return true; } } resetToStartKey(); return false; }
class class_name[name] begin[{] method[hasNext, return_type[type[boolean]], modifier[final public], parameter[]] begin[{] call[.resetToLastKey, parameter[]] if[member[.mIsFirst]] begin[{] assign[member[.mIsFirst], literal[false]] if[call[mPredicate.hasNext, parameter[]]] begin[{] if[call[.isBooleanFalse, parameter[]]] begin[{] call[.resetToStartKey, parameter[]] return[literal[false]] else begin[{] None end[}] call[.resetToLastKey, parameter[]] return[literal[true]] else begin[{] None end[}] else begin[{] None end[}] call[.resetToStartKey, parameter[]] return[literal[false]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { identifier[resetToLastKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mIsFirst] operator[SEP] { identifier[mIsFirst] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[mPredicate] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isBooleanFalse] operator[SEP] operator[SEP] operator[SEP] { identifier[resetToStartKey] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[resetToLastKey] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } identifier[resetToStartKey] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public Surface preConcatenate (AffineTransform xf) { AffineTransform txf = tx(); Transforms.multiply(xf.m00, xf.m01, xf.m10, xf.m11, xf.tx, xf.ty, txf, txf); return this; }
class class_name[name] begin[{] method[preConcatenate, return_type[type[Surface]], modifier[public], parameter[xf]] begin[{] local_variable[type[AffineTransform], txf] call[Transforms.multiply, parameter[member[xf.m00], member[xf.m01], member[xf.m10], member[xf.m11], member[xf.tx], member[xf.ty], member[.txf], member[.txf]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Surface] identifier[preConcatenate] operator[SEP] identifier[AffineTransform] identifier[xf] operator[SEP] { identifier[AffineTransform] identifier[txf] operator[=] identifier[tx] operator[SEP] operator[SEP] operator[SEP] identifier[Transforms] operator[SEP] identifier[multiply] operator[SEP] identifier[xf] operator[SEP] identifier[m00] , identifier[xf] operator[SEP] identifier[m01] , identifier[xf] operator[SEP] identifier[m10] , identifier[xf] operator[SEP] identifier[m11] , identifier[xf] operator[SEP] identifier[tx] , identifier[xf] operator[SEP] identifier[ty] , identifier[txf] , identifier[txf] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public final Flux<T> onErrorStop() { return subscriberContext(Context.of( OnNextFailureStrategy.KEY_ON_NEXT_ERROR_STRATEGY, OnNextFailureStrategy.stop())); }
class class_name[name] begin[{] method[onErrorStop, return_type[type[Flux]], modifier[final public], parameter[]] begin[{] return[call[.subscriberContext, parameter[call[Context.of, parameter[member[OnNextFailureStrategy.KEY_ON_NEXT_ERROR_STRATEGY], call[OnNextFailureStrategy.stop, parameter[]]]]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Flux] operator[<] identifier[T] operator[>] identifier[onErrorStop] operator[SEP] operator[SEP] { Keyword[return] identifier[subscriberContext] operator[SEP] identifier[Context] operator[SEP] identifier[of] operator[SEP] identifier[OnNextFailureStrategy] operator[SEP] identifier[KEY_ON_NEXT_ERROR_STRATEGY] , identifier[OnNextFailureStrategy] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public EEnum getWindowSpecificationCFORMAT() { if (windowSpecificationCFORMATEEnum == null) { windowSpecificationCFORMATEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(156); } return windowSpecificationCFORMATEEnum; }
class class_name[name] begin[{] method[getWindowSpecificationCFORMAT, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.windowSpecificationCFORMATEEnum], ==, literal[null]]] begin[{] assign[member[.windowSpecificationCFORMATEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=156)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.windowSpecificationCFORMATEEnum]] end[}] END[}]
Keyword[public] identifier[EEnum] identifier[getWindowSpecificationCFORMAT] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[windowSpecificationCFORMATEEnum] operator[==] Other[null] operator[SEP] { identifier[windowSpecificationCFORMATEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[AfplibPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[156] operator[SEP] operator[SEP] } Keyword[return] identifier[windowSpecificationCFORMATEEnum] operator[SEP] }
public StatementBuilder withQualifiers(List<SnakGroup> qualifiers) { for (SnakGroup sg : qualifiers) { withQualifiers(sg); } return getThis(); }
class class_name[name] begin[{] method[withQualifiers, return_type[type[StatementBuilder]], modifier[public], parameter[qualifiers]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withQualifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=qualifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SnakGroup, sub_type=None))), label=None) return[call[.getThis, parameter[]]] end[}] END[}]
Keyword[public] identifier[StatementBuilder] identifier[withQualifiers] operator[SEP] identifier[List] operator[<] identifier[SnakGroup] operator[>] identifier[qualifiers] operator[SEP] { Keyword[for] operator[SEP] identifier[SnakGroup] identifier[sg] operator[:] identifier[qualifiers] operator[SEP] { identifier[withQualifiers] operator[SEP] identifier[sg] operator[SEP] operator[SEP] } Keyword[return] identifier[getThis] operator[SEP] operator[SEP] operator[SEP] }
public EClass getIfcTwoDirectionRepeatFactor() { if (ifcTwoDirectionRepeatFactorEClass == null) { ifcTwoDirectionRepeatFactorEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(625); } return ifcTwoDirectionRepeatFactorEClass; }
class class_name[name] begin[{] method[getIfcTwoDirectionRepeatFactor, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcTwoDirectionRepeatFactorEClass], ==, literal[null]]] begin[{] assign[member[.ifcTwoDirectionRepeatFactorEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=625)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcTwoDirectionRepeatFactorEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcTwoDirectionRepeatFactor] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcTwoDirectionRepeatFactorEClass] operator[==] Other[null] operator[SEP] { identifier[ifcTwoDirectionRepeatFactorEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[625] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcTwoDirectionRepeatFactorEClass] operator[SEP] }
static Optional<String> nullableAnnotationFor(Element element, TypeMirror elementType) { List<? extends AnnotationMirror> typeAnnotations = elementType.getAnnotationMirrors(); if (nullableAnnotationIndex(typeAnnotations).isPresent()) { return Optional.of(""); } List<? extends AnnotationMirror> elementAnnotations = element.getAnnotationMirrors(); OptionalInt nullableAnnotationIndex = nullableAnnotationIndex(elementAnnotations); if (nullableAnnotationIndex.isPresent()) { ImmutableList<String> annotations = annotationStrings(elementAnnotations); return Optional.of(annotations.get(nullableAnnotationIndex.getAsInt()) + " "); } else { return Optional.empty(); } }
class class_name[name] begin[{] method[nullableAnnotationFor, return_type[type[Optional]], modifier[static], parameter[element, elementType]] begin[{] local_variable[type[List], typeAnnotations] if[call[.nullableAnnotationIndex, parameter[member[.typeAnnotations]]]] begin[{] return[call[Optional.of, parameter[literal[""]]]] else begin[{] None end[}] local_variable[type[List], elementAnnotations] local_variable[type[OptionalInt], nullableAnnotationIndex] if[call[nullableAnnotationIndex.isPresent, parameter[]]] begin[{] local_variable[type[ImmutableList], annotations] return[call[Optional.of, parameter[binary_operation[call[annotations.get, parameter[call[nullableAnnotationIndex.getAsInt, parameter[]]]], +, literal[" "]]]]] else begin[{] return[call[Optional.empty, parameter[]]] end[}] end[}] END[}]
Keyword[static] identifier[Optional] operator[<] identifier[String] operator[>] identifier[nullableAnnotationFor] operator[SEP] identifier[Element] identifier[element] , identifier[TypeMirror] identifier[elementType] operator[SEP] { identifier[List] operator[<] operator[?] Keyword[extends] identifier[AnnotationMirror] operator[>] identifier[typeAnnotations] operator[=] identifier[elementType] operator[SEP] identifier[getAnnotationMirrors] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nullableAnnotationIndex] operator[SEP] identifier[typeAnnotations] operator[SEP] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[List] operator[<] operator[?] Keyword[extends] identifier[AnnotationMirror] operator[>] identifier[elementAnnotations] operator[=] identifier[element] operator[SEP] identifier[getAnnotationMirrors] operator[SEP] operator[SEP] operator[SEP] identifier[OptionalInt] identifier[nullableAnnotationIndex] operator[=] identifier[nullableAnnotationIndex] operator[SEP] identifier[elementAnnotations] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nullableAnnotationIndex] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[ImmutableList] operator[<] identifier[String] operator[>] identifier[annotations] operator[=] identifier[annotationStrings] operator[SEP] identifier[elementAnnotations] operator[SEP] operator[SEP] Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[annotations] operator[SEP] identifier[get] operator[SEP] identifier[nullableAnnotationIndex] operator[SEP] identifier[getAsInt] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } }
public HtmlResponse withView(Object viewObject) { assertArgumentNotNull("viewObject", viewObject); if (!getRegistrationList().isEmpty()) { String msg = "Cannot call withView() with renderWith(): registrationList=" + getRegistrationList(); throw new IllegalStateException(msg); } this.viewObject = viewObject; return this; }
class class_name[name] begin[{] method[withView, return_type[type[HtmlResponse]], modifier[public], parameter[viewObject]] begin[{] call[.assertArgumentNotNull, parameter[literal["viewObject"], member[.viewObject]]] if[call[.getRegistrationList, parameter[]]] begin[{] local_variable[type[String], msg] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, 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) else begin[{] None end[}] assign[THIS[member[None.viewObject]], member[.viewObject]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[HtmlResponse] identifier[withView] operator[SEP] identifier[Object] identifier[viewObject] operator[SEP] { identifier[assertArgumentNotNull] operator[SEP] literal[String] , identifier[viewObject] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[getRegistrationList] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[getRegistrationList] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[viewObject] operator[=] identifier[viewObject] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void registerTypeface(String typefaceName, AssetManager assets, String filePath) { Typeface typeface = Typeface.createFromAsset(assets, filePath); mTypefaces.put(typefaceName, typeface); }
class class_name[name] begin[{] method[registerTypeface, return_type[void], modifier[public], parameter[typefaceName, assets, filePath]] begin[{] local_variable[type[Typeface], typeface] call[mTypefaces.put, parameter[member[.typefaceName], member[.typeface]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerTypeface] operator[SEP] identifier[String] identifier[typefaceName] , identifier[AssetManager] identifier[assets] , identifier[String] identifier[filePath] operator[SEP] { identifier[Typeface] identifier[typeface] operator[=] identifier[Typeface] operator[SEP] identifier[createFromAsset] operator[SEP] identifier[assets] , identifier[filePath] operator[SEP] operator[SEP] identifier[mTypefaces] operator[SEP] identifier[put] operator[SEP] identifier[typefaceName] , identifier[typeface] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.GSLW__MH: return getMH(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=GSLW__MH, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GSLW__MH] operator[:] Keyword[return] identifier[getMH] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public static CommerceAccountOrganizationRel findByPrimaryKey( CommerceAccountOrganizationRelPK commerceAccountOrganizationRelPK) throws com.liferay.commerce.account.exception.NoSuchAccountOrganizationRelException { return getPersistence() .findByPrimaryKey(commerceAccountOrganizationRelPK); }
class class_name[name] begin[{] method[findByPrimaryKey, return_type[type[CommerceAccountOrganizationRel]], modifier[public static], parameter[commerceAccountOrganizationRelPK]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceAccountOrganizationRel] identifier[findByPrimaryKey] operator[SEP] identifier[CommerceAccountOrganizationRelPK] identifier[commerceAccountOrganizationRelPK] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[account] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchAccountOrganizationRelException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByPrimaryKey] operator[SEP] identifier[commerceAccountOrganizationRelPK] operator[SEP] operator[SEP] }
private void initTemplates() throws Exception { if (templates != null && templates.length > 0) { for (String template : templates) { Assert.hasText(template, "Can not read template in [" + template + "]. Check that templates is not empty."); createTemplate(client.getLowLevelClient(), classpathRoot, template, forceTemplate); } } }
class class_name[name] begin[{] method[initTemplates, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[binary_operation[member[.templates], !=, literal[null]], &&, binary_operation[member[templates.length], >, literal[0]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not read template in ["), operandr=MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]. Check that templates is not empty."), operator=+)], member=hasText, postfix_operators=[], prefix_operators=[], qualifier=Assert, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLowLevelClient, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), MemberReference(member=classpathRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=forceTemplate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTemplate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=templates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=template)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[initTemplates] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[templates] operator[!=] Other[null] operator[&&] identifier[templates] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[template] operator[:] identifier[templates] operator[SEP] { identifier[Assert] operator[SEP] identifier[hasText] operator[SEP] identifier[template] , literal[String] operator[+] identifier[template] operator[+] literal[String] operator[SEP] operator[SEP] identifier[createTemplate] operator[SEP] identifier[client] operator[SEP] identifier[getLowLevelClient] operator[SEP] operator[SEP] , identifier[classpathRoot] , identifier[template] , identifier[forceTemplate] operator[SEP] operator[SEP] } } }
public int getExactSubsSize(String topicExpression) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getExactSubsSize", topicExpression); int numSubs = 0; // Test whether table is now empty if(!_registeredExactConsumerMonitors.isEmpty()) { if(_registeredExactConsumerMonitors.containsKey(topicExpression)) { RegisteredCallbacks rMonitor = (RegisteredCallbacks)_registeredExactConsumerMonitors.get(topicExpression); // Get the list of matching consumers ArrayList consumerList = rMonitor.getMatchingConsumers(); if(consumerList != null && !consumerList.isEmpty()) { numSubs = consumerList.size(); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getExactSubsSize", new Integer(numSubs)); return numSubs; }
class class_name[name] begin[{] method[getExactSubsSize, return_type[type[int]], modifier[public], parameter[topicExpression]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["getExactSubsSize"], member[.topicExpression]]] else begin[{] None end[}] local_variable[type[int], numSubs] if[call[_registeredExactConsumerMonitors.isEmpty, parameter[]]] begin[{] if[call[_registeredExactConsumerMonitors.containsKey, parameter[member[.topicExpression]]]] begin[{] local_variable[type[RegisteredCallbacks], rMonitor] local_variable[type[ArrayList], consumerList] if[binary_operation[binary_operation[member[.consumerList], !=, literal[null]], &&, call[consumerList.isEmpty, parameter[]]]] begin[{] assign[member[.numSubs], call[consumerList.size, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["getExactSubsSize"], ClassCreator(arguments=[MemberReference(member=numSubs, 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=Integer, sub_type=None))]] else begin[{] None end[}] return[member[.numSubs]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getExactSubsSize] operator[SEP] identifier[String] identifier[topicExpression] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[topicExpression] operator[SEP] operator[SEP] Keyword[int] identifier[numSubs] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[_registeredExactConsumerMonitors] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_registeredExactConsumerMonitors] operator[SEP] identifier[containsKey] operator[SEP] identifier[topicExpression] operator[SEP] operator[SEP] { identifier[RegisteredCallbacks] identifier[rMonitor] operator[=] operator[SEP] identifier[RegisteredCallbacks] operator[SEP] identifier[_registeredExactConsumerMonitors] operator[SEP] identifier[get] operator[SEP] identifier[topicExpression] operator[SEP] operator[SEP] identifier[ArrayList] identifier[consumerList] operator[=] identifier[rMonitor] operator[SEP] identifier[getMatchingConsumers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[consumerList] operator[!=] Other[null] operator[&&] operator[!] identifier[consumerList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[numSubs] operator[=] identifier[consumerList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Integer] operator[SEP] identifier[numSubs] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[numSubs] operator[SEP] }
Table USAGE_PRIVILEGES() { Table t = sysTables[USAGE_PRIVILEGES]; if (t == null) { t = createBlankTable(sysTableHsqlNames[USAGE_PRIVILEGES]); addColumn(t, "GRANTOR", SQL_IDENTIFIER); // not null addColumn(t, "GRANTEE", SQL_IDENTIFIER); // not null addColumn(t, "OBJECT_CATALOG", SQL_IDENTIFIER); addColumn(t, "OBJECT_SCHEMA", SQL_IDENTIFIER); addColumn(t, "OBJECT_NAME", SQL_IDENTIFIER); // not null addColumn(t, "OBJECT_TYPE", CHARACTER_DATA); // not null addColumn(t, "PRIVILEGE_TYPE", CHARACTER_DATA); addColumn(t, "IS_GRANTABLE", YES_OR_NO); // not null // order: COLUMN_NAME, PRIVILEGE // for unique: GRANTEE, GRANTOR, TABLE_NAME, TABLE_SCHEM, TABLE_CAT // false PK, as TABLE_SCHEM and/or TABLE_CAT may be null HsqlName name = HsqlNameManager.newInfoSchemaObjectName( sysTableHsqlNames[USAGE_PRIVILEGES].name, false, SchemaObject.INDEX); t.createPrimaryKey(name, new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }, false); return t; } // Object[] row; // final int grantor = 0; final int grantee = 1; final int object_catalog = 2; final int object_schema = 3; final int object_name = 4; final int object_type = 5; final int privilege_type = 6; final int is_grantable = 7; PersistentStore store = database.persistentStoreCollection.getStore(t); Iterator objects = new WrapperIterator(database.schemaManager .databaseObjectIterator(SchemaObject.SEQUENCE), database .schemaManager.databaseObjectIterator(SchemaObject.COLLATION)); objects = new WrapperIterator( objects, database.schemaManager.databaseObjectIterator( SchemaObject.CHARSET)); objects = new WrapperIterator( objects, database.schemaManager.databaseObjectIterator( SchemaObject.DOMAIN)); /* objects = new WrapperIterator( objects, database.schemaManager.databaseObjectIterator(SchemaObject.TYPE)); */ OrderedHashSet grantees = session.getGrantee().getGranteeAndAllRolesWithPublic(); while (objects.hasNext()) { SchemaObject object = (SchemaObject) objects.next(); for (int i = 0; i < grantees.size(); i++) { Grantee granteeObject = (Grantee) grantees.get(i); OrderedHashSet rights = granteeObject.getAllDirectPrivileges(object); OrderedHashSet grants = granteeObject.getAllGrantedPrivileges(object); if (!grants.isEmpty()) { grants.addAll(rights); rights = grants; } for (int j = 0; j < rights.size(); j++) { Right right = (Right) rights.get(j); Right grantableRight = right.getGrantableRights(); row = t.getEmptyRowData(); row[grantor] = right.getGrantor().getName().name; row[grantee] = right.getGrantee().getName().name; row[object_catalog] = database.getCatalogName().name; row[object_schema] = object.getSchemaName().name; row[object_name] = object.getName().name; row[object_type] = SchemaObjectSet.getName(object.getName().type); row[privilege_type] = Tokens.T_USAGE; row[is_grantable] = right.getGrantee() == object.getOwner() || grantableRight.isFull() ? Tokens.T_YES : Tokens.T_NO;; try { t.insertSys(store, row); } catch (HsqlException e) {} } } } return t; }
class class_name[name] begin[{] method[USAGE_PRIVILEGES, return_type[type[Table]], modifier[default], parameter[]] begin[{] local_variable[type[Table], t] if[binary_operation[member[.t], ==, literal[null]]] begin[{] assign[member[.t], call[.createBlankTable, parameter[member[.sysTableHsqlNames]]]] call[.addColumn, parameter[member[.t], literal["GRANTOR"], member[.SQL_IDENTIFIER]]] call[.addColumn, parameter[member[.t], literal["GRANTEE"], member[.SQL_IDENTIFIER]]] call[.addColumn, parameter[member[.t], literal["OBJECT_CATALOG"], member[.SQL_IDENTIFIER]]] call[.addColumn, parameter[member[.t], literal["OBJECT_SCHEMA"], member[.SQL_IDENTIFIER]]] call[.addColumn, parameter[member[.t], literal["OBJECT_NAME"], member[.SQL_IDENTIFIER]]] call[.addColumn, parameter[member[.t], literal["OBJECT_TYPE"], member[.CHARACTER_DATA]]] call[.addColumn, parameter[member[.t], literal["PRIVILEGE_TYPE"], member[.CHARACTER_DATA]]] call[.addColumn, parameter[member[.t], literal["IS_GRANTABLE"], member[.YES_OR_NO]]] local_variable[type[HsqlName], name] call[t.createPrimaryKey, parameter[member[.name], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), literal[false]]] return[member[.t]] else begin[{] None end[}] local_variable[type[Object], row] local_variable[type[int], grantor] local_variable[type[int], grantee] local_variable[type[int], object_catalog] local_variable[type[int], object_schema] local_variable[type[int], object_name] local_variable[type[int], object_type] local_variable[type[int], privilege_type] local_variable[type[int], is_grantable] local_variable[type[PersistentStore], store] local_variable[type[Iterator], objects] assign[member[.objects], ClassCreator(arguments=[MemberReference(member=objects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=CHARSET, postfix_operators=[], prefix_operators=[], qualifier=SchemaObject, selectors=[])], member=databaseObjectIterator, postfix_operators=[], prefix_operators=[], qualifier=database.schemaManager, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WrapperIterator, sub_type=None))] assign[member[.objects], ClassCreator(arguments=[MemberReference(member=objects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=DOMAIN, postfix_operators=[], prefix_operators=[], qualifier=SchemaObject, selectors=[])], member=databaseObjectIterator, postfix_operators=[], prefix_operators=[], qualifier=database.schemaManager, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WrapperIterator, sub_type=None))] local_variable[type[OrderedHashSet], grantees] while[call[objects.hasNext, parameter[]]] begin[{] local_variable[type[SchemaObject], object] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=grantees, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Grantee, sub_type=None)), name=granteeObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Grantee, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAllDirectPrivileges, postfix_operators=[], prefix_operators=[], qualifier=granteeObject, selectors=[], type_arguments=None), name=rights)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OrderedHashSet, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAllGrantedPrivileges, postfix_operators=[], prefix_operators=[], qualifier=granteeObject, selectors=[], type_arguments=None), name=grants)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OrderedHashSet, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=grants, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=grants, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=grants, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=rights, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Right, sub_type=None)), name=right)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Right, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGrantableRights, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[], type_arguments=None), name=grantableRight)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Right, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getEmptyRowData, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=grantor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getGrantor, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=grantee, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getGrantee, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=object_catalog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getCatalogName, postfix_operators=[], prefix_operators=[], qualifier=database, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=object_schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getSchemaName, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=object_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=object_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)], member=getName, postfix_operators=[], prefix_operators=[], qualifier=SchemaObjectSet, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=privilege_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=T_USAGE, postfix_operators=[], prefix_operators=[], qualifier=Tokens, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=is_grantable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getGrantee, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getOwner, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), operator===), operandr=MethodInvocation(arguments=[], member=isFull, postfix_operators=[], prefix_operators=[], qualifier=grantableRight, selectors=[], type_arguments=None), operator=||), if_false=MemberReference(member=T_NO, postfix_operators=[], prefix_operators=[], qualifier=Tokens, selectors=[]), if_true=MemberReference(member=T_YES, postfix_operators=[], prefix_operators=[], qualifier=Tokens, selectors=[]))), label=None), Statement(label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=store, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insertSys, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['HsqlException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rights, selectors=[], type_arguments=None), 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)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=grantees, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] return[member[.t]] end[}] END[}]
identifier[Table] identifier[USAGE_PRIVILEGES] operator[SEP] operator[SEP] { identifier[Table] identifier[t] operator[=] identifier[sysTables] operator[SEP] identifier[USAGE_PRIVILEGES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[==] Other[null] operator[SEP] { identifier[t] operator[=] identifier[createBlankTable] operator[SEP] identifier[sysTableHsqlNames] operator[SEP] identifier[USAGE_PRIVILEGES] operator[SEP] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[SQL_IDENTIFIER] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[SQL_IDENTIFIER] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[SQL_IDENTIFIER] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[SQL_IDENTIFIER] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[SQL_IDENTIFIER] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[CHARACTER_DATA] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[CHARACTER_DATA] operator[SEP] operator[SEP] identifier[addColumn] operator[SEP] identifier[t] , literal[String] , identifier[YES_OR_NO] operator[SEP] operator[SEP] identifier[HsqlName] identifier[name] operator[=] identifier[HsqlNameManager] operator[SEP] identifier[newInfoSchemaObjectName] operator[SEP] identifier[sysTableHsqlNames] operator[SEP] identifier[USAGE_PRIVILEGES] operator[SEP] operator[SEP] identifier[name] , literal[boolean] , identifier[SchemaObject] operator[SEP] identifier[INDEX] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[createPrimaryKey] operator[SEP] identifier[name] , Keyword[new] Keyword[int] operator[SEP] operator[SEP] { Other[0] , Other[1] , Other[2] , Other[3] , Other[4] , Other[5] , Other[6] , Other[7] } , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP] } identifier[Object] operator[SEP] operator[SEP] identifier[row] operator[SEP] Keyword[final] Keyword[int] identifier[grantor] operator[=] Other[0] operator[SEP] Keyword[final] Keyword[int] identifier[grantee] operator[=] Other[1] operator[SEP] Keyword[final] Keyword[int] identifier[object_catalog] operator[=] Other[2] operator[SEP] Keyword[final] Keyword[int] identifier[object_schema] operator[=] Other[3] operator[SEP] Keyword[final] Keyword[int] identifier[object_name] operator[=] Other[4] operator[SEP] Keyword[final] Keyword[int] identifier[object_type] operator[=] Other[5] operator[SEP] Keyword[final] Keyword[int] identifier[privilege_type] operator[=] Other[6] operator[SEP] Keyword[final] Keyword[int] identifier[is_grantable] operator[=] Other[7] operator[SEP] identifier[PersistentStore] identifier[store] operator[=] identifier[database] operator[SEP] identifier[persistentStoreCollection] operator[SEP] identifier[getStore] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[Iterator] identifier[objects] operator[=] Keyword[new] identifier[WrapperIterator] operator[SEP] identifier[database] operator[SEP] identifier[schemaManager] operator[SEP] identifier[databaseObjectIterator] operator[SEP] identifier[SchemaObject] operator[SEP] identifier[SEQUENCE] operator[SEP] , identifier[database] operator[SEP] identifier[schemaManager] operator[SEP] identifier[databaseObjectIterator] operator[SEP] identifier[SchemaObject] operator[SEP] identifier[COLLATION] operator[SEP] operator[SEP] operator[SEP] identifier[objects] operator[=] Keyword[new] identifier[WrapperIterator] operator[SEP] identifier[objects] , identifier[database] operator[SEP] identifier[schemaManager] operator[SEP] identifier[databaseObjectIterator] operator[SEP] identifier[SchemaObject] operator[SEP] identifier[CHARSET] operator[SEP] operator[SEP] operator[SEP] identifier[objects] operator[=] Keyword[new] identifier[WrapperIterator] operator[SEP] identifier[objects] , identifier[database] operator[SEP] identifier[schemaManager] operator[SEP] identifier[databaseObjectIterator] operator[SEP] identifier[SchemaObject] operator[SEP] identifier[DOMAIN] operator[SEP] operator[SEP] operator[SEP] identifier[OrderedHashSet] identifier[grantees] operator[=] identifier[session] operator[SEP] identifier[getGrantee] operator[SEP] operator[SEP] operator[SEP] identifier[getGranteeAndAllRolesWithPublic] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[objects] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[SchemaObject] identifier[object] operator[=] operator[SEP] identifier[SchemaObject] operator[SEP] identifier[objects] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[grantees] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Grantee] identifier[granteeObject] operator[=] operator[SEP] identifier[Grantee] operator[SEP] identifier[grantees] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[OrderedHashSet] identifier[rights] operator[=] identifier[granteeObject] operator[SEP] identifier[getAllDirectPrivileges] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[OrderedHashSet] identifier[grants] operator[=] identifier[granteeObject] operator[SEP] identifier[getAllGrantedPrivileges] operator[SEP] identifier[object] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[grants] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[grants] operator[SEP] identifier[addAll] operator[SEP] identifier[rights] operator[SEP] operator[SEP] identifier[rights] operator[=] identifier[grants] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[rights] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[Right] identifier[right] operator[=] operator[SEP] identifier[Right] operator[SEP] identifier[rights] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[Right] identifier[grantableRight] operator[=] identifier[right] operator[SEP] identifier[getGrantableRights] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[=] identifier[t] operator[SEP] identifier[getEmptyRowData] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[grantor] operator[SEP] operator[=] identifier[right] operator[SEP] identifier[getGrantor] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[row] operator[SEP] identifier[grantee] operator[SEP] operator[=] identifier[right] operator[SEP] identifier[getGrantee] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[row] operator[SEP] identifier[object_catalog] operator[SEP] operator[=] identifier[database] operator[SEP] identifier[getCatalogName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[row] operator[SEP] identifier[object_schema] operator[SEP] operator[=] identifier[object] operator[SEP] identifier[getSchemaName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[row] operator[SEP] identifier[object_name] operator[SEP] operator[=] identifier[object] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[row] operator[SEP] identifier[object_type] operator[SEP] operator[=] identifier[SchemaObjectSet] operator[SEP] identifier[getName] operator[SEP] identifier[object] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[privilege_type] operator[SEP] operator[=] identifier[Tokens] operator[SEP] identifier[T_USAGE] operator[SEP] identifier[row] operator[SEP] identifier[is_grantable] operator[SEP] operator[=] identifier[right] operator[SEP] identifier[getGrantee] operator[SEP] operator[SEP] operator[==] identifier[object] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[||] identifier[grantableRight] operator[SEP] identifier[isFull] operator[SEP] operator[SEP] operator[?] identifier[Tokens] operator[SEP] identifier[T_YES] operator[:] identifier[Tokens] operator[SEP] identifier[T_NO] operator[SEP] operator[SEP] Keyword[try] { identifier[t] operator[SEP] identifier[insertSys] operator[SEP] identifier[store] , identifier[row] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[HsqlException] identifier[e] operator[SEP] { } } } } Keyword[return] identifier[t] operator[SEP] }
@Override public GetVaultAccessPolicyResult getVaultAccessPolicy(GetVaultAccessPolicyRequest request) { request = beforeClientExecution(request); return executeGetVaultAccessPolicy(request); }
class class_name[name] begin[{] method[getVaultAccessPolicy, return_type[type[GetVaultAccessPolicyResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetVaultAccessPolicy, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetVaultAccessPolicyResult] identifier[getVaultAccessPolicy] operator[SEP] identifier[GetVaultAccessPolicyRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetVaultAccessPolicy] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public char charAt(int pos) { int startChunk = pos >>> m_chunkBits; if (startChunk == 0 && m_innerFSB != null) return m_innerFSB.charAt(pos & m_chunkMask); else return m_array[startChunk][pos & m_chunkMask]; }
class class_name[name] begin[{] method[charAt, return_type[type[char]], modifier[public], parameter[pos]] begin[{] local_variable[type[int], startChunk] if[binary_operation[binary_operation[member[.startChunk], ==, literal[0]], &&, binary_operation[member[.m_innerFSB], !=, literal[null]]]] begin[{] return[call[m_innerFSB.charAt, parameter[binary_operation[member[.pos], &, member[.m_chunkMask]]]]] else begin[{] return[member[.m_array]] end[}] end[}] END[}]
Keyword[public] Keyword[char] identifier[charAt] operator[SEP] Keyword[int] identifier[pos] operator[SEP] { Keyword[int] identifier[startChunk] operator[=] identifier[pos] operator[>] operator[>] operator[>] identifier[m_chunkBits] operator[SEP] Keyword[if] operator[SEP] identifier[startChunk] operator[==] Other[0] operator[&&] identifier[m_innerFSB] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[m_innerFSB] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[&] identifier[m_chunkMask] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[m_array] operator[SEP] identifier[startChunk] operator[SEP] operator[SEP] identifier[pos] operator[&] identifier[m_chunkMask] operator[SEP] operator[SEP] }
@Override public Positions merge(Positions other) { if (other instanceof SinglePosition) { SinglePosition that = (SinglePosition) other; return builder().addSinglePosition(that).build(); } else if (other instanceof LinearPositions) { LinearPositions that = (LinearPositions) other; return AreaPositions.builder().addLinearPosition(this).addLinearPosition(that).build(); } else { return other.merge(this); } }
class class_name[name] begin[{] method[merge, return_type[type[Positions]], modifier[public], parameter[other]] begin[{] if[binary_operation[member[.other], instanceof, type[SinglePosition]]] begin[{] local_variable[type[SinglePosition], that] return[call[.builder, parameter[]]] else begin[{] if[binary_operation[member[.other], instanceof, type[LinearPositions]]] begin[{] local_variable[type[LinearPositions], that] return[call[AreaPositions.builder, parameter[]]] else begin[{] return[call[other.merge, parameter[THIS[]]]] end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Positions] identifier[merge] operator[SEP] identifier[Positions] identifier[other] operator[SEP] { Keyword[if] operator[SEP] identifier[other] Keyword[instanceof] identifier[SinglePosition] operator[SEP] { identifier[SinglePosition] identifier[that] operator[=] operator[SEP] identifier[SinglePosition] operator[SEP] identifier[other] operator[SEP] Keyword[return] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[addSinglePosition] operator[SEP] identifier[that] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[other] Keyword[instanceof] identifier[LinearPositions] operator[SEP] { identifier[LinearPositions] identifier[that] operator[=] operator[SEP] identifier[LinearPositions] operator[SEP] identifier[other] operator[SEP] Keyword[return] identifier[AreaPositions] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[addLinearPosition] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[addLinearPosition] operator[SEP] identifier[that] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[other] operator[SEP] identifier[merge] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public <T extends XPathBuilder> T setTemplate(final String key, final String value) { if (value == null) { templates.remove(key); } else { templates.put(key, value); } return (T) this; }
class class_name[name] begin[{] method[setTemplate, return_type[type[T]], modifier[public], parameter[key, value]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] call[templates.remove, parameter[member[.key]]] else begin[{] call[templates.put, parameter[member[.key], member[.value]]] end[}] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[XPathBuilder] operator[>] identifier[T] identifier[setTemplate] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[String] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { identifier[templates] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[else] { identifier[templates] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[T] operator[SEP] Keyword[this] operator[SEP] }
public List<MailSessionType<WebAppType<T>>> getAllMailSession() { List<MailSessionType<WebAppType<T>>> list = new ArrayList<MailSessionType<WebAppType<T>>>(); List<Node> nodeList = childNode.get("mail-session"); for(Node node: nodeList) { MailSessionType<WebAppType<T>> type = new MailSessionTypeImpl<WebAppType<T>>(this, "mail-session", childNode, node); list.add(type); } return list; }
class class_name[name] begin[{] method[getAllMailSession, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], list] local_variable[type[List], nodeList] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="mail-session"), MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=WebAppType, sub_type=None))], dimensions=None, name=MailSessionTypeImpl, sub_type=None)), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=WebAppType, sub_type=None))], dimensions=[], name=MailSessionType, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nodeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) return[member[.list]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[MailSessionType] operator[<] identifier[WebAppType] operator[<] identifier[T] operator[>] operator[>] operator[>] identifier[getAllMailSession] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[MailSessionType] operator[<] identifier[WebAppType] operator[<] identifier[T] operator[>] operator[>] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[MailSessionType] operator[<] identifier[WebAppType] operator[<] identifier[T] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[childNode] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[nodeList] operator[SEP] { identifier[MailSessionType] operator[<] identifier[WebAppType] operator[<] identifier[T] operator[>] operator[>] identifier[type] operator[=] Keyword[new] identifier[MailSessionTypeImpl] operator[<] identifier[WebAppType] operator[<] identifier[T] operator[>] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[childNode] , identifier[node] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[type] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }
public void setAttributeValue(final AttributeValue attributeValue) { deviceAttribute_3 = new DeviceAttribute_3(attributeValue); use_union = false; attributeValue_5.name = attributeValue.name; attributeValue_5.quality = attributeValue.quality; attributeValue_5.data_format = AttrDataFormat.FMT_UNKNOWN; attributeValue_5.time = attributeValue.time; attributeValue_5.r_dim = new AttributeDim(); attributeValue_5.w_dim = new AttributeDim(); attributeValue_5.r_dim.dim_x = attributeValue.dim_x; attributeValue_5.r_dim.dim_y = attributeValue.dim_y; attributeValue_5.w_dim.dim_x = 0; attributeValue_5.w_dim.dim_y = 0; attributeValue_5.err_list = null; }
class class_name[name] begin[{] method[setAttributeValue, return_type[void], modifier[public], parameter[attributeValue]] begin[{] assign[member[.deviceAttribute_3], ClassCreator(arguments=[MemberReference(member=attributeValue, 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=DeviceAttribute_3, sub_type=None))] assign[member[.use_union], literal[false]] assign[member[attributeValue_5.name], member[attributeValue.name]] assign[member[attributeValue_5.quality], member[attributeValue.quality]] assign[member[attributeValue_5.data_format], member[AttrDataFormat.FMT_UNKNOWN]] assign[member[attributeValue_5.time], member[attributeValue.time]] assign[member[attributeValue_5.r_dim], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttributeDim, sub_type=None))] assign[member[attributeValue_5.w_dim], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttributeDim, sub_type=None))] assign[member[attributeValue_5.r_dim.dim_x], member[attributeValue.dim_x]] assign[member[attributeValue_5.r_dim.dim_y], member[attributeValue.dim_y]] assign[member[attributeValue_5.w_dim.dim_x], literal[0]] assign[member[attributeValue_5.w_dim.dim_y], literal[0]] assign[member[attributeValue_5.err_list], literal[null]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAttributeValue] operator[SEP] Keyword[final] identifier[AttributeValue] identifier[attributeValue] operator[SEP] { identifier[deviceAttribute_3] operator[=] Keyword[new] identifier[DeviceAttribute_3] operator[SEP] identifier[attributeValue] operator[SEP] operator[SEP] identifier[use_union] operator[=] literal[boolean] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[name] operator[=] identifier[attributeValue] operator[SEP] identifier[name] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[quality] operator[=] identifier[attributeValue] operator[SEP] identifier[quality] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[data_format] operator[=] identifier[AttrDataFormat] operator[SEP] identifier[FMT_UNKNOWN] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[time] operator[=] identifier[attributeValue] operator[SEP] identifier[time] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[r_dim] operator[=] Keyword[new] identifier[AttributeDim] operator[SEP] operator[SEP] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[w_dim] operator[=] Keyword[new] identifier[AttributeDim] operator[SEP] operator[SEP] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[r_dim] operator[SEP] identifier[dim_x] operator[=] identifier[attributeValue] operator[SEP] identifier[dim_x] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[r_dim] operator[SEP] identifier[dim_y] operator[=] identifier[attributeValue] operator[SEP] identifier[dim_y] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[w_dim] operator[SEP] identifier[dim_x] operator[=] Other[0] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[w_dim] operator[SEP] identifier[dim_y] operator[=] Other[0] operator[SEP] identifier[attributeValue_5] operator[SEP] identifier[err_list] operator[=] Other[null] operator[SEP] }
public RateLimit getRateLimit() throws OAuthSystemException, OAuthProblemException { cleanError(); prepareToken(); OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient(); OAuthClient oAuthClient = new OAuthClient(httpClient); OAuthClientRequest bearerRequest = new OAuthBearerClientRequest(settings.getURL(Constants.GET_RATE_URL)) //.setAccessToken(accessToken) // 'Authorization' => 'Bearer xxxx' not accepted right now .buildHeaderMessage(); Map<String, String> headers = getAuthorizedHeader(); bearerRequest.setHeaders(headers); OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient.resource(bearerRequest, OAuth.HttpMethod.GET, OneloginOAuthJSONResourceResponse.class); RateLimit ratelimit = null; if (oAuthResponse.getResponseCode() == 200) { JSONObject data = oAuthResponse.getData(); if (data != null) { ratelimit = new RateLimit(data); } } else { error = oAuthResponse.getError(); errorDescription = oAuthResponse.getErrorDescription(); } return ratelimit; }
class class_name[name] begin[{] method[getRateLimit, return_type[type[RateLimit]], modifier[public], parameter[]] begin[{] call[.cleanError, parameter[]] call[.prepareToken, parameter[]] local_variable[type[OneloginURLConnectionClient], httpClient] local_variable[type[OAuthClient], oAuthClient] local_variable[type[OAuthClientRequest], bearerRequest] local_variable[type[Map], headers] call[bearerRequest.setHeaders, parameter[member[.headers]]] local_variable[type[OneloginOAuthJSONResourceResponse], oAuthResponse] local_variable[type[RateLimit], ratelimit] if[binary_operation[call[oAuthResponse.getResponseCode, parameter[]], ==, literal[200]]] begin[{] local_variable[type[JSONObject], data] if[binary_operation[member[.data], !=, literal[null]]] begin[{] assign[member[.ratelimit], ClassCreator(arguments=[MemberReference(member=data, 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=RateLimit, sub_type=None))] else begin[{] None end[}] else begin[{] assign[member[.error], call[oAuthResponse.getError, parameter[]]] assign[member[.errorDescription], call[oAuthResponse.getErrorDescription, parameter[]]] end[}] return[member[.ratelimit]] end[}] END[}]
Keyword[public] identifier[RateLimit] identifier[getRateLimit] operator[SEP] operator[SEP] Keyword[throws] identifier[OAuthSystemException] , identifier[OAuthProblemException] { identifier[cleanError] operator[SEP] operator[SEP] operator[SEP] identifier[prepareToken] operator[SEP] operator[SEP] operator[SEP] identifier[OneloginURLConnectionClient] identifier[httpClient] operator[=] Keyword[new] identifier[OneloginURLConnectionClient] operator[SEP] operator[SEP] operator[SEP] identifier[OAuthClient] identifier[oAuthClient] operator[=] Keyword[new] identifier[OAuthClient] operator[SEP] identifier[httpClient] operator[SEP] operator[SEP] identifier[OAuthClientRequest] identifier[bearerRequest] operator[=] Keyword[new] identifier[OAuthBearerClientRequest] operator[SEP] identifier[settings] operator[SEP] identifier[getURL] operator[SEP] identifier[Constants] operator[SEP] identifier[GET_RATE_URL] operator[SEP] operator[SEP] operator[SEP] identifier[buildHeaderMessage] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] operator[=] identifier[getAuthorizedHeader] operator[SEP] operator[SEP] operator[SEP] identifier[bearerRequest] operator[SEP] identifier[setHeaders] operator[SEP] identifier[headers] operator[SEP] operator[SEP] identifier[OneloginOAuthJSONResourceResponse] identifier[oAuthResponse] operator[=] identifier[oAuthClient] operator[SEP] identifier[resource] operator[SEP] identifier[bearerRequest] , identifier[OAuth] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[GET] , identifier[OneloginOAuthJSONResourceResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[RateLimit] identifier[ratelimit] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[oAuthResponse] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[==] Other[200] operator[SEP] { identifier[JSONObject] identifier[data] operator[=] identifier[oAuthResponse] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[!=] Other[null] operator[SEP] { identifier[ratelimit] operator[=] Keyword[new] identifier[RateLimit] operator[SEP] identifier[data] operator[SEP] operator[SEP] } } Keyword[else] { identifier[error] operator[=] identifier[oAuthResponse] operator[SEP] identifier[getError] operator[SEP] operator[SEP] operator[SEP] identifier[errorDescription] operator[=] identifier[oAuthResponse] operator[SEP] identifier[getErrorDescription] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ratelimit] operator[SEP] }
public List<O> getItems(int count, int offset) { return getDatastore().find(clazz).offset(offset).limit(count).asList(); }
class class_name[name] begin[{] method[getItems, return_type[type[List]], modifier[public], parameter[count, offset]] begin[{] return[call[.getDatastore, parameter[]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[O] operator[>] identifier[getItems] operator[SEP] Keyword[int] identifier[count] , Keyword[int] identifier[offset] operator[SEP] { Keyword[return] identifier[getDatastore] operator[SEP] operator[SEP] operator[SEP] identifier[find] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[offset] operator[SEP] identifier[offset] operator[SEP] operator[SEP] identifier[limit] operator[SEP] identifier[count] operator[SEP] operator[SEP] identifier[asList] operator[SEP] operator[SEP] operator[SEP] }
public static <T> T[] toArray(Class<T> componentType, Collection<T> collection) { T[] array = (T[]) Array.newInstance(componentType, collection.size()); if (componentType.isAssignableFrom(Typ.getComponentType(collection))) { return collection.toArray(array); } else { int index = 0; for (Object o : collection) { array[index] = Conversions.coerce(componentType, o); index++; } return array; } }
class class_name[name] begin[{] method[toArray, return_type[type[T]], modifier[public static], parameter[componentType, collection]] begin[{] local_variable[type[T], array] if[call[componentType.isAssignableFrom, parameter[call[Typ.getComponentType, parameter[member[.collection]]]]]] begin[{] return[call[collection.toArray, parameter[member[.array]]]] else begin[{] local_variable[type[int], index] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=componentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=coerce, postfix_operators=[], prefix_operators=[], qualifier=Conversions, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=collection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.array]] end[}] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[componentType] , identifier[Collection] operator[<] identifier[T] operator[>] identifier[collection] operator[SEP] { identifier[T] operator[SEP] operator[SEP] identifier[array] operator[=] operator[SEP] identifier[T] operator[SEP] operator[SEP] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[componentType] , identifier[collection] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Typ] operator[SEP] identifier[getComponentType] operator[SEP] identifier[collection] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[collection] operator[SEP] identifier[toArray] operator[SEP] identifier[array] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[o] operator[:] identifier[collection] operator[SEP] { identifier[array] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[Conversions] operator[SEP] identifier[coerce] operator[SEP] identifier[componentType] , identifier[o] operator[SEP] operator[SEP] identifier[index] operator[++] operator[SEP] } Keyword[return] identifier[array] operator[SEP] } }
public synchronized void dumpStorage(final PrintStream out) { if (!validState) { throw new InvalidStateException(); } try { final StringBuilder sb = new StringBuilder(4096); sb.append("#").append("ID").append("\t").append("Node").append("\n"); for (int i = 1; i < storageBlock; i++) { final Node<K, V> node = getNode(i); sb.append(i).append((rootIdx == i) ? "R\t" : "\t").append(node).append("\n"); if ((i % 1000) == 0) { out.print(sb.toString()); sb.setLength(0); } } if (sb.length() > 0) { out.print(sb.toString()); sb.setLength(0); } } finally { releaseNodes(); } }
class class_name[name] begin[{] method[dumpStorage, return_type[void], modifier[synchronized public], parameter[out]] begin[{] if[member[.validState]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidStateException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ID")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Node")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=node)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Node, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=rootIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="R\t"))], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setLength, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=storageBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(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=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setLength, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=releaseNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[dumpStorage] operator[SEP] Keyword[final] identifier[PrintStream] identifier[out] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[validState] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidStateException] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[4096] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[storageBlock] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[Node] operator[<] identifier[K] , identifier[V] operator[>] identifier[node] operator[=] identifier[getNode] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[rootIdx] operator[==] identifier[i] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[%] Other[1000] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[releaseNodes] operator[SEP] operator[SEP] operator[SEP] } }
public void setAttempts(java.util.Collection<AttemptDetail> attempts) { if (attempts == null) { this.attempts = null; return; } this.attempts = new java.util.ArrayList<AttemptDetail>(attempts); }
class class_name[name] begin[{] method[setAttempts, return_type[void], modifier[public], parameter[attempts]] begin[{] if[binary_operation[member[.attempts], ==, literal[null]]] begin[{] assign[THIS[member[None.attempts]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.attempts]], ClassCreator(arguments=[MemberReference(member=attempts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AttemptDetail, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAttempts] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[AttemptDetail] operator[>] identifier[attempts] operator[SEP] { Keyword[if] operator[SEP] identifier[attempts] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[attempts] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[attempts] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[AttemptDetail] operator[>] operator[SEP] identifier[attempts] operator[SEP] operator[SEP] }
public List<CmsFormatterChangeSet> getFormatterChangeSets() { CmsADEConfigData currentConfig = this; List<CmsFormatterChangeSet> result = Lists.newArrayList(); while (currentConfig != null) { CmsFormatterChangeSet changes = currentConfig.getOwnFormatterChangeSet(); if (changes != null) { result.add(changes); } currentConfig = currentConfig.parent(); } Collections.reverse(result); return result; }
class class_name[name] begin[{] method[getFormatterChangeSets, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[CmsADEConfigData], currentConfig] local_variable[type[List], result] while[binary_operation[member[.currentConfig], !=, literal[null]]] begin[{] local_variable[type[CmsFormatterChangeSet], changes] if[binary_operation[member[.changes], !=, literal[null]]] begin[{] call[result.add, parameter[member[.changes]]] else begin[{] None end[}] assign[member[.currentConfig], call[currentConfig.parent, parameter[]]] end[}] call[Collections.reverse, parameter[member[.result]]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CmsFormatterChangeSet] operator[>] identifier[getFormatterChangeSets] operator[SEP] operator[SEP] { identifier[CmsADEConfigData] identifier[currentConfig] operator[=] Keyword[this] operator[SEP] identifier[List] operator[<] identifier[CmsFormatterChangeSet] operator[>] identifier[result] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[currentConfig] operator[!=] Other[null] operator[SEP] { identifier[CmsFormatterChangeSet] identifier[changes] operator[=] identifier[currentConfig] operator[SEP] identifier[getOwnFormatterChangeSet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[changes] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[changes] operator[SEP] operator[SEP] } identifier[currentConfig] operator[=] identifier[currentConfig] operator[SEP] identifier[parent] operator[SEP] operator[SEP] operator[SEP] } identifier[Collections] operator[SEP] identifier[reverse] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static void main(String[] args) throws IOException { Profiles p = Profiles.read(new File(args[0])); if (args.length >= 2) { Map<Integer,Set<String>> lists = new TreeMap<Integer,Set<String>>(); for (int i = 1; i <= 4; i++) lists.put(i, new TreeSet<String>()); File rt_jar_lst = new File(args[1]); for (String line: Files.readAllLines(rt_jar_lst.toPath(), Charset.defaultCharset())) { if (line.endsWith(".class")) { String type = line.substring(0, line.length() - 6); int profile = p.getProfile(type); for (int i = profile; i <= 4; i++) lists.get(i).add(type); } } for (int i = 1; i <= 4; i++) { BufferedWriter out = new BufferedWriter(new FileWriter(i + ".txt")); try { for (String type: lists.get(i)) { out.write(type); out.newLine(); } } finally { out.close(); } } } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] local_variable[type[Profiles], p] if[binary_operation[member[args.length], >=, literal[2]]] begin[{] local_variable[type[Map], lists] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=TreeSet, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=lists, selectors=[], type_arguments=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=4), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[File], rt_jar_lst] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".class")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProfile, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), name=profile)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=lists, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=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=4), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=profile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toPath, postfix_operators=[], prefix_operators=[], qualifier=rt_jar_lst, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=defaultCharset, postfix_operators=[], prefix_operators=[], qualifier=Charset, selectors=[], type_arguments=None)], member=readAllLines, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".txt"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedWriter, sub_type=None)), name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None)), TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=newLine, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=lists, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], label=None, resources=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=4), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Profiles] identifier[p] operator[=] identifier[Profiles] operator[SEP] identifier[read] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[>=] Other[2] operator[SEP] { identifier[Map] operator[<] identifier[Integer] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[lists] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[Integer] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] Other[4] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[lists] operator[SEP] identifier[put] operator[SEP] identifier[i] , Keyword[new] identifier[TreeSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[rt_jar_lst] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[args] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[line] operator[:] identifier[Files] operator[SEP] identifier[readAllLines] operator[SEP] identifier[rt_jar_lst] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] , identifier[Charset] operator[SEP] identifier[defaultCharset] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[type] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[6] operator[SEP] operator[SEP] Keyword[int] identifier[profile] operator[=] identifier[p] operator[SEP] identifier[getProfile] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[profile] operator[SEP] identifier[i] operator[<=] Other[4] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[lists] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[type] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] Other[4] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[BufferedWriter] identifier[out] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[FileWriter] operator[SEP] identifier[i] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[String] identifier[type] operator[:] identifier[lists] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[newLine] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } } }
@Override public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ignoreIfExists) throws TableAlreadyExistException, DatabaseNotExistException { checkNotNull(tablePath); checkNotNull(table); if (!databaseExists(tablePath.getDatabaseName())) { throw new DatabaseNotExistException(catalogName, tablePath.getDatabaseName()); } if (tableExists(tablePath)) { if (!ignoreIfExists) { throw new TableAlreadyExistException(catalogName, tablePath); } } else { tables.put(tablePath, table.copy()); if ((table instanceof CatalogTable) && ((CatalogTable) table).isPartitioned()) { partitions.put(tablePath, new LinkedHashMap<>()); } } }
class class_name[name] begin[{] method[createTable, return_type[void], modifier[public], parameter[tablePath, table, ignoreIfExists]] begin[{] call[.checkNotNull, parameter[member[.tablePath]]] call[.checkNotNull, parameter[member[.table]]] if[call[.databaseExists, parameter[call[tablePath.getDatabaseName, parameter[]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=catalogName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDatabaseName, postfix_operators=[], prefix_operators=[], qualifier=tablePath, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseNotExistException, sub_type=None)), label=None) else begin[{] None end[}] if[call[.tableExists, parameter[member[.tablePath]]]] begin[{] if[member[.ignoreIfExists]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=catalogName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tablePath, 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=TableAlreadyExistException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] call[tables.put, parameter[member[.tablePath], call[table.copy, parameter[]]]] if[binary_operation[binary_operation[member[.table], instanceof, type[CatalogTable]], &&, Cast(expression=MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CatalogTable, sub_type=None))]] begin[{] call[partitions.put, parameter[member[.tablePath], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashMap, sub_type=None))]] else begin[{] None end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[createTable] operator[SEP] identifier[ObjectPath] identifier[tablePath] , identifier[CatalogBaseTable] identifier[table] , Keyword[boolean] identifier[ignoreIfExists] operator[SEP] Keyword[throws] identifier[TableAlreadyExistException] , identifier[DatabaseNotExistException] { identifier[checkNotNull] operator[SEP] identifier[tablePath] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[table] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[databaseExists] operator[SEP] identifier[tablePath] operator[SEP] identifier[getDatabaseName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[DatabaseNotExistException] operator[SEP] identifier[catalogName] , identifier[tablePath] operator[SEP] identifier[getDatabaseName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tableExists] operator[SEP] identifier[tablePath] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[ignoreIfExists] operator[SEP] { Keyword[throw] Keyword[new] identifier[TableAlreadyExistException] operator[SEP] identifier[catalogName] , identifier[tablePath] operator[SEP] operator[SEP] } } Keyword[else] { identifier[tables] operator[SEP] identifier[put] operator[SEP] identifier[tablePath] , identifier[table] operator[SEP] identifier[copy] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[table] Keyword[instanceof] identifier[CatalogTable] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[CatalogTable] operator[SEP] identifier[table] operator[SEP] operator[SEP] identifier[isPartitioned] operator[SEP] operator[SEP] operator[SEP] { identifier[partitions] operator[SEP] identifier[put] operator[SEP] identifier[tablePath] , Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
@Override public boolean isSelected(final Comparable<E> value, final boolean caseSensitive) { if (pattern == null) if (caseSensitive) this.pattern = Pattern.compile(patternParm); else this.pattern = Pattern.compile(patternParm, Pattern.CASE_INSENSITIVE); final Matcher m = pattern.matcher(value.toString()); return m.matches(); }
class class_name[name] begin[{] method[isSelected, return_type[type[boolean]], modifier[public], parameter[value, caseSensitive]] begin[{] if[binary_operation[member[.pattern], ==, literal[null]]] begin[{] if[member[.caseSensitive]] begin[{] assign[THIS[member[None.pattern]], call[Pattern.compile, parameter[member[.patternParm]]]] else begin[{] assign[THIS[member[None.pattern]], call[Pattern.compile, parameter[member[.patternParm], member[Pattern.CASE_INSENSITIVE]]]] end[}] else begin[{] None end[}] local_variable[type[Matcher], m] return[call[m.matches, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isSelected] operator[SEP] Keyword[final] identifier[Comparable] operator[<] identifier[E] operator[>] identifier[value] , Keyword[final] Keyword[boolean] identifier[caseSensitive] operator[SEP] { Keyword[if] operator[SEP] identifier[pattern] operator[==] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[caseSensitive] operator[SEP] Keyword[this] operator[SEP] identifier[pattern] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[patternParm] operator[SEP] operator[SEP] Keyword[else] Keyword[this] operator[SEP] identifier[pattern] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[patternParm] , identifier[Pattern] operator[SEP] identifier[CASE_INSENSITIVE] operator[SEP] operator[SEP] Keyword[final] identifier[Matcher] identifier[m] operator[=] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[m] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] }
public Class< ? > loadClass(final String name, final boolean resolve) throws ClassNotFoundException { Class cls = loader.get().load( this, name, resolve ); if ( cls == null ) { throw new ClassNotFoundException( "Unable to load class: " + name ); } return cls; }
class class_name[name] begin[{] method[loadClass, return_type[type[Class]], modifier[public], parameter[name, resolve]] begin[{] local_variable[type[Class], cls] if[binary_operation[member[.cls], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to load class: "), operandr=MemberReference(member=name, 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=ClassNotFoundException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.cls]] end[}] END[}]
Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[loadClass] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] Keyword[boolean] identifier[resolve] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] { identifier[Class] identifier[cls] operator[=] identifier[loader] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[load] operator[SEP] Keyword[this] , identifier[name] , identifier[resolve] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cls] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ClassNotFoundException] operator[SEP] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] } Keyword[return] identifier[cls] operator[SEP] }
public final <R> Ix<R> publish(IxFunction<? super Ix<T>, ? extends Iterable<? extends R>> transform) { return new IxPublishSelector<T, R>(this, nullCheck(transform, "transform is null")); }
class class_name[name] begin[{] method[publish, 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=IxPublishSelector, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] operator[<] identifier[R] operator[>] identifier[Ix] operator[<] identifier[R] operator[>] identifier[publish] 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[IxPublishSelector] operator[<] identifier[T] , identifier[R] operator[>] operator[SEP] Keyword[this] , identifier[nullCheck] operator[SEP] identifier[transform] , literal[String] operator[SEP] operator[SEP] operator[SEP] }
public void sendToDirect(String topicURI, Object event, String webSocketSessionId) { Assert.notNull(webSocketSessionId, "WebSocket session id must not be null"); sendToDirect(topicURI, event, Collections.singleton(webSocketSessionId)); }
class class_name[name] begin[{] method[sendToDirect, return_type[void], modifier[public], parameter[topicURI, event, webSocketSessionId]] begin[{] call[Assert.notNull, parameter[member[.webSocketSessionId], literal["WebSocket session id must not be null"]]] call[.sendToDirect, parameter[member[.topicURI], member[.event], call[Collections.singleton, parameter[member[.webSocketSessionId]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[sendToDirect] operator[SEP] identifier[String] identifier[topicURI] , identifier[Object] identifier[event] , identifier[String] identifier[webSocketSessionId] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[webSocketSessionId] , literal[String] operator[SEP] operator[SEP] identifier[sendToDirect] operator[SEP] identifier[topicURI] , identifier[event] , identifier[Collections] operator[SEP] identifier[singleton] operator[SEP] identifier[webSocketSessionId] operator[SEP] operator[SEP] operator[SEP] }
public WorkerPoolResourceInner beginCreateOrUpdateMultiRolePool(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { return beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginCreateOrUpdateMultiRolePool, return_type[type[WorkerPoolResourceInner]], modifier[public], parameter[resourceGroupName, name, multiRolePoolEnvelope]] begin[{] return[call[.beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.name], member[.multiRolePoolEnvelope]]]] end[}] END[}]
Keyword[public] identifier[WorkerPoolResourceInner] identifier[beginCreateOrUpdateMultiRolePool] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[name] , identifier[WorkerPoolResourceInner] identifier[multiRolePoolEnvelope] operator[SEP] { Keyword[return] identifier[beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[name] , identifier[multiRolePoolEnvelope] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public ServiceFuture<KeyOperationResult> signAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) { KeyIdentifier id = new KeyIdentifier(keyIdentifier); return signAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), algorithm, value, serviceCallback); }
class class_name[name] begin[{] method[signAsync, return_type[type[ServiceFuture]], modifier[public], parameter[keyIdentifier, algorithm, value, serviceCallback]] begin[{] local_variable[type[KeyIdentifier], id] return[call[.signAsync, parameter[call[id.vault, parameter[]], call[id.name, parameter[]], TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=version, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=version, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")), member[.algorithm], member[.value], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[KeyOperationResult] operator[>] identifier[signAsync] operator[SEP] identifier[String] identifier[keyIdentifier] , identifier[JsonWebKeySignatureAlgorithm] identifier[algorithm] , Keyword[byte] operator[SEP] operator[SEP] identifier[value] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[KeyOperationResult] operator[>] identifier[serviceCallback] operator[SEP] { identifier[KeyIdentifier] identifier[id] operator[=] Keyword[new] identifier[KeyIdentifier] operator[SEP] identifier[keyIdentifier] operator[SEP] operator[SEP] Keyword[return] identifier[signAsync] operator[SEP] identifier[id] operator[SEP] identifier[vault] operator[SEP] operator[SEP] , identifier[id] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[id] operator[SEP] identifier[version] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[id] operator[SEP] identifier[version] operator[SEP] operator[SEP] , identifier[algorithm] , identifier[value] , identifier[serviceCallback] operator[SEP] operator[SEP] }
void removeTopicSpaceReference( SIBUuid8 neighbourUuid, MESubscription subscription, SIBUuid12 topicSpace, String topic) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "removeTopicSpaceReference", new Object[] { neighbourUuid, subscription, topicSpace, topic }); // Synchronize around the topic space references to stop removal and // additions occuring at the same time. synchronized (_topicSpaces) { // From the list of topic spaces, get the HashMap that contains the // list of topicSpaces to topics. final TemporarySubscription sub = (TemporarySubscription) _topicSpaces.get(topicSpace); if (sub == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug( tc, "TemporarySubscription not found"); } else { // Remove a topic to the list of topics on this topic space for this ME if (sub.removeTopic(neighbourUuid, subscription)) // If the topicSpace is empty of topics, then remove the topicSpace from // list of topic spaces. _topicSpaces.remove(topicSpace); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "removeTopicSpaceReference"); }
class class_name[name] begin[{] method[removeTopicSpaceReference, return_type[void], modifier[default], parameter[neighbourUuid, subscription, topicSpace, topic]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["removeTopicSpaceReference"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=neighbourUuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subscription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topicSpace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] SYNCHRONIZED[member[._topicSpaces]] BEGIN[{] local_variable[type[TemporarySubscription], sub] if[binary_operation[member[.sub], ==, literal[null]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[SibTr.debug, parameter[member[.tc], literal["TemporarySubscription not found"]]] else begin[{] None end[}] else begin[{] if[call[sub.removeTopic, parameter[member[.neighbourUuid], member[.subscription]]]] begin[{] call[_topicSpaces.remove, parameter[member[.topicSpace]]] else begin[{] None end[}] end[}] END[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["removeTopicSpaceReference"]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[removeTopicSpaceReference] operator[SEP] identifier[SIBUuid8] identifier[neighbourUuid] , identifier[MESubscription] identifier[subscription] , identifier[SIBUuid12] identifier[topicSpace] , identifier[String] identifier[topic] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[neighbourUuid] , identifier[subscription] , identifier[topicSpace] , identifier[topic] } operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_topicSpaces] operator[SEP] { Keyword[final] identifier[TemporarySubscription] identifier[sub] operator[=] operator[SEP] identifier[TemporarySubscription] operator[SEP] identifier[_topicSpaces] operator[SEP] identifier[get] operator[SEP] identifier[topicSpace] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sub] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[sub] operator[SEP] identifier[removeTopic] operator[SEP] identifier[neighbourUuid] , identifier[subscription] operator[SEP] operator[SEP] identifier[_topicSpaces] operator[SEP] identifier[remove] operator[SEP] identifier[topicSpace] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public static MembersView createNew(int version, Collection<MemberImpl> members) { List<MemberInfo> list = new ArrayList<>(members.size()); for (MemberImpl member : members) { list.add(new MemberInfo(member)); } return new MembersView(version, unmodifiableList(list)); }
class class_name[name] begin[{] method[createNew, return_type[type[MembersView]], modifier[public static], parameter[version, members]] begin[{] local_variable[type[List], list] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=member, 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=MemberInfo, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=members, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=member)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MemberImpl, sub_type=None))), label=None) return[ClassCreator(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MembersView, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[MembersView] identifier[createNew] operator[SEP] Keyword[int] identifier[version] , identifier[Collection] operator[<] identifier[MemberImpl] operator[>] identifier[members] operator[SEP] { identifier[List] operator[<] identifier[MemberInfo] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[members] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MemberImpl] identifier[member] operator[:] identifier[members] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MemberInfo] operator[SEP] identifier[member] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[MembersView] operator[SEP] identifier[version] , identifier[unmodifiableList] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] }
public synchronized ServerStatusMessage[] getMessages(ServerStatusMessage afterMessage) throws Exception { boolean sawAfterMessage; String afterMessageString = null; if (afterMessage == null) { sawAfterMessage = true; } else { sawAfterMessage = false; afterMessageString = afterMessage.toString(); } FileInputStream in = null; try { in = new FileInputStream(_file); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); List<ServerStatusMessage> messages = new ArrayList<ServerStatusMessage>(); ServerStatusMessage message = getNextMessage(reader); while (message != null) { if (!sawAfterMessage) { if (message.toString().equals(afterMessageString)) { sawAfterMessage = true; } } else { messages.add(message); } message = getNextMessage(reader); } return messages.toArray(STATUS_MSG_ARRAY_TYPE); } catch (IOException ioe) { throw new Exception("Error opening server status file for reading: " + _file.getPath(), ioe); } finally { if (in != null) { try { in.close(); } catch (Exception e) { } } } }
class class_name[name] begin[{] method[getMessages, return_type[type[ServerStatusMessage]], modifier[synchronized public], parameter[afterMessage]] begin[{] local_variable[type[boolean], sawAfterMessage] local_variable[type[String], afterMessageString] if[binary_operation[member[.afterMessage], ==, literal[null]]] begin[{] assign[member[.sawAfterMessage], literal[true]] else begin[{] assign[member[.sawAfterMessage], literal[false]] assign[member[.afterMessageString], call[afterMessage.toString, parameter[]]] end[}] local_variable[type[FileInputStream], in] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, 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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), name=reader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServerStatusMessage, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=messages)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServerStatusMessage, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNextMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServerStatusMessage, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=sawAfterMessage, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[MethodInvocation(arguments=[MemberReference(member=afterMessageString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sawAfterMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNextMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=STATUS_MSG_ARRAY_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error opening server status file for reading: "), operandr=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=_file, selectors=[], type_arguments=None), operator=+), MemberReference(member=ioe, 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=Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[ServerStatusMessage] operator[SEP] operator[SEP] identifier[getMessages] operator[SEP] identifier[ServerStatusMessage] identifier[afterMessage] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[boolean] identifier[sawAfterMessage] operator[SEP] identifier[String] identifier[afterMessageString] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[afterMessage] operator[==] Other[null] operator[SEP] { identifier[sawAfterMessage] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[sawAfterMessage] operator[=] literal[boolean] operator[SEP] identifier[afterMessageString] operator[=] identifier[afterMessage] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[FileInputStream] identifier[in] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[in] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[_file] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[in] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ServerStatusMessage] operator[>] identifier[messages] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ServerStatusMessage] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ServerStatusMessage] identifier[message] operator[=] identifier[getNextMessage] operator[SEP] identifier[reader] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[message] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[sawAfterMessage] operator[SEP] { Keyword[if] operator[SEP] identifier[message] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[afterMessageString] operator[SEP] operator[SEP] { identifier[sawAfterMessage] operator[=] literal[boolean] operator[SEP] } } Keyword[else] { identifier[messages] operator[SEP] identifier[add] operator[SEP] identifier[message] operator[SEP] operator[SEP] } identifier[message] operator[=] identifier[getNextMessage] operator[SEP] identifier[reader] operator[SEP] operator[SEP] } Keyword[return] identifier[messages] operator[SEP] identifier[toArray] operator[SEP] identifier[STATUS_MSG_ARRAY_TYPE] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[_file] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[ioe] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[in] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } } } }
public <E> void reuseClassAnalysis(Class<E> analysisClass, Map<ClassDescriptor, Object> map) { Map<ClassDescriptor, Object> myMap = classAnalysisMap.get(analysisClass); if (myMap != null) { myMap.putAll(map); } else { myMap = createMap(classAnalysisEngineMap, analysisClass); myMap.putAll(map); classAnalysisMap.put(analysisClass, myMap); } }
class class_name[name] begin[{] method[reuseClassAnalysis, return_type[void], modifier[public], parameter[analysisClass, map]] begin[{] local_variable[type[Map], myMap] if[binary_operation[member[.myMap], !=, literal[null]]] begin[{] call[myMap.putAll, parameter[member[.map]]] else begin[{] assign[member[.myMap], call[.createMap, parameter[member[.classAnalysisEngineMap], member[.analysisClass]]]] call[myMap.putAll, parameter[member[.map]]] call[classAnalysisMap.put, parameter[member[.analysisClass], member[.myMap]]] end[}] end[}] END[}]
Keyword[public] operator[<] identifier[E] operator[>] Keyword[void] identifier[reuseClassAnalysis] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[analysisClass] , identifier[Map] operator[<] identifier[ClassDescriptor] , identifier[Object] operator[>] identifier[map] operator[SEP] { identifier[Map] operator[<] identifier[ClassDescriptor] , identifier[Object] operator[>] identifier[myMap] operator[=] identifier[classAnalysisMap] operator[SEP] identifier[get] operator[SEP] identifier[analysisClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[myMap] operator[!=] Other[null] operator[SEP] { identifier[myMap] operator[SEP] identifier[putAll] operator[SEP] identifier[map] operator[SEP] operator[SEP] } Keyword[else] { identifier[myMap] operator[=] identifier[createMap] operator[SEP] identifier[classAnalysisEngineMap] , identifier[analysisClass] operator[SEP] operator[SEP] identifier[myMap] operator[SEP] identifier[putAll] operator[SEP] identifier[map] operator[SEP] operator[SEP] identifier[classAnalysisMap] operator[SEP] identifier[put] operator[SEP] identifier[analysisClass] , identifier[myMap] operator[SEP] operator[SEP] } }
private void clearHotspots() { if (mRipple != null) { mRipple.end(); mRipple = null; mRippleActive = false; } if (mBackground != null) { mBackground.end(); mBackground = null; mBackgroundActive = false; } cancelExitingRipples(); }
class class_name[name] begin[{] method[clearHotspots, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.mRipple], !=, literal[null]]] begin[{] call[mRipple.end, parameter[]] assign[member[.mRipple], literal[null]] assign[member[.mRippleActive], literal[false]] else begin[{] None end[}] if[binary_operation[member[.mBackground], !=, literal[null]]] begin[{] call[mBackground.end, parameter[]] assign[member[.mBackground], literal[null]] assign[member[.mBackgroundActive], literal[false]] else begin[{] None end[}] call[.cancelExitingRipples, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[clearHotspots] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[mRipple] operator[!=] Other[null] operator[SEP] { identifier[mRipple] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] identifier[mRipple] operator[=] Other[null] operator[SEP] identifier[mRippleActive] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[mBackground] operator[!=] Other[null] operator[SEP] { identifier[mBackground] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] identifier[mBackground] operator[=] Other[null] operator[SEP] identifier[mBackgroundActive] operator[=] literal[boolean] operator[SEP] } identifier[cancelExitingRipples] operator[SEP] operator[SEP] operator[SEP] }
public static String getText(BufferedReader reader) throws IOException { StringBuilder answer = new StringBuilder(); // reading the content of the file within a char buffer // allow to keep the correct line endings char[] charBuffer = new char[8192]; int nbCharRead /* = 0*/; try { while ((nbCharRead = reader.read(charBuffer)) != -1) { // appends buffer answer.append(charBuffer, 0, nbCharRead); } Reader temp = reader; reader = null; temp.close(); } finally { closeWithWarning(reader); } return answer.toString(); }
class class_name[name] begin[{] method[getText, return_type[type[String]], modifier[public static], parameter[reader]] begin[{] local_variable[type[StringBuilder], answer] local_variable[type[char], charBuffer] local_variable[type[int], nbCharRead] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=charBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=nbCharRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=nbCharRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=charBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=temp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Reader, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeWithWarning, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[call[answer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getText] operator[SEP] identifier[BufferedReader] identifier[reader] operator[SEP] Keyword[throws] identifier[IOException] { identifier[StringBuilder] identifier[answer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[charBuffer] operator[=] Keyword[new] Keyword[char] operator[SEP] Other[8192] operator[SEP] operator[SEP] Keyword[int] identifier[nbCharRead] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] operator[SEP] identifier[nbCharRead] operator[=] identifier[reader] operator[SEP] identifier[read] operator[SEP] identifier[charBuffer] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[answer] operator[SEP] identifier[append] operator[SEP] identifier[charBuffer] , Other[0] , identifier[nbCharRead] operator[SEP] operator[SEP] } identifier[Reader] identifier[temp] operator[=] identifier[reader] operator[SEP] identifier[reader] operator[=] Other[null] operator[SEP] identifier[temp] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeWithWarning] operator[SEP] identifier[reader] operator[SEP] operator[SEP] } Keyword[return] identifier[answer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected TicketDefinition buildTicketDefinition(final TicketCatalog plan, final String prefix, final Class impl) { if (plan.contains(prefix)) { return plan.find(prefix); } return new DefaultTicketDefinition(impl, prefix, Ordered.LOWEST_PRECEDENCE); }
class class_name[name] begin[{] method[buildTicketDefinition, return_type[type[TicketDefinition]], modifier[protected], parameter[plan, prefix, impl]] begin[{] if[call[plan.contains, parameter[member[.prefix]]]] begin[{] return[call[plan.find, parameter[member[.prefix]]]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=impl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LOWEST_PRECEDENCE, postfix_operators=[], prefix_operators=[], qualifier=Ordered, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultTicketDefinition, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[TicketDefinition] identifier[buildTicketDefinition] operator[SEP] Keyword[final] identifier[TicketCatalog] identifier[plan] , Keyword[final] identifier[String] identifier[prefix] , Keyword[final] identifier[Class] identifier[impl] operator[SEP] { Keyword[if] operator[SEP] identifier[plan] operator[SEP] identifier[contains] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] { Keyword[return] identifier[plan] operator[SEP] identifier[find] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[DefaultTicketDefinition] operator[SEP] identifier[impl] , identifier[prefix] , identifier[Ordered] operator[SEP] identifier[LOWEST_PRECEDENCE] operator[SEP] operator[SEP] }
public void record (ChatChannel channel, String source, UserMessage msg, Name ...usernames) { // fill in the message's time stamp if necessary if (msg.timestamp == 0L) { msg.timestamp = System.currentTimeMillis(); } Entry entry = new Entry(channel, source, msg); for (Name username : usernames) { // add the message to this user's chat history List<Entry> history = getList(username); if (history == null) { continue; } history.add(entry); // if the history is big enough, potentially prune it (we always prune when asked for // the history, so this is just to balance memory usage with CPU expense) if (history.size() > 15) { prune(msg.timestamp, history); } } }
class class_name[name] begin[{] method[record, return_type[void], modifier[public], parameter[channel, source, msg, usernames]] begin[{] if[binary_operation[member[msg.timestamp], ==, literal[0L]]] begin[{] assign[member[msg.timestamp], call[System.currentTimeMillis, parameter[]]] else begin[{] None end[}] local_variable[type[Entry], entry] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=history)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=history, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=history, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=history, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[]), MemberReference(member=history, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prune, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=usernames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=username)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Name, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[record] operator[SEP] identifier[ChatChannel] identifier[channel] , identifier[String] identifier[source] , identifier[UserMessage] identifier[msg] , identifier[Name] operator[...] identifier[usernames] operator[SEP] { Keyword[if] operator[SEP] identifier[msg] operator[SEP] identifier[timestamp] operator[==] Other[0L] operator[SEP] { identifier[msg] operator[SEP] identifier[timestamp] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] } identifier[Entry] identifier[entry] operator[=] Keyword[new] identifier[Entry] operator[SEP] identifier[channel] , identifier[source] , identifier[msg] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Name] identifier[username] operator[:] identifier[usernames] operator[SEP] { identifier[List] operator[<] identifier[Entry] operator[>] identifier[history] operator[=] identifier[getList] operator[SEP] identifier[username] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[history] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[history] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[history] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[15] operator[SEP] { identifier[prune] operator[SEP] identifier[msg] operator[SEP] identifier[timestamp] , identifier[history] operator[SEP] operator[SEP] } } }
public static void childConnectionObserver(ServerBootstrap b, ConnectionObserver connectionObserver) { Objects.requireNonNull(b, "bootstrap"); Objects.requireNonNull(connectionObserver, "connectionObserver"); b.childOption(OBSERVER_OPTION, connectionObserver); }
class class_name[name] begin[{] method[childConnectionObserver, return_type[void], modifier[public static], parameter[b, connectionObserver]] begin[{] call[Objects.requireNonNull, parameter[member[.b], literal["bootstrap"]]] call[Objects.requireNonNull, parameter[member[.connectionObserver], literal["connectionObserver"]]] call[b.childOption, parameter[member[.OBSERVER_OPTION], member[.connectionObserver]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[childConnectionObserver] operator[SEP] identifier[ServerBootstrap] identifier[b] , identifier[ConnectionObserver] identifier[connectionObserver] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[b] , literal[String] operator[SEP] operator[SEP] identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[connectionObserver] , literal[String] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[childOption] operator[SEP] identifier[OBSERVER_OPTION] , identifier[connectionObserver] operator[SEP] operator[SEP] }
@Override protected IEntityGroup primFindGroup(String localKey) throws GroupsException { IEntityGroup group = groupFactory.find(localKey); if (group != null) { group.setLocalGroupService(this); } return group; }
class class_name[name] begin[{] method[primFindGroup, return_type[type[IEntityGroup]], modifier[protected], parameter[localKey]] begin[{] local_variable[type[IEntityGroup], group] if[binary_operation[member[.group], !=, literal[null]]] begin[{] call[group.setLocalGroupService, parameter[THIS[]]] else begin[{] None end[}] return[member[.group]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[IEntityGroup] identifier[primFindGroup] operator[SEP] identifier[String] identifier[localKey] operator[SEP] Keyword[throws] identifier[GroupsException] { identifier[IEntityGroup] identifier[group] operator[=] identifier[groupFactory] operator[SEP] identifier[find] operator[SEP] identifier[localKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[!=] Other[null] operator[SEP] { identifier[group] operator[SEP] identifier[setLocalGroupService] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } Keyword[return] identifier[group] operator[SEP] }
public void reinitialize () { m_aRWLock.writeLocked ( () -> { m_aMimeTypeContents.clear (); _registerDefaultMimeTypeContents (); }); if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Reinitialized " + MimeTypeDeterminator.class.getName ()); }
class class_name[name] begin[{] method[reinitialize, return_type[void], modifier[public], parameter[]] begin[{] call[m_aRWLock.writeLocked, parameter[LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=m_aMimeTypeContents, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=_registerDefaultMimeTypeContents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], parameters=[])]] if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{] call[LOGGER.debug, parameter[binary_operation[literal["Reinitialized "], +, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MimeTypeDeterminator, sub_type=None))]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[reinitialize] operator[SEP] operator[SEP] { identifier[m_aRWLock] operator[SEP] identifier[writeLocked] operator[SEP] operator[SEP] operator[SEP] operator[->] { identifier[m_aMimeTypeContents] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[_registerDefaultMimeTypeContents] operator[SEP] operator[SEP] operator[SEP] } 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] literal[String] operator[+] identifier[MimeTypeDeterminator] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public List<String> createType(TypesDef typeDef) throws AtlasServiceException { return createType(TypesSerialization.toJson(typeDef)); }
class class_name[name] begin[{] method[createType, return_type[type[List]], modifier[public], parameter[typeDef]] begin[{] return[call[.createType, parameter[call[TypesSerialization.toJson, parameter[member[.typeDef]]]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[createType] operator[SEP] identifier[TypesDef] identifier[typeDef] operator[SEP] Keyword[throws] identifier[AtlasServiceException] { Keyword[return] identifier[createType] operator[SEP] identifier[TypesSerialization] operator[SEP] identifier[toJson] operator[SEP] identifier[typeDef] operator[SEP] operator[SEP] operator[SEP] }