code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public OvhRemoteAccess serviceName_remoteAccesses_POST(String serviceName, String allowedIp, Date expirationDate, Long exposedPort, String publicKey) throws IOException { String qPath = "/overTheBox/{serviceName}/remoteAccesses"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "allowedIp", allowedIp); addBody(o, "expirationDate", expirationDate); addBody(o, "exposedPort", exposedPort); addBody(o, "publicKey", publicKey); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhRemoteAccess.class); }
class class_name[name] begin[{] method[serviceName_remoteAccesses_POST, return_type[type[OvhRemoteAccess]], modifier[public], parameter[serviceName, allowedIp, expirationDate, exposedPort, publicKey]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["allowedIp"], member[.allowedIp]]] call[.addBody, parameter[member[.o], literal["expirationDate"], member[.expirationDate]]] call[.addBody, parameter[member[.o], literal["exposedPort"], member[.exposedPort]]] call[.addBody, parameter[member[.o], literal["publicKey"], member[.publicKey]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhRemoteAccess, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhRemoteAccess] identifier[serviceName_remoteAccesses_POST] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[allowedIp] , identifier[Date] identifier[expirationDate] , identifier[Long] identifier[exposedPort] , identifier[String] identifier[publicKey] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[allowedIp] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[expirationDate] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[exposedPort] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[publicKey] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhRemoteAccess] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
static public TimestampType decodeTimestamp(final ByteBuffer bb) { final Long val = bb.getLong(); return new TimestampType(val); }
class class_name[name] begin[{] method[decodeTimestamp, return_type[type[TimestampType]], modifier[public static], parameter[bb]] begin[{] local_variable[type[Long], val] return[ClassCreator(arguments=[MemberReference(member=val, 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=TimestampType, sub_type=None))] end[}] END[}]
Keyword[static] Keyword[public] identifier[TimestampType] identifier[decodeTimestamp] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[bb] operator[SEP] { Keyword[final] identifier[Long] identifier[val] operator[=] identifier[bb] operator[SEP] identifier[getLong] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TimestampType] operator[SEP] identifier[val] operator[SEP] operator[SEP] }
public DescribeAlarmHistoryResult withAlarmHistoryItems(AlarmHistoryItem... alarmHistoryItems) { if (this.alarmHistoryItems == null) { setAlarmHistoryItems(new com.amazonaws.internal.SdkInternalList<AlarmHistoryItem>(alarmHistoryItems.length)); } for (AlarmHistoryItem ele : alarmHistoryItems) { this.alarmHistoryItems.add(ele); } return this; }
class class_name[name] begin[{] method[withAlarmHistoryItems, return_type[type[DescribeAlarmHistoryResult]], modifier[public], parameter[alarmHistoryItems]] begin[{] if[binary_operation[THIS[member[None.alarmHistoryItems]], ==, literal[null]]] begin[{] call[.setAlarmHistoryItems, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=alarmHistoryItems, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AlarmHistoryItem, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=alarmHistoryItems, 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=alarmHistoryItems, 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=AlarmHistoryItem, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeAlarmHistoryResult] identifier[withAlarmHistoryItems] operator[SEP] identifier[AlarmHistoryItem] operator[...] identifier[alarmHistoryItems] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[alarmHistoryItems] operator[==] Other[null] operator[SEP] { identifier[setAlarmHistoryItems] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[AlarmHistoryItem] operator[>] operator[SEP] identifier[alarmHistoryItems] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[AlarmHistoryItem] identifier[ele] operator[:] identifier[alarmHistoryItems] operator[SEP] { Keyword[this] operator[SEP] identifier[alarmHistoryItems] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public Request setContent(String content) { if (body == null) body = new RequestBody(); this.body.setContent(content); return this; }
class class_name[name] begin[{] method[setContent, return_type[type[Request]], modifier[public], parameter[content]] begin[{] if[binary_operation[member[.body], ==, literal[null]]] begin[{] assign[member[.body], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RequestBody, sub_type=None))] else begin[{] None end[}] THIS[member[None.body]call[None.setContent, parameter[member[.content]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Request] identifier[setContent] operator[SEP] identifier[String] identifier[content] operator[SEP] { Keyword[if] operator[SEP] identifier[body] operator[==] Other[null] operator[SEP] identifier[body] operator[=] Keyword[new] identifier[RequestBody] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[body] operator[SEP] identifier[setContent] operator[SEP] identifier[content] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@SuppressLint("HardwareIds") public static String getDeviceId(Context context) { String androidId = getString(context.getContentResolver(), ANDROID_ID); if (!isNullOrEmpty(androidId) && !"9774d56d682e549c".equals(androidId) && !"unknown".equals(androidId) && !"000000000000000".equals(androidId)) { return androidId; } // Serial number, guaranteed to be on all non phones in 2.3+. if (!isNullOrEmpty(Build.SERIAL)) { return Build.SERIAL; } // Telephony ID, guaranteed to be on all phones, requires READ_PHONE_STATE permission if (hasPermission(context, READ_PHONE_STATE) && hasFeature(context, FEATURE_TELEPHONY)) { TelephonyManager telephonyManager = getSystemService(context, TELEPHONY_SERVICE); @SuppressLint("MissingPermission") String telephonyId = telephonyManager.getDeviceId(); if (!isNullOrEmpty(telephonyId)) { return telephonyId; } } // If this still fails, generate random identifier that does not persist across installations return UUID.randomUUID().toString(); }
class class_name[name] begin[{] method[getDeviceId, return_type[type[String]], modifier[public static], parameter[context]] begin[{] local_variable[type[String], androidId] if[binary_operation[binary_operation[binary_operation[call[.isNullOrEmpty, parameter[member[.androidId]]], &&, literal["9774d56d682e549c"]], &&, literal["unknown"]], &&, literal["000000000000000"]]] begin[{] return[member[.androidId]] else begin[{] None end[}] if[call[.isNullOrEmpty, parameter[member[Build.SERIAL]]]] begin[{] return[member[Build.SERIAL]] else begin[{] None end[}] if[binary_operation[call[.hasPermission, parameter[member[.context], member[.READ_PHONE_STATE]]], &&, call[.hasFeature, parameter[member[.context], member[.FEATURE_TELEPHONY]]]]] begin[{] local_variable[type[TelephonyManager], telephonyManager] local_variable[type[String], telephonyId] if[call[.isNullOrEmpty, parameter[member[.telephonyId]]]] begin[{] return[member[.telephonyId]] else begin[{] None end[}] else begin[{] None end[}] return[call[UUID.randomUUID, parameter[]]] end[}] END[}]
annotation[@] identifier[SuppressLint] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[String] identifier[getDeviceId] operator[SEP] identifier[Context] identifier[context] operator[SEP] { identifier[String] identifier[androidId] operator[=] identifier[getString] operator[SEP] identifier[context] operator[SEP] identifier[getContentResolver] operator[SEP] operator[SEP] , identifier[ANDROID_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNullOrEmpty] operator[SEP] identifier[androidId] operator[SEP] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[androidId] operator[SEP] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[androidId] operator[SEP] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[androidId] operator[SEP] operator[SEP] { Keyword[return] identifier[androidId] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isNullOrEmpty] operator[SEP] identifier[Build] operator[SEP] identifier[SERIAL] operator[SEP] operator[SEP] { Keyword[return] identifier[Build] operator[SEP] identifier[SERIAL] operator[SEP] } Keyword[if] operator[SEP] identifier[hasPermission] operator[SEP] identifier[context] , identifier[READ_PHONE_STATE] operator[SEP] operator[&&] identifier[hasFeature] operator[SEP] identifier[context] , identifier[FEATURE_TELEPHONY] operator[SEP] operator[SEP] { identifier[TelephonyManager] identifier[telephonyManager] operator[=] identifier[getSystemService] operator[SEP] identifier[context] , identifier[TELEPHONY_SERVICE] operator[SEP] operator[SEP] annotation[@] identifier[SuppressLint] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[telephonyId] operator[=] identifier[telephonyManager] operator[SEP] identifier[getDeviceId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNullOrEmpty] operator[SEP] identifier[telephonyId] operator[SEP] operator[SEP] { Keyword[return] identifier[telephonyId] operator[SEP] } } Keyword[return] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public HostDiskPartitionInfo computeDiskPartitionInfo(String devicePath, HostDiskPartitionLayout layout) throws HostConfigFault, NotFound, RuntimeFault, RemoteException { return computeDiskPartitionInfo(devicePath, layout, null); }
class class_name[name] begin[{] method[computeDiskPartitionInfo, return_type[type[HostDiskPartitionInfo]], modifier[public], parameter[devicePath, layout]] begin[{] return[call[.computeDiskPartitionInfo, parameter[member[.devicePath], member[.layout], literal[null]]]] end[}] END[}]
Keyword[public] identifier[HostDiskPartitionInfo] identifier[computeDiskPartitionInfo] operator[SEP] identifier[String] identifier[devicePath] , identifier[HostDiskPartitionLayout] identifier[layout] operator[SEP] Keyword[throws] identifier[HostConfigFault] , identifier[NotFound] , identifier[RuntimeFault] , identifier[RemoteException] { Keyword[return] identifier[computeDiskPartitionInfo] operator[SEP] identifier[devicePath] , identifier[layout] , Other[null] operator[SEP] operator[SEP] }
@Override public String fetch(String url) { try{ LOGGER.debug("url:"+url); WEB_DRIVER.get(url); String html = WEB_DRIVER.getPageSource(); LOGGER.debug("html:"+html); return html; }catch (Exception e) { LOGGER.error("获取URL:"+url+"页面出错", e); } return ""; }
class class_name[name] begin[{] method[fetch, return_type[type[String]], modifier[public], parameter[url]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="url:"), operandr=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=WEB_DRIVER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPageSource, postfix_operators=[], prefix_operators=[], qualifier=WEB_DRIVER, selectors=[], type_arguments=None), name=html)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="html:"), operandr=MemberReference(member=html, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=html, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="获取URL:"), operandr=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="页面出错"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[literal[""]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[fetch] operator[SEP] identifier[String] identifier[url] operator[SEP] { Keyword[try] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[url] operator[SEP] operator[SEP] identifier[WEB_DRIVER] operator[SEP] identifier[get] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[String] identifier[html] operator[=] identifier[WEB_DRIVER] operator[SEP] identifier[getPageSource] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[html] operator[SEP] operator[SEP] Keyword[return] identifier[html] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[url] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] }
public static void encode(StringBuilder sb, long data) { for (int i = 58; i > 0; i -= 6) { sb.append(encode(data >> i)); } sb.append(encode(data << 2)); }
class class_name[name] begin[{] method[encode, return_type[void], modifier[public static], parameter[sb, data]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>>)], member=encode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=58), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6))]), label=None) call[sb.append, parameter[call[.encode, parameter[binary_operation[member[.data], <<, literal[2]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[encode] operator[SEP] identifier[StringBuilder] identifier[sb] , Keyword[long] identifier[data] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[58] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] identifier[i] operator[-=] Other[6] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[encode] operator[SEP] identifier[data] operator[>] operator[>] identifier[i] operator[SEP] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[encode] operator[SEP] identifier[data] operator[<<] Other[2] operator[SEP] operator[SEP] operator[SEP] }
private static BigDecimal doSubtract(final BigDecimal v1, final BigDecimal v2) { BigDecimal diff = v1; if (v1 != null && v2 != null) { diff = v1.subtract(v2); } else if (v2 != null) { diff = v2.negate(); } return diff; }
class class_name[name] begin[{] method[doSubtract, return_type[type[BigDecimal]], modifier[private static], parameter[v1, v2]] begin[{] local_variable[type[BigDecimal], diff] if[binary_operation[binary_operation[member[.v1], !=, literal[null]], &&, binary_operation[member[.v2], !=, literal[null]]]] begin[{] assign[member[.diff], call[v1.subtract, parameter[member[.v2]]]] else begin[{] if[binary_operation[member[.v2], !=, literal[null]]] begin[{] assign[member[.diff], call[v2.negate, parameter[]]] else begin[{] None end[}] end[}] return[member[.diff]] end[}] END[}]
Keyword[private] Keyword[static] identifier[BigDecimal] identifier[doSubtract] operator[SEP] Keyword[final] identifier[BigDecimal] identifier[v1] , Keyword[final] identifier[BigDecimal] identifier[v2] operator[SEP] { identifier[BigDecimal] identifier[diff] operator[=] identifier[v1] operator[SEP] Keyword[if] operator[SEP] identifier[v1] operator[!=] Other[null] operator[&&] identifier[v2] operator[!=] Other[null] operator[SEP] { identifier[diff] operator[=] identifier[v1] operator[SEP] identifier[subtract] operator[SEP] identifier[v2] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[v2] operator[!=] Other[null] operator[SEP] { identifier[diff] operator[=] identifier[v2] operator[SEP] identifier[negate] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[diff] operator[SEP] }
@SuppressWarnings("cast") public MoneyFormatter toFormatter(Locale locale) { MoneyFormatter.checkNotNull(locale, "Locale must not be null"); MoneyPrinter[] printersCopy = (MoneyPrinter[]) printers.toArray(new MoneyPrinter[printers.size()]); MoneyParser[] parsersCopy = (MoneyParser[]) parsers.toArray(new MoneyParser[parsers.size()]); return new MoneyFormatter(locale, printersCopy, parsersCopy); }
class class_name[name] begin[{] method[toFormatter, return_type[type[MoneyFormatter]], modifier[public], parameter[locale]] begin[{] call[MoneyFormatter.checkNotNull, parameter[member[.locale], literal["Locale must not be null"]]] local_variable[type[MoneyPrinter], printersCopy] local_variable[type[MoneyParser], parsersCopy] return[ClassCreator(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=printersCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parsersCopy, 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=MoneyFormatter, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[MoneyFormatter] identifier[toFormatter] operator[SEP] identifier[Locale] identifier[locale] operator[SEP] { identifier[MoneyFormatter] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[locale] , literal[String] operator[SEP] operator[SEP] identifier[MoneyPrinter] operator[SEP] operator[SEP] identifier[printersCopy] operator[=] operator[SEP] identifier[MoneyPrinter] operator[SEP] operator[SEP] operator[SEP] identifier[printers] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[MoneyPrinter] operator[SEP] identifier[printers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[MoneyParser] operator[SEP] operator[SEP] identifier[parsersCopy] operator[=] operator[SEP] identifier[MoneyParser] operator[SEP] operator[SEP] operator[SEP] identifier[parsers] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[MoneyParser] operator[SEP] identifier[parsers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[MoneyFormatter] operator[SEP] identifier[locale] , identifier[printersCopy] , identifier[parsersCopy] operator[SEP] operator[SEP] }
private static XsdList getAttributeList(XsdAttribute attribute) { return attribute.getXsdSimpleType() != null ? attribute.getXsdSimpleType().getList() : null; }
class class_name[name] begin[{] method[getAttributeList, return_type[type[XsdList]], modifier[private static], parameter[attribute]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getXsdSimpleType, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=getXsdSimpleType, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[MethodInvocation(arguments=[], member=getList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[XsdList] identifier[getAttributeList] operator[SEP] identifier[XsdAttribute] identifier[attribute] operator[SEP] { Keyword[return] identifier[attribute] operator[SEP] identifier[getXsdSimpleType] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[attribute] operator[SEP] identifier[getXsdSimpleType] operator[SEP] operator[SEP] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
private void maybeCloseS3Client(String reason) { LOG.debug("Decremented S3 client reference count for " + reason); if (_stashReaderRefCount.decrementAndGet() == 0) { LOG.debug("Closing S3 client for StashFileSystem at " + _uri); _s3.shutdown(); } }
class class_name[name] begin[{] method[maybeCloseS3Client, return_type[void], modifier[private], parameter[reason]] begin[{] call[LOG.debug, parameter[binary_operation[literal["Decremented S3 client reference count for "], +, member[.reason]]]] if[binary_operation[call[_stashReaderRefCount.decrementAndGet, parameter[]], ==, literal[0]]] begin[{] call[LOG.debug, parameter[binary_operation[literal["Closing S3 client for StashFileSystem at "], +, member[._uri]]]] call[_s3.shutdown, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[maybeCloseS3Client] operator[SEP] identifier[String] identifier[reason] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[reason] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_stashReaderRefCount] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[_uri] operator[SEP] operator[SEP] identifier[_s3] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] } }
public Pattern<T, T> followedBy(final String name) { return new Pattern<>(name, this, ConsumingStrategy.SKIP_TILL_NEXT, afterMatchSkipStrategy); }
class class_name[name] begin[{] method[followedBy, return_type[type[Pattern]], modifier[public], parameter[name]] begin[{] return[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SKIP_TILL_NEXT, postfix_operators=[], prefix_operators=[], qualifier=ConsumingStrategy, selectors=[]), MemberReference(member=afterMatchSkipStrategy, 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=Pattern, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Pattern] operator[<] identifier[T] , identifier[T] operator[>] identifier[followedBy] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[return] Keyword[new] identifier[Pattern] operator[<] operator[>] operator[SEP] identifier[name] , Keyword[this] , identifier[ConsumingStrategy] operator[SEP] identifier[SKIP_TILL_NEXT] , identifier[afterMatchSkipStrategy] operator[SEP] operator[SEP] }
public static List<UITaskMetric> getTaskMetrics(MetricInfo info, String component, int window) { TreeMap<Integer, UITaskMetric> taskData = new TreeMap<>(); if (info != null) { for (Map.Entry<String, Map<Integer, MetricSnapshot>> metric : info.get_metrics().entrySet()) { String name = metric.getKey(); String[] split_name = name.split("@"); int taskId = JStormUtils.parseInt(UIMetricUtils.extractTaskId(split_name)); String componentName = UIMetricUtils.extractComponentName(split_name); if (componentName != null && !componentName.equals(component)) continue; //only handle the tasks belongs to the specific component String metricName = UIMetricUtils.extractMetricName(split_name); String parentComp = null; if (metricName != null && metricName.contains(".")) { parentComp = metricName.split("\\.")[0]; metricName = metricName.split("\\.")[1]; } if (!metric.getValue().containsKey(window)) { LOG.info("task snapshot {} missing window:{}", metric.getKey(), window); continue; } MetricSnapshot snapshot = metric.getValue().get(window); UITaskMetric taskMetric; if (taskData.containsKey(taskId)) { taskMetric = taskData.get(taskId); } else { taskMetric = new UITaskMetric(component, taskId); taskData.put(taskId, taskMetric); } taskMetric.setMetricValue(snapshot, parentComp, metricName); } } for (UITaskMetric t : taskData.values()) { t.mergeValue(); } return new ArrayList<>(taskData.values()); }
class class_name[name] begin[{] method[getTaskMetrics, return_type[type[List]], modifier[public static], parameter[info, component, window]] begin[{] local_variable[type[TreeMap], taskData] if[binary_operation[member[.info], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=metric, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@")], member=split, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), name=split_name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=split_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractTaskId, postfix_operators=[], prefix_operators=[], qualifier=UIMetricUtils, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=JStormUtils, selectors=[], type_arguments=None), name=taskId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=split_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractComponentName, postfix_operators=[], prefix_operators=[], qualifier=UIMetricUtils, selectors=[], type_arguments=None), name=componentName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=componentName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=componentName, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=split_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractMetricName, postfix_operators=[], prefix_operators=[], qualifier=UIMetricUtils, selectors=[], type_arguments=None), name=metricName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=parentComp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=metricName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=metricName, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parentComp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\.")], member=split, postfix_operators=[], prefix_operators=[], qualifier=metricName, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=metricName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\.")], member=split, postfix_operators=[], prefix_operators=[], qualifier=metricName, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=['!'], qualifier=metric, selectors=[MethodInvocation(arguments=[MemberReference(member=window, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="task snapshot {} missing window:{}"), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=metric, selectors=[], type_arguments=None), MemberReference(member=window, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=metric, selectors=[MethodInvocation(arguments=[MemberReference(member=window, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=snapshot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MetricSnapshot, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=taskMetric)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UITaskMetric, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=taskId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=taskData, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=taskMetric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=taskId, 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=UITaskMetric, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=taskId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=taskMetric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=taskData, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=taskMetric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=taskId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=taskData, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=snapshot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentComp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metricName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMetricValue, postfix_operators=[], prefix_operators=[], qualifier=taskMetric, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=get_metrics, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=metric)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MetricSnapshot, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=mergeValue, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=taskData, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UITaskMetric, sub_type=None))), label=None) return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=taskData, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[UITaskMetric] operator[>] identifier[getTaskMetrics] operator[SEP] identifier[MetricInfo] identifier[info] , identifier[String] identifier[component] , Keyword[int] identifier[window] operator[SEP] { identifier[TreeMap] operator[<] identifier[Integer] , identifier[UITaskMetric] operator[>] identifier[taskData] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[info] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Map] operator[<] identifier[Integer] , identifier[MetricSnapshot] operator[>] operator[>] identifier[metric] operator[:] identifier[info] operator[SEP] identifier[get_metrics] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[metric] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[split_name] operator[=] identifier[name] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[taskId] operator[=] identifier[JStormUtils] operator[SEP] identifier[parseInt] operator[SEP] identifier[UIMetricUtils] operator[SEP] identifier[extractTaskId] operator[SEP] identifier[split_name] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[componentName] operator[=] identifier[UIMetricUtils] operator[SEP] identifier[extractComponentName] operator[SEP] identifier[split_name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[componentName] operator[!=] Other[null] operator[&&] operator[!] identifier[componentName] operator[SEP] identifier[equals] operator[SEP] identifier[component] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[String] identifier[metricName] operator[=] identifier[UIMetricUtils] operator[SEP] identifier[extractMetricName] operator[SEP] identifier[split_name] operator[SEP] operator[SEP] identifier[String] identifier[parentComp] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[metricName] operator[!=] Other[null] operator[&&] identifier[metricName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[parentComp] operator[=] identifier[metricName] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[metricName] operator[=] identifier[metricName] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[metric] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[window] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[metric] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[window] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[MetricSnapshot] identifier[snapshot] operator[=] identifier[metric] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[window] operator[SEP] operator[SEP] identifier[UITaskMetric] identifier[taskMetric] operator[SEP] Keyword[if] operator[SEP] identifier[taskData] operator[SEP] identifier[containsKey] operator[SEP] identifier[taskId] operator[SEP] operator[SEP] { identifier[taskMetric] operator[=] identifier[taskData] operator[SEP] identifier[get] operator[SEP] identifier[taskId] operator[SEP] operator[SEP] } Keyword[else] { identifier[taskMetric] operator[=] Keyword[new] identifier[UITaskMetric] operator[SEP] identifier[component] , identifier[taskId] operator[SEP] operator[SEP] identifier[taskData] operator[SEP] identifier[put] operator[SEP] identifier[taskId] , identifier[taskMetric] operator[SEP] operator[SEP] } identifier[taskMetric] operator[SEP] identifier[setMetricValue] operator[SEP] identifier[snapshot] , identifier[parentComp] , identifier[metricName] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[UITaskMetric] identifier[t] operator[:] identifier[taskData] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[t] operator[SEP] identifier[mergeValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[taskData] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public String getLabel() { ResourceStore rs; ResourceRef rr; synchronized(lock) { rs = this.resourceStore; rr = this.resourceRef; } if(rr != null) { String path = rr.getPath().toString(); boolean isDirectory = path.endsWith(Path.SEPARATOR_STRING); int slashBefore; if(isDirectory) { slashBefore = path.lastIndexOf(Path.SEPARATOR_CHAR, path.length() - 2); } else { slashBefore = path.lastIndexOf(Path.SEPARATOR_CHAR); } String filename = path.substring(slashBefore + 1); if(filename.isEmpty()) throw new IllegalArgumentException("Invalid filename for file: " + path); if(!isDirectory) { if(rs != null) { try { try (ResourceConnection conn = rs.getResource(rr.getPath()).open()) { if(conn.exists()) { return filename + " (" + StringUtility.getApproximateSize(conn.getLength()) + ')' ; } } } catch(FileNotFoundException e) { // Resource removed between calls to exists() and getLength() // fall-through to return filename } catch(IOException e) { throw new WrappedException(e); } } } return filename; } throw new IllegalStateException("Path not set"); }
class class_name[name] begin[{] method[getLabel, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[ResourceStore], rs] local_variable[type[ResourceRef], rr] SYNCHRONIZED[member[.lock]] BEGIN[{] assign[member[.rs], THIS[member[None.resourceStore]]] assign[member[.rr], THIS[member[None.resourceRef]]] END[}] if[binary_operation[member[.rr], !=, literal[null]]] begin[{] local_variable[type[String], path] local_variable[type[boolean], isDirectory] local_variable[type[int], slashBefore] if[member[.isDirectory]] begin[{] assign[member[.slashBefore], call[path.lastIndexOf, parameter[member[Path.SEPARATOR_CHAR], binary_operation[call[path.length, parameter[]], -, literal[2]]]]] else begin[{] assign[member[.slashBefore], call[path.lastIndexOf, parameter[member[Path.SEPARATOR_CHAR]]]] end[}] local_variable[type[String], filename] if[call[filename.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid filename for file: "), operandr=MemberReference(member=path, 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[}] if[member[.isDirectory]] begin[{] if[binary_operation[member[.rs], !=, literal[null]]] begin[{] TryStatement(block=[TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ("), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)], member=getApproximateSize, postfix_operators=[], prefix_operators=[], qualifier=StringUtility, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')'), operator=+), label=None)]))], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=conn, type=ReferenceType(arguments=None, dimensions=[], name=ResourceConnection, sub_type=None), value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=rr, selectors=[], type_arguments=None)], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[MethodInvocation(arguments=[], member=open, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))])], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException'])), 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=WrappedException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] return[member[.filename]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Path not set")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getLabel] operator[SEP] operator[SEP] { identifier[ResourceStore] identifier[rs] operator[SEP] identifier[ResourceRef] identifier[rr] operator[SEP] Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { identifier[rs] operator[=] Keyword[this] operator[SEP] identifier[resourceStore] operator[SEP] identifier[rr] operator[=] Keyword[this] operator[SEP] identifier[resourceRef] operator[SEP] } Keyword[if] operator[SEP] identifier[rr] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[path] operator[=] identifier[rr] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isDirectory] operator[=] identifier[path] operator[SEP] identifier[endsWith] operator[SEP] identifier[Path] operator[SEP] identifier[SEPARATOR_STRING] operator[SEP] operator[SEP] Keyword[int] identifier[slashBefore] operator[SEP] Keyword[if] operator[SEP] identifier[isDirectory] operator[SEP] { identifier[slashBefore] operator[=] identifier[path] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[Path] operator[SEP] identifier[SEPARATOR_CHAR] , identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] } Keyword[else] { identifier[slashBefore] operator[=] identifier[path] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[Path] operator[SEP] identifier[SEPARATOR_CHAR] operator[SEP] operator[SEP] } identifier[String] identifier[filename] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[slashBefore] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filename] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isDirectory] operator[SEP] { Keyword[if] operator[SEP] identifier[rs] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[try] operator[SEP] identifier[ResourceConnection] identifier[conn] operator[=] identifier[rs] operator[SEP] identifier[getResource] operator[SEP] identifier[rr] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[conn] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[filename] operator[+] literal[String] operator[+] identifier[StringUtility] operator[SEP] identifier[getApproximateSize] operator[SEP] identifier[conn] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[WrappedException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } Keyword[return] identifier[filename] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
protected List<Class<?>> getExtensionClasses() { return Lists.<Class<?>> newArrayList( ArrayExtensions.class, BigDecimalExtensions.class, BigIntegerExtensions.class, BooleanExtensions.class, ByteExtensions.class, CharacterExtensions.class, CollectionExtensions.class, ComparableExtensions.class, DoubleExtensions.class, FloatExtensions.class, FunctionExtensions.class, IntegerExtensions.class, IterableExtensions.class, IteratorExtensions.class, ListExtensions.class, LongExtensions.class, MapExtensions.class, ObjectExtensions.class, ProcedureExtensions.class, ShortExtensions.class, StringExtensions.class); }
class class_name[name] begin[{] method[getExtensionClasses, return_type[type[List]], modifier[protected], parameter[]] begin[{] return[call[.Lists, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimalExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigIntegerExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BooleanExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CharacterExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CollectionExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ComparableExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DoubleExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FloatExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FunctionExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IterableExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IteratorExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ListExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LongExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MapExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProcedureExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShortExtensions, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringExtensions, sub_type=None))]]] end[}] END[}]
Keyword[protected] identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[getExtensionClasses] operator[SEP] operator[SEP] { Keyword[return] identifier[Lists] operator[SEP] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[newArrayList] operator[SEP] identifier[ArrayExtensions] operator[SEP] Keyword[class] , identifier[BigDecimalExtensions] operator[SEP] Keyword[class] , identifier[BigIntegerExtensions] operator[SEP] Keyword[class] , identifier[BooleanExtensions] operator[SEP] Keyword[class] , identifier[ByteExtensions] operator[SEP] Keyword[class] , identifier[CharacterExtensions] operator[SEP] Keyword[class] , identifier[CollectionExtensions] operator[SEP] Keyword[class] , identifier[ComparableExtensions] operator[SEP] Keyword[class] , identifier[DoubleExtensions] operator[SEP] Keyword[class] , identifier[FloatExtensions] operator[SEP] Keyword[class] , identifier[FunctionExtensions] operator[SEP] Keyword[class] , identifier[IntegerExtensions] operator[SEP] Keyword[class] , identifier[IterableExtensions] operator[SEP] Keyword[class] , identifier[IteratorExtensions] operator[SEP] Keyword[class] , identifier[ListExtensions] operator[SEP] Keyword[class] , identifier[LongExtensions] operator[SEP] Keyword[class] , identifier[MapExtensions] operator[SEP] Keyword[class] , identifier[ObjectExtensions] operator[SEP] Keyword[class] , identifier[ProcedureExtensions] operator[SEP] Keyword[class] , identifier[ShortExtensions] operator[SEP] Keyword[class] , identifier[StringExtensions] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static final File createLocalTempFile(final File basefile, final String prefix, final boolean isDeleteOnExit) throws IOException { File tmp = File.createTempFile(prefix + basefile.getName(), "", basefile.getParentFile()); if (isDeleteOnExit) { tmp.deleteOnExit(); } return tmp; }
class class_name[name] begin[{] method[createLocalTempFile, return_type[type[File]], modifier[final public static], parameter[basefile, prefix, isDeleteOnExit]] begin[{] local_variable[type[File], tmp] if[member[.isDeleteOnExit]] begin[{] call[tmp.deleteOnExit, parameter[]] else begin[{] None end[}] return[member[.tmp]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[File] identifier[createLocalTempFile] operator[SEP] Keyword[final] identifier[File] identifier[basefile] , Keyword[final] identifier[String] identifier[prefix] , Keyword[final] Keyword[boolean] identifier[isDeleteOnExit] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[tmp] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] identifier[prefix] operator[+] identifier[basefile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] , identifier[basefile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isDeleteOnExit] operator[SEP] { identifier[tmp] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[tmp] operator[SEP] }
public List<Process> read(final Reader reader) throws SAXException, IOException { this.processes = ((ProcessBuildData) this.parser.read( reader )).getProcesses(); return this.processes; }
class class_name[name] begin[{] method[read, return_type[type[List]], modifier[public], parameter[reader]] begin[{] assign[THIS[member[None.processes]], Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=parser, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=ProcessBuildData, sub_type=None))] return[THIS[member[None.processes]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Process] operator[>] identifier[read] operator[SEP] Keyword[final] identifier[Reader] identifier[reader] operator[SEP] Keyword[throws] identifier[SAXException] , identifier[IOException] { Keyword[this] operator[SEP] identifier[processes] operator[=] operator[SEP] operator[SEP] identifier[ProcessBuildData] operator[SEP] Keyword[this] operator[SEP] identifier[parser] operator[SEP] identifier[read] operator[SEP] identifier[reader] operator[SEP] operator[SEP] operator[SEP] identifier[getProcesses] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[processes] operator[SEP] }
public static String generateFilterCondition(String propertyName, String operation, final Date value) { return generateFilterCondition(propertyName, operation, Utility.getJavaISO8601Time(value), EdmType.DATE_TIME); }
class class_name[name] begin[{] method[generateFilterCondition, return_type[type[String]], modifier[public static], parameter[propertyName, operation, value]] begin[{] return[call[.generateFilterCondition, parameter[member[.propertyName], member[.operation], call[Utility.getJavaISO8601Time, parameter[member[.value]]], member[EdmType.DATE_TIME]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[generateFilterCondition] operator[SEP] identifier[String] identifier[propertyName] , identifier[String] identifier[operation] , Keyword[final] identifier[Date] identifier[value] operator[SEP] { Keyword[return] identifier[generateFilterCondition] operator[SEP] identifier[propertyName] , identifier[operation] , identifier[Utility] operator[SEP] identifier[getJavaISO8601Time] operator[SEP] identifier[value] operator[SEP] , identifier[EdmType] operator[SEP] identifier[DATE_TIME] operator[SEP] operator[SEP] }
@Override public void add(MtasDataItem<T1, T2> newItem) throws IOException { if (newItem instanceof MtasDataItemAdvanced) { MtasDataItemAdvanced<T1, T2> newTypedItem = (MtasDataItemAdvanced<T1, T2>) newItem; valueSum = operations.add11(valueSum, newTypedItem.valueSum); valueSumOfLogs = operations.add22(valueSumOfLogs, newTypedItem.valueSumOfLogs); valueSumOfSquares = operations.add11(valueSumOfSquares, newTypedItem.valueSumOfSquares); valueMin = operations.min11(valueMin, newTypedItem.valueMin); valueMax = operations.max11(valueMax, newTypedItem.valueMax); valueN += newTypedItem.valueN; recomputeComparableSortValue = true; } else { throw new IOException("can only add MtasDataItemAdvanced"); } }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[newItem]] begin[{] if[binary_operation[member[.newItem], instanceof, type[MtasDataItemAdvanced]]] begin[{] local_variable[type[MtasDataItemAdvanced], newTypedItem] assign[member[.valueSum], call[operations.add11, parameter[member[.valueSum], member[newTypedItem.valueSum]]]] assign[member[.valueSumOfLogs], call[operations.add22, parameter[member[.valueSumOfLogs], member[newTypedItem.valueSumOfLogs]]]] assign[member[.valueSumOfSquares], call[operations.add11, parameter[member[.valueSumOfSquares], member[newTypedItem.valueSumOfSquares]]]] assign[member[.valueMin], call[operations.min11, parameter[member[.valueMin], member[newTypedItem.valueMin]]]] assign[member[.valueMax], call[operations.max11, parameter[member[.valueMax], member[newTypedItem.valueMax]]]] assign[member[.valueN], member[newTypedItem.valueN]] assign[member[.recomputeComparableSortValue], literal[true]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="can only add MtasDataItemAdvanced")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[MtasDataItem] operator[<] identifier[T1] , identifier[T2] operator[>] identifier[newItem] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[newItem] Keyword[instanceof] identifier[MtasDataItemAdvanced] operator[SEP] { identifier[MtasDataItemAdvanced] operator[<] identifier[T1] , identifier[T2] operator[>] identifier[newTypedItem] operator[=] operator[SEP] identifier[MtasDataItemAdvanced] operator[<] identifier[T1] , identifier[T2] operator[>] operator[SEP] identifier[newItem] operator[SEP] identifier[valueSum] operator[=] identifier[operations] operator[SEP] identifier[add11] operator[SEP] identifier[valueSum] , identifier[newTypedItem] operator[SEP] identifier[valueSum] operator[SEP] operator[SEP] identifier[valueSumOfLogs] operator[=] identifier[operations] operator[SEP] identifier[add22] operator[SEP] identifier[valueSumOfLogs] , identifier[newTypedItem] operator[SEP] identifier[valueSumOfLogs] operator[SEP] operator[SEP] identifier[valueSumOfSquares] operator[=] identifier[operations] operator[SEP] identifier[add11] operator[SEP] identifier[valueSumOfSquares] , identifier[newTypedItem] operator[SEP] identifier[valueSumOfSquares] operator[SEP] operator[SEP] identifier[valueMin] operator[=] identifier[operations] operator[SEP] identifier[min11] operator[SEP] identifier[valueMin] , identifier[newTypedItem] operator[SEP] identifier[valueMin] operator[SEP] operator[SEP] identifier[valueMax] operator[=] identifier[operations] operator[SEP] identifier[max11] operator[SEP] identifier[valueMax] , identifier[newTypedItem] operator[SEP] identifier[valueMax] operator[SEP] operator[SEP] identifier[valueN] operator[+=] identifier[newTypedItem] operator[SEP] identifier[valueN] operator[SEP] identifier[recomputeComparableSortValue] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public static String getEngineUrl(String serverSpec) throws NamingException { String url; int at = serverSpec.indexOf('@'); if (at>0) { url = serverSpec.substring(at+1); } else { int colonDashDash = serverSpec.indexOf("://"); if (colonDashDash>0) { url = serverSpec; } else { url = PropertyManager.getProperty(PropertyNames.MDW_REMOTE_SERVER + "." + serverSpec); if (url==null) throw new NamingException("Cannot find engine URL for " + serverSpec); } } return url; }
class class_name[name] begin[{] method[getEngineUrl, return_type[type[String]], modifier[public static], parameter[serverSpec]] begin[{] local_variable[type[String], url] local_variable[type[int], at] if[binary_operation[member[.at], >, literal[0]]] begin[{] assign[member[.url], call[serverSpec.substring, parameter[binary_operation[member[.at], +, literal[1]]]]] else begin[{] local_variable[type[int], colonDashDash] if[binary_operation[member[.colonDashDash], >, literal[0]]] begin[{] assign[member[.url], member[.serverSpec]] else begin[{] assign[member[.url], call[PropertyManager.getProperty, parameter[binary_operation[binary_operation[member[PropertyNames.MDW_REMOTE_SERVER], +, literal["."]], +, member[.serverSpec]]]]] if[binary_operation[member[.url], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot find engine URL for "), operandr=MemberReference(member=serverSpec, 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=NamingException, sub_type=None)), label=None) else begin[{] None end[}] end[}] end[}] return[member[.url]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getEngineUrl] operator[SEP] identifier[String] identifier[serverSpec] operator[SEP] Keyword[throws] identifier[NamingException] { identifier[String] identifier[url] operator[SEP] Keyword[int] identifier[at] operator[=] identifier[serverSpec] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[at] operator[>] Other[0] operator[SEP] { identifier[url] operator[=] identifier[serverSpec] operator[SEP] identifier[substring] operator[SEP] identifier[at] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[colonDashDash] operator[=] identifier[serverSpec] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colonDashDash] operator[>] Other[0] operator[SEP] { identifier[url] operator[=] identifier[serverSpec] operator[SEP] } Keyword[else] { identifier[url] operator[=] identifier[PropertyManager] operator[SEP] identifier[getProperty] operator[SEP] identifier[PropertyNames] operator[SEP] identifier[MDW_REMOTE_SERVER] operator[+] literal[String] operator[+] identifier[serverSpec] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NamingException] operator[SEP] literal[String] operator[+] identifier[serverSpec] operator[SEP] operator[SEP] } } Keyword[return] identifier[url] operator[SEP] }
public static boolean isReverseSorted(float[] floatArray) { for(int i = 0; i < floatArray.length - 1 ; i++) { if(floatArray[i] < floatArray [i + 1]) { return false; } } return true; }
class class_name[name] begin[{] method[isReverseSorted, return_type[type[boolean]], modifier[public static], parameter[floatArray]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=floatArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=floatArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=floatArray, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isReverseSorted] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[floatArray] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[floatArray] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[floatArray] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[floatArray] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Override public void removeByBillingAddressId(long billingAddressId) { for (CommerceOrder commerceOrder : findByBillingAddressId( billingAddressId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceOrder); } }
class class_name[name] begin[{] method[removeByBillingAddressId, return_type[void], modifier[public], parameter[billingAddressId]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commerceOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=billingAddressId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=findByBillingAddressId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=commerceOrder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceOrder, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeByBillingAddressId] operator[SEP] Keyword[long] identifier[billingAddressId] operator[SEP] { Keyword[for] operator[SEP] identifier[CommerceOrder] identifier[commerceOrder] operator[:] identifier[findByBillingAddressId] operator[SEP] identifier[billingAddressId] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] { identifier[remove] operator[SEP] identifier[commerceOrder] operator[SEP] operator[SEP] } }
public static PrivateKey readPemPrivateKey(final String privateKeyAsString, final String algorithm) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException { final byte[] decoded = new Base64().decode(privateKeyAsString); return readPrivateKey(decoded, algorithm); }
class class_name[name] begin[{] method[readPemPrivateKey, return_type[type[PrivateKey]], modifier[public static], parameter[privateKeyAsString, algorithm]] begin[{] local_variable[type[byte], decoded] return[call[.readPrivateKey, parameter[member[.decoded], member[.algorithm]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[PrivateKey] identifier[readPemPrivateKey] operator[SEP] Keyword[final] identifier[String] identifier[privateKeyAsString] , Keyword[final] identifier[String] identifier[algorithm] operator[SEP] Keyword[throws] identifier[NoSuchAlgorithmException] , identifier[InvalidKeySpecException] , identifier[NoSuchProviderException] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[decoded] operator[=] Keyword[new] identifier[Base64] operator[SEP] operator[SEP] operator[SEP] identifier[decode] operator[SEP] identifier[privateKeyAsString] operator[SEP] operator[SEP] Keyword[return] identifier[readPrivateKey] operator[SEP] identifier[decoded] , identifier[algorithm] operator[SEP] operator[SEP] }
public Brand getBrand(String accountId, String brandId) throws ApiException { return getBrand(accountId, brandId, null); }
class class_name[name] begin[{] method[getBrand, return_type[type[Brand]], modifier[public], parameter[accountId, brandId]] begin[{] return[call[.getBrand, parameter[member[.accountId], member[.brandId], literal[null]]]] end[}] END[}]
Keyword[public] identifier[Brand] identifier[getBrand] operator[SEP] identifier[String] identifier[accountId] , identifier[String] identifier[brandId] operator[SEP] Keyword[throws] identifier[ApiException] { Keyword[return] identifier[getBrand] operator[SEP] identifier[accountId] , identifier[brandId] , Other[null] operator[SEP] operator[SEP] }
public T solve( T B ) { convertType.specify(this,B); // Look to see if there is a special function for handling this case if( this.mat.getType() != B.getType() ) { Method m = findAlternative("solve",mat,B.mat,convertType.commonType.getClassType()); if( m != null ) { T ret = wrapMatrix(convertType.commonType.create(1,1)); invoke(m,this.mat,B.mat,ret.mat); // TODO handle boolean return from solve return ret; } } T A = convertType.convert(this); B = convertType.convert(B); T x = A.createMatrix(mat.getNumCols(),B.getMatrix().getNumCols(), A.getType()); if( !A.ops.solve(A.mat,x.mat,B.mat)) throw new SingularMatrixException(); if( A.ops.hasUncountable(x.mat)) throw new SingularMatrixException("Solution contains uncountable numbers"); return x; }
class class_name[name] begin[{] method[solve, return_type[type[T]], modifier[public], parameter[B]] begin[{] call[convertType.specify, parameter[THIS[], member[.B]]] if[binary_operation[THIS[member[None.mat]call[None.getType, parameter[]]], !=, call[B.getType, parameter[]]]] begin[{] local_variable[type[Method], m] if[binary_operation[member[.m], !=, literal[null]]] begin[{] local_variable[type[T], ret] call[.invoke, parameter[member[.m], THIS[member[None.mat]], member[B.mat], member[ret.mat]]] return[member[.ret]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[T], A] assign[member[.B], call[convertType.convert, parameter[member[.B]]]] local_variable[type[T], x] if[call[A.ops.solve, parameter[member[A.mat], member[x.mat], member[B.mat]]]] 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=SingularMatrixException, sub_type=None)), label=None) else begin[{] None end[}] if[call[A.ops.hasUncountable, parameter[member[x.mat]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Solution contains uncountable numbers")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SingularMatrixException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.x]] end[}] END[}]
Keyword[public] identifier[T] identifier[solve] operator[SEP] identifier[T] identifier[B] operator[SEP] { identifier[convertType] operator[SEP] identifier[specify] operator[SEP] Keyword[this] , identifier[B] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[mat] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[!=] identifier[B] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { identifier[Method] identifier[m] operator[=] identifier[findAlternative] operator[SEP] literal[String] , identifier[mat] , identifier[B] operator[SEP] identifier[mat] , identifier[convertType] operator[SEP] identifier[commonType] operator[SEP] identifier[getClassType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[!=] Other[null] operator[SEP] { identifier[T] identifier[ret] operator[=] identifier[wrapMatrix] operator[SEP] identifier[convertType] operator[SEP] identifier[commonType] operator[SEP] identifier[create] operator[SEP] Other[1] , Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[m] , Keyword[this] operator[SEP] identifier[mat] , identifier[B] operator[SEP] identifier[mat] , identifier[ret] operator[SEP] identifier[mat] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] } } identifier[T] identifier[A] operator[=] identifier[convertType] operator[SEP] identifier[convert] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[B] operator[=] identifier[convertType] operator[SEP] identifier[convert] operator[SEP] identifier[B] operator[SEP] operator[SEP] identifier[T] identifier[x] operator[=] identifier[A] operator[SEP] identifier[createMatrix] operator[SEP] identifier[mat] operator[SEP] identifier[getNumCols] operator[SEP] operator[SEP] , identifier[B] operator[SEP] identifier[getMatrix] operator[SEP] operator[SEP] operator[SEP] identifier[getNumCols] operator[SEP] operator[SEP] , identifier[A] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[A] operator[SEP] identifier[ops] operator[SEP] identifier[solve] operator[SEP] identifier[A] operator[SEP] identifier[mat] , identifier[x] operator[SEP] identifier[mat] , identifier[B] operator[SEP] identifier[mat] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SingularMatrixException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[A] operator[SEP] identifier[ops] operator[SEP] identifier[hasUncountable] operator[SEP] identifier[x] operator[SEP] identifier[mat] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SingularMatrixException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[x] operator[SEP] }
public int getActualMaximum(int field) { /* It is a known limitation that the code here (and in getActualMinimum) * won't behave properly at the extreme limits of GregorianCalendar's * representable range (except for the code that handles the YEAR * field). That's because the ends of the representable range are at * odd spots in the year. For calendars with the default Gregorian * cutover, these limits are Sun Dec 02 16:47:04 GMT 292269055 BC to Sun * Aug 17 07:12:55 GMT 292278994 AD, somewhat different for non-GMT * zones. As a result, if the calendar is set to Aug 1 292278994 AD, * the actual maximum of DAY_OF_MONTH is 17, not 30. If the date is Mar * 31 in that year, the actual maximum month might be Jul, whereas is * the date is Mar 15, the actual maximum might be Aug -- depending on * the precise semantics that are desired. Similar considerations * affect all fields. Nonetheless, this effect is sufficiently arcane * that we permit it, rather than complicating the code to handle such * intricacies. - liu 8/20/98 * UPDATE: No longer true, since we have pulled in the limit values on * the year. - Liu 11/6/00 */ switch (field) { case YEAR: /* The year computation is no different, in principle, from the * others, however, the range of possible maxima is large. In * addition, the way we know we've exceeded the range is different. * For these reasons, we use the special case code below to handle * this field. * * The actual maxima for YEAR depend on the type of calendar: * * Gregorian = May 17, 292275056 BC - Aug 17, 292278994 AD * Julian = Dec 2, 292269055 BC - Jan 3, 292272993 AD * Hybrid = Dec 2, 292269055 BC - Aug 17, 292278994 AD * * We know we've exceeded the maximum when either the month, date, * time, or era changes in response to setting the year. We don't * check for month, date, and time here because the year and era are * sufficient to detect an invalid year setting. NOTE: If code is * added to check the month and date in the future for some reason, * Feb 29 must be allowed to shift to Mar 1 when setting the year. */ { Calendar cal = (Calendar) clone(); cal.setLenient(true); int era = cal.get(ERA); Date d = cal.getTime(); /* Perform a binary search, with the invariant that lowGood is a * valid year, and highBad is an out of range year. */ int lowGood = LIMITS[YEAR][1]; int highBad = LIMITS[YEAR][2]+1; while ((lowGood + 1) < highBad) { int y = (lowGood + highBad) / 2; cal.set(YEAR, y); if (cal.get(YEAR) == y && cal.get(ERA) == era) { lowGood = y; } else { highBad = y; cal.setTime(d); // Restore original fields } } return lowGood; } default: return super.getActualMaximum(field); } }
class class_name[name] begin[{] method[getActualMaximum, return_type[type[int]], modifier[public], parameter[field]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['YEAR'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Calendar, sub_type=None)), name=cal)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Calendar, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setLenient, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ERA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), name=era)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=LIMITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=YEAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), name=lowGood)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=LIMITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=YEAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=highBad)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lowGood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=highBad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=YEAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=YEAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ERA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), operandr=MemberReference(member=era, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=highBad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lowGood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lowGood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=highBad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None), ReturnStatement(expression=MemberReference(member=lowGood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=SuperMethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getActualMaximum, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[int] identifier[getActualMaximum] operator[SEP] Keyword[int] identifier[field] operator[SEP] { Keyword[switch] operator[SEP] identifier[field] operator[SEP] { Keyword[case] identifier[YEAR] operator[:] { identifier[Calendar] identifier[cal] operator[=] operator[SEP] identifier[Calendar] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[setLenient] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[era] operator[=] identifier[cal] operator[SEP] identifier[get] operator[SEP] identifier[ERA] operator[SEP] operator[SEP] identifier[Date] identifier[d] operator[=] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lowGood] operator[=] identifier[LIMITS] operator[SEP] identifier[YEAR] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[highBad] operator[=] identifier[LIMITS] operator[SEP] identifier[YEAR] operator[SEP] operator[SEP] Other[2] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[lowGood] operator[+] Other[1] operator[SEP] operator[<] identifier[highBad] operator[SEP] { Keyword[int] identifier[y] operator[=] operator[SEP] identifier[lowGood] operator[+] identifier[highBad] operator[SEP] operator[/] Other[2] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[YEAR] , identifier[y] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cal] operator[SEP] identifier[get] operator[SEP] identifier[YEAR] operator[SEP] operator[==] identifier[y] operator[&&] identifier[cal] operator[SEP] identifier[get] operator[SEP] identifier[ERA] operator[SEP] operator[==] identifier[era] operator[SEP] { identifier[lowGood] operator[=] identifier[y] operator[SEP] } Keyword[else] { identifier[highBad] operator[=] identifier[y] operator[SEP] identifier[cal] operator[SEP] identifier[setTime] operator[SEP] identifier[d] operator[SEP] operator[SEP] } } Keyword[return] identifier[lowGood] operator[SEP] } Keyword[default] operator[:] Keyword[return] Keyword[super] operator[SEP] identifier[getActualMaximum] operator[SEP] identifier[field] operator[SEP] operator[SEP] } }
public static Map.Entry<String, Map<String, ?>> pressKeyCodeCommand(int key) { return new AbstractMap.SimpleEntry<>( PRESS_KEY_CODE, prepareArguments("keycode", key)); }
class class_name[name] begin[{] method[pressKeyCodeCommand, return_type[type[Map]], modifier[public static], parameter[key]] begin[{] return[ClassCreator(arguments=[MemberReference(member=PRESS_KEY_CODE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="keycode"), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareArguments, 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=AbstractMap, sub_type=ReferenceType(arguments=[], dimensions=None, name=SimpleEntry, sub_type=None)))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , operator[?] operator[>] operator[>] identifier[pressKeyCodeCommand] operator[SEP] Keyword[int] identifier[key] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractMap] operator[SEP] identifier[SimpleEntry] operator[<] operator[>] operator[SEP] identifier[PRESS_KEY_CODE] , identifier[prepareArguments] operator[SEP] literal[String] , identifier[key] operator[SEP] operator[SEP] operator[SEP] }
@Override public void setSpan(Object what, int start, int end, int flags) { if (mSpanCount + 1 >= mSpans.length) { int newsize = mSpanCount + 10; Object[] newtags = new Object[newsize]; int[] newdata = new int[newsize * 3]; System.arraycopy(mSpans, 0, newtags, 0, mSpanCount); System.arraycopy(mSpanData, 0, newdata, 0, mSpanCount * 3); mSpans = newtags; mSpanData = newdata; } mSpans[mSpanCount] = what; mSpanData[mSpanCount * COLUMNS + START] = start; mSpanData[mSpanCount * COLUMNS + END] = end; mSpanData[mSpanCount * COLUMNS + FLAGS] = flags; mSpanCount++; }
class class_name[name] begin[{] method[setSpan, return_type[void], modifier[public], parameter[what, start, end, flags]] begin[{] if[binary_operation[binary_operation[member[.mSpanCount], +, literal[1]], >=, member[mSpans.length]]] begin[{] local_variable[type[int], newsize] local_variable[type[Object], newtags] local_variable[type[int], newdata] call[System.arraycopy, parameter[member[.mSpans], literal[0], member[.newtags], literal[0], member[.mSpanCount]]] call[System.arraycopy, parameter[member[.mSpanData], literal[0], member[.newdata], literal[0], binary_operation[member[.mSpanCount], *, literal[3]]]] assign[member[.mSpans], member[.newtags]] assign[member[.mSpanData], member[.newdata]] else begin[{] None end[}] assign[member[.mSpans], member[.what]] assign[member[.mSpanData], member[.start]] assign[member[.mSpanData], member[.end]] assign[member[.mSpanData], member[.flags]] member[.mSpanCount] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setSpan] operator[SEP] identifier[Object] identifier[what] , Keyword[int] identifier[start] , Keyword[int] identifier[end] , Keyword[int] identifier[flags] operator[SEP] { Keyword[if] operator[SEP] identifier[mSpanCount] operator[+] Other[1] operator[>=] identifier[mSpans] operator[SEP] identifier[length] operator[SEP] { Keyword[int] identifier[newsize] operator[=] identifier[mSpanCount] operator[+] Other[10] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[newtags] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[newsize] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[newdata] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[newsize] operator[*] Other[3] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[mSpans] , Other[0] , identifier[newtags] , Other[0] , identifier[mSpanCount] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[mSpanData] , Other[0] , identifier[newdata] , Other[0] , identifier[mSpanCount] operator[*] Other[3] operator[SEP] operator[SEP] identifier[mSpans] operator[=] identifier[newtags] operator[SEP] identifier[mSpanData] operator[=] identifier[newdata] operator[SEP] } identifier[mSpans] operator[SEP] identifier[mSpanCount] operator[SEP] operator[=] identifier[what] operator[SEP] identifier[mSpanData] operator[SEP] identifier[mSpanCount] operator[*] identifier[COLUMNS] operator[+] identifier[START] operator[SEP] operator[=] identifier[start] operator[SEP] identifier[mSpanData] operator[SEP] identifier[mSpanCount] operator[*] identifier[COLUMNS] operator[+] identifier[END] operator[SEP] operator[=] identifier[end] operator[SEP] identifier[mSpanData] operator[SEP] identifier[mSpanCount] operator[*] identifier[COLUMNS] operator[+] identifier[FLAGS] operator[SEP] operator[=] identifier[flags] operator[SEP] identifier[mSpanCount] operator[++] operator[SEP] }
public static Double getDouble(String propertyName) { return NumberUtil.toDoubleObject(System.getProperty(propertyName), null); }
class class_name[name] begin[{] method[getDouble, return_type[type[Double]], modifier[public static], parameter[propertyName]] begin[{] return[call[NumberUtil.toDoubleObject, parameter[call[System.getProperty, parameter[member[.propertyName]]], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Double] identifier[getDouble] operator[SEP] identifier[String] identifier[propertyName] operator[SEP] { Keyword[return] identifier[NumberUtil] operator[SEP] identifier[toDoubleObject] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[propertyName] operator[SEP] , Other[null] operator[SEP] operator[SEP] }
public static Validator<CharSequence> minLength(@NonNull final Context context, final int minLength) { return new MinLengthValidator(context, R.string.default_error_message, minLength); }
class class_name[name] begin[{] method[minLength, return_type[type[Validator]], modifier[public static], parameter[context, minLength]] begin[{] return[ClassCreator(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=default_error_message, postfix_operators=[], prefix_operators=[], qualifier=R.string, selectors=[]), MemberReference(member=minLength, 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=MinLengthValidator, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Validator] operator[<] identifier[CharSequence] operator[>] identifier[minLength] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[Context] identifier[context] , Keyword[final] Keyword[int] identifier[minLength] operator[SEP] { Keyword[return] Keyword[new] identifier[MinLengthValidator] operator[SEP] identifier[context] , identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[default_error_message] , identifier[minLength] operator[SEP] operator[SEP] }
public JSONObject putValue(String key, boolean value) { put(key, JSONBoolean.valueOf(value)); return this; }
class class_name[name] begin[{] method[putValue, return_type[type[JSONObject]], modifier[public], parameter[key, value]] begin[{] call[.put, parameter[member[.key], call[JSONBoolean.valueOf, parameter[member[.value]]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JSONObject] identifier[putValue] operator[SEP] identifier[String] identifier[key] , Keyword[boolean] identifier[value] operator[SEP] { identifier[put] operator[SEP] identifier[key] , identifier[JSONBoolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void reimageComputeNode(String poolId, String nodeId, ComputeNodeReimageOption nodeReimageOption, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { ComputeNodeReimageOptions options = new ComputeNodeReimageOptions(); BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors); bhMgr.applyRequestBehaviors(options); this.parentBatchClient.protocolLayer().computeNodes().reimage(poolId, nodeId, nodeReimageOption, options); }
class class_name[name] begin[{] method[reimageComputeNode, return_type[void], modifier[public], parameter[poolId, nodeId, nodeReimageOption, additionalBehaviors]] begin[{] local_variable[type[ComputeNodeReimageOptions], options] local_variable[type[BehaviorManager], bhMgr] call[bhMgr.applyRequestBehaviors, parameter[member[.options]]] THIS[member[None.parentBatchClient]call[None.protocolLayer, parameter[]]call[None.computeNodes, parameter[]]call[None.reimage, parameter[member[.poolId], member[.nodeId], member[.nodeReimageOption], member[.options]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[reimageComputeNode] operator[SEP] identifier[String] identifier[poolId] , identifier[String] identifier[nodeId] , identifier[ComputeNodeReimageOption] identifier[nodeReimageOption] , identifier[Iterable] operator[<] identifier[BatchClientBehavior] operator[>] identifier[additionalBehaviors] operator[SEP] Keyword[throws] identifier[BatchErrorException] , identifier[IOException] { identifier[ComputeNodeReimageOptions] identifier[options] operator[=] Keyword[new] identifier[ComputeNodeReimageOptions] operator[SEP] operator[SEP] operator[SEP] identifier[BehaviorManager] identifier[bhMgr] operator[=] Keyword[new] identifier[BehaviorManager] operator[SEP] Keyword[this] operator[SEP] identifier[customBehaviors] operator[SEP] operator[SEP] , identifier[additionalBehaviors] operator[SEP] operator[SEP] identifier[bhMgr] operator[SEP] identifier[applyRequestBehaviors] operator[SEP] identifier[options] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parentBatchClient] operator[SEP] identifier[protocolLayer] operator[SEP] operator[SEP] operator[SEP] identifier[computeNodes] operator[SEP] operator[SEP] operator[SEP] identifier[reimage] operator[SEP] identifier[poolId] , identifier[nodeId] , identifier[nodeReimageOption] , identifier[options] operator[SEP] operator[SEP] }
public int writeDirectory(HttpServletResponse res, File dir, String path) throws IOException { // error checking if (dir == null) { res.sendError(HttpServletResponse.SC_NOT_FOUND); return 0; } if (!dir.exists() || !dir.isDirectory()) { res.sendError(HttpServletResponse.SC_NOT_FOUND); return 0; } // Get directory as HTML String dirHtmlString = getDirectory(path, dir); thredds.servlet.ServletUtil.setResponseContentLength(res, dirHtmlString); res.setContentType(ContentType.html.getContentHeader()); PrintWriter writer = res.getWriter(); writer.write(dirHtmlString); writer.flush(); return dirHtmlString.length(); }
class class_name[name] begin[{] method[writeDirectory, return_type[type[int]], modifier[public], parameter[res, dir, path]] begin[{] if[binary_operation[member[.dir], ==, literal[null]]] begin[{] call[res.sendError, parameter[member[HttpServletResponse.SC_NOT_FOUND]]] return[literal[0]] else begin[{] None end[}] if[binary_operation[call[dir.exists, parameter[]], ||, call[dir.isDirectory, parameter[]]]] begin[{] call[res.sendError, parameter[member[HttpServletResponse.SC_NOT_FOUND]]] return[literal[0]] else begin[{] None end[}] local_variable[type[String], dirHtmlString] call[thredds.servlet.ServletUtil.setResponseContentLength, parameter[member[.res], member[.dirHtmlString]]] call[res.setContentType, parameter[call[ContentType.html.getContentHeader, parameter[]]]] local_variable[type[PrintWriter], writer] call[writer.write, parameter[member[.dirHtmlString]]] call[writer.flush, parameter[]] return[call[dirHtmlString.length, parameter[]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[writeDirectory] operator[SEP] identifier[HttpServletResponse] identifier[res] , identifier[File] identifier[dir] , identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[dir] operator[==] Other[null] operator[SEP] { identifier[res] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_FOUND] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[dir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[||] operator[!] identifier[dir] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[res] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_FOUND] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP] } identifier[String] identifier[dirHtmlString] operator[=] identifier[getDirectory] operator[SEP] identifier[path] , identifier[dir] operator[SEP] operator[SEP] identifier[thredds] operator[SEP] identifier[servlet] operator[SEP] identifier[ServletUtil] operator[SEP] identifier[setResponseContentLength] operator[SEP] identifier[res] , identifier[dirHtmlString] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[setContentType] operator[SEP] identifier[ContentType] operator[SEP] identifier[html] operator[SEP] identifier[getContentHeader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[writer] operator[=] identifier[res] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[dirHtmlString] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dirHtmlString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] }
public ManagedServiceBuilder addEndpointServiceWithAliasAndServiceManagmentBundle( final String alias, final Object endpointService, final ServiceManagementBundle serviceManagementBundle) { addEndpointServiceWithAliasAndQueueHandlerCallbacks(alias, endpointService, new QueueCallBackHandler() { @Override public void queueProcess() { serviceManagementBundle.process(); } }); return this; }
class class_name[name] begin[{] method[addEndpointServiceWithAliasAndServiceManagmentBundle, return_type[type[ManagedServiceBuilder]], modifier[public], parameter[alias, endpointService, serviceManagementBundle]] begin[{] call[.addEndpointServiceWithAliasAndQueueHandlerCallbacks, parameter[member[.alias], member[.endpointService], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=process, postfix_operators=[], prefix_operators=[], qualifier=serviceManagementBundle, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=queueProcess, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QueueCallBackHandler, sub_type=None))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ManagedServiceBuilder] identifier[addEndpointServiceWithAliasAndServiceManagmentBundle] operator[SEP] Keyword[final] identifier[String] identifier[alias] , Keyword[final] identifier[Object] identifier[endpointService] , Keyword[final] identifier[ServiceManagementBundle] identifier[serviceManagementBundle] operator[SEP] { identifier[addEndpointServiceWithAliasAndQueueHandlerCallbacks] operator[SEP] identifier[alias] , identifier[endpointService] , Keyword[new] identifier[QueueCallBackHandler] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[queueProcess] operator[SEP] operator[SEP] { identifier[serviceManagementBundle] operator[SEP] identifier[process] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public boolean completeExceptionally(Throwable ex) { if (ex == null) throw new NullPointerException(); boolean triggered = internalComplete(new AltResult(ex)); postComplete(); return triggered; }
class class_name[name] begin[{] method[completeExceptionally, return_type[type[boolean]], modifier[public], parameter[ex]] begin[{] if[binary_operation[member[.ex], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[boolean], triggered] call[.postComplete, parameter[]] return[member[.triggered]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[completeExceptionally] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] identifier[ex] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[triggered] operator[=] identifier[internalComplete] operator[SEP] Keyword[new] identifier[AltResult] operator[SEP] identifier[ex] operator[SEP] operator[SEP] operator[SEP] identifier[postComplete] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[triggered] operator[SEP] }
public void execute() { final CustomTabsIntent intent = new CustomTabsIntent.Builder().build(); customTabsHelper.openCustomTab(context, intent, uri, new CustomTabsHelper.BrowserFallback()); }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[CustomTabsIntent], intent] call[customTabsHelper.openCustomTab, parameter[member[.context], member[.intent], member[.uri], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CustomTabsHelper, sub_type=ReferenceType(arguments=None, dimensions=None, name=BrowserFallback, sub_type=None)))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] { Keyword[final] identifier[CustomTabsIntent] identifier[intent] operator[=] Keyword[new] identifier[CustomTabsIntent] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[customTabsHelper] operator[SEP] identifier[openCustomTab] operator[SEP] identifier[context] , identifier[intent] , identifier[uri] , Keyword[new] identifier[CustomTabsHelper] operator[SEP] identifier[BrowserFallback] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
boolean rangeEquals(final int start, final int count, final String cached) { return rangeEquals(charBuf, start, count, cached); }
class class_name[name] begin[{] method[rangeEquals, return_type[type[boolean]], modifier[default], parameter[start, count, cached]] begin[{] return[call[.rangeEquals, parameter[member[.charBuf], member[.start], member[.count], member[.cached]]]] end[}] END[}]
Keyword[boolean] identifier[rangeEquals] operator[SEP] Keyword[final] Keyword[int] identifier[start] , Keyword[final] Keyword[int] identifier[count] , Keyword[final] identifier[String] identifier[cached] operator[SEP] { Keyword[return] identifier[rangeEquals] operator[SEP] identifier[charBuf] , identifier[start] , identifier[count] , identifier[cached] operator[SEP] operator[SEP] }
protected String extractPackageNameFromAndroidArtifact( Artifact artifact ) throws MojoExecutionException { final File unpackedLibFolder = getUnpackedLibFolder( artifact ); final File manifest = new File( unpackedLibFolder, "AndroidManifest.xml" ); if ( !manifest.exists() ) { throw new MojoExecutionException( "AndroidManifest.xml file wasn't found in next place: " + unpackedLibFolder ); } return extractPackageNameFromAndroidManifest( manifest ); }
class class_name[name] begin[{] method[extractPackageNameFromAndroidArtifact, return_type[type[String]], modifier[protected], parameter[artifact]] begin[{] local_variable[type[File], unpackedLibFolder] local_variable[type[File], manifest] if[call[manifest.exists, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AndroidManifest.xml file wasn't found in next place: "), operandr=MemberReference(member=unpackedLibFolder, 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=MojoExecutionException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.extractPackageNameFromAndroidManifest, parameter[member[.manifest]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[extractPackageNameFromAndroidArtifact] operator[SEP] identifier[Artifact] identifier[artifact] operator[SEP] Keyword[throws] identifier[MojoExecutionException] { Keyword[final] identifier[File] identifier[unpackedLibFolder] operator[=] identifier[getUnpackedLibFolder] operator[SEP] identifier[artifact] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[manifest] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[unpackedLibFolder] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[manifest] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[MojoExecutionException] operator[SEP] literal[String] operator[+] identifier[unpackedLibFolder] operator[SEP] operator[SEP] } Keyword[return] identifier[extractPackageNameFromAndroidManifest] operator[SEP] identifier[manifest] operator[SEP] operator[SEP] }
public static ZooKeeperLeaderRetrievalService createLeaderRetrievalService( final CuratorFramework client, final Configuration configuration) throws Exception { return createLeaderRetrievalService(client, configuration, ""); }
class class_name[name] begin[{] method[createLeaderRetrievalService, return_type[type[ZooKeeperLeaderRetrievalService]], modifier[public static], parameter[client, configuration]] begin[{] return[call[.createLeaderRetrievalService, parameter[member[.client], member[.configuration], literal[""]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ZooKeeperLeaderRetrievalService] identifier[createLeaderRetrievalService] operator[SEP] Keyword[final] identifier[CuratorFramework] identifier[client] , Keyword[final] identifier[Configuration] identifier[configuration] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[return] identifier[createLeaderRetrievalService] operator[SEP] identifier[client] , identifier[configuration] , literal[String] operator[SEP] operator[SEP] }
@Override public void reset(final long mNodeKey) { super.reset(mNodeKey); if (mDupSet != null) { mDupSet.clear(); } if (mOp1 != null) { mOp1.reset(mNodeKey); } if (mOp2 != null) { mOp2.reset(mNodeKey); } }
class class_name[name] begin[{] method[reset, return_type[void], modifier[public], parameter[mNodeKey]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=mNodeKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[binary_operation[member[.mDupSet], !=, literal[null]]] begin[{] call[mDupSet.clear, parameter[]] else begin[{] None end[}] if[binary_operation[member[.mOp1], !=, literal[null]]] begin[{] call[mOp1.reset, parameter[member[.mNodeKey]]] else begin[{] None end[}] if[binary_operation[member[.mOp2], !=, literal[null]]] begin[{] call[mOp2.reset, parameter[member[.mNodeKey]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[reset] operator[SEP] Keyword[final] Keyword[long] identifier[mNodeKey] operator[SEP] { Keyword[super] operator[SEP] identifier[reset] operator[SEP] identifier[mNodeKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mDupSet] operator[!=] Other[null] operator[SEP] { identifier[mDupSet] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mOp1] operator[!=] Other[null] operator[SEP] { identifier[mOp1] operator[SEP] identifier[reset] operator[SEP] identifier[mNodeKey] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mOp2] operator[!=] Other[null] operator[SEP] { identifier[mOp2] operator[SEP] identifier[reset] operator[SEP] identifier[mNodeKey] operator[SEP] operator[SEP] } }
public void setDayExcluded (final int day, final boolean exclude) { if ((day < 1) || (day > MAX_DAYS_IN_MONTH)) { throw new IllegalArgumentException ("The day parameter must be in the range of 1 to " + MAX_DAYS_IN_MONTH); } m_aExcludeDays[day - 1] = exclude; m_aExcludeAll = areAllDaysExcluded (); }
class class_name[name] begin[{] method[setDayExcluded, return_type[void], modifier[public], parameter[day, exclude]] begin[{] if[binary_operation[binary_operation[member[.day], <, literal[1]], ||, binary_operation[member[.day], >, member[.MAX_DAYS_IN_MONTH]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The day parameter must be in the range of 1 to "), operandr=MemberReference(member=MAX_DAYS_IN_MONTH, 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[member[.m_aExcludeDays], member[.exclude]] assign[member[.m_aExcludeAll], call[.areAllDaysExcluded, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDayExcluded] operator[SEP] Keyword[final] Keyword[int] identifier[day] , Keyword[final] Keyword[boolean] identifier[exclude] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[day] operator[<] Other[1] operator[SEP] operator[||] operator[SEP] identifier[day] operator[>] identifier[MAX_DAYS_IN_MONTH] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[MAX_DAYS_IN_MONTH] operator[SEP] operator[SEP] } identifier[m_aExcludeDays] operator[SEP] identifier[day] operator[-] Other[1] operator[SEP] operator[=] identifier[exclude] operator[SEP] identifier[m_aExcludeAll] operator[=] identifier[areAllDaysExcluded] operator[SEP] operator[SEP] operator[SEP] }
@Nonnull public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS, @Nonnull final String sContent, @Nonnull final Charset aCharset) { ValueEnforcer.notNull (sContent, "Content"); ValueEnforcer.notNull (aCharset, "Charset"); return writeStream (aOS, sContent.getBytes (aCharset)); }
class class_name[name] begin[{] method[writeStream, return_type[type[ESuccess]], modifier[public static], parameter[aOS, sContent, aCharset]] begin[{] call[ValueEnforcer.notNull, parameter[member[.sContent], literal["Content"]]] call[ValueEnforcer.notNull, parameter[member[.aCharset], literal["Charset"]]] return[call[.writeStream, parameter[member[.aOS], call[sContent.getBytes, parameter[member[.aCharset]]]]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[ESuccess] identifier[writeStream] operator[SEP] annotation[@] identifier[WillClose] annotation[@] identifier[Nonnull] Keyword[final] identifier[OutputStream] identifier[aOS] , annotation[@] identifier[Nonnull] Keyword[final] identifier[String] identifier[sContent] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Charset] identifier[aCharset] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[sContent] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aCharset] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[writeStream] operator[SEP] identifier[aOS] , identifier[sContent] operator[SEP] identifier[getBytes] operator[SEP] identifier[aCharset] operator[SEP] operator[SEP] operator[SEP] }
String toTag(Archive source, String name, Archive target) { if (source == target || !target.getModule().isNamed()) { return target.getName(); } Module module = target.getModule(); String pn = name; if ((type == CLASS || type == VERBOSE)) { int i = name.lastIndexOf('.'); pn = i > 0 ? name.substring(0, i) : ""; } // exported API if (module.isExported(pn) && !module.isJDKUnsupported()) { return showProfileOrModule(module); } // JDK internal API if (!source.getModule().isJDK() && module.isJDK()){ return "JDK internal API (" + module.name() + ")"; } // qualified exports or inaccessible boolean isExported = module.isExported(pn, source.getModule().name()); return module.name() + (isExported ? " (qualified)" : " (internal)"); }
class class_name[name] begin[{] method[toTag, return_type[type[String]], modifier[default], parameter[source, name, target]] begin[{] if[binary_operation[binary_operation[member[.source], ==, member[.target]], ||, call[target.getModule, parameter[]]]] begin[{] return[call[target.getName, parameter[]]] else begin[{] None end[}] local_variable[type[Module], module] local_variable[type[String], pn] if[binary_operation[binary_operation[member[.type], ==, member[.CLASS]], ||, binary_operation[member[.type], ==, member[.VERBOSE]]]] begin[{] local_variable[type[int], i] assign[member[.pn], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None))] else begin[{] None end[}] if[binary_operation[call[module.isExported, parameter[member[.pn]]], &&, call[module.isJDKUnsupported, parameter[]]]] begin[{] return[call[.showProfileOrModule, parameter[member[.module]]]] else begin[{] None end[}] if[binary_operation[call[source.getModule, parameter[]], &&, call[module.isJDK, parameter[]]]] begin[{] return[binary_operation[binary_operation[literal["JDK internal API ("], +, call[module.name, parameter[]]], +, literal[")"]]] else begin[{] None end[}] local_variable[type[boolean], isExported] return[binary_operation[call[module.name, parameter[]], +, TernaryExpression(condition=MemberReference(member=isExported, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (internal)"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (qualified)"))]] end[}] END[}]
identifier[String] identifier[toTag] operator[SEP] identifier[Archive] identifier[source] , identifier[String] identifier[name] , identifier[Archive] identifier[target] operator[SEP] { Keyword[if] operator[SEP] identifier[source] operator[==] identifier[target] operator[||] operator[!] identifier[target] operator[SEP] identifier[getModule] operator[SEP] operator[SEP] operator[SEP] identifier[isNamed] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[target] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } identifier[Module] identifier[module] operator[=] identifier[target] operator[SEP] identifier[getModule] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pn] operator[=] identifier[name] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[type] operator[==] identifier[CLASS] operator[||] identifier[type] operator[==] identifier[VERBOSE] operator[SEP] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[name] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pn] operator[=] identifier[i] operator[>] Other[0] operator[?] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[i] operator[SEP] operator[:] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[module] operator[SEP] identifier[isExported] operator[SEP] identifier[pn] operator[SEP] operator[&&] operator[!] identifier[module] operator[SEP] identifier[isJDKUnsupported] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[showProfileOrModule] operator[SEP] identifier[module] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[source] operator[SEP] identifier[getModule] operator[SEP] operator[SEP] operator[SEP] identifier[isJDK] operator[SEP] operator[SEP] operator[&&] identifier[module] operator[SEP] identifier[isJDK] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[module] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] } Keyword[boolean] identifier[isExported] operator[=] identifier[module] operator[SEP] identifier[isExported] operator[SEP] identifier[pn] , identifier[source] operator[SEP] identifier[getModule] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[module] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] operator[SEP] identifier[isExported] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] }
@Deprecated public static <T> void recordOperationSteps(final OperationContext context, final Map<T, ModelNode> operations, final Map<T, ModelNode> responses, final OperationHandlerResolver handlerResolver, final boolean adjustAddresses) throws OperationFailedException { recordOperationSteps(context, operations, responses, handlerResolver, adjustAddresses, true); }
class class_name[name] begin[{] method[recordOperationSteps, return_type[void], modifier[public static], parameter[context, operations, responses, handlerResolver, adjustAddresses]] begin[{] call[.recordOperationSteps, parameter[member[.context], member[.operations], member[.responses], member[.handlerResolver], member[.adjustAddresses], literal[true]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[void] identifier[recordOperationSteps] operator[SEP] Keyword[final] identifier[OperationContext] identifier[context] , Keyword[final] identifier[Map] operator[<] identifier[T] , identifier[ModelNode] operator[>] identifier[operations] , Keyword[final] identifier[Map] operator[<] identifier[T] , identifier[ModelNode] operator[>] identifier[responses] , Keyword[final] identifier[OperationHandlerResolver] identifier[handlerResolver] , Keyword[final] Keyword[boolean] identifier[adjustAddresses] operator[SEP] Keyword[throws] identifier[OperationFailedException] { identifier[recordOperationSteps] operator[SEP] identifier[context] , identifier[operations] , identifier[responses] , identifier[handlerResolver] , identifier[adjustAddresses] , literal[boolean] operator[SEP] operator[SEP] }
public EClass getIfcFurnishingElement() { if (ifcFurnishingElementEClass == null) { ifcFurnishingElementEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(259); } return ifcFurnishingElementEClass; }
class class_name[name] begin[{] method[getIfcFurnishingElement, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcFurnishingElementEClass], ==, literal[null]]] begin[{] assign[member[.ifcFurnishingElementEClass], 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=259)], 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[.ifcFurnishingElementEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcFurnishingElement] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcFurnishingElementEClass] operator[==] Other[null] operator[SEP] { identifier[ifcFurnishingElementEClass] 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[259] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcFurnishingElementEClass] operator[SEP] }
public void deleteStorageAccount(String resourceGroupName, String accountName, String storageAccountName) { deleteStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single().body(); }
class class_name[name] begin[{] method[deleteStorageAccount, return_type[void], modifier[public], parameter[resourceGroupName, accountName, storageAccountName]] begin[{] call[.deleteStorageAccountWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.storageAccountName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteStorageAccount] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[storageAccountName] operator[SEP] { identifier[deleteStorageAccountWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[storageAccountName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public static String filepath2URI(String path){ // return null if path is null. if (path == null) return null; char separator = java.io.File.separatorChar; path = path.replace(separator, '/'); int len = path.length(), ch; StringBuilder buffer = new StringBuilder(len*3); buffer.append("file://"); // change C:/blah to /C:/blah if (len >= 2 && path.charAt(1) == ':') { ch = Character.toUpperCase(path.charAt(0)); if (ch >= 'A' && ch <= 'Z') { buffer.append('/'); } } // for each character in the path int i = 0; for (; i < len; i++) { ch = path.charAt(i); // if it's not an ASCII character, break here, and use UTF-8 encoding if (ch >= 128) break; if (gNeedEscaping[ch]) { buffer.append('%'); buffer.append(gAfterEscaping1[ch]); buffer.append(gAfterEscaping2[ch]); // record the fact that it's escaped } else { buffer.append((char)ch); } } // we saw some non-ascii character if (i < len) { // get UTF-8 bytes for the remaining sub-string byte[] bytes = null; byte b; try { bytes = path.substring(i).getBytes("UTF-8"); } catch (java.io.UnsupportedEncodingException e) { // should never happen return path; } len = bytes.length; // for each byte for (i = 0; i < len; i++) { b = bytes[i]; // for non-ascii character: make it positive, then escape if (b < 0) { ch = b + 256; buffer.append('%'); buffer.append(gHexChs[ch >> 4]); buffer.append(gHexChs[ch & 0xf]); } else if (gNeedEscaping[b]) { buffer.append('%'); buffer.append(gAfterEscaping1[b]); buffer.append(gAfterEscaping2[b]); } else { buffer.append((char)b); } } } return buffer.toString(); }
class class_name[name] begin[{] method[filepath2URI, return_type[type[String]], modifier[public static], parameter[path]] begin[{] if[binary_operation[member[.path], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[char], separator] assign[member[.path], call[path.replace, parameter[member[.separator], literal['/']]]] local_variable[type[int], len] local_variable[type[StringBuilder], buffer] call[buffer.append, parameter[literal["file://"]]] if[binary_operation[binary_operation[member[.len], >=, literal[2]], &&, binary_operation[call[path.charAt, parameter[literal[1]]], ==, literal[':']]]] begin[{] assign[member[.ch], call[Character.toUpperCase, parameter[call[path.charAt, parameter[literal[0]]]]]] if[binary_operation[binary_operation[member[.ch], >=, literal['A']], &&, binary_operation[member[.ch], <=, literal['Z']]]] begin[{] call[buffer.append, parameter[literal['/']]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=128), operator=>=), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), IfStatement(condition=MemberReference(member=gNeedEscaping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gAfterEscaping1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gAfterEscaping2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.i], <, member[.len]]] begin[{] local_variable[type[byte], bytes] local_variable[type[byte], b] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['java.io.UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) assign[member[.len], member[bytes.length]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=IfStatement(condition=MemberReference(member=gNeedEscaping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gAfterEscaping1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gAfterEscaping2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gHexChs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>>))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gHexChs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xf), operator=&))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[filepath2URI] operator[SEP] identifier[String] identifier[path] operator[SEP] { Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[char] identifier[separator] operator[=] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[File] operator[SEP] identifier[separatorChar] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] identifier[replace] operator[SEP] identifier[separator] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[ch] operator[SEP] identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[len] operator[*] Other[3] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>=] Other[2] operator[&&] identifier[path] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[ch] operator[=] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[path] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ch] operator[=] identifier[path] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[>=] Other[128] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[gNeedEscaping] operator[SEP] identifier[ch] operator[SEP] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[gAfterEscaping1] operator[SEP] identifier[ch] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[gAfterEscaping2] operator[SEP] identifier[ch] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[ch] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Other[null] operator[SEP] Keyword[byte] identifier[b] operator[SEP] Keyword[try] { identifier[bytes] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[return] identifier[path] operator[SEP] } identifier[len] operator[=] identifier[bytes] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[b] operator[=] identifier[bytes] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[<] Other[0] operator[SEP] { identifier[ch] operator[=] identifier[b] operator[+] Other[256] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[gHexChs] operator[SEP] identifier[ch] operator[>] operator[>] Other[4] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[gHexChs] operator[SEP] identifier[ch] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[gNeedEscaping] operator[SEP] identifier[b] operator[SEP] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[gAfterEscaping1] operator[SEP] identifier[b] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[gAfterEscaping2] operator[SEP] identifier[b] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[b] operator[SEP] operator[SEP] } } } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public final boolean validateCell(final UIComponent target) { int[] rowcol = CellUtility.getRowColFromComponentAttributes(target); int row = rowcol[0]; int col = rowcol[1]; return validateWithRowColInCurrentPage(row, col, true); }
class class_name[name] begin[{] method[validateCell, return_type[type[boolean]], modifier[final public], parameter[target]] begin[{] local_variable[type[int], rowcol] local_variable[type[int], row] local_variable[type[int], col] return[call[.validateWithRowColInCurrentPage, parameter[member[.row], member[.col], literal[true]]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[boolean] identifier[validateCell] operator[SEP] Keyword[final] identifier[UIComponent] identifier[target] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[rowcol] operator[=] identifier[CellUtility] operator[SEP] identifier[getRowColFromComponentAttributes] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[int] identifier[row] operator[=] identifier[rowcol] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[col] operator[=] identifier[rowcol] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[validateWithRowColInCurrentPage] operator[SEP] identifier[row] , identifier[col] , literal[boolean] operator[SEP] operator[SEP] }
public static HashMap<String, String> createEvent(HashMap data, String typeStr, String dap, HashMap<String, String> info, boolean isStrictID) { HashMap newEvent = new HashMap<String, String>(); EventType type; try { type = EventType.valueOf(typeStr.toUpperCase()); typeStr = type.toString().toLowerCase(); } catch (IllegalArgumentException e) { LOG.error("{} event is not recognized, please try other event name", typeStr); return new HashMap<String, String>(); } catch (Exception e) { LOG.error(getStackTrace(e)); return new HashMap<String, String>(); } newEvent.put("event", typeStr); String pdate = getFstPdate(data, ""); if (!pdate.equals("")) { String date = dateOffset(pdate, dap); if (date != null) { newEvent.put("date", date); } else { LOG.error("Given days after planting has a invalid value {}", dap); return new HashMap<String, String>(); } } else { LOG.error("Planting date is not available in the given data set"); return new HashMap<String, String>(); } if (isStrictID) { String[] ids = info.keySet().toArray(new String[0]); for (String id : ids) { String path = AcePathfinder.INSTANCE.getPath(id); if (path == null || !path.contains(typeStr)) { LOG.warn("{} is not belong to {} event, please check if it is a typo"); // info.remove(id); } } } newEvent.putAll(info); return newEvent; }
class class_name[name] begin[{] method[createEvent, return_type[type[HashMap]], modifier[public static], parameter[data, typeStr, dap, info, isStrictID]] begin[{] local_variable[type[HashMap], newEvent] local_variable[type[EventType], type] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=typeStr, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=EventType, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=typeStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[MethodInvocation(arguments=[], member=toLowerCase, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{} event is not recognized, please try other event name"), MemberReference(member=typeStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[newEvent.put, parameter[literal["event"], member[.typeStr]]] local_variable[type[String], pdate] if[call[pdate.equals, parameter[literal[""]]]] begin[{] local_variable[type[String], date] if[binary_operation[member[.date], !=, literal[null]]] begin[{] call[newEvent.put, parameter[literal["date"], member[.date]]] else begin[{] call[LOG.error, parameter[literal["Given days after planting has a invalid value {}"], member[.dap]]] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] end[}] else begin[{] call[LOG.error, parameter[literal["Planting date is not available in the given data set"]]] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] end[}] if[member[.isStrictID]] begin[{] local_variable[type[String], ids] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=AcePathfinder.INSTANCE, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=typeStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=path, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{} is not belong to {} event, please check if it is a typo")], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] call[newEvent.putAll, parameter[member[.info]]] return[member[.newEvent]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[createEvent] operator[SEP] identifier[HashMap] identifier[data] , identifier[String] identifier[typeStr] , identifier[String] identifier[dap] , identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[info] , Keyword[boolean] identifier[isStrictID] operator[SEP] { identifier[HashMap] identifier[newEvent] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[EventType] identifier[type] operator[SEP] Keyword[try] { identifier[type] operator[=] identifier[EventType] operator[SEP] identifier[valueOf] operator[SEP] identifier[typeStr] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[typeStr] operator[=] identifier[type] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[typeStr] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[newEvent] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[typeStr] operator[SEP] operator[SEP] identifier[String] identifier[pdate] operator[=] identifier[getFstPdate] operator[SEP] identifier[data] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pdate] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[date] operator[=] identifier[dateOffset] operator[SEP] identifier[pdate] , identifier[dap] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[date] operator[!=] Other[null] operator[SEP] { identifier[newEvent] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[date] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[dap] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isStrictID] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[ids] operator[=] identifier[info] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[id] operator[:] identifier[ids] operator[SEP] { identifier[String] identifier[path] operator[=] identifier[AcePathfinder] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getPath] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[||] operator[!] identifier[path] operator[SEP] identifier[contains] operator[SEP] identifier[typeStr] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } identifier[newEvent] operator[SEP] identifier[putAll] operator[SEP] identifier[info] operator[SEP] operator[SEP] Keyword[return] identifier[newEvent] operator[SEP] }
public static boolean setFeatureStyle(PolylineOptions polylineOptions, GeoPackage geoPackage, FeatureRow featureRow, float density) { FeatureStyleExtension featureStyleExtension = new FeatureStyleExtension(geoPackage); return setFeatureStyle(polylineOptions, featureStyleExtension, featureRow, density); }
class class_name[name] begin[{] method[setFeatureStyle, return_type[type[boolean]], modifier[public static], parameter[polylineOptions, geoPackage, featureRow, density]] begin[{] local_variable[type[FeatureStyleExtension], featureStyleExtension] return[call[.setFeatureStyle, parameter[member[.polylineOptions], member[.featureStyleExtension], member[.featureRow], member[.density]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[setFeatureStyle] operator[SEP] identifier[PolylineOptions] identifier[polylineOptions] , identifier[GeoPackage] identifier[geoPackage] , identifier[FeatureRow] identifier[featureRow] , Keyword[float] identifier[density] operator[SEP] { identifier[FeatureStyleExtension] identifier[featureStyleExtension] operator[=] Keyword[new] identifier[FeatureStyleExtension] operator[SEP] identifier[geoPackage] operator[SEP] operator[SEP] Keyword[return] identifier[setFeatureStyle] operator[SEP] identifier[polylineOptions] , identifier[featureStyleExtension] , identifier[featureRow] , identifier[density] operator[SEP] operator[SEP] }
private void replaceStringNodeLocationForExportedTopLevelVariable( Node n, int sourcePosition, int length) { if (n.hasOneChild()) { Node assign = n.getFirstChild(); if (assign != null && assign.isAssign()) { // ASSIGN always has two children. Node getProp = assign.getFirstChild(); if (getProp != null && getProp.isGetProp()) { // GETPROP always has two children: a name node and a string node. They should both take // on the source range of the original variable. for (Node child : getProp.children()) { child.setSourceEncodedPosition(sourcePosition); child.setLength(length); } } } } }
class class_name[name] begin[{] method[replaceStringNodeLocationForExportedTopLevelVariable, return_type[void], modifier[private], parameter[n, sourcePosition, length]] begin[{] if[call[n.hasOneChild, parameter[]]] begin[{] local_variable[type[Node], assign] if[binary_operation[binary_operation[member[.assign], !=, literal[null]], &&, call[assign.isAssign, parameter[]]]] begin[{] local_variable[type[Node], getProp] if[binary_operation[binary_operation[member[.getProp], !=, literal[null]], &&, call[getProp.isGetProp, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sourcePosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSourceEncodedPosition, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLength, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=children, postfix_operators=[], prefix_operators=[], qualifier=getProp, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[replaceStringNodeLocationForExportedTopLevelVariable] operator[SEP] identifier[Node] identifier[n] , Keyword[int] identifier[sourcePosition] , Keyword[int] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[hasOneChild] operator[SEP] operator[SEP] operator[SEP] { identifier[Node] identifier[assign] operator[=] identifier[n] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[assign] operator[!=] Other[null] operator[&&] identifier[assign] operator[SEP] identifier[isAssign] operator[SEP] operator[SEP] operator[SEP] { identifier[Node] identifier[getProp] operator[=] identifier[assign] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getProp] operator[!=] Other[null] operator[&&] identifier[getProp] operator[SEP] identifier[isGetProp] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Node] identifier[child] operator[:] identifier[getProp] operator[SEP] identifier[children] operator[SEP] operator[SEP] operator[SEP] { identifier[child] operator[SEP] identifier[setSourceEncodedPosition] operator[SEP] identifier[sourcePosition] operator[SEP] operator[SEP] identifier[child] operator[SEP] identifier[setLength] operator[SEP] identifier[length] operator[SEP] operator[SEP] } } } } }
@Override public ListStateMachinesResult listStateMachines(ListStateMachinesRequest request) { request = beforeClientExecution(request); return executeListStateMachines(request); }
class class_name[name] begin[{] method[listStateMachines, return_type[type[ListStateMachinesResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeListStateMachines, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ListStateMachinesResult] identifier[listStateMachines] operator[SEP] identifier[ListStateMachinesRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListStateMachines] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public Number parse(String text, ParsePosition parsePosition, double upperBound) { // try matching each rule in the rule set against the text being // parsed. Whichever one matches the most characters is the one // that determines the value we return. ParsePosition highWaterMark = new ParsePosition(0); Number result = NFRule.ZERO; Number tempResult; // dump out if there's no text to parse if (text.length() == 0) { return result; } // Try each of the negative rules, fraction rules, infinity rules and NaN rules for (NFRule fractionRule : nonNumericalRules) { if (fractionRule != null) { tempResult = fractionRule.doParse(text, parsePosition, false, upperBound); if (parsePosition.getIndex() > highWaterMark.getIndex()) { result = tempResult; highWaterMark.setIndex(parsePosition.getIndex()); } // commented out because the error-index API on ParsePosition isn't there in 1.1.x // if (parsePosition.getErrorIndex() > highWaterMark.getErrorIndex()) { // highWaterMark.setErrorIndex(parsePosition.getErrorIndex()); // } parsePosition.setIndex(0); } } // finally, go through the regular rules one at a time. We start // at the end of the list because we want to try matching the most // significant rule first (this helps ensure that we parse // "five thousand three hundred six" as // "(five thousand) (three hundred) (six)" rather than // "((five thousand three) hundred) (six)"). Skip rules whose // base values are higher than the upper bound (again, this helps // limit ambiguity by making sure the rules that match a rule's // are less significant than the rule containing the substitutions)/ for (int i = rules.length - 1; i >= 0 && highWaterMark.getIndex() < text.length(); i--) { if (!isFractionRuleSet && rules[i].getBaseValue() >= upperBound) { continue; } tempResult = rules[i].doParse(text, parsePosition, isFractionRuleSet, upperBound); if (parsePosition.getIndex() > highWaterMark.getIndex()) { result = tempResult; highWaterMark.setIndex(parsePosition.getIndex()); } // commented out because the error-index API on ParsePosition isn't there in 1.1.x // if (parsePosition.getErrorIndex() > highWaterMark.getErrorIndex()) { // highWaterMark.setErrorIndex(parsePosition.getErrorIndex()); // } parsePosition.setIndex(0); } // finally, update the parse position we were passed to point to the // first character we didn't use, and return the result that // corresponds to that string of characters parsePosition.setIndex(highWaterMark.getIndex()); // commented out because the error-index API on ParsePosition isn't there in 1.1.x // if (parsePosition.getIndex() == 0) { // parsePosition.setErrorIndex(highWaterMark.getErrorIndex()); // } return result; }
class class_name[name] begin[{] method[parse, return_type[type[Number]], modifier[public], parameter[text, parsePosition, upperBound]] begin[{] local_variable[type[ParsePosition], highWaterMark] local_variable[type[Number], result] local_variable[type[Number], tempResult] if[binary_operation[call[text.length, parameter[]], ==, literal[0]]] begin[{] return[member[.result]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fractionRule, 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=tempResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parsePosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=upperBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doParse, postfix_operators=[], prefix_operators=[], qualifier=fractionRule, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=parsePosition, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=highWaterMark, selectors=[], type_arguments=None), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tempResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=parsePosition, selectors=[], type_arguments=None)], member=setIndex, postfix_operators=[], prefix_operators=[], qualifier=highWaterMark, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setIndex, postfix_operators=[], prefix_operators=[], qualifier=parsePosition, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=nonNumericalRules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fractionRule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NFRule, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isFractionRuleSet, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=rules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getBaseValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MemberReference(member=upperBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tempResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=rules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parsePosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isFractionRuleSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=upperBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doParse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=parsePosition, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=highWaterMark, selectors=[], type_arguments=None), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tempResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=parsePosition, selectors=[], type_arguments=None)], member=setIndex, postfix_operators=[], prefix_operators=[], qualifier=highWaterMark, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setIndex, postfix_operators=[], prefix_operators=[], qualifier=parsePosition, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=highWaterMark, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operator=<), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=rules, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[parsePosition.setIndex, parameter[call[highWaterMark.getIndex, parameter[]]]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Number] identifier[parse] operator[SEP] identifier[String] identifier[text] , identifier[ParsePosition] identifier[parsePosition] , Keyword[double] identifier[upperBound] operator[SEP] { identifier[ParsePosition] identifier[highWaterMark] operator[=] Keyword[new] identifier[ParsePosition] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Number] identifier[result] operator[=] identifier[NFRule] operator[SEP] identifier[ZERO] operator[SEP] identifier[Number] identifier[tempResult] operator[SEP] Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[result] operator[SEP] } Keyword[for] operator[SEP] identifier[NFRule] identifier[fractionRule] operator[:] identifier[nonNumericalRules] operator[SEP] { Keyword[if] operator[SEP] identifier[fractionRule] operator[!=] Other[null] operator[SEP] { identifier[tempResult] operator[=] identifier[fractionRule] operator[SEP] identifier[doParse] operator[SEP] identifier[text] , identifier[parsePosition] , literal[boolean] , identifier[upperBound] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parsePosition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[>] identifier[highWaterMark] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[tempResult] operator[SEP] identifier[highWaterMark] operator[SEP] identifier[setIndex] operator[SEP] identifier[parsePosition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[parsePosition] operator[SEP] identifier[setIndex] operator[SEP] Other[0] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[rules] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[&&] identifier[highWaterMark] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[<] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[--] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isFractionRuleSet] operator[&&] identifier[rules] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getBaseValue] operator[SEP] operator[SEP] operator[>=] identifier[upperBound] operator[SEP] { Keyword[continue] operator[SEP] } identifier[tempResult] operator[=] identifier[rules] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[doParse] operator[SEP] identifier[text] , identifier[parsePosition] , identifier[isFractionRuleSet] , identifier[upperBound] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parsePosition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[>] identifier[highWaterMark] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[tempResult] operator[SEP] identifier[highWaterMark] operator[SEP] identifier[setIndex] operator[SEP] identifier[parsePosition] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[parsePosition] operator[SEP] identifier[setIndex] operator[SEP] Other[0] operator[SEP] operator[SEP] } identifier[parsePosition] operator[SEP] identifier[setIndex] operator[SEP] identifier[highWaterMark] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static Color lerpColor(ColorSet colorSet1, ColorSet colorSet2, double amt) { return lerpColor((HSBColor)HSBColor.color(colorSet1), (HSBColor)HSBColor.color(colorSet2), amt); }
class class_name[name] begin[{] method[lerpColor, return_type[type[Color]], modifier[public static], parameter[colorSet1, colorSet2, amt]] begin[{] return[call[.lerpColor, parameter[Cast(expression=MethodInvocation(arguments=[MemberReference(member=colorSet1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=color, postfix_operators=[], prefix_operators=[], qualifier=HSBColor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HSBColor, sub_type=None)), Cast(expression=MethodInvocation(arguments=[MemberReference(member=colorSet2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=color, postfix_operators=[], prefix_operators=[], qualifier=HSBColor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HSBColor, sub_type=None)), member[.amt]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Color] identifier[lerpColor] operator[SEP] identifier[ColorSet] identifier[colorSet1] , identifier[ColorSet] identifier[colorSet2] , Keyword[double] identifier[amt] operator[SEP] { Keyword[return] identifier[lerpColor] operator[SEP] operator[SEP] identifier[HSBColor] operator[SEP] identifier[HSBColor] operator[SEP] identifier[color] operator[SEP] identifier[colorSet1] operator[SEP] , operator[SEP] identifier[HSBColor] operator[SEP] identifier[HSBColor] operator[SEP] identifier[color] operator[SEP] identifier[colorSet2] operator[SEP] , identifier[amt] operator[SEP] operator[SEP] }
private static void doExecute(Executor executor, Runnable runnable) { try { executor.execute(runnable); } catch (Throwable th) { log.log(Level.SEVERE, "Failed to execute PingCallback", th); } }
class class_name[name] begin[{] method[doExecute, return_type[void], modifier[private static], parameter[executor, runnable]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=runnable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=executor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to execute PingCallback"), MemberReference(member=th, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=th, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[doExecute] operator[SEP] identifier[Executor] identifier[executor] , identifier[Runnable] identifier[runnable] operator[SEP] { Keyword[try] { identifier[executor] operator[SEP] identifier[execute] operator[SEP] identifier[runnable] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[th] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[th] operator[SEP] operator[SEP] } }
@Override public void removeByG_U(long groupId, long userId) { for (CommerceWishList commerceWishList : findByG_U(groupId, userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceWishList); } }
class class_name[name] begin[{] method[removeByG_U, return_type[void], modifier[public], parameter[groupId, userId]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commerceWishList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=findByG_U, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=commerceWishList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceWishList, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeByG_U] operator[SEP] Keyword[long] identifier[groupId] , Keyword[long] identifier[userId] operator[SEP] { Keyword[for] operator[SEP] identifier[CommerceWishList] identifier[commerceWishList] operator[:] identifier[findByG_U] operator[SEP] identifier[groupId] , identifier[userId] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] { identifier[remove] operator[SEP] identifier[commerceWishList] operator[SEP] operator[SEP] } }
public static TermWalker positionalWalker(PositionalTermVisitor visitor) { PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl(); positionalTraverser.setContextChangeVisitor(visitor); visitor.setPositionalTraverser(positionalTraverser); return new TermWalker(new DepthFirstBacktrackingSearch<Term, Term>(), positionalTraverser, visitor); }
class class_name[name] begin[{] method[positionalWalker, return_type[type[TermWalker]], modifier[public static], parameter[visitor]] begin[{] local_variable[type[PositionalTermTraverser], positionalTraverser] call[positionalTraverser.setContextChangeVisitor, parameter[member[.visitor]]] call[visitor.setPositionalTraverser, parameter[member[.positionalTraverser]]] return[ClassCreator(arguments=[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=Term, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Term, sub_type=None))], dimensions=None, name=DepthFirstBacktrackingSearch, sub_type=None)), MemberReference(member=positionalTraverser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=visitor, 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=TermWalker, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[TermWalker] identifier[positionalWalker] operator[SEP] identifier[PositionalTermVisitor] identifier[visitor] operator[SEP] { identifier[PositionalTermTraverser] identifier[positionalTraverser] operator[=] Keyword[new] identifier[PositionalTermTraverserImpl] operator[SEP] operator[SEP] operator[SEP] identifier[positionalTraverser] operator[SEP] identifier[setContextChangeVisitor] operator[SEP] identifier[visitor] operator[SEP] operator[SEP] identifier[visitor] operator[SEP] identifier[setPositionalTraverser] operator[SEP] identifier[positionalTraverser] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TermWalker] operator[SEP] Keyword[new] identifier[DepthFirstBacktrackingSearch] operator[<] identifier[Term] , identifier[Term] operator[>] operator[SEP] operator[SEP] , identifier[positionalTraverser] , identifier[visitor] operator[SEP] operator[SEP] }
public static void storeToFolder(File folder, Collection<? extends EclipseBundle> bundles, Collection<? extends EclipseFeature> features) throws IOException { File pluginsFolder = new File(folder, PLUGINS_FOLDER); File featuresFolder = new File(folder, FEATURES_FOLDER); FileUtils.forceMkdir(pluginsFolder); FileUtils.forceMkdir(featuresFolder); for (EclipseFeature feature : features) { if (feature instanceof StreamReference) { try (InputStream stream = ((StreamReference) feature).createStream()) { FileUtils.copyInputStreamToFile(stream, new File(featuresFolder, getFileName(feature))); } } else { throw new IllegalArgumentException("feature " + createWrongTypeMsg(feature)); } } for (EclipseBundle bundle : bundles) { if (bundle instanceof StreamReference) { try (InputStream stream = ((StreamReference) bundle).createStream()) { FileUtils.copyInputStreamToFile(stream, new File(pluginsFolder, getFileName(bundle))); } } else { throw new IllegalArgumentException("bundle " + createWrongTypeMsg(bundle)); } } }
class class_name[name] begin[{] method[storeToFolder, return_type[void], modifier[public static], parameter[folder, bundles, features]] begin[{] local_variable[type[File], pluginsFolder] local_variable[type[File], featuresFolder] call[FileUtils.forceMkdir, parameter[member[.pluginsFolder]]] call[FileUtils.forceMkdir, parameter[member[.featuresFolder]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=StreamReference, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="feature "), operandr=MethodInvocation(arguments=[MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createWrongTypeMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=featuresFolder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFileName, 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=File, sub_type=None))], member=copyInputStreamToFile, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stream, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=Cast(expression=MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StreamReference, sub_type=None)))])]))]), control=EnhancedForControl(iterable=MemberReference(member=features, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=feature)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EclipseFeature, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bundle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=StreamReference, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bundle "), operandr=MethodInvocation(arguments=[MemberReference(member=bundle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createWrongTypeMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=pluginsFolder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=bundle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFileName, 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=File, sub_type=None))], member=copyInputStreamToFile, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stream, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=Cast(expression=MemberReference(member=bundle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StreamReference, sub_type=None)))])]))]), control=EnhancedForControl(iterable=MemberReference(member=bundles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bundle)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EclipseBundle, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[storeToFolder] operator[SEP] identifier[File] identifier[folder] , identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[EclipseBundle] operator[>] identifier[bundles] , identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[EclipseFeature] operator[>] identifier[features] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[pluginsFolder] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[folder] , identifier[PLUGINS_FOLDER] operator[SEP] operator[SEP] identifier[File] identifier[featuresFolder] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[folder] , identifier[FEATURES_FOLDER] operator[SEP] operator[SEP] identifier[FileUtils] operator[SEP] identifier[forceMkdir] operator[SEP] identifier[pluginsFolder] operator[SEP] operator[SEP] identifier[FileUtils] operator[SEP] identifier[forceMkdir] operator[SEP] identifier[featuresFolder] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[EclipseFeature] identifier[feature] operator[:] identifier[features] operator[SEP] { Keyword[if] operator[SEP] identifier[feature] Keyword[instanceof] identifier[StreamReference] operator[SEP] { Keyword[try] operator[SEP] identifier[InputStream] identifier[stream] operator[=] operator[SEP] operator[SEP] identifier[StreamReference] operator[SEP] identifier[feature] operator[SEP] operator[SEP] identifier[createStream] operator[SEP] operator[SEP] operator[SEP] { identifier[FileUtils] operator[SEP] identifier[copyInputStreamToFile] operator[SEP] identifier[stream] , Keyword[new] identifier[File] operator[SEP] identifier[featuresFolder] , identifier[getFileName] operator[SEP] identifier[feature] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[createWrongTypeMsg] operator[SEP] identifier[feature] operator[SEP] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[EclipseBundle] identifier[bundle] operator[:] identifier[bundles] operator[SEP] { Keyword[if] operator[SEP] identifier[bundle] Keyword[instanceof] identifier[StreamReference] operator[SEP] { Keyword[try] operator[SEP] identifier[InputStream] identifier[stream] operator[=] operator[SEP] operator[SEP] identifier[StreamReference] operator[SEP] identifier[bundle] operator[SEP] operator[SEP] identifier[createStream] operator[SEP] operator[SEP] operator[SEP] { identifier[FileUtils] operator[SEP] identifier[copyInputStreamToFile] operator[SEP] identifier[stream] , Keyword[new] identifier[File] operator[SEP] identifier[pluginsFolder] , identifier[getFileName] operator[SEP] identifier[bundle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[createWrongTypeMsg] operator[SEP] identifier[bundle] operator[SEP] operator[SEP] operator[SEP] } } }
public boolean isMarshallable(final AttributeDefinition attribute, final ModelNode resourceModel, final boolean marshallDefault) { return resourceModel.hasDefined(attribute.getName()) && (marshallDefault || !resourceModel.get(attribute.getName()).equals(attribute.getDefaultValue())); }
class class_name[name] begin[{] method[isMarshallable, return_type[type[boolean]], modifier[public], parameter[attribute, resourceModel, marshallDefault]] begin[{] return[binary_operation[call[resourceModel.hasDefined, parameter[call[attribute.getName, parameter[]]]], &&, binary_operation[member[.marshallDefault], ||, call[resourceModel.get, parameter[call[attribute.getName, parameter[]]]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isMarshallable] operator[SEP] Keyword[final] identifier[AttributeDefinition] identifier[attribute] , Keyword[final] identifier[ModelNode] identifier[resourceModel] , Keyword[final] Keyword[boolean] identifier[marshallDefault] operator[SEP] { Keyword[return] identifier[resourceModel] operator[SEP] identifier[hasDefined] operator[SEP] identifier[attribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[marshallDefault] operator[||] operator[!] identifier[resourceModel] operator[SEP] identifier[get] operator[SEP] identifier[attribute] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[attribute] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public EClass getIfcStyledRepresentation() { if (ifcStyledRepresentationEClass == null) { ifcStyledRepresentationEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(667); } return ifcStyledRepresentationEClass; }
class class_name[name] begin[{] method[getIfcStyledRepresentation, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcStyledRepresentationEClass], ==, literal[null]]] begin[{] assign[member[.ifcStyledRepresentationEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=667)], 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[.ifcStyledRepresentationEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcStyledRepresentation] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcStyledRepresentationEClass] operator[==] Other[null] operator[SEP] { identifier[ifcStyledRepresentationEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[667] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcStyledRepresentationEClass] operator[SEP] }
@Override public void start() { config.getIcon().map(Media::getFile).filter(File::exists).ifPresent(file -> setIcon(file.getPath())); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] call[config.getIcon, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] { identifier[config] operator[SEP] identifier[getIcon] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Media] operator[::] identifier[getFile] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[File] operator[::] identifier[exists] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[file] operator[->] identifier[setIcon] operator[SEP] identifier[file] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void close(SelectionKey key, Exception cause) { if (key == null) { return; } // Cancel key key.cancel(); // Get channel SelectableChannel channel = key.channel(); if (channel == null) { return; } // Debug if (debug) { try { if (channel instanceof SocketChannel) { SocketChannel socketChannel = (SocketChannel) channel; logger.info("Client channel closed to " + socketChannel.getRemoteAddress() + ".", cause); } } catch (Exception ignored) { } } // Close channel try { channel.close(); } catch (Exception ignored) { } }
class class_name[name] begin[{] method[close, return_type[void], modifier[protected], parameter[key, cause]] begin[{] if[binary_operation[member[.key], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] call[key.cancel, parameter[]] local_variable[type[SelectableChannel], channel] if[binary_operation[member[.channel], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[member[.debug]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SocketChannel, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SocketChannel, sub_type=None)), name=socketChannel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SocketChannel, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Client channel closed to "), operandr=MethodInvocation(arguments=[], member=getRemoteAddress, postfix_operators=[], prefix_operators=[], qualifier=socketChannel, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[close] operator[SEP] identifier[SelectionKey] identifier[key] , identifier[Exception] identifier[cause] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[key] operator[SEP] identifier[cancel] operator[SEP] operator[SEP] operator[SEP] identifier[SelectableChannel] identifier[channel] operator[=] identifier[key] operator[SEP] identifier[channel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[channel] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[debug] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[channel] Keyword[instanceof] identifier[SocketChannel] operator[SEP] { identifier[SocketChannel] identifier[socketChannel] operator[=] operator[SEP] identifier[SocketChannel] operator[SEP] identifier[channel] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[socketChannel] operator[SEP] identifier[getRemoteAddress] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[cause] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignored] operator[SEP] { } } Keyword[try] { identifier[channel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignored] operator[SEP] { } }
public void ensureMinMax() { double t; if (this.maxx < this.minx) { t = this.minx; this.minx = this.maxx; this.maxx = t; } if (this.maxy < this.miny) { t = this.miny; this.miny = this.maxy; this.maxy = t; } if (this.maxz < this.minz) { t = this.minz; this.minz = this.maxz; this.maxz = t; } if (this.maxm < this.minm) { t = this.minm; this.minm = this.maxm; this.maxm = t; } }
class class_name[name] begin[{] method[ensureMinMax, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[double], t] if[binary_operation[THIS[member[None.maxx]], <, THIS[member[None.minx]]]] begin[{] assign[member[.t], THIS[member[None.minx]]] assign[THIS[member[None.minx]], THIS[member[None.maxx]]] assign[THIS[member[None.maxx]], member[.t]] else begin[{] None end[}] if[binary_operation[THIS[member[None.maxy]], <, THIS[member[None.miny]]]] begin[{] assign[member[.t], THIS[member[None.miny]]] assign[THIS[member[None.miny]], THIS[member[None.maxy]]] assign[THIS[member[None.maxy]], member[.t]] else begin[{] None end[}] if[binary_operation[THIS[member[None.maxz]], <, THIS[member[None.minz]]]] begin[{] assign[member[.t], THIS[member[None.minz]]] assign[THIS[member[None.minz]], THIS[member[None.maxz]]] assign[THIS[member[None.maxz]], member[.t]] else begin[{] None end[}] if[binary_operation[THIS[member[None.maxm]], <, THIS[member[None.minm]]]] begin[{] assign[member[.t], THIS[member[None.minm]]] assign[THIS[member[None.minm]], THIS[member[None.maxm]]] assign[THIS[member[None.maxm]], member[.t]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[ensureMinMax] operator[SEP] operator[SEP] { Keyword[double] identifier[t] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[maxx] operator[<] Keyword[this] operator[SEP] identifier[minx] operator[SEP] { identifier[t] operator[=] Keyword[this] operator[SEP] identifier[minx] operator[SEP] Keyword[this] operator[SEP] identifier[minx] operator[=] Keyword[this] operator[SEP] identifier[maxx] operator[SEP] Keyword[this] operator[SEP] identifier[maxx] operator[=] identifier[t] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[maxy] operator[<] Keyword[this] operator[SEP] identifier[miny] operator[SEP] { identifier[t] operator[=] Keyword[this] operator[SEP] identifier[miny] operator[SEP] Keyword[this] operator[SEP] identifier[miny] operator[=] Keyword[this] operator[SEP] identifier[maxy] operator[SEP] Keyword[this] operator[SEP] identifier[maxy] operator[=] identifier[t] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[maxz] operator[<] Keyword[this] operator[SEP] identifier[minz] operator[SEP] { identifier[t] operator[=] Keyword[this] operator[SEP] identifier[minz] operator[SEP] Keyword[this] operator[SEP] identifier[minz] operator[=] Keyword[this] operator[SEP] identifier[maxz] operator[SEP] Keyword[this] operator[SEP] identifier[maxz] operator[=] identifier[t] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[maxm] operator[<] Keyword[this] operator[SEP] identifier[minm] operator[SEP] { identifier[t] operator[=] Keyword[this] operator[SEP] identifier[minm] operator[SEP] Keyword[this] operator[SEP] identifier[minm] operator[=] Keyword[this] operator[SEP] identifier[maxm] operator[SEP] Keyword[this] operator[SEP] identifier[maxm] operator[=] identifier[t] operator[SEP] } }
public boolean contains0(int idx) { if (idx < 0) throw new IndexOutOfBoundsException("idx < 0: " + idx); idx -= _bitoff; return (idx >= 0) && (idx < _nbits) && (_val[_byteoff + (idx >> 3)] & ((byte)1 << (idx & 7))) != 0; }
class class_name[name] begin[{] method[contains0, return_type[type[boolean]], modifier[public], parameter[idx]] begin[{] if[binary_operation[member[.idx], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="idx < 0: "), operandr=MemberReference(member=idx, 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=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.idx], member[._bitoff]] return[binary_operation[binary_operation[binary_operation[member[.idx], >=, literal[0]], &&, binary_operation[member[.idx], <, member[._nbits]]], &&, binary_operation[binary_operation[member[._val], &, binary_operation[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), type=BasicType(dimensions=[], name=byte)), <<, binary_operation[member[.idx], &, literal[7]]]], !=, literal[0]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[contains0] operator[SEP] Keyword[int] identifier[idx] operator[SEP] { Keyword[if] operator[SEP] identifier[idx] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] literal[String] operator[+] identifier[idx] operator[SEP] operator[SEP] identifier[idx] operator[-=] identifier[_bitoff] operator[SEP] Keyword[return] operator[SEP] identifier[idx] operator[>=] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[idx] operator[<] identifier[_nbits] operator[SEP] operator[&&] operator[SEP] identifier[_val] operator[SEP] identifier[_byteoff] operator[+] operator[SEP] identifier[idx] operator[>] operator[>] Other[3] operator[SEP] operator[SEP] operator[&] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] Other[1] operator[<<] operator[SEP] identifier[idx] operator[&] Other[7] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] }
public void setServicesLastAccessed(java.util.Collection<ServiceLastAccessed> servicesLastAccessed) { if (servicesLastAccessed == null) { this.servicesLastAccessed = null; return; } this.servicesLastAccessed = new com.amazonaws.internal.SdkInternalList<ServiceLastAccessed>(servicesLastAccessed); }
class class_name[name] begin[{] method[setServicesLastAccessed, return_type[void], modifier[public], parameter[servicesLastAccessed]] begin[{] if[binary_operation[member[.servicesLastAccessed], ==, literal[null]]] begin[{] assign[THIS[member[None.servicesLastAccessed]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.servicesLastAccessed]], ClassCreator(arguments=[MemberReference(member=servicesLastAccessed, 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=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServiceLastAccessed, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setServicesLastAccessed] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ServiceLastAccessed] operator[>] identifier[servicesLastAccessed] operator[SEP] { Keyword[if] operator[SEP] identifier[servicesLastAccessed] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[servicesLastAccessed] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[servicesLastAccessed] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ServiceLastAccessed] operator[>] operator[SEP] identifier[servicesLastAccessed] operator[SEP] operator[SEP] }
public final Ix<List<T>> collectToList() { return collect(ToListHelper.<T>initialFactory(), ToListHelper.<T>collector()); }
class class_name[name] begin[{] method[collectToList, return_type[type[Ix]], modifier[final public], parameter[]] begin[{] return[call[.collect, parameter[call[.ToListHelper, parameter[]], call[.ToListHelper, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Ix] operator[<] identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[collectToList] operator[SEP] operator[SEP] { Keyword[return] identifier[collect] operator[SEP] identifier[ToListHelper] operator[SEP] operator[<] identifier[T] operator[>] identifier[initialFactory] operator[SEP] operator[SEP] , identifier[ToListHelper] operator[SEP] operator[<] identifier[T] operator[>] identifier[collector] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
static boolean isBasicValueType(final Object obj) { return obj == null || obj instanceof String || obj instanceof Integer || obj instanceof Boolean || obj instanceof Long || obj instanceof Float || obj instanceof Double || obj instanceof Short || obj instanceof Byte || obj instanceof Character || obj.getClass().isEnum(); }
class class_name[name] begin[{] method[isBasicValueType, return_type[type[boolean]], modifier[static], parameter[obj]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.obj], ==, literal[null]], ||, binary_operation[member[.obj], instanceof, type[String]]], ||, binary_operation[member[.obj], instanceof, type[Integer]]], ||, binary_operation[member[.obj], instanceof, type[Boolean]]], ||, binary_operation[member[.obj], instanceof, type[Long]]], ||, binary_operation[member[.obj], instanceof, type[Float]]], ||, binary_operation[member[.obj], instanceof, type[Double]]], ||, binary_operation[member[.obj], instanceof, type[Short]]], ||, binary_operation[member[.obj], instanceof, type[Byte]]], ||, binary_operation[member[.obj], instanceof, type[Character]]], ||, call[obj.getClass, parameter[]]]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[isBasicValueType] operator[SEP] Keyword[final] identifier[Object] identifier[obj] operator[SEP] { Keyword[return] identifier[obj] operator[==] Other[null] operator[||] identifier[obj] Keyword[instanceof] identifier[String] operator[||] identifier[obj] Keyword[instanceof] identifier[Integer] operator[||] identifier[obj] Keyword[instanceof] identifier[Boolean] operator[||] identifier[obj] Keyword[instanceof] identifier[Long] operator[||] identifier[obj] Keyword[instanceof] identifier[Float] operator[||] identifier[obj] Keyword[instanceof] identifier[Double] operator[||] identifier[obj] Keyword[instanceof] identifier[Short] operator[||] identifier[obj] Keyword[instanceof] identifier[Byte] operator[||] identifier[obj] Keyword[instanceof] identifier[Character] operator[||] identifier[obj] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[SEP] }
public void extractChild( PlanNode child ) { if (child.getChildCount() == 0) { removeChild(child); } else { PlanNode grandChild = child.getFirstChild(); replaceChild(child, grandChild); } }
class class_name[name] begin[{] method[extractChild, return_type[void], modifier[public], parameter[child]] begin[{] if[binary_operation[call[child.getChildCount, parameter[]], ==, literal[0]]] begin[{] call[.removeChild, parameter[member[.child]]] else begin[{] local_variable[type[PlanNode], grandChild] call[.replaceChild, parameter[member[.child], member[.grandChild]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[extractChild] operator[SEP] identifier[PlanNode] identifier[child] operator[SEP] { Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[removeChild] operator[SEP] identifier[child] operator[SEP] operator[SEP] } Keyword[else] { identifier[PlanNode] identifier[grandChild] operator[=] identifier[child] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[replaceChild] operator[SEP] identifier[child] , identifier[grandChild] operator[SEP] operator[SEP] } }
@Override public <B> Identity<B> flatMap(Function<? super A, ? extends Monad<B, Identity<?>>> f) { return f.apply(runIdentity()).coerce(); }
class class_name[name] begin[{] method[flatMap, return_type[type[Identity]], modifier[public], parameter[f]] begin[{] return[call[f.apply, parameter[call[.runIdentity, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[B] operator[>] identifier[Identity] operator[<] identifier[B] operator[>] identifier[flatMap] operator[SEP] identifier[Function] operator[<] operator[?] Keyword[super] identifier[A] , operator[?] Keyword[extends] identifier[Monad] operator[<] identifier[B] , identifier[Identity] operator[<] operator[?] operator[>] operator[>] operator[>] identifier[f] operator[SEP] { Keyword[return] identifier[f] operator[SEP] identifier[apply] operator[SEP] identifier[runIdentity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[coerce] operator[SEP] operator[SEP] operator[SEP] }
@Override public void updateByte(final String columnLabel, final byte x) throws SQLException { wrapped.updateByte(columnLabel, x); }
class class_name[name] begin[{] method[updateByte, return_type[void], modifier[public], parameter[columnLabel, x]] begin[{] call[wrapped.updateByte, parameter[member[.columnLabel], member[.x]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[updateByte] operator[SEP] Keyword[final] identifier[String] identifier[columnLabel] , Keyword[final] Keyword[byte] identifier[x] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[wrapped] operator[SEP] identifier[updateByte] operator[SEP] identifier[columnLabel] , identifier[x] operator[SEP] operator[SEP] }
private String build(Evidence evidence) { VelocityContext context = new VelocityContext(); StringWriter writer = new StringWriter(); context.put("records", evidence.getRecords()); context.put("caseNo", evidence.getCaseNo()); context.put("testScriptName", evidence.getScriptName()); context.put("result", (evidence.hasError()) ? "NG" : ""); Future<?> screenshotRezeFuture = evidence.getScreenshotResizeFuture(); if (screenshotRezeFuture != null) { try { screenshotRezeFuture.get(3, TimeUnit.SECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { LOG.warn("screenshot.resize.wait.error", e); } } tmpl.merge(context, writer); return writer.toString(); }
class class_name[name] begin[{] method[build, return_type[type[String]], modifier[private], parameter[evidence]] begin[{] local_variable[type[VelocityContext], context] local_variable[type[StringWriter], writer] call[context.put, parameter[literal["records"], call[evidence.getRecords, parameter[]]]] call[context.put, parameter[literal["caseNo"], call[evidence.getCaseNo, parameter[]]]] call[context.put, parameter[literal["testScriptName"], call[evidence.getScriptName, parameter[]]]] call[context.put, parameter[literal["result"], TernaryExpression(condition=MethodInvocation(arguments=[], member=hasError, postfix_operators=[], prefix_operators=[], qualifier=evidence, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NG"))]] local_variable[type[Future], screenshotRezeFuture] if[binary_operation[member[.screenshotRezeFuture], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=SECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=screenshotRezeFuture, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="screenshot.resize.wait.error"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException', 'ExecutionException', 'TimeoutException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] call[tmpl.merge, parameter[member[.context], member[.writer]]] return[call[writer.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[build] operator[SEP] identifier[Evidence] identifier[evidence] operator[SEP] { identifier[VelocityContext] identifier[context] operator[=] Keyword[new] identifier[VelocityContext] operator[SEP] operator[SEP] operator[SEP] identifier[StringWriter] identifier[writer] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[evidence] operator[SEP] identifier[getRecords] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[evidence] operator[SEP] identifier[getCaseNo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[evidence] operator[SEP] identifier[getScriptName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] literal[String] , operator[SEP] identifier[evidence] operator[SEP] identifier[hasError] operator[SEP] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[Future] operator[<] operator[?] operator[>] identifier[screenshotRezeFuture] operator[=] identifier[evidence] operator[SEP] identifier[getScreenshotResizeFuture] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[screenshotRezeFuture] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[screenshotRezeFuture] operator[SEP] identifier[get] operator[SEP] Other[3] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] operator[|] identifier[ExecutionException] operator[|] identifier[TimeoutException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } identifier[tmpl] operator[SEP] identifier[merge] operator[SEP] identifier[context] , identifier[writer] operator[SEP] operator[SEP] Keyword[return] identifier[writer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public GarbageCollectorMXBean getGarbageCollectorMXBean(String name) { for (GarbageCollectorMXBean bean : getGarbageCollectorMXBeans()) { if (bean.getName().equals(name)) { return bean; } } return null; }
class class_name[name] begin[{] method[getGarbageCollectorMXBean, return_type[type[GarbageCollectorMXBean]], modifier[public], parameter[name]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=bean, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getGarbageCollectorMXBeans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GarbageCollectorMXBean, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[GarbageCollectorMXBean] identifier[getGarbageCollectorMXBean] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[for] operator[SEP] identifier[GarbageCollectorMXBean] identifier[bean] operator[:] identifier[getGarbageCollectorMXBeans] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[bean] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[return] identifier[bean] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
@Override public void visitParameterAnnotation(ParameterAnnotations arg0) { ParameterAnnotationEntry[] parameterAnnotationEntries = arg0.getParameterAnnotationEntries(); int numParametersToMethod = getNumberMethodArguments(); int offset = 0; if (numParametersToMethod > parameterAnnotationEntries.length) { offset = 1; } for (int i = 0; i < parameterAnnotationEntries.length; i++) { ParameterAnnotationEntry e = parameterAnnotationEntries[i]; for (AnnotationEntry ae : e.getAnnotationEntries()) { boolean runtimeVisible = ae.isRuntimeVisible(); String name = ClassName.fromFieldSignature(ae.getAnnotationType()); if (name == null) { continue; } name = ClassName.toDottedClassName(name); Map<String, ElementValue> map = new HashMap<>(); for (ElementValuePair ev : ae.getElementValuePairs()) { map.put(ev.getNameString(), ev.getValue()); } visitParameterAnnotation(offset + i, name, map, runtimeVisible); } } }
class class_name[name] begin[{] method[visitParameterAnnotation, return_type[void], modifier[public], parameter[arg0]] begin[{] local_variable[type[ParameterAnnotationEntry], parameterAnnotationEntries] local_variable[type[int], numParametersToMethod] local_variable[type[int], offset] if[binary_operation[member[.numParametersToMethod], >, member[parameterAnnotationEntries.length]]] begin[{] assign[member[.offset], literal[1]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=parameterAnnotationEntries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParameterAnnotationEntry, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=isRuntimeVisible, postfix_operators=[], prefix_operators=[], qualifier=ae, selectors=[], type_arguments=None), name=runtimeVisible)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAnnotationType, postfix_operators=[], prefix_operators=[], qualifier=ae, selectors=[], type_arguments=None)], member=fromFieldSignature, postfix_operators=[], prefix_operators=[], qualifier=ClassName, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=name, 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=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toDottedClassName, postfix_operators=[], prefix_operators=[], qualifier=ClassName, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), name=map)], 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=ElementValue, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNameString, postfix_operators=[], prefix_operators=[], qualifier=ev, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=ev, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getElementValuePairs, postfix_operators=[], prefix_operators=[], qualifier=ae, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ev)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ElementValuePair, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=runtimeVisible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitParameterAnnotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAnnotationEntries, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationEntry, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parameterAnnotationEntries, 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[Override] Keyword[public] Keyword[void] identifier[visitParameterAnnotation] operator[SEP] identifier[ParameterAnnotations] identifier[arg0] operator[SEP] { identifier[ParameterAnnotationEntry] operator[SEP] operator[SEP] identifier[parameterAnnotationEntries] operator[=] identifier[arg0] operator[SEP] identifier[getParameterAnnotationEntries] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numParametersToMethod] operator[=] identifier[getNumberMethodArguments] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[offset] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[numParametersToMethod] operator[>] identifier[parameterAnnotationEntries] operator[SEP] identifier[length] operator[SEP] { identifier[offset] operator[=] Other[1] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parameterAnnotationEntries] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ParameterAnnotationEntry] identifier[e] operator[=] identifier[parameterAnnotationEntries] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AnnotationEntry] identifier[ae] operator[:] identifier[e] operator[SEP] identifier[getAnnotationEntries] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[runtimeVisible] operator[=] identifier[ae] operator[SEP] identifier[isRuntimeVisible] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[ClassName] operator[SEP] identifier[fromFieldSignature] operator[SEP] identifier[ae] operator[SEP] identifier[getAnnotationType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[name] operator[=] identifier[ClassName] operator[SEP] identifier[toDottedClassName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[ElementValue] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ElementValuePair] identifier[ev] operator[:] identifier[ae] operator[SEP] identifier[getElementValuePairs] operator[SEP] operator[SEP] operator[SEP] { identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[ev] operator[SEP] identifier[getNameString] operator[SEP] operator[SEP] , identifier[ev] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[visitParameterAnnotation] operator[SEP] identifier[offset] operator[+] identifier[i] , identifier[name] , identifier[map] , identifier[runtimeVisible] operator[SEP] operator[SEP] } } }
public DevInfo info() { Util.out4.println("DeviceImpl.info() arrived"); final DevInfo back = new DevInfo(); // // Retrieve server host // final Util tg = Util.instance(); back.server_host = tg.get_host_name(); // // Fill-in remaining structure fields // back.dev_class = device_class.get_name(); back.server_id = tg.get_ds_real_name(); back.server_version = Tango_DevVersion; back.doc_url = device_class.get_doc_url(); // // Record operation request in black box // blackbox.insert_op(Op_Info); // // Return to caller // Util.out4.println("Leaving DeviceImpl.info()"); return back; }
class class_name[name] begin[{] method[info, return_type[type[DevInfo]], modifier[public], parameter[]] begin[{] call[Util.out4.println, parameter[literal["DeviceImpl.info() arrived"]]] local_variable[type[DevInfo], back] local_variable[type[Util], tg] assign[member[back.server_host], call[tg.get_host_name, parameter[]]] assign[member[back.dev_class], call[device_class.get_name, parameter[]]] assign[member[back.server_id], call[tg.get_ds_real_name, parameter[]]] assign[member[back.server_version], member[.Tango_DevVersion]] assign[member[back.doc_url], call[device_class.get_doc_url, parameter[]]] call[blackbox.insert_op, parameter[member[.Op_Info]]] call[Util.out4.println, parameter[literal["Leaving DeviceImpl.info()"]]] return[member[.back]] end[}] END[}]
Keyword[public] identifier[DevInfo] identifier[info] operator[SEP] operator[SEP] { identifier[Util] operator[SEP] identifier[out4] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[DevInfo] identifier[back] operator[=] Keyword[new] identifier[DevInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Util] identifier[tg] operator[=] identifier[Util] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[back] operator[SEP] identifier[server_host] operator[=] identifier[tg] operator[SEP] identifier[get_host_name] operator[SEP] operator[SEP] operator[SEP] identifier[back] operator[SEP] identifier[dev_class] operator[=] identifier[device_class] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] operator[SEP] identifier[back] operator[SEP] identifier[server_id] operator[=] identifier[tg] operator[SEP] identifier[get_ds_real_name] operator[SEP] operator[SEP] operator[SEP] identifier[back] operator[SEP] identifier[server_version] operator[=] identifier[Tango_DevVersion] operator[SEP] identifier[back] operator[SEP] identifier[doc_url] operator[=] identifier[device_class] operator[SEP] identifier[get_doc_url] operator[SEP] operator[SEP] operator[SEP] identifier[blackbox] operator[SEP] identifier[insert_op] operator[SEP] identifier[Op_Info] operator[SEP] operator[SEP] identifier[Util] operator[SEP] identifier[out4] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[back] operator[SEP] }
public static boolean isImpersonationProxy(GSIConstants.CertificateType certType) { return certType == GSIConstants.CertificateType.GSI_3_IMPERSONATION_PROXY || certType == GSIConstants.CertificateType.GSI_3_LIMITED_PROXY || certType == GSIConstants.CertificateType.GSI_4_IMPERSONATION_PROXY || certType == GSIConstants.CertificateType.GSI_4_LIMITED_PROXY || certType == GSIConstants.CertificateType.GSI_2_LIMITED_PROXY || certType == GSIConstants.CertificateType.GSI_2_PROXY; }
class class_name[name] begin[{] method[isImpersonationProxy, return_type[type[boolean]], modifier[public static], parameter[certType]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.certType], ==, member[GSIConstants.CertificateType.GSI_3_IMPERSONATION_PROXY]], ||, binary_operation[member[.certType], ==, member[GSIConstants.CertificateType.GSI_3_LIMITED_PROXY]]], ||, binary_operation[member[.certType], ==, member[GSIConstants.CertificateType.GSI_4_IMPERSONATION_PROXY]]], ||, binary_operation[member[.certType], ==, member[GSIConstants.CertificateType.GSI_4_LIMITED_PROXY]]], ||, binary_operation[member[.certType], ==, member[GSIConstants.CertificateType.GSI_2_LIMITED_PROXY]]], ||, binary_operation[member[.certType], ==, member[GSIConstants.CertificateType.GSI_2_PROXY]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isImpersonationProxy] operator[SEP] identifier[GSIConstants] operator[SEP] identifier[CertificateType] identifier[certType] operator[SEP] { Keyword[return] identifier[certType] operator[==] identifier[GSIConstants] operator[SEP] identifier[CertificateType] operator[SEP] identifier[GSI_3_IMPERSONATION_PROXY] operator[||] identifier[certType] operator[==] identifier[GSIConstants] operator[SEP] identifier[CertificateType] operator[SEP] identifier[GSI_3_LIMITED_PROXY] operator[||] identifier[certType] operator[==] identifier[GSIConstants] operator[SEP] identifier[CertificateType] operator[SEP] identifier[GSI_4_IMPERSONATION_PROXY] operator[||] identifier[certType] operator[==] identifier[GSIConstants] operator[SEP] identifier[CertificateType] operator[SEP] identifier[GSI_4_LIMITED_PROXY] operator[||] identifier[certType] operator[==] identifier[GSIConstants] operator[SEP] identifier[CertificateType] operator[SEP] identifier[GSI_2_LIMITED_PROXY] operator[||] identifier[certType] operator[==] identifier[GSIConstants] operator[SEP] identifier[CertificateType] operator[SEP] identifier[GSI_2_PROXY] operator[SEP] }
static public TypedDataset open( FeatureType datatype, String location, ucar.nc2.util.CancelTask task, StringBuilder errlog) throws IOException { DatasetUrl durl = DatasetUrl.findDatasetUrl(location); NetcdfDataset ncd = NetcdfDataset.acquireDataset(durl, true, task); return open( datatype, ncd, task, errlog); }
class class_name[name] begin[{] method[open, return_type[type[TypedDataset]], modifier[public static], parameter[datatype, location, task, errlog]] begin[{] local_variable[type[DatasetUrl], durl] local_variable[type[NetcdfDataset], ncd] return[call[.open, parameter[member[.datatype], member[.ncd], member[.task], member[.errlog]]]] end[}] END[}]
Keyword[static] Keyword[public] identifier[TypedDataset] identifier[open] operator[SEP] identifier[FeatureType] identifier[datatype] , identifier[String] identifier[location] , identifier[ucar] operator[SEP] identifier[nc2] operator[SEP] identifier[util] operator[SEP] identifier[CancelTask] identifier[task] , identifier[StringBuilder] identifier[errlog] operator[SEP] Keyword[throws] identifier[IOException] { identifier[DatasetUrl] identifier[durl] operator[=] identifier[DatasetUrl] operator[SEP] identifier[findDatasetUrl] operator[SEP] identifier[location] operator[SEP] operator[SEP] identifier[NetcdfDataset] identifier[ncd] operator[=] identifier[NetcdfDataset] operator[SEP] identifier[acquireDataset] operator[SEP] identifier[durl] , literal[boolean] , identifier[task] operator[SEP] operator[SEP] Keyword[return] identifier[open] operator[SEP] identifier[datatype] , identifier[ncd] , identifier[task] , identifier[errlog] operator[SEP] operator[SEP] }
public NextResponse delete(final String url, final Map<String, String> queries, final Map<String, String> headers) throws IOException { return request(HttpMethod.DELETE, url, queries, null, headers); }
class class_name[name] begin[{] method[delete, return_type[type[NextResponse]], modifier[public], parameter[url, queries, headers]] begin[{] return[call[.request, parameter[member[HttpMethod.DELETE], member[.url], member[.queries], literal[null], member[.headers]]]] end[}] END[}]
Keyword[public] identifier[NextResponse] identifier[delete] operator[SEP] Keyword[final] identifier[String] identifier[url] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[queries] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[request] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[DELETE] , identifier[url] , identifier[queries] , Other[null] , identifier[headers] operator[SEP] operator[SEP] }
public static void packEntries(File[] filesToPack, File destZipFile) { packEntries(filesToPack, destZipFile, IdentityNameMapper.INSTANCE); }
class class_name[name] begin[{] method[packEntries, return_type[void], modifier[public static], parameter[filesToPack, destZipFile]] begin[{] call[.packEntries, parameter[member[.filesToPack], member[.destZipFile], member[IdentityNameMapper.INSTANCE]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[packEntries] operator[SEP] identifier[File] operator[SEP] operator[SEP] identifier[filesToPack] , identifier[File] identifier[destZipFile] operator[SEP] { identifier[packEntries] operator[SEP] identifier[filesToPack] , identifier[destZipFile] , identifier[IdentityNameMapper] operator[SEP] identifier[INSTANCE] operator[SEP] operator[SEP] }
public static <T> T[] reverse(T[] a) { int len = a.length; T[] copy = newArray(a.getClass().getComponentType(), len); for (int i = 0; i < len; i++) { copy[i] = a[len - i - 1]; } return copy; }
class class_name[name] begin[{] method[reverse, return_type[type[T]], modifier[public static], parameter[a]] begin[{] local_variable[type[int], len] local_variable[type[T], copy] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=copy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=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[.copy]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[reverse] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[a] operator[SEP] { Keyword[int] identifier[len] operator[=] identifier[a] operator[SEP] identifier[length] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[copy] operator[=] identifier[newArray] operator[SEP] identifier[a] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[len] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[copy] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[len] operator[-] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[return] identifier[copy] operator[SEP] }
public final String revealWhereCatalog(final TradingCatalog pTcat, final FilterItems<CatalogGs> pFilterCatalog) throws Exception { List<CatalogGs> subcgsAll = new ArrayList<CatalogGs>(); subcgsAll.add(pTcat.getCatalog()); if (pFilterCatalog != null && pFilterCatalog.getOperator() != null && pFilterCatalog.getItems().size() > 0) { for (CatalogGs cgs : pFilterCatalog.getItems()) { TradingCatalog tcat = findTradingCatalogById(this.catalogs, cgs.getItsId()); subcgsAll.add(cgs); copySubcatalogsGs(tcat, subcgsAll); } } else { copySubcatalogsGs(pTcat, subcgsAll); } Set<CatalogGs> subcgs = new HashSet<CatalogGs>(); for (CatalogGs cgs : subcgsAll) { if (!cgs.getHasSubcatalogs()) { subcgs.add(cgs); } } if (subcgs.size() > 1) { StringBuffer sb = new StringBuffer(" in (" + pTcat.getCatalog().getItsId()); for (CatalogGs cgs : subcgs) { sb.append("," + cgs.getItsId()); } sb.append(")"); return sb.toString(); } else { return "=" + subcgs.iterator().next().getItsId(); } }
class class_name[name] begin[{] method[revealWhereCatalog, return_type[type[String]], modifier[final public], parameter[pTcat, pFilterCatalog]] begin[{] local_variable[type[List], subcgsAll] call[subcgsAll.add, parameter[call[pTcat.getCatalog, parameter[]]]] if[binary_operation[binary_operation[binary_operation[member[.pFilterCatalog], !=, literal[null]], &&, binary_operation[call[pFilterCatalog.getOperator, parameter[]], !=, literal[null]]], &&, binary_operation[call[pFilterCatalog.getItems, parameter[]], >, literal[0]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=catalogs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MethodInvocation(arguments=[], member=getItsId, postfix_operators=[], prefix_operators=[], qualifier=cgs, selectors=[], type_arguments=None)], member=findTradingCatalogById, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tcat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TradingCatalog, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=subcgsAll, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tcat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subcgsAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copySubcatalogsGs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getItems, postfix_operators=[], prefix_operators=[], qualifier=pFilterCatalog, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cgs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CatalogGs, sub_type=None))), label=None) else begin[{] call[.copySubcatalogsGs, parameter[member[.pTcat], member[.subcgsAll]]] end[}] local_variable[type[Set], subcgs] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getHasSubcatalogs, postfix_operators=[], prefix_operators=['!'], qualifier=cgs, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=subcgs, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=subcgsAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cgs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CatalogGs, sub_type=None))), label=None) if[binary_operation[call[subcgs.size, parameter[]], >, literal[1]]] begin[{] local_variable[type[StringBuffer], sb] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operandr=MethodInvocation(arguments=[], member=getItsId, postfix_operators=[], prefix_operators=[], qualifier=cgs, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=subcgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cgs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CatalogGs, sub_type=None))), label=None) call[sb.append, parameter[literal[")"]]] return[call[sb.toString, parameter[]]] else begin[{] return[binary_operation[literal["="], +, call[subcgs.iterator, parameter[]]]] end[}] end[}] END[}]
Keyword[public] Keyword[final] identifier[String] identifier[revealWhereCatalog] operator[SEP] Keyword[final] identifier[TradingCatalog] identifier[pTcat] , Keyword[final] identifier[FilterItems] operator[<] identifier[CatalogGs] operator[>] identifier[pFilterCatalog] operator[SEP] Keyword[throws] identifier[Exception] { identifier[List] operator[<] identifier[CatalogGs] operator[>] identifier[subcgsAll] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CatalogGs] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[subcgsAll] operator[SEP] identifier[add] operator[SEP] identifier[pTcat] operator[SEP] identifier[getCatalog] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pFilterCatalog] operator[!=] Other[null] operator[&&] identifier[pFilterCatalog] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[pFilterCatalog] operator[SEP] identifier[getItems] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[CatalogGs] identifier[cgs] operator[:] identifier[pFilterCatalog] operator[SEP] identifier[getItems] operator[SEP] operator[SEP] operator[SEP] { identifier[TradingCatalog] identifier[tcat] operator[=] identifier[findTradingCatalogById] operator[SEP] Keyword[this] operator[SEP] identifier[catalogs] , identifier[cgs] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[subcgsAll] operator[SEP] identifier[add] operator[SEP] identifier[cgs] operator[SEP] operator[SEP] identifier[copySubcatalogsGs] operator[SEP] identifier[tcat] , identifier[subcgsAll] operator[SEP] operator[SEP] } } Keyword[else] { identifier[copySubcatalogsGs] operator[SEP] identifier[pTcat] , identifier[subcgsAll] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[CatalogGs] operator[>] identifier[subcgs] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[CatalogGs] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CatalogGs] identifier[cgs] operator[:] identifier[subcgsAll] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[cgs] operator[SEP] identifier[getHasSubcatalogs] operator[SEP] operator[SEP] operator[SEP] { identifier[subcgs] operator[SEP] identifier[add] operator[SEP] identifier[cgs] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[subcgs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[+] identifier[pTcat] operator[SEP] identifier[getCatalog] operator[SEP] operator[SEP] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CatalogGs] identifier[cgs] operator[:] identifier[subcgs] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[cgs] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] literal[String] operator[+] identifier[subcgs] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] } }
public void setSources(java.util.Collection<InputSourceRequest> sources) { if (sources == null) { this.sources = null; return; } this.sources = new java.util.ArrayList<InputSourceRequest>(sources); }
class class_name[name] begin[{] method[setSources, return_type[void], modifier[public], parameter[sources]] begin[{] if[binary_operation[member[.sources], ==, literal[null]]] begin[{] assign[THIS[member[None.sources]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.sources]], ClassCreator(arguments=[MemberReference(member=sources, 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=InputSourceRequest, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSources] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[InputSourceRequest] operator[>] identifier[sources] operator[SEP] { Keyword[if] operator[SEP] identifier[sources] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[sources] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[sources] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[InputSourceRequest] operator[>] operator[SEP] identifier[sources] operator[SEP] operator[SEP] }
public static Map.Entry<String, Map<String, ?>> toggleTouchIdEnrollmentCommand(boolean enabled) { return new AbstractMap.SimpleEntry<>( TOUCH_ID_ENROLLMENT, prepareArguments("enabled", enabled)); }
class class_name[name] begin[{] method[toggleTouchIdEnrollmentCommand, return_type[type[Map]], modifier[public static], parameter[enabled]] begin[{] return[ClassCreator(arguments=[MemberReference(member=TOUCH_ID_ENROLLMENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="enabled"), MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareArguments, 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=AbstractMap, sub_type=ReferenceType(arguments=[], dimensions=None, name=SimpleEntry, sub_type=None)))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , operator[?] operator[>] operator[>] identifier[toggleTouchIdEnrollmentCommand] operator[SEP] Keyword[boolean] identifier[enabled] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractMap] operator[SEP] identifier[SimpleEntry] operator[<] operator[>] operator[SEP] identifier[TOUCH_ID_ENROLLMENT] , identifier[prepareArguments] operator[SEP] literal[String] , identifier[enabled] operator[SEP] operator[SEP] operator[SEP] }
private void generateXMLReport( final ITransaction transaction, final WebdavResponse resp, final LockedObject lo ) throws IOException { final HashMap<String, String> namespaces = new HashMap<String, String>(); namespaces.put( "DAV:", "D" ); resp.setStatus( SC_OK ); resp.setContentType( "text/xml; charset=UTF-8" ); final XMLWriter generatedXML = new XMLWriter( resp.getWriter(), namespaces ); generatedXML.writeXMLHeader(); generatedXML.writeElement( "DAV::prop", XMLWriter.OPENING ); generatedXML.writeElement( "DAV::lockdiscovery", XMLWriter.OPENING ); generatedXML.writeElement( "DAV::activelock", XMLWriter.OPENING ); generatedXML.writeElement( "DAV::locktype", XMLWriter.OPENING ); generatedXML.writeProperty( "DAV::" + _type ); generatedXML.writeElement( "DAV::locktype", XMLWriter.CLOSING ); generatedXML.writeElement( "DAV::lockscope", XMLWriter.OPENING ); if ( _exclusive ) { generatedXML.writeProperty( "DAV::exclusive" ); } else { generatedXML.writeProperty( "DAV::shared" ); } generatedXML.writeElement( "DAV::lockscope", XMLWriter.CLOSING ); final int depth = lo.getLockDepth(); generatedXML.writeElement( "DAV::depth", XMLWriter.OPENING ); if ( depth == INFINITY ) { generatedXML.writeText( "Infinity" ); } else { generatedXML.writeText( String.valueOf( depth ) ); } generatedXML.writeElement( "DAV::depth", XMLWriter.CLOSING ); generatedXML.writeElement( "DAV::owner", XMLWriter.OPENING ); generatedXML.writeElement( "DAV::href", XMLWriter.OPENING ); generatedXML.writeText( _lockOwner ); generatedXML.writeElement( "DAV::href", XMLWriter.CLOSING ); generatedXML.writeElement( "DAV::owner", XMLWriter.CLOSING ); final long timeout = lo.getTimeoutMillis(); generatedXML.writeElement( "DAV::timeout", XMLWriter.OPENING ); generatedXML.writeText( "Second-" + timeout / 1000 ); generatedXML.writeElement( "DAV::timeout", XMLWriter.CLOSING ); final String lockToken = lo.getID(); generatedXML.writeElement( "DAV::locktoken", XMLWriter.OPENING ); generatedXML.writeElement( "DAV::href", XMLWriter.OPENING ); generatedXML.writeText( "opaquelocktoken:" + lockToken ); generatedXML.writeElement( "DAV::href", XMLWriter.CLOSING ); generatedXML.writeElement( "DAV::locktoken", XMLWriter.CLOSING ); generatedXML.writeElement( "DAV::activelock", XMLWriter.CLOSING ); generatedXML.writeElement( "DAV::lockdiscovery", XMLWriter.CLOSING ); generatedXML.writeElement( "DAV::prop", XMLWriter.CLOSING ); resp.addHeader( "Lock-Token", "<opaquelocktoken:" + lockToken + ">" ); generatedXML.sendData(); }
class class_name[name] begin[{] method[generateXMLReport, return_type[void], modifier[private], parameter[transaction, resp, lo]] begin[{] local_variable[type[HashMap], namespaces] call[namespaces.put, parameter[literal["DAV:"], literal["D"]]] call[resp.setStatus, parameter[member[.SC_OK]]] call[resp.setContentType, parameter[literal["text/xml; charset=UTF-8"]]] local_variable[type[XMLWriter], generatedXML] call[generatedXML.writeXMLHeader, parameter[]] call[generatedXML.writeElement, parameter[literal["DAV::prop"], member[XMLWriter.OPENING]]] call[generatedXML.writeElement, parameter[literal["DAV::lockdiscovery"], member[XMLWriter.OPENING]]] call[generatedXML.writeElement, parameter[literal["DAV::activelock"], member[XMLWriter.OPENING]]] call[generatedXML.writeElement, parameter[literal["DAV::locktype"], member[XMLWriter.OPENING]]] call[generatedXML.writeProperty, parameter[binary_operation[literal["DAV::"], +, member[._type]]]] call[generatedXML.writeElement, parameter[literal["DAV::locktype"], member[XMLWriter.CLOSING]]] call[generatedXML.writeElement, parameter[literal["DAV::lockscope"], member[XMLWriter.OPENING]]] if[member[._exclusive]] begin[{] call[generatedXML.writeProperty, parameter[literal["DAV::exclusive"]]] else begin[{] call[generatedXML.writeProperty, parameter[literal["DAV::shared"]]] end[}] call[generatedXML.writeElement, parameter[literal["DAV::lockscope"], member[XMLWriter.CLOSING]]] local_variable[type[int], depth] call[generatedXML.writeElement, parameter[literal["DAV::depth"], member[XMLWriter.OPENING]]] if[binary_operation[member[.depth], ==, member[.INFINITY]]] begin[{] call[generatedXML.writeText, parameter[literal["Infinity"]]] else begin[{] call[generatedXML.writeText, parameter[call[String.valueOf, parameter[member[.depth]]]]] end[}] call[generatedXML.writeElement, parameter[literal["DAV::depth"], member[XMLWriter.CLOSING]]] call[generatedXML.writeElement, parameter[literal["DAV::owner"], member[XMLWriter.OPENING]]] call[generatedXML.writeElement, parameter[literal["DAV::href"], member[XMLWriter.OPENING]]] call[generatedXML.writeText, parameter[member[._lockOwner]]] call[generatedXML.writeElement, parameter[literal["DAV::href"], member[XMLWriter.CLOSING]]] call[generatedXML.writeElement, parameter[literal["DAV::owner"], member[XMLWriter.CLOSING]]] local_variable[type[long], timeout] call[generatedXML.writeElement, parameter[literal["DAV::timeout"], member[XMLWriter.OPENING]]] call[generatedXML.writeText, parameter[binary_operation[literal["Second-"], +, binary_operation[member[.timeout], /, literal[1000]]]]] call[generatedXML.writeElement, parameter[literal["DAV::timeout"], member[XMLWriter.CLOSING]]] local_variable[type[String], lockToken] call[generatedXML.writeElement, parameter[literal["DAV::locktoken"], member[XMLWriter.OPENING]]] call[generatedXML.writeElement, parameter[literal["DAV::href"], member[XMLWriter.OPENING]]] call[generatedXML.writeText, parameter[binary_operation[literal["opaquelocktoken:"], +, member[.lockToken]]]] call[generatedXML.writeElement, parameter[literal["DAV::href"], member[XMLWriter.CLOSING]]] call[generatedXML.writeElement, parameter[literal["DAV::locktoken"], member[XMLWriter.CLOSING]]] call[generatedXML.writeElement, parameter[literal["DAV::activelock"], member[XMLWriter.CLOSING]]] call[generatedXML.writeElement, parameter[literal["DAV::lockdiscovery"], member[XMLWriter.CLOSING]]] call[generatedXML.writeElement, parameter[literal["DAV::prop"], member[XMLWriter.CLOSING]]] call[resp.addHeader, parameter[literal["Lock-Token"], binary_operation[binary_operation[literal["<opaquelocktoken:"], +, member[.lockToken]], +, literal[">"]]]] call[generatedXML.sendData, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[generateXMLReport] operator[SEP] Keyword[final] identifier[ITransaction] identifier[transaction] , Keyword[final] identifier[WebdavResponse] identifier[resp] , Keyword[final] identifier[LockedObject] identifier[lo] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[namespaces] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[namespaces] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setStatus] operator[SEP] identifier[SC_OK] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[XMLWriter] identifier[generatedXML] operator[=] Keyword[new] identifier[XMLWriter] operator[SEP] identifier[resp] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] , identifier[namespaces] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeXMLHeader] operator[SEP] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeProperty] operator[SEP] literal[String] operator[+] identifier[_type] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_exclusive] operator[SEP] { identifier[generatedXML] operator[SEP] identifier[writeProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[generatedXML] operator[SEP] identifier[writeProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[depth] operator[=] identifier[lo] operator[SEP] identifier[getLockDepth] operator[SEP] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[depth] operator[==] identifier[INFINITY] operator[SEP] { identifier[generatedXML] operator[SEP] identifier[writeText] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[generatedXML] operator[SEP] identifier[writeText] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[depth] operator[SEP] operator[SEP] operator[SEP] } identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeText] operator[SEP] identifier[_lockOwner] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[timeout] operator[=] identifier[lo] operator[SEP] identifier[getTimeoutMillis] operator[SEP] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeText] operator[SEP] literal[String] operator[+] identifier[timeout] operator[/] Other[1000] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[lockToken] operator[=] identifier[lo] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[OPENING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeText] operator[SEP] literal[String] operator[+] identifier[lockToken] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[writeElement] operator[SEP] literal[String] , identifier[XMLWriter] operator[SEP] identifier[CLOSING] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[lockToken] operator[+] literal[String] operator[SEP] operator[SEP] identifier[generatedXML] operator[SEP] identifier[sendData] operator[SEP] operator[SEP] operator[SEP] }
public DescribeVpnGatewaysRequest withVpnGatewayIds(String... vpnGatewayIds) { if (this.vpnGatewayIds == null) { setVpnGatewayIds(new com.amazonaws.internal.SdkInternalList<String>(vpnGatewayIds.length)); } for (String ele : vpnGatewayIds) { this.vpnGatewayIds.add(ele); } return this; }
class class_name[name] begin[{] method[withVpnGatewayIds, return_type[type[DescribeVpnGatewaysRequest]], modifier[public], parameter[vpnGatewayIds]] begin[{] if[binary_operation[THIS[member[None.vpnGatewayIds]], ==, literal[null]]] begin[{] call[.setVpnGatewayIds, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=vpnGatewayIds, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=vpnGatewayIds, 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=vpnGatewayIds, 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=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeVpnGatewaysRequest] identifier[withVpnGatewayIds] operator[SEP] identifier[String] operator[...] identifier[vpnGatewayIds] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[vpnGatewayIds] operator[==] Other[null] operator[SEP] { identifier[setVpnGatewayIds] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[vpnGatewayIds] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[vpnGatewayIds] operator[SEP] { Keyword[this] operator[SEP] identifier[vpnGatewayIds] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public void setBinding(String name, Value value) { bindingSet.addBinding(name, value); }
class class_name[name] begin[{] method[setBinding, return_type[void], modifier[public], parameter[name, value]] begin[{] call[bindingSet.addBinding, parameter[member[.name], member[.value]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setBinding] operator[SEP] identifier[String] identifier[name] , identifier[Value] identifier[value] operator[SEP] { identifier[bindingSet] operator[SEP] identifier[addBinding] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] }
@Override protected Resource doCreateResource(URI uri, URIResourceFactory parent) { try { return JarResource.create(uri, parent); } catch(URISyntaxException e) { throw new IllegalArgumentException(uri.toString(), e); } }
class class_name[name] begin[{] method[doCreateResource, return_type[type[Resource]], modifier[protected], parameter[uri, parent]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=JarResource, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Resource] identifier[doCreateResource] operator[SEP] identifier[URI] identifier[uri] , identifier[URIResourceFactory] identifier[parent] operator[SEP] { Keyword[try] { Keyword[return] identifier[JarResource] operator[SEP] identifier[create] operator[SEP] identifier[uri] , identifier[parent] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public IfcStructuralSurfaceTypeEnum createIfcStructuralSurfaceTypeEnumFromString(EDataType eDataType, String initialValue) { IfcStructuralSurfaceTypeEnum result = IfcStructuralSurfaceTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
class class_name[name] begin[{] method[createIfcStructuralSurfaceTypeEnumFromString, return_type[type[IfcStructuralSurfaceTypeEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{] local_variable[type[IfcStructuralSurfaceTypeEnum], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, 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) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[IfcStructuralSurfaceTypeEnum] identifier[createIfcStructuralSurfaceTypeEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] { identifier[IfcStructuralSurfaceTypeEnum] identifier[result] operator[=] identifier[IfcStructuralSurfaceTypeEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public ProcessInfo execute(boolean background,String... command) { ProcessBuilder pb = new ProcessBuilder(command); return executeProcess(background,pb); }
class class_name[name] begin[{] method[execute, return_type[type[ProcessInfo]], modifier[public], parameter[background, command]] begin[{] local_variable[type[ProcessBuilder], pb] return[call[.executeProcess, parameter[member[.background], member[.pb]]]] end[}] END[}]
Keyword[public] identifier[ProcessInfo] identifier[execute] operator[SEP] Keyword[boolean] identifier[background] , identifier[String] operator[...] identifier[command] operator[SEP] { identifier[ProcessBuilder] identifier[pb] operator[=] Keyword[new] identifier[ProcessBuilder] operator[SEP] identifier[command] operator[SEP] operator[SEP] Keyword[return] identifier[executeProcess] operator[SEP] identifier[background] , identifier[pb] operator[SEP] operator[SEP] }
public void open() { setState(State.OPEN); protocol.registerResetListener(sessionId(), request -> resendEvents(request.index()), server.getServiceManager().executor()); }
class class_name[name] begin[{] method[open, return_type[void], modifier[public], parameter[]] begin[{] call[.setState, parameter[member[State.OPEN]]] call[protocol.registerResetListener, parameter[call[.sessionId, parameter[]], LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=index, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)], member=resendEvents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), call[server.getServiceManager, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[open] operator[SEP] operator[SEP] { identifier[setState] operator[SEP] identifier[State] operator[SEP] identifier[OPEN] operator[SEP] operator[SEP] identifier[protocol] operator[SEP] identifier[registerResetListener] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] , identifier[request] operator[->] identifier[resendEvents] operator[SEP] identifier[request] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] , identifier[server] operator[SEP] identifier[getServiceManager] operator[SEP] operator[SEP] operator[SEP] identifier[executor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(preferredWidth, preferredHeight); } } orientation = gauge.getOrientation(); aspectRatio = preferredHeight / preferredWidth; titleText = new Text(gauge.getTitle()); titleText.setTextOrigin(VPos.CENTER); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); unitText = new Text(gauge.getUnit()); unitText.setTextOrigin(VPos.CENTER); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); tickMarkCanvas = new Canvas(0.79699248 * preferredWidth, 0.08333333 * preferredHeight); tickMarksCtx = tickMarkCanvas.getGraphicsContext2D(); sectionsCanvas = new Canvas(0.79699248 * preferredWidth, 0.5 * preferredHeight); sectionsCtx = sectionsCanvas.getGraphicsContext2D(); barRect = new Rectangle(); Tooltip.install(barRect, barTooltip); thresholdRect = new Rectangle(); Tooltip.install(thresholdRect, thresholdTooltip); pane = new Pane(titleText, unitText, tickMarkCanvas, sectionsCanvas, barRect, thresholdRect); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
class class_name[name] begin[{] method[initGraphics, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[call[Double.compare, parameter[call[gauge.getPrefWidth, parameter[]], literal[0.0]]], <=, literal[0]], ||, binary_operation[call[Double.compare, parameter[call[gauge.getPrefHeight, parameter[]], literal[0.0]]], <=, literal[0]]], ||, binary_operation[call[Double.compare, parameter[call[gauge.getWidth, parameter[]], literal[0.0]]], <=, literal[0]]], ||, binary_operation[call[Double.compare, parameter[call[gauge.getHeight, parameter[]], literal[0.0]]], <=, literal[0]]]] begin[{] if[binary_operation[binary_operation[call[gauge.getPrefWidth, parameter[]], >, literal[0]], &&, binary_operation[call[gauge.getPrefHeight, parameter[]], >, literal[0]]]] begin[{] call[gauge.setPrefSize, parameter[call[gauge.getPrefWidth, parameter[]], call[gauge.getPrefHeight, parameter[]]]] else begin[{] call[gauge.setPrefSize, parameter[member[.preferredWidth], member[.preferredHeight]]] end[}] else begin[{] None end[}] assign[member[.orientation], call[gauge.getOrientation, parameter[]]] assign[member[.aspectRatio], binary_operation[member[.preferredHeight], /, member[.preferredWidth]]] assign[member[.titleText], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTitle, postfix_operators=[], prefix_operators=[], qualifier=gauge, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Text, sub_type=None))] call[titleText.setTextOrigin, parameter[member[VPos.CENTER]]] call[Helper.enableNode, parameter[member[.titleText], call[gauge.getTitle, parameter[]]]] assign[member[.unitText], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getUnit, postfix_operators=[], prefix_operators=[], qualifier=gauge, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Text, sub_type=None))] call[unitText.setTextOrigin, parameter[member[VPos.CENTER]]] call[Helper.enableNode, parameter[member[.unitText], call[gauge.getUnit, parameter[]]]] assign[member[.tickMarkCanvas], ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.79699248), operandr=MemberReference(member=preferredWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.08333333), operandr=MemberReference(member=preferredHeight, 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=Canvas, sub_type=None))] assign[member[.tickMarksCtx], call[tickMarkCanvas.getGraphicsContext2D, parameter[]]] assign[member[.sectionsCanvas], ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.79699248), operandr=MemberReference(member=preferredWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.5), operandr=MemberReference(member=preferredHeight, 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=Canvas, sub_type=None))] assign[member[.sectionsCtx], call[sectionsCanvas.getGraphicsContext2D, parameter[]]] assign[member[.barRect], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))] call[Tooltip.install, parameter[member[.barRect], member[.barTooltip]]] assign[member[.thresholdRect], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))] call[Tooltip.install, parameter[member[.thresholdRect], member[.thresholdTooltip]]] assign[member[.pane], ClassCreator(arguments=[MemberReference(member=titleText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unitText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tickMarkCanvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sectionsCanvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=barRect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thresholdRect, 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=Pane, sub_type=None))] call[pane.setBorder, parameter[ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBorderPaint, postfix_operators=[], prefix_operators=[], qualifier=gauge, selectors=[], type_arguments=None), MemberReference(member=SOLID, postfix_operators=[], prefix_operators=[], qualifier=BorderStrokeStyle, selectors=[]), MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=CornerRadii, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBorderWidth, postfix_operators=[], prefix_operators=[], qualifier=gauge, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BorderWidths, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BorderStroke, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Border, sub_type=None))]] call[pane.setBackground, parameter[ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBackgroundPaint, postfix_operators=[], prefix_operators=[], qualifier=gauge, selectors=[], type_arguments=None), MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=CornerRadii, selectors=[]), MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=Insets, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BackgroundFill, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Background, sub_type=None))]] call[.getChildren, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[initGraphics] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[compare] operator[SEP] identifier[gauge] operator[SEP] identifier[getPrefWidth] operator[SEP] operator[SEP] , literal[Float] operator[SEP] operator[<=] Other[0] operator[||] identifier[Double] operator[SEP] identifier[compare] operator[SEP] identifier[gauge] operator[SEP] identifier[getPrefHeight] operator[SEP] operator[SEP] , literal[Float] operator[SEP] operator[<=] Other[0] operator[||] identifier[Double] operator[SEP] identifier[compare] operator[SEP] identifier[gauge] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , literal[Float] operator[SEP] operator[<=] Other[0] operator[||] identifier[Double] operator[SEP] identifier[compare] operator[SEP] identifier[gauge] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] , literal[Float] operator[SEP] operator[<=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[getPrefWidth] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[gauge] operator[SEP] identifier[getPrefHeight] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[gauge] operator[SEP] identifier[setPrefSize] operator[SEP] identifier[gauge] operator[SEP] identifier[getPrefWidth] operator[SEP] operator[SEP] , identifier[gauge] operator[SEP] identifier[getPrefHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[gauge] operator[SEP] identifier[setPrefSize] operator[SEP] identifier[preferredWidth] , identifier[preferredHeight] operator[SEP] operator[SEP] } } identifier[orientation] operator[=] identifier[gauge] operator[SEP] identifier[getOrientation] operator[SEP] operator[SEP] operator[SEP] identifier[aspectRatio] operator[=] identifier[preferredHeight] operator[/] identifier[preferredWidth] operator[SEP] identifier[titleText] operator[=] Keyword[new] identifier[Text] operator[SEP] identifier[gauge] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[titleText] operator[SEP] identifier[setTextOrigin] operator[SEP] identifier[VPos] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] identifier[Helper] operator[SEP] identifier[enableNode] operator[SEP] identifier[titleText] , operator[!] identifier[gauge] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[unitText] operator[=] Keyword[new] identifier[Text] operator[SEP] identifier[gauge] operator[SEP] identifier[getUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[unitText] operator[SEP] identifier[setTextOrigin] operator[SEP] identifier[VPos] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] identifier[Helper] operator[SEP] identifier[enableNode] operator[SEP] identifier[unitText] , operator[!] identifier[gauge] operator[SEP] identifier[getUnit] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tickMarkCanvas] operator[=] Keyword[new] identifier[Canvas] operator[SEP] literal[Float] operator[*] identifier[preferredWidth] , literal[Float] operator[*] identifier[preferredHeight] operator[SEP] operator[SEP] identifier[tickMarksCtx] operator[=] identifier[tickMarkCanvas] operator[SEP] identifier[getGraphicsContext2D] operator[SEP] operator[SEP] operator[SEP] identifier[sectionsCanvas] operator[=] Keyword[new] identifier[Canvas] operator[SEP] literal[Float] operator[*] identifier[preferredWidth] , literal[Float] operator[*] identifier[preferredHeight] operator[SEP] operator[SEP] identifier[sectionsCtx] operator[=] identifier[sectionsCanvas] operator[SEP] identifier[getGraphicsContext2D] operator[SEP] operator[SEP] operator[SEP] identifier[barRect] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] operator[SEP] operator[SEP] identifier[Tooltip] operator[SEP] identifier[install] operator[SEP] identifier[barRect] , identifier[barTooltip] operator[SEP] operator[SEP] identifier[thresholdRect] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] operator[SEP] operator[SEP] identifier[Tooltip] operator[SEP] identifier[install] operator[SEP] identifier[thresholdRect] , identifier[thresholdTooltip] operator[SEP] operator[SEP] identifier[pane] operator[=] Keyword[new] identifier[Pane] operator[SEP] identifier[titleText] , identifier[unitText] , identifier[tickMarkCanvas] , identifier[sectionsCanvas] , identifier[barRect] , identifier[thresholdRect] operator[SEP] operator[SEP] identifier[pane] operator[SEP] identifier[setBorder] operator[SEP] Keyword[new] identifier[Border] operator[SEP] Keyword[new] identifier[BorderStroke] operator[SEP] identifier[gauge] operator[SEP] identifier[getBorderPaint] operator[SEP] operator[SEP] , identifier[BorderStrokeStyle] operator[SEP] identifier[SOLID] , identifier[CornerRadii] operator[SEP] identifier[EMPTY] , Keyword[new] identifier[BorderWidths] operator[SEP] identifier[gauge] operator[SEP] identifier[getBorderWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pane] operator[SEP] identifier[setBackground] operator[SEP] Keyword[new] identifier[Background] operator[SEP] Keyword[new] identifier[BackgroundFill] operator[SEP] identifier[gauge] operator[SEP] identifier[getBackgroundPaint] operator[SEP] operator[SEP] , identifier[CornerRadii] operator[SEP] identifier[EMPTY] , identifier[Insets] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[setAll] operator[SEP] identifier[pane] operator[SEP] operator[SEP] }
@Override public void initialize() throws InitializationException { ListenerChain chain = new ListenerChain(); setListenerChain(chain); // Construct the listener chain in the right order. Listeners early in the chain are called before listeners // placed later in the chain. chain.addListener(this); chain.addListener(new HTMLMacroBlockStateChainingListener(chain)); chain.addListener(new EmptyBlockChainingListener(chain)); chain.addListener(new MetaDataStateChainingListener(chain)); chain.addListener(new HTMLMacroXHTMLChainingRenderer(this.linkRenderer, this.imageRenderer, chain)); }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[ListenerChain], chain] call[.setListenerChain, parameter[member[.chain]]] call[chain.addListener, parameter[THIS[]]] call[chain.addListener, parameter[ClassCreator(arguments=[MemberReference(member=chain, 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=HTMLMacroBlockStateChainingListener, sub_type=None))]] call[chain.addListener, parameter[ClassCreator(arguments=[MemberReference(member=chain, 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=EmptyBlockChainingListener, sub_type=None))]] call[chain.addListener, parameter[ClassCreator(arguments=[MemberReference(member=chain, 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=MetaDataStateChainingListener, sub_type=None))]] call[chain.addListener, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=linkRenderer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=imageRenderer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=chain, 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=HTMLMacroXHTMLChainingRenderer, sub_type=None))]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[initialize] operator[SEP] operator[SEP] Keyword[throws] identifier[InitializationException] { identifier[ListenerChain] identifier[chain] operator[=] Keyword[new] identifier[ListenerChain] operator[SEP] operator[SEP] operator[SEP] identifier[setListenerChain] operator[SEP] identifier[chain] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[addListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[HTMLMacroBlockStateChainingListener] operator[SEP] identifier[chain] operator[SEP] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[EmptyBlockChainingListener] operator[SEP] identifier[chain] operator[SEP] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[MetaDataStateChainingListener] operator[SEP] identifier[chain] operator[SEP] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[HTMLMacroXHTMLChainingRenderer] operator[SEP] Keyword[this] operator[SEP] identifier[linkRenderer] , Keyword[this] operator[SEP] identifier[imageRenderer] , identifier[chain] operator[SEP] operator[SEP] operator[SEP] }
public List<Statement> getAllStatements() { List<Statement> ret = new ArrayList<Statement>(); // Statements within this group if (statements != null) { ret.addAll(statements); } // Statements within nested statement groups if (statementGroups != null) { for (final StatementGroup sg : statementGroups) ret.addAll(sg.getAllStatements()); } return ret; }
class class_name[name] begin[{] method[getAllStatements, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], ret] if[binary_operation[member[.statements], !=, literal[null]]] begin[{] call[ret.addAll, parameter[member[.statements]]] else begin[{] None end[}] if[binary_operation[member[.statementGroups], !=, literal[null]]] begin[{] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAllStatements, postfix_operators=[], prefix_operators=[], qualifier=sg, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=statementGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StatementGroup, sub_type=None))), label=None) else begin[{] None end[}] return[member[.ret]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Statement] operator[>] identifier[getAllStatements] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Statement] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Statement] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[statements] operator[!=] Other[null] operator[SEP] { identifier[ret] operator[SEP] identifier[addAll] operator[SEP] identifier[statements] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[statementGroups] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[StatementGroup] identifier[sg] operator[:] identifier[statementGroups] operator[SEP] identifier[ret] operator[SEP] identifier[addAll] operator[SEP] identifier[sg] operator[SEP] identifier[getAllStatements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public OperationFuture<List<AlertPolicy>> modify(AlertPolicyFilter filter, AlertPolicyConfig modifyConfig) { return modify(getRefsFromFilter(filter), modifyConfig); }
class class_name[name] begin[{] method[modify, return_type[type[OperationFuture]], modifier[public], parameter[filter, modifyConfig]] begin[{] return[call[.modify, parameter[call[.getRefsFromFilter, parameter[member[.filter]]], member[.modifyConfig]]]] end[}] END[}]
Keyword[public] identifier[OperationFuture] operator[<] identifier[List] operator[<] identifier[AlertPolicy] operator[>] operator[>] identifier[modify] operator[SEP] identifier[AlertPolicyFilter] identifier[filter] , identifier[AlertPolicyConfig] identifier[modifyConfig] operator[SEP] { Keyword[return] identifier[modify] operator[SEP] identifier[getRefsFromFilter] operator[SEP] identifier[filter] operator[SEP] , identifier[modifyConfig] operator[SEP] operator[SEP] }
public ProcessExecutor redirectErrorAlsoTo(OutputStream output) { streams(redirectErrorAlsoTo(pumps(), output)); redirectErrorStream(false); return this; }
class class_name[name] begin[{] method[redirectErrorAlsoTo, return_type[type[ProcessExecutor]], modifier[public], parameter[output]] begin[{] call[.streams, parameter[call[.redirectErrorAlsoTo, parameter[call[.pumps, parameter[]], member[.output]]]]] call[.redirectErrorStream, parameter[literal[false]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ProcessExecutor] identifier[redirectErrorAlsoTo] operator[SEP] identifier[OutputStream] identifier[output] operator[SEP] { identifier[streams] operator[SEP] identifier[redirectErrorAlsoTo] operator[SEP] identifier[pumps] operator[SEP] operator[SEP] , identifier[output] operator[SEP] operator[SEP] operator[SEP] identifier[redirectErrorStream] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public Partition addPartition(String partitionId, String partitionDn) throws Exception { Log.info(c, "addPartition", "entry " + partitionId + " " + partitionDn); JdbmPartition partition = new JdbmPartition(this.service.getSchemaManager()); partition.setId(partitionId); partition.setPartitionPath(new File(this.service.getInstanceLayout().getPartitionsDirectory(), partitionId).toURI()); partition.setSuffixDn(new Dn(partitionDn)); service.addPartition(partition); Log.info(c, "addPartition", "exit"); return partition; }
class class_name[name] begin[{] method[addPartition, return_type[type[Partition]], modifier[public], parameter[partitionId, partitionDn]] begin[{] call[Log.info, parameter[member[.c], literal["addPartition"], binary_operation[binary_operation[binary_operation[literal["entry "], +, member[.partitionId]], +, literal[" "]], +, member[.partitionDn]]]] local_variable[type[JdbmPartition], partition] call[partition.setId, parameter[member[.partitionId]]] call[partition.setPartitionPath, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=service, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getInstanceLayout, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getPartitionsDirectory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=partitionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toURI, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]] call[partition.setSuffixDn, parameter[ClassCreator(arguments=[MemberReference(member=partitionDn, 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=Dn, sub_type=None))]] call[service.addPartition, parameter[member[.partition]]] call[Log.info, parameter[member[.c], literal["addPartition"], literal["exit"]]] return[member[.partition]] end[}] END[}]
Keyword[public] identifier[Partition] identifier[addPartition] operator[SEP] identifier[String] identifier[partitionId] , identifier[String] identifier[partitionDn] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Log] operator[SEP] identifier[info] operator[SEP] identifier[c] , literal[String] , literal[String] operator[+] identifier[partitionId] operator[+] literal[String] operator[+] identifier[partitionDn] operator[SEP] operator[SEP] identifier[JdbmPartition] identifier[partition] operator[=] Keyword[new] identifier[JdbmPartition] operator[SEP] Keyword[this] operator[SEP] identifier[service] operator[SEP] identifier[getSchemaManager] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[partition] operator[SEP] identifier[setId] operator[SEP] identifier[partitionId] operator[SEP] operator[SEP] identifier[partition] operator[SEP] identifier[setPartitionPath] operator[SEP] Keyword[new] identifier[File] operator[SEP] Keyword[this] operator[SEP] identifier[service] operator[SEP] identifier[getInstanceLayout] operator[SEP] operator[SEP] operator[SEP] identifier[getPartitionsDirectory] operator[SEP] operator[SEP] , identifier[partitionId] operator[SEP] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[partition] operator[SEP] identifier[setSuffixDn] operator[SEP] Keyword[new] identifier[Dn] operator[SEP] identifier[partitionDn] operator[SEP] operator[SEP] operator[SEP] identifier[service] operator[SEP] identifier[addPartition] operator[SEP] identifier[partition] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[info] operator[SEP] identifier[c] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[partition] operator[SEP] }
private CmsSpellcheckingRequest parseJsonRequest(JSONObject jsonRequest) { final String id = jsonRequest.optString(JSON_ID); final JSONObject params = jsonRequest.optJSONObject(JSON_PARAMS); if (null == params) { LOG.debug("Invalid JSON request: No field \"params\" defined. "); return null; } final JSONArray words = params.optJSONArray(JSON_WORDS); final String lang = params.optString(JSON_LANG, LANG_DEFAULT); if (null == words) { LOG.debug("Invalid JSON request: No field \"words\" defined. "); return null; } // Convert JSON array to array of type String final List<String> wordsToCheck = new LinkedList<String>(); for (int i = 0; i < words.length(); i++) { final String word = words.opt(i).toString(); wordsToCheck.add(word); if (Character.isUpperCase(word.codePointAt(0))) { wordsToCheck.add(word.toLowerCase()); } } return new CmsSpellcheckingRequest(wordsToCheck.toArray(new String[wordsToCheck.size()]), lang, id); }
class class_name[name] begin[{] method[parseJsonRequest, return_type[type[CmsSpellcheckingRequest]], modifier[private], parameter[jsonRequest]] begin[{] local_variable[type[String], id] local_variable[type[JSONObject], params] if[binary_operation[literal[null], ==, member[.params]]] begin[{] call[LOG.debug, parameter[literal["Invalid JSON request: No field \"params\" defined. "]]] return[literal[null]] else begin[{] None end[}] local_variable[type[JSONArray], words] local_variable[type[String], lang] if[binary_operation[literal[null], ==, member[.words]]] begin[{] call[LOG.debug, parameter[literal["Invalid JSON request: No field \"words\" defined. "]]] return[literal[null]] else begin[{] None end[}] local_variable[type[List], wordsToCheck] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=opt, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=word)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=wordsToCheck, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=codePointAt, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)], member=isUpperCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=wordsToCheck, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[ClassCreator(arguments=[MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=wordsToCheck, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=wordsToCheck, selectors=[], type_arguments=None), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, 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=CmsSpellcheckingRequest, sub_type=None))] end[}] END[}]
Keyword[private] identifier[CmsSpellcheckingRequest] identifier[parseJsonRequest] operator[SEP] identifier[JSONObject] identifier[jsonRequest] operator[SEP] { Keyword[final] identifier[String] identifier[id] operator[=] identifier[jsonRequest] operator[SEP] identifier[optString] operator[SEP] identifier[JSON_ID] operator[SEP] operator[SEP] Keyword[final] identifier[JSONObject] identifier[params] operator[=] identifier[jsonRequest] operator[SEP] identifier[optJSONObject] operator[SEP] identifier[JSON_PARAMS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[params] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[JSONArray] identifier[words] operator[=] identifier[params] operator[SEP] identifier[optJSONArray] operator[SEP] identifier[JSON_WORDS] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[lang] operator[=] identifier[params] operator[SEP] identifier[optString] operator[SEP] identifier[JSON_LANG] , identifier[LANG_DEFAULT] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[words] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[wordsToCheck] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[words] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[String] identifier[word] operator[=] identifier[words] operator[SEP] identifier[opt] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[wordsToCheck] operator[SEP] identifier[add] operator[SEP] identifier[word] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isUpperCase] operator[SEP] identifier[word] operator[SEP] identifier[codePointAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { identifier[wordsToCheck] operator[SEP] identifier[add] operator[SEP] identifier[word] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[CmsSpellcheckingRequest] operator[SEP] identifier[wordsToCheck] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[wordsToCheck] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[lang] , identifier[id] operator[SEP] operator[SEP] }
public void stop() { if (this.logWriter != null) { this.logWriter.stop(); this.logWriter.getLogRepositoryManager().stop(); this.logWriter = null; } if (this.traceWriter != null) { this.traceWriter.stop(); this.traceWriter.getLogRepositoryManager().stop(); this.traceWriter = null; } }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[THIS[member[None.logWriter]], !=, literal[null]]] begin[{] THIS[member[None.logWriter]call[None.stop, parameter[]]] THIS[member[None.logWriter]call[None.getLogRepositoryManager, parameter[]]call[None.stop, parameter[]]] assign[THIS[member[None.logWriter]], literal[null]] else begin[{] None end[}] if[binary_operation[THIS[member[None.traceWriter]], !=, literal[null]]] begin[{] THIS[member[None.traceWriter]call[None.stop, parameter[]]] THIS[member[None.traceWriter]call[None.getLogRepositoryManager, parameter[]]call[None.stop, parameter[]]] assign[THIS[member[None.traceWriter]], literal[null]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[logWriter] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[logWriter] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[logWriter] operator[SEP] identifier[getLogRepositoryManager] operator[SEP] operator[SEP] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[logWriter] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[traceWriter] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[traceWriter] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[traceWriter] operator[SEP] identifier[getLogRepositoryManager] operator[SEP] operator[SEP] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[traceWriter] operator[=] Other[null] operator[SEP] } }
public static Calendar getCalendarParameter(final HttpServletRequest request, final String name, final String format) { String value = request.getParameter(name); if (StringUtils.isBlank(value)) { return null; } return DateFormatHelper.parse(value, format); }
class class_name[name] begin[{] method[getCalendarParameter, return_type[type[Calendar]], modifier[public static], parameter[request, name, format]] begin[{] local_variable[type[String], value] if[call[StringUtils.isBlank, parameter[member[.value]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[DateFormatHelper.parse, parameter[member[.value], member[.format]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Calendar] identifier[getCalendarParameter] operator[SEP] Keyword[final] identifier[HttpServletRequest] identifier[request] , Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[format] operator[SEP] { identifier[String] identifier[value] operator[=] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[value] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[DateFormatHelper] operator[SEP] identifier[parse] operator[SEP] identifier[value] , identifier[format] operator[SEP] operator[SEP] }
public OutlierResult run(Relation<O> relation) { final DistanceQuery<O> distanceQuery = relation.getDistanceQuery(getDistanceFunction()); final KNNQuery<O> knnQuery = relation.getKNNQuery(distanceQuery, k); FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("kNN distance for objects", relation.size(), LOG) : null; DoubleMinMax minmax = new DoubleMinMax(); WritableDoubleDataStore knno_score = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory.HINT_STATIC); // compute distance to the k nearest neighbor. for(DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) { // distance to the kth nearest neighbor // (assuming the query point is always included, with distance 0) final double dkn = knnQuery.getKNNForDBID(it, k).getKNNDistance(); knno_score.putDouble(it, dkn); minmax.put(dkn); LOG.incrementProcessed(prog); } LOG.ensureCompleted(prog); DoubleRelation scoreres = new MaterializedDoubleRelation("kNN Outlier Score", "knn-outlier", knno_score, relation.getDBIDs()); OutlierScoreMeta meta = new BasicOutlierScoreMeta(minmax.getMin(), minmax.getMax(), 0., Double.POSITIVE_INFINITY, 0.); return new OutlierResult(meta, scoreres); }
class class_name[name] begin[{] method[run, return_type[type[OutlierResult]], modifier[public], parameter[relation]] begin[{] local_variable[type[DistanceQuery], distanceQuery] local_variable[type[KNNQuery], knnQuery] local_variable[type[FiniteProgress], prog] local_variable[type[DoubleMinMax], minmax] local_variable[type[WritableDoubleDataStore], knno_score] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=it, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getKNNForDBID, postfix_operators=[], prefix_operators=[], qualifier=knnQuery, selectors=[MethodInvocation(arguments=[], member=getKNNDistance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=dkn)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=it, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dkn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putDouble, postfix_operators=[], prefix_operators=[], qualifier=knno_score, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dkn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=minmax, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=incrementProcessed, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterDBIDs, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None)]), label=None) call[LOG.ensureCompleted, parameter[member[.prog]]] local_variable[type[DoubleRelation], scoreres] local_variable[type[OutlierScoreMeta], meta] return[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scoreres, 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=OutlierResult, sub_type=None))] end[}] END[}]
Keyword[public] identifier[OutlierResult] identifier[run] operator[SEP] identifier[Relation] operator[<] identifier[O] operator[>] identifier[relation] operator[SEP] { Keyword[final] identifier[DistanceQuery] operator[<] identifier[O] operator[>] identifier[distanceQuery] operator[=] identifier[relation] operator[SEP] identifier[getDistanceQuery] operator[SEP] identifier[getDistanceFunction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[KNNQuery] operator[<] identifier[O] operator[>] identifier[knnQuery] operator[=] identifier[relation] operator[SEP] identifier[getKNNQuery] operator[SEP] identifier[distanceQuery] , identifier[k] operator[SEP] operator[SEP] identifier[FiniteProgress] identifier[prog] operator[=] identifier[LOG] operator[SEP] identifier[isVerbose] operator[SEP] operator[SEP] operator[?] Keyword[new] identifier[FiniteProgress] operator[SEP] literal[String] , identifier[relation] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[LOG] operator[SEP] operator[:] Other[null] operator[SEP] identifier[DoubleMinMax] identifier[minmax] operator[=] Keyword[new] identifier[DoubleMinMax] operator[SEP] operator[SEP] operator[SEP] identifier[WritableDoubleDataStore] identifier[knno_score] operator[=] identifier[DataStoreUtil] operator[SEP] identifier[makeDoubleStorage] operator[SEP] identifier[relation] operator[SEP] identifier[getDBIDs] operator[SEP] operator[SEP] , identifier[DataStoreFactory] operator[SEP] identifier[HINT_STATIC] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DBIDIter] identifier[it] operator[=] identifier[relation] operator[SEP] identifier[iterDBIDs] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[double] identifier[dkn] operator[=] identifier[knnQuery] operator[SEP] identifier[getKNNForDBID] operator[SEP] identifier[it] , identifier[k] operator[SEP] operator[SEP] identifier[getKNNDistance] operator[SEP] operator[SEP] operator[SEP] identifier[knno_score] operator[SEP] identifier[putDouble] operator[SEP] identifier[it] , identifier[dkn] operator[SEP] operator[SEP] identifier[minmax] operator[SEP] identifier[put] operator[SEP] identifier[dkn] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[incrementProcessed] operator[SEP] identifier[prog] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[ensureCompleted] operator[SEP] identifier[prog] operator[SEP] operator[SEP] identifier[DoubleRelation] identifier[scoreres] operator[=] Keyword[new] identifier[MaterializedDoubleRelation] operator[SEP] literal[String] , literal[String] , identifier[knno_score] , identifier[relation] operator[SEP] identifier[getDBIDs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[OutlierScoreMeta] identifier[meta] operator[=] Keyword[new] identifier[BasicOutlierScoreMeta] operator[SEP] identifier[minmax] operator[SEP] identifier[getMin] operator[SEP] operator[SEP] , identifier[minmax] operator[SEP] identifier[getMax] operator[SEP] operator[SEP] , literal[Float] , identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] , literal[Float] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[OutlierResult] operator[SEP] identifier[meta] , identifier[scoreres] operator[SEP] operator[SEP] }