code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
String httpPost(String url, String body, UsernamePasswordCredentials credentials) throws Exception { logger.debug(format("httpPost %s, body:%s", url, body)); final HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); CredentialsProvider provider = null; if (credentials != null) { provider = new BasicCredentialsProvider(); provider.setCredentials(AuthScope.ANY, credentials); httpClientBuilder.setDefaultCredentialsProvider(provider); } if (registry != null) { httpClientBuilder.setConnectionManager(new PoolingHttpClientConnectionManager(registry)); } HttpClient client = httpClientBuilder.build(); HttpPost httpPost = new HttpPost(url); httpPost.setConfig(getRequestConfig()); AuthCache authCache = new BasicAuthCache(); HttpHost targetHost = new HttpHost(httpPost.getURI().getHost(), httpPost.getURI().getPort()); if (credentials != null) { authCache.put(targetHost, new BasicScheme()); } final HttpClientContext context = HttpClientContext.create(); if (null != provider) { context.setCredentialsProvider(provider); } if (credentials != null) { context.setAuthCache(authCache); } httpPost.setEntity(new StringEntity(body)); if (credentials != null) { httpPost.addHeader(new BasicScheme(). authenticate(credentials, httpPost, context)); } HttpResponse response = client.execute(httpPost, context); int status = response.getStatusLine().getStatusCode(); HttpEntity entity = response.getEntity(); logger.trace(format("httpPost %s sending...", url)); String responseBody = entity != null ? EntityUtils.toString(entity) : null; logger.trace(format("httpPost %s responseBody %s", url, responseBody)); if (status >= 400) { Exception e = new Exception(format("POST request to %s with request body: %s, " + "failed with status code: %d. Response: %s", url, body, status, responseBody)); logger.error(e.getMessage()); throw e; } logger.debug(format("httpPost Status: %d returning: %s ", status, responseBody)); return responseBody; }
class class_name[name] begin[{] method[httpPost, return_type[type[String]], modifier[default], parameter[url, body, credentials]] begin[{] call[logger.debug, parameter[call[.format, parameter[literal["httpPost %s, body:%s"], member[.url], member[.body]]]]] local_variable[type[HttpClientBuilder], httpClientBuilder] local_variable[type[CredentialsProvider], provider] if[binary_operation[member[.credentials], !=, literal[null]]] begin[{] assign[member[.provider], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicCredentialsProvider, sub_type=None))] call[provider.setCredentials, parameter[member[AuthScope.ANY], member[.credentials]]] call[httpClientBuilder.setDefaultCredentialsProvider, parameter[member[.provider]]] else begin[{] None end[}] if[binary_operation[member[.registry], !=, literal[null]]] begin[{] call[httpClientBuilder.setConnectionManager, parameter[ClassCreator(arguments=[MemberReference(member=registry, 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=PoolingHttpClientConnectionManager, sub_type=None))]] else begin[{] None end[}] local_variable[type[HttpClient], client] local_variable[type[HttpPost], httpPost] call[httpPost.setConfig, parameter[call[.getRequestConfig, parameter[]]]] local_variable[type[AuthCache], authCache] local_variable[type[HttpHost], targetHost] if[binary_operation[member[.credentials], !=, literal[null]]] begin[{] call[authCache.put, parameter[member[.targetHost], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicScheme, sub_type=None))]] else begin[{] None end[}] local_variable[type[HttpClientContext], context] if[binary_operation[literal[null], !=, member[.provider]]] begin[{] call[context.setCredentialsProvider, parameter[member[.provider]]] else begin[{] None end[}] if[binary_operation[member[.credentials], !=, literal[null]]] begin[{] call[context.setAuthCache, parameter[member[.authCache]]] else begin[{] None end[}] call[httpPost.setEntity, parameter[ClassCreator(arguments=[MemberReference(member=body, 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=StringEntity, sub_type=None))]] if[binary_operation[member[.credentials], !=, literal[null]]] begin[{] call[httpPost.addHeader, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=credentials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpPost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=authenticate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BasicScheme, sub_type=None))]] else begin[{] None end[}] local_variable[type[HttpResponse], response] local_variable[type[int], status] local_variable[type[HttpEntity], entity] call[logger.trace, parameter[call[.format, parameter[literal["httpPost %s sending..."], member[.url]]]]] local_variable[type[String], responseBody] call[logger.trace, parameter[call[.format, parameter[literal["httpPost %s responseBody %s"], member[.url], member[.responseBody]]]]] if[binary_operation[member[.status], >=, literal[400]]] begin[{] local_variable[type[Exception], e] call[logger.error, parameter[call[e.getMessage, parameter[]]]] ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] call[logger.debug, parameter[call[.format, parameter[literal["httpPost Status: %d returning: %s "], member[.status], member[.responseBody]]]]] return[member[.responseBody]] end[}] END[}]
identifier[String] identifier[httpPost] operator[SEP] identifier[String] identifier[url] , identifier[String] identifier[body] , identifier[UsernamePasswordCredentials] identifier[credentials] operator[SEP] Keyword[throws] identifier[Exception] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[url] , identifier[body] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[HttpClientBuilder] identifier[httpClientBuilder] operator[=] identifier[HttpClientBuilder] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[CredentialsProvider] identifier[provider] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[credentials] operator[!=] Other[null] operator[SEP] { identifier[provider] operator[=] Keyword[new] identifier[BasicCredentialsProvider] operator[SEP] operator[SEP] operator[SEP] identifier[provider] operator[SEP] identifier[setCredentials] operator[SEP] identifier[AuthScope] operator[SEP] identifier[ANY] , identifier[credentials] operator[SEP] operator[SEP] identifier[httpClientBuilder] operator[SEP] identifier[setDefaultCredentialsProvider] operator[SEP] identifier[provider] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[registry] operator[!=] Other[null] operator[SEP] { identifier[httpClientBuilder] operator[SEP] identifier[setConnectionManager] operator[SEP] Keyword[new] identifier[PoolingHttpClientConnectionManager] operator[SEP] identifier[registry] operator[SEP] operator[SEP] operator[SEP] } identifier[HttpClient] identifier[client] operator[=] identifier[httpClientBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[HttpPost] identifier[httpPost] operator[=] Keyword[new] identifier[HttpPost] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[httpPost] operator[SEP] identifier[setConfig] operator[SEP] identifier[getRequestConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AuthCache] identifier[authCache] operator[=] Keyword[new] identifier[BasicAuthCache] operator[SEP] operator[SEP] operator[SEP] identifier[HttpHost] identifier[targetHost] operator[=] Keyword[new] identifier[HttpHost] operator[SEP] identifier[httpPost] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] , identifier[httpPost] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[credentials] operator[!=] Other[null] operator[SEP] { identifier[authCache] operator[SEP] identifier[put] operator[SEP] identifier[targetHost] , Keyword[new] identifier[BasicScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[HttpClientContext] identifier[context] operator[=] identifier[HttpClientContext] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[provider] operator[SEP] { identifier[context] operator[SEP] identifier[setCredentialsProvider] operator[SEP] identifier[provider] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[credentials] operator[!=] Other[null] operator[SEP] { identifier[context] operator[SEP] identifier[setAuthCache] operator[SEP] identifier[authCache] operator[SEP] operator[SEP] } identifier[httpPost] operator[SEP] identifier[setEntity] operator[SEP] Keyword[new] identifier[StringEntity] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[credentials] operator[!=] Other[null] operator[SEP] { identifier[httpPost] operator[SEP] identifier[addHeader] operator[SEP] Keyword[new] identifier[BasicScheme] operator[SEP] operator[SEP] operator[SEP] identifier[authenticate] operator[SEP] identifier[credentials] , identifier[httpPost] , identifier[context] operator[SEP] operator[SEP] operator[SEP] } identifier[HttpResponse] identifier[response] operator[=] identifier[client] operator[SEP] identifier[execute] operator[SEP] identifier[httpPost] , identifier[context] operator[SEP] operator[SEP] Keyword[int] identifier[status] operator[=] identifier[response] operator[SEP] identifier[getStatusLine] operator[SEP] operator[SEP] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] identifier[HttpEntity] identifier[entity] operator[=] identifier[response] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[responseBody] operator[=] identifier[entity] operator[!=] Other[null] operator[?] identifier[EntityUtils] operator[SEP] identifier[toString] operator[SEP] identifier[entity] operator[SEP] operator[:] Other[null] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[url] , identifier[responseBody] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[status] operator[>=] Other[400] operator[SEP] { identifier[Exception] identifier[e] operator[=] Keyword[new] identifier[Exception] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , identifier[url] , identifier[body] , identifier[status] , identifier[responseBody] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[status] , identifier[responseBody] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[responseBody] operator[SEP] }
public static synchronized <T> T createNicePartialMockForAllMethodsExcept(Class<T> type, String methodNameToExclude, Class<?> firstArgumentType, Class<?>... moreTypes) { /* * The reason why we've split the first and "additional types" is * because it should not intervene with the mockAllExcept(type, * String...methodNames) method. */ final Class<?>[] argumentTypes = mergeArgumentTypes(firstArgumentType, moreTypes); return createNiceMock(type, WhiteboxImpl.getAllMethodsExcept(type, methodNameToExclude, argumentTypes)); }
class class_name[name] begin[{] method[createNicePartialMockForAllMethodsExcept, return_type[type[T]], modifier[synchronized public static], parameter[type, methodNameToExclude, firstArgumentType, moreTypes]] begin[{] local_variable[type[Class], argumentTypes] return[call[.createNiceMock, parameter[member[.type], call[WhiteboxImpl.getAllMethodsExcept, parameter[member[.type], member[.methodNameToExclude], member[.argumentTypes]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] operator[<] identifier[T] operator[>] identifier[T] identifier[createNicePartialMockForAllMethodsExcept] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] , identifier[String] identifier[methodNameToExclude] , identifier[Class] operator[<] operator[?] operator[>] identifier[firstArgumentType] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[moreTypes] operator[SEP] { Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[argumentTypes] operator[=] identifier[mergeArgumentTypes] operator[SEP] identifier[firstArgumentType] , identifier[moreTypes] operator[SEP] operator[SEP] Keyword[return] identifier[createNiceMock] operator[SEP] identifier[type] , identifier[WhiteboxImpl] operator[SEP] identifier[getAllMethodsExcept] operator[SEP] identifier[type] , identifier[methodNameToExclude] , identifier[argumentTypes] operator[SEP] operator[SEP] operator[SEP] }
public void put(String path, String[] value) { StringBuilder sb = new StringBuilder(); char[] chars = path.toCharArray(); OUT: for (int i = 0; i < chars.length; i++) { char c = chars[i]; switch (c) { case '[': case '(': i++; StringBuilder sb2 = new StringBuilder(); boolean isNumber = true; for (; i < chars.length; i++) { char c2 = chars[i]; switch (c2) { case ']': case ')': if ((c == '[' && c2 == ']') || (c == '(' && c2 == ')')) { if (isNumber && !(c == '(')) { sb.append(':').append(sb2); } else { sb.append('.').append(sb2); } continue OUT; } } isNumber = isNumber && Character.isDigit(c2); sb2.append(c2); } break; default: sb.append(c); break; } } path = sb.toString(); putPath(path, value); }
class class_name[name] begin[{] method[put, return_type[void], modifier[public], parameter[path, value]] begin[{] local_variable[type[StringBuilder], sb] local_variable[type[char], chars] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='['), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='(')], statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=isNumber)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=c2)], modifiers=set(), type=BasicType(dimensions=[], name=char)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')')], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='['), operator===), operandr=BinaryOperation(operandl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']'), operator===), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='('), operator===), operandr=BinaryOperation(operandl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')'), operator===), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='('), operator===), operator=&&), else_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=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=sb2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), 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=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=sb2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), ContinueStatement(goto=OUT, label=None)]))])], expression=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=isNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDigit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb2, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=chars, selectors=[]), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=chars, 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=OUT) assign[member[.path], call[sb.toString, parameter[]]] call[.putPath, parameter[member[.path], member[.value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[put] operator[SEP] identifier[String] identifier[path] , identifier[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[chars] operator[=] identifier[path] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[OUT] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[chars] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[chars] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[c] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[i] operator[++] operator[SEP] identifier[StringBuilder] identifier[sb2] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isNumber] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[chars] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c2] operator[=] identifier[chars] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[c2] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[&&] identifier[c2] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[&&] identifier[c2] operator[==] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isNumber] operator[&&] operator[!] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[sb2] operator[SEP] operator[SEP] } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[sb2] operator[SEP] operator[SEP] } Keyword[continue] identifier[OUT] operator[SEP] } } identifier[isNumber] operator[=] identifier[isNumber] operator[&&] identifier[Character] operator[SEP] identifier[isDigit] operator[SEP] identifier[c2] operator[SEP] operator[SEP] identifier[sb2] operator[SEP] identifier[append] operator[SEP] identifier[c2] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } identifier[path] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[putPath] operator[SEP] identifier[path] , identifier[value] operator[SEP] operator[SEP] }
public void write(ByteCodeWriter out) throws IOException { out.writeUTF8Const(getName()); out.writeIntUTF8(_value); }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[out]] begin[{] call[out.writeUTF8Const, parameter[call[.getName, parameter[]]]] call[out.writeIntUTF8, parameter[member[._value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[ByteCodeWriter] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] { identifier[out] operator[SEP] identifier[writeUTF8Const] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeIntUTF8] operator[SEP] identifier[_value] operator[SEP] operator[SEP] }
@Override public ListenableFuture<Table> modifyColumnFamilyAsync(ModifyColumnFamiliesRequest request) { return createUnaryListener(request, modifyColumnFamilyRpc, request.getName()).getAsyncResult(); }
class class_name[name] begin[{] method[modifyColumnFamilyAsync, return_type[type[ListenableFuture]], modifier[public], parameter[request]] begin[{] return[call[.createUnaryListener, parameter[member[.request], member[.modifyColumnFamilyRpc], call[request.getName, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ListenableFuture] operator[<] identifier[Table] operator[>] identifier[modifyColumnFamilyAsync] operator[SEP] identifier[ModifyColumnFamiliesRequest] identifier[request] operator[SEP] { Keyword[return] identifier[createUnaryListener] operator[SEP] identifier[request] , identifier[modifyColumnFamilyRpc] , identifier[request] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getAsyncResult] operator[SEP] operator[SEP] operator[SEP] }
@Override public RespondToAuthChallengeResult respondToAuthChallenge(RespondToAuthChallengeRequest request) { request = beforeClientExecution(request); return executeRespondToAuthChallenge(request); }
class class_name[name] begin[{] method[respondToAuthChallenge, return_type[type[RespondToAuthChallengeResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeRespondToAuthChallenge, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[RespondToAuthChallengeResult] identifier[respondToAuthChallenge] operator[SEP] identifier[RespondToAuthChallengeRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeRespondToAuthChallenge] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public synchronized long[] updateReplicas(List<Long> replicas, Map<Integer, Long> partitionMasters) { return updateReplicasInternal(replicas, partitionMasters, null); }
class class_name[name] begin[{] method[updateReplicas, return_type[type[long]], modifier[synchronized public], parameter[replicas, partitionMasters]] begin[{] return[call[.updateReplicasInternal, parameter[member[.replicas], member[.partitionMasters], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[long] operator[SEP] operator[SEP] identifier[updateReplicas] operator[SEP] identifier[List] operator[<] identifier[Long] operator[>] identifier[replicas] , identifier[Map] operator[<] identifier[Integer] , identifier[Long] operator[>] identifier[partitionMasters] operator[SEP] { Keyword[return] identifier[updateReplicasInternal] operator[SEP] identifier[replicas] , identifier[partitionMasters] , Other[null] operator[SEP] operator[SEP] }
public static int getOSArch() { if (osArch == -1) { osArch = toIntArch(System.getProperty("os.arch.data.model")); if (osArch == ARCH_UNKNOW) osArch = toIntArch(System.getProperty("os.arch")); } return osArch; }
class class_name[name] begin[{] method[getOSArch, return_type[type[int]], modifier[public static], parameter[]] begin[{] if[binary_operation[member[.osArch], ==, literal[1]]] begin[{] assign[member[.osArch], call[.toIntArch, parameter[call[System.getProperty, parameter[literal["os.arch.data.model"]]]]]] if[binary_operation[member[.osArch], ==, member[.ARCH_UNKNOW]]] begin[{] assign[member[.osArch], call[.toIntArch, parameter[call[System.getProperty, parameter[literal["os.arch"]]]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.osArch]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getOSArch] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[osArch] operator[==] operator[-] Other[1] operator[SEP] { identifier[osArch] operator[=] identifier[toIntArch] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[osArch] operator[==] identifier[ARCH_UNKNOW] operator[SEP] identifier[osArch] operator[=] identifier[toIntArch] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[osArch] operator[SEP] }
public BoundaryConditionalEventActivityBehavior parseBoundaryConditionalEventDefinition(Element element, boolean interrupting, ActivityImpl conditionalActivity) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.BOUNDARY_CONDITIONAL); ConditionalEventDefinition conditionalEventDefinition = parseConditionalEventDefinition(element, conditionalActivity); conditionalEventDefinition.setInterrupting(interrupting); addEventSubscriptionDeclaration(conditionalEventDefinition, conditionalActivity.getEventScope(), element); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseBoundaryConditionalEventDefinition(element, interrupting, conditionalActivity); } return new BoundaryConditionalEventActivityBehavior(conditionalEventDefinition); }
class class_name[name] begin[{] method[parseBoundaryConditionalEventDefinition, return_type[type[BoundaryConditionalEventActivityBehavior]], modifier[public], parameter[element, interrupting, conditionalActivity]] begin[{] call[conditionalActivity.getProperties, parameter[]] local_variable[type[ConditionalEventDefinition], conditionalEventDefinition] call[conditionalEventDefinition.setInterrupting, parameter[member[.interrupting]]] call[.addEventSubscriptionDeclaration, parameter[member[.conditionalEventDefinition], call[conditionalActivity.getEventScope, parameter[]], member[.element]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=interrupting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conditionalActivity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseBoundaryConditionalEventDefinition, postfix_operators=[], prefix_operators=[], qualifier=parseListener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parseListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parseListener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BpmnParseListener, sub_type=None))), label=None) return[ClassCreator(arguments=[MemberReference(member=conditionalEventDefinition, 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=BoundaryConditionalEventActivityBehavior, sub_type=None))] end[}] END[}]
Keyword[public] identifier[BoundaryConditionalEventActivityBehavior] identifier[parseBoundaryConditionalEventDefinition] operator[SEP] identifier[Element] identifier[element] , Keyword[boolean] identifier[interrupting] , identifier[ActivityImpl] identifier[conditionalActivity] operator[SEP] { identifier[conditionalActivity] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[BpmnProperties] operator[SEP] identifier[TYPE] , identifier[ActivityTypes] operator[SEP] identifier[BOUNDARY_CONDITIONAL] operator[SEP] operator[SEP] identifier[ConditionalEventDefinition] identifier[conditionalEventDefinition] operator[=] identifier[parseConditionalEventDefinition] operator[SEP] identifier[element] , identifier[conditionalActivity] operator[SEP] operator[SEP] identifier[conditionalEventDefinition] operator[SEP] identifier[setInterrupting] operator[SEP] identifier[interrupting] operator[SEP] operator[SEP] identifier[addEventSubscriptionDeclaration] operator[SEP] identifier[conditionalEventDefinition] , identifier[conditionalActivity] operator[SEP] identifier[getEventScope] operator[SEP] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BpmnParseListener] identifier[parseListener] operator[:] identifier[parseListeners] operator[SEP] { identifier[parseListener] operator[SEP] identifier[parseBoundaryConditionalEventDefinition] operator[SEP] identifier[element] , identifier[interrupting] , identifier[conditionalActivity] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[BoundaryConditionalEventActivityBehavior] operator[SEP] identifier[conditionalEventDefinition] operator[SEP] operator[SEP] }
public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate, int batchSize, Executor executor) { CountCombiner<T> combiner = new CountCombiner<T>(); CountProcedureFactory<T> procedureFactory = new CountProcedureFactory<T>(predicate); ParallelIterate.forEach( iterable, procedureFactory, combiner, batchSize, executor); return combiner.getCount(); }
class class_name[name] begin[{] method[count, return_type[type[int]], modifier[public static], parameter[iterable, predicate, batchSize, executor]] begin[{] local_variable[type[CountCombiner], combiner] local_variable[type[CountProcedureFactory], procedureFactory] call[ParallelIterate.forEach, parameter[member[.iterable], member[.procedureFactory], member[.combiner], member[.batchSize], member[.executor]]] return[call[combiner.getCount, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[int] identifier[count] operator[SEP] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[iterable] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[predicate] , Keyword[int] identifier[batchSize] , identifier[Executor] identifier[executor] operator[SEP] { identifier[CountCombiner] operator[<] identifier[T] operator[>] identifier[combiner] operator[=] Keyword[new] identifier[CountCombiner] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[CountProcedureFactory] operator[<] identifier[T] operator[>] identifier[procedureFactory] operator[=] Keyword[new] identifier[CountProcedureFactory] operator[<] identifier[T] operator[>] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] identifier[ParallelIterate] operator[SEP] identifier[forEach] operator[SEP] identifier[iterable] , identifier[procedureFactory] , identifier[combiner] , identifier[batchSize] , identifier[executor] operator[SEP] operator[SEP] Keyword[return] identifier[combiner] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] }
public static ConversationHsmLocalizableParameter defaultValue(final String defaultValue) { ConversationHsmLocalizableParameter parameter = new ConversationHsmLocalizableParameter(); parameter.defaultValue = defaultValue; return parameter; }
class class_name[name] begin[{] method[defaultValue, return_type[type[ConversationHsmLocalizableParameter]], modifier[public static], parameter[defaultValue]] begin[{] local_variable[type[ConversationHsmLocalizableParameter], parameter] assign[member[parameter.defaultValue], member[.defaultValue]] return[member[.parameter]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ConversationHsmLocalizableParameter] identifier[defaultValue] operator[SEP] Keyword[final] identifier[String] identifier[defaultValue] operator[SEP] { identifier[ConversationHsmLocalizableParameter] identifier[parameter] operator[=] Keyword[new] identifier[ConversationHsmLocalizableParameter] operator[SEP] operator[SEP] operator[SEP] identifier[parameter] operator[SEP] identifier[defaultValue] operator[=] identifier[defaultValue] operator[SEP] Keyword[return] identifier[parameter] operator[SEP] }
public FileFormat determineFileFormat(BufferedInputStream bis, String filename) throws IOException { int len = 1024 * 100; String ext = ""; if (filename != null) { int dot = filename.lastIndexOf('.'); if (dot > 0) { ext = filename.substring(dot + 1); } } //check the first couple of bytes bis.mark(len); try { byte[] firstCharacters = new byte[6]; bis.read(firstCharacters); //check if the file starts with a %YAML directive if (firstCharacters[0] == '%' && firstCharacters[1] == 'Y' && firstCharacters[2] == 'A' && firstCharacters[3] == 'M' && firstCharacters[4] == 'L' && Character.isWhitespace(firstCharacters[5])) { return FileFormat.YAML; } //check if the file starts with an EndNote tag, but //also make sure the extension is not 'bib' or 'yml'/'yaml' //because BibTeX comments and YAML directives look like //EndNote tags if (firstCharacters[0] == '%' && Character.isWhitespace(firstCharacters[2]) && !ext.equalsIgnoreCase("bib") && !ext.equalsIgnoreCase("yaml") && !ext.equalsIgnoreCase("yml")) { return FileFormat.ENDNOTE; } //check if the file starts with a RIS type tag if (firstCharacters[0] == 'T' && firstCharacters[1] == 'Y' && Character.isWhitespace(firstCharacters[2]) && Character.isWhitespace(firstCharacters[3]) && firstCharacters[4] == '-') { return FileFormat.RIS; } } finally { bis.reset(); } //now check if it's json, bibtex or yaml bis.mark(len); try { while (true) { int c = bis.read(); --len; if (c < 0 || len < 2) { return FileFormat.UNKNOWN; } if (!Character.isWhitespace(c)) { if (c == '[') { return FileFormat.JSON_ARRAY; } else if (c == '{') { return FileFormat.JSON_OBJECT; } if (ext.equalsIgnoreCase("yaml") || ext.equalsIgnoreCase("yml")) { return FileFormat.YAML; } return FileFormat.BIBTEX; } } } finally { bis.reset(); } }
class class_name[name] begin[{] method[determineFileFormat, return_type[type[FileFormat]], modifier[public], parameter[bis, filename]] begin[{] local_variable[type[int], len] local_variable[type[String], ext] if[binary_operation[member[.filename], !=, literal[null]]] begin[{] local_variable[type[int], dot] if[binary_operation[member[.dot], >, literal[0]]] begin[{] assign[member[.ext], call[filename.substring, parameter[binary_operation[member[.dot], +, literal[1]]]]] else begin[{] None end[}] else begin[{] None end[}] call[bis.mark, parameter[member[.len]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=firstCharacters)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=bis, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Y'), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=firstCharacters, 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='A'), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='M'), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='L'), operator===), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5))])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=YAML, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%'), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bib")], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=['!'], qualifier=ext, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yaml")], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=['!'], qualifier=ext, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yml")], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=['!'], qualifier=ext, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=ENDNOTE, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='T'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Y'), operator===), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=firstCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=RIS, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=bis, selectors=[], type_arguments=None), label=None)], label=None, resources=None) call[bis.mark, parameter[member[.len]]] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=bis, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MemberReference(member=len, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=<), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWhitespace, postfix_operators=[], prefix_operators=['!'], qualifier=Character, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='['), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=JSON_OBJECT, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=JSON_ARRAY, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yaml")], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=ext, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yml")], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=ext, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=YAML, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)])), ReturnStatement(expression=MemberReference(member=BIBTEX, postfix_operators=[], prefix_operators=[], qualifier=FileFormat, selectors=[]), label=None)]))]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=bis, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[FileFormat] identifier[determineFileFormat] operator[SEP] identifier[BufferedInputStream] identifier[bis] , identifier[String] identifier[filename] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[len] operator[=] Other[1024] operator[*] Other[100] operator[SEP] identifier[String] identifier[ext] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[filename] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[dot] operator[=] identifier[filename] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dot] operator[>] Other[0] operator[SEP] { identifier[ext] operator[=] identifier[filename] operator[SEP] identifier[substring] operator[SEP] identifier[dot] operator[+] Other[1] operator[SEP] operator[SEP] } } identifier[bis] operator[SEP] identifier[mark] operator[SEP] identifier[len] operator[SEP] operator[SEP] Keyword[try] { Keyword[byte] operator[SEP] operator[SEP] identifier[firstCharacters] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[6] operator[SEP] operator[SEP] identifier[bis] operator[SEP] identifier[read] operator[SEP] identifier[firstCharacters] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstCharacters] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[firstCharacters] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[firstCharacters] operator[SEP] Other[2] operator[SEP] operator[==] literal[String] operator[&&] identifier[firstCharacters] operator[SEP] Other[3] operator[SEP] operator[==] literal[String] operator[&&] identifier[firstCharacters] operator[SEP] Other[4] operator[SEP] operator[==] literal[String] operator[&&] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[firstCharacters] operator[SEP] Other[5] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[FileFormat] operator[SEP] identifier[YAML] operator[SEP] } Keyword[if] operator[SEP] identifier[firstCharacters] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[firstCharacters] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[ext] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[ext] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[ext] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[FileFormat] operator[SEP] identifier[ENDNOTE] operator[SEP] } Keyword[if] operator[SEP] identifier[firstCharacters] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[firstCharacters] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[firstCharacters] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[&&] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[firstCharacters] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[&&] identifier[firstCharacters] operator[SEP] Other[4] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[return] identifier[FileFormat] operator[SEP] identifier[RIS] operator[SEP] } } Keyword[finally] { identifier[bis] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] } identifier[bis] operator[SEP] identifier[mark] operator[SEP] identifier[len] operator[SEP] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[c] operator[=] identifier[bis] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[--] identifier[len] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] Other[0] operator[||] identifier[len] operator[<] Other[2] operator[SEP] { Keyword[return] identifier[FileFormat] operator[SEP] identifier[UNKNOWN] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[c] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[return] identifier[FileFormat] operator[SEP] identifier[JSON_ARRAY] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[return] identifier[FileFormat] operator[SEP] identifier[JSON_OBJECT] operator[SEP] } Keyword[if] operator[SEP] identifier[ext] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[ext] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[FileFormat] operator[SEP] identifier[YAML] operator[SEP] } Keyword[return] identifier[FileFormat] operator[SEP] identifier[BIBTEX] operator[SEP] } } } Keyword[finally] { identifier[bis] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] } }
public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd) { productItem.setStatus(productItem.getStatus() | (1 << 3) | (1 << 2) | (1 << 1)); if (application == null) application = BaseApplet.getSharedInstance().getApplication(); application.getTaskScheduler().addTask(new CalendarDateChangeTask(application, strParams, productItem, dateStart, dateEnd)); }
class class_name[name] begin[{] method[changeRemoteDate, return_type[void], modifier[public], parameter[application, strParams, productItem, dateStart, dateEnd]] begin[{] call[productItem.setStatus, parameter[binary_operation[binary_operation[binary_operation[call[productItem.getStatus, parameter[]], |, binary_operation[literal[1], <<, literal[3]]], |, binary_operation[literal[1], <<, literal[2]]], |, binary_operation[literal[1], <<, literal[1]]]]] if[binary_operation[member[.application], ==, literal[null]]] begin[{] assign[member[.application], call[BaseApplet.getSharedInstance, parameter[]]] else begin[{] None end[}] call[application.getTaskScheduler, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[changeRemoteDate] operator[SEP] identifier[Application] identifier[application] , identifier[String] identifier[strParams] , identifier[CachedItem] identifier[productItem] , identifier[Date] identifier[dateStart] , identifier[Date] identifier[dateEnd] operator[SEP] { identifier[productItem] operator[SEP] identifier[setStatus] operator[SEP] identifier[productItem] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[|] operator[SEP] Other[1] operator[<<] Other[3] operator[SEP] operator[|] operator[SEP] Other[1] operator[<<] Other[2] operator[SEP] operator[|] operator[SEP] Other[1] operator[<<] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[application] operator[==] Other[null] operator[SEP] identifier[application] operator[=] identifier[BaseApplet] operator[SEP] identifier[getSharedInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] identifier[application] operator[SEP] identifier[getTaskScheduler] operator[SEP] operator[SEP] operator[SEP] identifier[addTask] operator[SEP] Keyword[new] identifier[CalendarDateChangeTask] operator[SEP] identifier[application] , identifier[strParams] , identifier[productItem] , identifier[dateStart] , identifier[dateEnd] operator[SEP] operator[SEP] operator[SEP] }
public boolean recordVersion(String version) { if (currentInfo.documentVersion(version)) { populated = true; return true; } else { return false; } }
class class_name[name] begin[{] method[recordVersion, return_type[type[boolean]], modifier[public], parameter[version]] begin[{] if[call[currentInfo.documentVersion, parameter[member[.version]]]] begin[{] assign[member[.populated], literal[true]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[recordVersion] operator[SEP] identifier[String] identifier[version] operator[SEP] { Keyword[if] operator[SEP] identifier[currentInfo] operator[SEP] identifier[documentVersion] operator[SEP] identifier[version] operator[SEP] operator[SEP] { identifier[populated] operator[=] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public static String getRelativePath(File base, File file) { String pathBase = base.getAbsolutePath(); if (base.isDirectory()) pathBase += "/"; String pathFile = file.getAbsolutePath(); if (file.isDirectory()) pathFile += "/"; return getRelativePath(pathBase, pathFile); }
class class_name[name] begin[{] method[getRelativePath, return_type[type[String]], modifier[public static], parameter[base, file]] begin[{] local_variable[type[String], pathBase] if[call[base.isDirectory, parameter[]]] begin[{] assign[member[.pathBase], literal["/"]] else begin[{] None end[}] local_variable[type[String], pathFile] if[call[file.isDirectory, parameter[]]] begin[{] assign[member[.pathFile], literal["/"]] else begin[{] None end[}] return[call[.getRelativePath, parameter[member[.pathBase], member[.pathFile]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getRelativePath] operator[SEP] identifier[File] identifier[base] , identifier[File] identifier[file] operator[SEP] { identifier[String] identifier[pathBase] operator[=] identifier[base] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[base] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[pathBase] operator[+=] literal[String] operator[SEP] identifier[String] identifier[pathFile] operator[=] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[pathFile] operator[+=] literal[String] operator[SEP] Keyword[return] identifier[getRelativePath] operator[SEP] identifier[pathBase] , identifier[pathFile] operator[SEP] operator[SEP] }
protected void correctIndentation() { // TODO: Fix // if(this.parentList != null) { // this.leftIndent = this.leftIndent + this.parentList.getLeftIndent() + this.parentList.getFirstIndent(); // } for(int i = 0; i < this.items.size(); i++) { if(this.items.get(i) instanceof RtfList) { ((RtfList) this.items.get(i)).correctIndentation(); } else if(this.items.get(i) instanceof RtfListItem) { ((RtfListItem) this.items.get(i)).correctIndentation(); } } }
class class_name[name] begin[{] method[correctIndentation, return_type[void], modifier[protected], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=ReferenceType(arguments=None, dimensions=[], name=RtfList, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=ReferenceType(arguments=None, dimensions=[], name=RtfListItem, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=RtfListItem, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=RtfList, sub_type=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[correctIndentation] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[RtfList] operator[SEP] { operator[SEP] operator[SEP] identifier[RtfList] operator[SEP] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[correctIndentation] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[RtfListItem] operator[SEP] { operator[SEP] operator[SEP] identifier[RtfListItem] operator[SEP] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[correctIndentation] operator[SEP] operator[SEP] operator[SEP] } } }
public void setTransparentSectionsEnabled(final boolean TRANSPARENT_SECTIONS_ENABLED) { transparentSectionsEnabled = TRANSPARENT_SECTIONS_ENABLED; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
class class_name[name] begin[{] method[setTransparentSectionsEnabled, return_type[void], modifier[public], parameter[TRANSPARENT_SECTIONS_ENABLED]] begin[{] assign[member[.transparentSectionsEnabled], member[.TRANSPARENT_SECTIONS_ENABLED]] call[.init, parameter[call[.getInnerBounds, parameter[]], call[.getInnerBounds, parameter[]]]] call[.repaint, parameter[call[.getInnerBounds, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTransparentSectionsEnabled] operator[SEP] Keyword[final] Keyword[boolean] identifier[TRANSPARENT_SECTIONS_ENABLED] operator[SEP] { identifier[transparentSectionsEnabled] operator[=] identifier[TRANSPARENT_SECTIONS_ENABLED] operator[SEP] identifier[init] operator[SEP] identifier[getInnerBounds] operator[SEP] operator[SEP] operator[SEP] identifier[width] , identifier[getInnerBounds] operator[SEP] operator[SEP] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[repaint] operator[SEP] identifier[getInnerBounds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public final void addAllHelperTexts(@NonNull final Collection<CharSequence> helperTexts) { Condition.INSTANCE.ensureNotNull(helperTexts, "The collection may not be null"); for (CharSequence helperText : helperTexts) { addHelperText(helperText); } }
class class_name[name] begin[{] method[addAllHelperTexts, return_type[void], modifier[final public], parameter[helperTexts]] begin[{] call[Condition.INSTANCE.ensureNotNull, parameter[member[.helperTexts], literal["The collection may not be null"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=helperText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHelperText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=helperTexts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=helperText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[addAllHelperTexts] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[Collection] operator[<] identifier[CharSequence] operator[>] identifier[helperTexts] operator[SEP] { identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[helperTexts] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CharSequence] identifier[helperText] operator[:] identifier[helperTexts] operator[SEP] { identifier[addHelperText] operator[SEP] identifier[helperText] operator[SEP] operator[SEP] } }
protected void setMoments() { moments.clear(); for(Integer i: momentDegrees) moments.put(i, 0.0); for(Double d: insertStat.keySet()) { for(int j: momentDegrees) moments.put(j, moments.get(j)+Math.pow(d-expectation, j)*(insertStat.get(d)/observationCount)); } }
class class_name[name] begin[{] method[setMoments, return_type[void], modifier[protected], parameter[]] begin[{] call[moments.clear, parameter[]] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0)], member=put, postfix_operators=[], prefix_operators=[], qualifier=moments, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=momentDegrees, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=moments, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=expectation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pow, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=insertStat, selectors=[], type_arguments=None), operandr=MemberReference(member=observationCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operator=*), operator=+)], member=put, postfix_operators=[], prefix_operators=[], qualifier=moments, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=momentDegrees, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=insertStat, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[setMoments] operator[SEP] operator[SEP] { identifier[moments] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[i] operator[:] identifier[momentDegrees] operator[SEP] identifier[moments] operator[SEP] identifier[put] operator[SEP] identifier[i] , literal[Float] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Double] identifier[d] operator[:] identifier[insertStat] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[:] identifier[momentDegrees] operator[SEP] identifier[moments] operator[SEP] identifier[put] operator[SEP] identifier[j] , identifier[moments] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[d] operator[-] identifier[expectation] , identifier[j] operator[SEP] operator[*] operator[SEP] identifier[insertStat] operator[SEP] identifier[get] operator[SEP] identifier[d] operator[SEP] operator[/] identifier[observationCount] operator[SEP] operator[SEP] operator[SEP] } }
public void checkValueData(String propertyId, int orderNumber) throws ValueDataNotFoundException, IOException { File f = getFile(propertyId, orderNumber); if (!f.exists()) { throw new ValueDataNotFoundException("Value data corresponding to property with [id=" + propertyId + ", ordernum=" + orderNumber + "] does not exist."); } }
class class_name[name] begin[{] method[checkValueData, return_type[void], modifier[public], parameter[propertyId, orderNumber]] begin[{] local_variable[type[File], f] if[call[f.exists, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Value data corresponding to property with [id="), operandr=MemberReference(member=propertyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ordernum="), operator=+), operandr=MemberReference(member=orderNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] does not exist."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValueDataNotFoundException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[checkValueData] operator[SEP] identifier[String] identifier[propertyId] , Keyword[int] identifier[orderNumber] operator[SEP] Keyword[throws] identifier[ValueDataNotFoundException] , identifier[IOException] { identifier[File] identifier[f] operator[=] identifier[getFile] operator[SEP] identifier[propertyId] , identifier[orderNumber] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ValueDataNotFoundException] operator[SEP] literal[String] operator[+] identifier[propertyId] operator[+] literal[String] operator[+] identifier[orderNumber] operator[+] literal[String] operator[SEP] operator[SEP] } }
@Override public EEnum getIfcFlowDirectionEnum() { if (ifcFlowDirectionEnumEEnum == null) { ifcFlowDirectionEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(992); } return ifcFlowDirectionEnumEEnum; }
class class_name[name] begin[{] method[getIfcFlowDirectionEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcFlowDirectionEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcFlowDirectionEnumEEnum], 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=992)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcFlowDirectionEnumEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcFlowDirectionEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcFlowDirectionEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcFlowDirectionEnumEEnum] operator[=] operator[SEP] identifier[EEnum] 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[992] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcFlowDirectionEnumEEnum] operator[SEP] }
public static xen_sf_storagecentervpx_image delete(nitro_service client, xen_sf_storagecentervpx_image resource) throws Exception { resource.validate("delete"); return ((xen_sf_storagecentervpx_image[]) resource.delete_resource(client))[0]; }
class class_name[name] begin[{] method[delete, return_type[type[xen_sf_storagecentervpx_image]], modifier[public static], parameter[client, resource]] begin[{] call[resource.validate, parameter[literal["delete"]]] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete_resource, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=xen_sf_storagecentervpx_image, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[xen_sf_storagecentervpx_image] identifier[delete] operator[SEP] identifier[nitro_service] identifier[client] , identifier[xen_sf_storagecentervpx_image] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] { identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[xen_sf_storagecentervpx_image] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[delete_resource] operator[SEP] identifier[client] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] }
private static void mapNumericField(final Object mappingClassInstance, final Field mappingField, final JBBPNumericField numericField, final boolean invertBitOrder) { final Class<?> fieldClass = mappingField.getType(); try { if (fieldClass == byte.class) { mappingField.setByte(mappingClassInstance, (byte) (invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt())); } else if (fieldClass == boolean.class) { mappingField.setBoolean(mappingClassInstance, numericField.getAsBool()); } else if (fieldClass == char.class) { mappingField.setChar(mappingClassInstance, (char) (invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt())); } else if (fieldClass == short.class) { mappingField.setShort(mappingClassInstance, (short) (invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt())); } else if (fieldClass == int.class) { mappingField.setInt(mappingClassInstance, (int) (invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt())); } else if (fieldClass == long.class) { mappingField.setLong(mappingClassInstance, (invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsLong())); } else if (fieldClass == float.class) { if (numericField instanceof JBBPFieldInt) { mappingField.setFloat(mappingClassInstance, invertBitOrder ? Float.intBitsToFloat((int) numericField.getAsInvertedBitOrder()) : Float.intBitsToFloat(numericField.getAsInt())); } else { mappingField.setFloat(mappingClassInstance, invertBitOrder ? Float.intBitsToFloat((int) numericField.getAsInvertedBitOrder()) : numericField.getAsFloat()); } } else if (fieldClass == double.class) { if (numericField instanceof JBBPFieldLong) { mappingField.setDouble(mappingClassInstance, invertBitOrder ? Double.longBitsToDouble(numericField.getAsInvertedBitOrder()) : Double.longBitsToDouble(numericField.getAsLong())); } else { mappingField.setDouble(mappingClassInstance, invertBitOrder ? Double.longBitsToDouble(numericField.getAsInvertedBitOrder()) : numericField.getAsDouble()); } } else { throw new JBBPMapperException("Unsupported mapping class field type to be mapped for binary parsed data", (JBBPAbstractField) numericField, mappingClassInstance.getClass(), mappingField, null); } } catch (IllegalAccessException ex) { throw new JBBPMapperException("Can't get access to a mapping field", (JBBPAbstractField) numericField, mappingClassInstance.getClass(), mappingField, ex); } catch (IllegalArgumentException ex) { throw new JBBPMapperException("Can't set argument to a mapping field", (JBBPAbstractField) numericField, mappingClassInstance.getClass(), mappingField, ex); } }
class class_name[name] begin[{] method[mapNumericField, return_type[void], modifier[private static], parameter[mappingClassInstance, mappingField, numericField, invertBitOrder]] begin[{] local_variable[type[Class], fieldClass] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=byte)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=char)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=short)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=long)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=float)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fieldClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=double)), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported mapping class field type to be mapped for binary parsed data"), Cast(expression=MemberReference(member=numericField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JBBPAbstractField, sub_type=None)), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=mappingClassInstance, selectors=[], type_arguments=None), MemberReference(member=mappingField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JBBPMapperException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=numericField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JBBPFieldLong, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getAsDouble, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)], member=longBitsToDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None))], member=setDouble, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAsLong, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)], member=longBitsToDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)], member=longBitsToDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None))], member=setDouble, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=numericField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JBBPFieldInt, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getAsFloat, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))], member=intBitsToFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None))], member=setFloat, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAsInt, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)], member=intBitsToFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))], member=intBitsToFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None))], member=setFloat, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getAsLong, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None))], member=setLong, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getAsInt, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)), type=BasicType(dimensions=[], name=int))], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getAsInt, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)), type=BasicType(dimensions=[], name=short))], member=setShort, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getAsInt, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)), type=BasicType(dimensions=[], name=char))], member=setChar, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getAsBool, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)], member=setBoolean, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mappingClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=TernaryExpression(condition=MemberReference(member=invertBitOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getAsInt, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getAsInvertedBitOrder, postfix_operators=[], prefix_operators=[], qualifier=numericField, selectors=[], type_arguments=None)), type=BasicType(dimensions=[], name=byte))], member=setByte, postfix_operators=[], prefix_operators=[], qualifier=mappingField, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't get access to a mapping field"), Cast(expression=MemberReference(member=numericField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JBBPAbstractField, sub_type=None)), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=mappingClassInstance, selectors=[], type_arguments=None), MemberReference(member=mappingField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JBBPMapperException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalAccessException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't set argument to a mapping field"), Cast(expression=MemberReference(member=numericField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JBBPAbstractField, sub_type=None)), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=mappingClassInstance, selectors=[], type_arguments=None), MemberReference(member=mappingField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JBBPMapperException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[mapNumericField] operator[SEP] Keyword[final] identifier[Object] identifier[mappingClassInstance] , Keyword[final] identifier[Field] identifier[mappingField] , Keyword[final] identifier[JBBPNumericField] identifier[numericField] , Keyword[final] Keyword[boolean] identifier[invertBitOrder] operator[SEP] { Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[fieldClass] operator[=] identifier[mappingField] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[byte] operator[SEP] Keyword[class] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setByte] operator[SEP] identifier[mappingClassInstance] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[invertBitOrder] operator[?] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[:] identifier[numericField] operator[SEP] identifier[getAsInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setBoolean] operator[SEP] identifier[mappingClassInstance] , identifier[numericField] operator[SEP] identifier[getAsBool] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[char] operator[SEP] Keyword[class] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setChar] operator[SEP] identifier[mappingClassInstance] , operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[invertBitOrder] operator[?] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[:] identifier[numericField] operator[SEP] identifier[getAsInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[short] operator[SEP] Keyword[class] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setShort] operator[SEP] identifier[mappingClassInstance] , operator[SEP] Keyword[short] operator[SEP] operator[SEP] identifier[invertBitOrder] operator[?] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[:] identifier[numericField] operator[SEP] identifier[getAsInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[int] operator[SEP] Keyword[class] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setInt] operator[SEP] identifier[mappingClassInstance] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[invertBitOrder] operator[?] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[:] identifier[numericField] operator[SEP] identifier[getAsInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[long] operator[SEP] Keyword[class] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setLong] operator[SEP] identifier[mappingClassInstance] , operator[SEP] identifier[invertBitOrder] operator[?] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[:] identifier[numericField] operator[SEP] identifier[getAsLong] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[float] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[numericField] Keyword[instanceof] identifier[JBBPFieldInt] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setFloat] operator[SEP] identifier[mappingClassInstance] , identifier[invertBitOrder] operator[?] identifier[Float] operator[SEP] identifier[intBitsToFloat] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[Float] operator[SEP] identifier[intBitsToFloat] operator[SEP] identifier[numericField] operator[SEP] identifier[getAsInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[mappingField] operator[SEP] identifier[setFloat] operator[SEP] identifier[mappingClassInstance] , identifier[invertBitOrder] operator[?] identifier[Float] operator[SEP] identifier[intBitsToFloat] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[numericField] operator[SEP] identifier[getAsFloat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[fieldClass] operator[==] Keyword[double] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[numericField] Keyword[instanceof] identifier[JBBPFieldLong] operator[SEP] { identifier[mappingField] operator[SEP] identifier[setDouble] operator[SEP] identifier[mappingClassInstance] , identifier[invertBitOrder] operator[?] identifier[Double] operator[SEP] identifier[longBitsToDouble] operator[SEP] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[Double] operator[SEP] identifier[longBitsToDouble] operator[SEP] identifier[numericField] operator[SEP] identifier[getAsLong] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[mappingField] operator[SEP] identifier[setDouble] operator[SEP] identifier[mappingClassInstance] , identifier[invertBitOrder] operator[?] identifier[Double] operator[SEP] identifier[longBitsToDouble] operator[SEP] identifier[numericField] operator[SEP] identifier[getAsInvertedBitOrder] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[numericField] operator[SEP] identifier[getAsDouble] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[JBBPMapperException] operator[SEP] literal[String] , operator[SEP] identifier[JBBPAbstractField] operator[SEP] identifier[numericField] , identifier[mappingClassInstance] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[mappingField] , Other[null] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[JBBPMapperException] operator[SEP] literal[String] , operator[SEP] identifier[JBBPAbstractField] operator[SEP] identifier[numericField] , identifier[mappingClassInstance] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[mappingField] , identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[JBBPMapperException] operator[SEP] literal[String] , operator[SEP] identifier[JBBPAbstractField] operator[SEP] identifier[numericField] , identifier[mappingClassInstance] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[mappingField] , identifier[ex] operator[SEP] operator[SEP] } }
public final void writtenStartedFlush(AOStream stream, Item startedFlushItem) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "writtenStartedFlush"); String key = SIMPUtils.getRemoteGetKey(stream.getRemoteMEUuid(), stream.getGatheringTargetDestUuid()); StreamInfo sinfo = streamTable.get(key); if ((sinfo != null) && sinfo.streamId.equals(stream.streamId)) { synchronized (sinfo) { sinfo.item = (AOStartedFlushItem) startedFlushItem; } } else { // this should not occur // log error and throw exception SIErrorException e = new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.AnycastOutputHandler", "1:2858:1.89.4.1" }, null)); // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.AnycastOutputHandler.writtenStartedFlush", "1:2865:1.89.4.1", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.AnycastOutputHandler", "1:2872:1.89.4.1" }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "writtenStartedFlush", e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "writtenStartedFlush"); }
class class_name[name] begin[{] method[writtenStartedFlush, return_type[void], modifier[final public], parameter[stream, startedFlushItem]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["writtenStartedFlush"]]] else begin[{] None end[}] local_variable[type[String], key] local_variable[type[StreamInfo], sinfo] if[binary_operation[binary_operation[member[.sinfo], !=, literal[null]], &&, call[sinfo.streamId.equals, parameter[member[stream.streamId]]]]] begin[{] SYNCHRONIZED[member[.sinfo]] BEGIN[{] assign[member[sinfo.item], Cast(expression=MemberReference(member=startedFlushItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AOStartedFlushItem, sub_type=None))] END[}] else begin[{] local_variable[type[SIErrorException], e] call[FFDCFilter.processException, parameter[member[.e], literal["com.ibm.ws.sib.processor.impl.AnycastOutputHandler.writtenStartedFlush"], literal["1:2865:1.89.4.1"], THIS[]]] call[SibTr.exception, parameter[member[.tc], member[.e]]] call[SibTr.error, parameter[member[.tc], literal["INTERNAL_MESSAGING_ERROR_CWSIP0001"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.AnycastOutputHandler"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:2872:1.89.4.1")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["writtenStartedFlush"], member[.e]]] else begin[{] None end[}] ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["writtenStartedFlush"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[writtenStartedFlush] operator[SEP] identifier[AOStream] identifier[stream] , identifier[Item] identifier[startedFlushItem] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[key] operator[=] identifier[SIMPUtils] operator[SEP] identifier[getRemoteGetKey] operator[SEP] identifier[stream] operator[SEP] identifier[getRemoteMEUuid] operator[SEP] operator[SEP] , identifier[stream] operator[SEP] identifier[getGatheringTargetDestUuid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StreamInfo] identifier[sinfo] operator[=] identifier[streamTable] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[sinfo] operator[!=] Other[null] operator[SEP] operator[&&] identifier[sinfo] operator[SEP] identifier[streamId] operator[SEP] identifier[equals] operator[SEP] identifier[stream] operator[SEP] identifier[streamId] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[sinfo] operator[SEP] { identifier[sinfo] operator[SEP] identifier[item] operator[=] operator[SEP] identifier[AOStartedFlushItem] operator[SEP] identifier[startedFlushItem] operator[SEP] } } Keyword[else] { identifier[SIErrorException] identifier[e] operator[=] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] } , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private synchronized void submitToExecutor(final Runnable command) { if ( state.get() == State.STARTED ) { executorService.submit(command); } }
class class_name[name] begin[{] method[submitToExecutor, return_type[void], modifier[synchronized private], parameter[command]] begin[{] if[binary_operation[call[state.get, parameter[]], ==, member[State.STARTED]]] begin[{] call[executorService.submit, parameter[member[.command]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[synchronized] Keyword[void] identifier[submitToExecutor] operator[SEP] Keyword[final] identifier[Runnable] identifier[command] operator[SEP] { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] identifier[State] operator[SEP] identifier[STARTED] operator[SEP] { identifier[executorService] operator[SEP] identifier[submit] operator[SEP] identifier[command] operator[SEP] operator[SEP] } }
@SuppressWarnings("squid:S3346") private int filterLoads(int d, int delta, boolean isSup) throws ContradictionException { assert maxSlackBinHeap != null; int nChanges = 0; if (loadSlack(d, maxSlackBinHeap.get(d).peek()) > delta) { do { int b = maxSlackBinHeap.get(d).poll(); if (isSup) { p.filterLoadSup(d, b, delta + p.loads[d][b].getLB()); } else { p.filterLoadInf(d, b, p.loads[d][b].getUB() - delta); } assert loadSlack(d, b) == delta; maxSlackBinHeap.get(d).offer(b); nChanges++; } while (!maxSlackBinHeap.get(d).isEmpty() && loadSlack(d, maxSlackBinHeap.get(d).peek()) > delta); } return nChanges; }
class class_name[name] begin[{] method[filterLoads, return_type[type[int]], modifier[private], parameter[d, delta, isSup]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=maxSlackBinHeap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) local_variable[type[int], nChanges] if[binary_operation[call[.loadSlack, parameter[member[.d], call[maxSlackBinHeap.get, parameter[member[.d]]]]], >, member[.delta]]] begin[{] do[binary_operation[call[maxSlackBinHeap.get, parameter[member[.d]]], &&, binary_operation[call[.loadSlack, parameter[member[.d], call[maxSlackBinHeap.get, parameter[member[.d]]]]], >, member[.delta]]]] begin[{] local_variable[type[int], b] if[member[.isSup]] begin[{] call[p.filterLoadSup, parameter[member[.d], member[.b], binary_operation[member[.delta], +, member[p.loads]]]] else begin[{] call[p.filterLoadInf, parameter[member[.d], member[.b], binary_operation[member[p.loads], -, member[.delta]]]] end[}] AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadSlack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None, value=None) call[maxSlackBinHeap.get, parameter[member[.d]]] member[.nChanges] end[}] else begin[{] None end[}] return[member[.nChanges]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[int] identifier[filterLoads] operator[SEP] Keyword[int] identifier[d] , Keyword[int] identifier[delta] , Keyword[boolean] identifier[isSup] operator[SEP] Keyword[throws] identifier[ContradictionException] { Keyword[assert] identifier[maxSlackBinHeap] operator[!=] Other[null] operator[SEP] Keyword[int] identifier[nChanges] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[loadSlack] operator[SEP] identifier[d] , identifier[maxSlackBinHeap] operator[SEP] identifier[get] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] operator[>] identifier[delta] operator[SEP] { Keyword[do] { Keyword[int] identifier[b] operator[=] identifier[maxSlackBinHeap] operator[SEP] identifier[get] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isSup] operator[SEP] { identifier[p] operator[SEP] identifier[filterLoadSup] operator[SEP] identifier[d] , identifier[b] , identifier[delta] operator[+] identifier[p] operator[SEP] identifier[loads] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[getLB] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[p] operator[SEP] identifier[filterLoadInf] operator[SEP] identifier[d] , identifier[b] , identifier[p] operator[SEP] identifier[loads] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[getUB] operator[SEP] operator[SEP] operator[-] identifier[delta] operator[SEP] operator[SEP] } Keyword[assert] identifier[loadSlack] operator[SEP] identifier[d] , identifier[b] operator[SEP] operator[==] identifier[delta] operator[SEP] identifier[maxSlackBinHeap] operator[SEP] identifier[get] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[offer] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[nChanges] operator[++] operator[SEP] } Keyword[while] operator[SEP] operator[!] identifier[maxSlackBinHeap] operator[SEP] identifier[get] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[loadSlack] operator[SEP] identifier[d] , identifier[maxSlackBinHeap] operator[SEP] identifier[get] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] operator[>] identifier[delta] operator[SEP] operator[SEP] } Keyword[return] identifier[nChanges] operator[SEP] }
private void hideUndoView(@NonNull final View view) { mCallback.getPrimaryView(view).setVisibility(View.VISIBLE); mCallback.getUndoView(view).setVisibility(View.GONE); }
class class_name[name] begin[{] method[hideUndoView, return_type[void], modifier[private], parameter[view]] begin[{] call[mCallback.getPrimaryView, parameter[member[.view]]] call[mCallback.getUndoView, parameter[member[.view]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[hideUndoView] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[View] identifier[view] operator[SEP] { identifier[mCallback] operator[SEP] identifier[getPrimaryView] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[setVisibility] operator[SEP] identifier[View] operator[SEP] identifier[VISIBLE] operator[SEP] operator[SEP] identifier[mCallback] operator[SEP] identifier[getUndoView] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[setVisibility] operator[SEP] identifier[View] operator[SEP] identifier[GONE] operator[SEP] operator[SEP] }
@Override public void normalise(ProjectCalendar calendar, LinkedList<TimephasedCost> list) { if (!list.isEmpty()) { //dumpList(list); splitDays(calendar, list); //dumpList(list); mergeSameDay(list); //dumpList(list); mergeSameCost(list); //dumpList(list); } }
class class_name[name] begin[{] method[normalise, return_type[void], modifier[public], parameter[calendar, list]] begin[{] if[call[list.isEmpty, parameter[]]] begin[{] call[.splitDays, parameter[member[.calendar], member[.list]]] call[.mergeSameDay, parameter[member[.list]]] call[.mergeSameCost, parameter[member[.list]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[normalise] operator[SEP] identifier[ProjectCalendar] identifier[calendar] , identifier[LinkedList] operator[<] identifier[TimephasedCost] operator[>] identifier[list] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[splitDays] operator[SEP] identifier[calendar] , identifier[list] operator[SEP] operator[SEP] identifier[mergeSameDay] operator[SEP] identifier[list] operator[SEP] operator[SEP] identifier[mergeSameCost] operator[SEP] identifier[list] operator[SEP] operator[SEP] } }
public void generate() throws IOException, TemplateException { File configFile = new File(baseDir, "config.yaml"); AggregatorModel aggregator = mapper.readValue(configFile, AggregatorModel.class); File project = new File(baseDir, "project"); mkdir(project); // Generate the individual client modules. Template pom = freemarker.getPomTemplate(); for (ModuleModel module : aggregator.getModules()) { File dir = new File(project, "aws-scala-sdk-" + module.getName()); mkdir(dir); Writer writer = new FileWriter(new File(dir, "pom.xml")); try { pom.process(module, writer); } finally { writer.close(); } } // Generate the aggregator module. Template agg = freemarker.getAggregatorTemplate(); Writer writer = new FileWriter(new File(project, "pom.xml")); try { agg.process(aggregator, writer); } finally { writer.close(); } }
class class_name[name] begin[{] method[generate, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[File], configFile] local_variable[type[AggregatorModel], aggregator] local_variable[type[File], project] call[.mkdir, parameter[member[.project]]] local_variable[type[Template], pom] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=project, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="aws-scala-sdk-"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=module, 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=File, sub_type=None)), name=dir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mkdir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pom.xml")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileWriter, sub_type=None)), name=writer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Writer, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=pom, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getModules, postfix_operators=[], prefix_operators=[], qualifier=aggregator, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=module)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModuleModel, sub_type=None))), label=None) local_variable[type[Template], agg] local_variable[type[Writer], writer] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aggregator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=agg, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[generate] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[TemplateException] { identifier[File] identifier[configFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[baseDir] , literal[String] operator[SEP] operator[SEP] identifier[AggregatorModel] identifier[aggregator] operator[=] identifier[mapper] operator[SEP] identifier[readValue] operator[SEP] identifier[configFile] , identifier[AggregatorModel] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[File] identifier[project] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[baseDir] , literal[String] operator[SEP] operator[SEP] identifier[mkdir] operator[SEP] identifier[project] operator[SEP] operator[SEP] identifier[Template] identifier[pom] operator[=] identifier[freemarker] operator[SEP] identifier[getPomTemplate] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ModuleModel] identifier[module] operator[:] identifier[aggregator] operator[SEP] identifier[getModules] operator[SEP] operator[SEP] operator[SEP] { identifier[File] identifier[dir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[project] , literal[String] operator[+] identifier[module] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mkdir] operator[SEP] identifier[dir] operator[SEP] operator[SEP] identifier[Writer] identifier[writer] operator[=] Keyword[new] identifier[FileWriter] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[dir] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[pom] operator[SEP] identifier[process] operator[SEP] identifier[module] , identifier[writer] operator[SEP] operator[SEP] } Keyword[finally] { identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } identifier[Template] identifier[agg] operator[=] identifier[freemarker] operator[SEP] identifier[getAggregatorTemplate] operator[SEP] operator[SEP] operator[SEP] identifier[Writer] identifier[writer] operator[=] Keyword[new] identifier[FileWriter] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[project] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[agg] operator[SEP] identifier[process] operator[SEP] identifier[aggregator] , identifier[writer] operator[SEP] operator[SEP] } Keyword[finally] { identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public void createBoxTree(BoxTreeCreationStatus stat) { boolean generated = false; do { if (stat.parent.isDisplayed()) { //add previously created boxes (the rest from the last twin) if (stat.parent.preadd != null) { addToTree(stat.parent.preadd, stat); stat.parent.preadd = null; //don't need to keep this anymore } //create :before elements if (stat.parent.previousTwin == null) { Node n = createPseudoElement(stat.parent, PseudoElementType.BEFORE); if (n != null && (n.getNodeType() == Node.ELEMENT_NODE || n.getNodeType() == Node.TEXT_NODE)) { stat.curchild = -1; createSubtree(n, stat); } } //create normal elements NodeList children = stat.parent.getElement().getChildNodes(); for (int child = stat.parent.firstDOMChild; child < stat.parent.lastDOMChild; child++) { Node n = children.item(child); if (n.getNodeType() == Node.ELEMENT_NODE || n.getNodeType() == Node.TEXT_NODE) { stat.curchild = child; createSubtree(n, stat); } } //create :after elements if (stat.parent.nextTwin == null) { Node n = createPseudoElement(stat.parent, PseudoElementType.AFTER); if (n != null && (n.getNodeType() == Node.ELEMENT_NODE || n.getNodeType() == Node.TEXT_NODE)) { stat.curchild = children.getLength(); createSubtree(n, stat); } } normalizeBox(stat.parent); } //if a twin box has been created, continue creating the unprocessed boxes in the twin box if (stat.parent.nextTwin != null) { stat.parent = stat.parent.nextTwin; generated = true; } else generated = false; } while (generated); }
class class_name[name] begin[{] method[createBoxTree, return_type[void], modifier[public], parameter[stat]] begin[{] local_variable[type[boolean], generated] do[member[.generated]] begin[{] if[call[stat.parent.isDisplayed, parameter[]]] begin[{] if[binary_operation[member[stat.parent.preadd], !=, literal[null]]] begin[{] call[.addToTree, parameter[member[stat.parent.preadd], member[.stat]]] assign[member[stat.parent.preadd], literal[null]] else begin[{] None end[}] if[binary_operation[member[stat.parent.previousTwin], ==, literal[null]]] begin[{] local_variable[type[Node], n] if[binary_operation[binary_operation[member[.n], !=, literal[null]], &&, binary_operation[binary_operation[call[n.getNodeType, parameter[]], ==, member[Node.ELEMENT_NODE]], ||, binary_operation[call[n.getNodeType, parameter[]], ==, member[Node.TEXT_NODE]]]]] begin[{] assign[member[stat.curchild], literal[1]] call[.createSubtree, parameter[member[.n], member[.stat]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[NodeList], children] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), operandr=MemberReference(member=ELEMENT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), operandr=MemberReference(member=TEXT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=curchild, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[]), type==, value=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createSubtree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lastDOMChild, postfix_operators=[], prefix_operators=[], qualifier=stat.parent, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=firstDOMChild, postfix_operators=[], prefix_operators=[], qualifier=stat.parent, selectors=[]), name=child)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=child, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[stat.parent.nextTwin], ==, literal[null]]] begin[{] local_variable[type[Node], n] if[binary_operation[binary_operation[member[.n], !=, literal[null]], &&, binary_operation[binary_operation[call[n.getNodeType, parameter[]], ==, member[Node.ELEMENT_NODE]], ||, binary_operation[call[n.getNodeType, parameter[]], ==, member[Node.TEXT_NODE]]]]] begin[{] assign[member[stat.curchild], call[children.getLength, parameter[]]] call[.createSubtree, parameter[member[.n], member[.stat]]] else begin[{] None end[}] else begin[{] None end[}] call[.normalizeBox, parameter[member[stat.parent]]] else begin[{] None end[}] if[binary_operation[member[stat.parent.nextTwin], !=, literal[null]]] begin[{] assign[member[stat.parent], member[stat.parent.nextTwin]] assign[member[.generated], literal[true]] else begin[{] assign[member[.generated], literal[false]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[createBoxTree] operator[SEP] identifier[BoxTreeCreationStatus] identifier[stat] operator[SEP] { Keyword[boolean] identifier[generated] operator[=] literal[boolean] operator[SEP] Keyword[do] { Keyword[if] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[isDisplayed] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[preadd] operator[!=] Other[null] operator[SEP] { identifier[addToTree] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[preadd] , identifier[stat] operator[SEP] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[preadd] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[previousTwin] operator[==] Other[null] operator[SEP] { identifier[Node] identifier[n] operator[=] identifier[createPseudoElement] operator[SEP] identifier[stat] operator[SEP] identifier[parent] , identifier[PseudoElementType] operator[SEP] identifier[BEFORE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[!=] Other[null] operator[&&] operator[SEP] identifier[n] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[ELEMENT_NODE] operator[||] identifier[n] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[TEXT_NODE] operator[SEP] operator[SEP] { identifier[stat] operator[SEP] identifier[curchild] operator[=] operator[-] Other[1] operator[SEP] identifier[createSubtree] operator[SEP] identifier[n] , identifier[stat] operator[SEP] operator[SEP] } } identifier[NodeList] identifier[children] operator[=] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[child] operator[=] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[firstDOMChild] operator[SEP] identifier[child] operator[<] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[lastDOMChild] operator[SEP] identifier[child] operator[++] operator[SEP] { identifier[Node] identifier[n] operator[=] identifier[children] operator[SEP] identifier[item] operator[SEP] identifier[child] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[ELEMENT_NODE] operator[||] identifier[n] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[TEXT_NODE] operator[SEP] { identifier[stat] operator[SEP] identifier[curchild] operator[=] identifier[child] operator[SEP] identifier[createSubtree] operator[SEP] identifier[n] , identifier[stat] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[nextTwin] operator[==] Other[null] operator[SEP] { identifier[Node] identifier[n] operator[=] identifier[createPseudoElement] operator[SEP] identifier[stat] operator[SEP] identifier[parent] , identifier[PseudoElementType] operator[SEP] identifier[AFTER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[!=] Other[null] operator[&&] operator[SEP] identifier[n] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[ELEMENT_NODE] operator[||] identifier[n] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[TEXT_NODE] operator[SEP] operator[SEP] { identifier[stat] operator[SEP] identifier[curchild] operator[=] identifier[children] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[createSubtree] operator[SEP] identifier[n] , identifier[stat] operator[SEP] operator[SEP] } } identifier[normalizeBox] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[nextTwin] operator[!=] Other[null] operator[SEP] { identifier[stat] operator[SEP] identifier[parent] operator[=] identifier[stat] operator[SEP] identifier[parent] operator[SEP] identifier[nextTwin] operator[SEP] identifier[generated] operator[=] literal[boolean] operator[SEP] } Keyword[else] identifier[generated] operator[=] literal[boolean] operator[SEP] } Keyword[while] operator[SEP] identifier[generated] operator[SEP] operator[SEP] }
public java.util.List<SupportedPlatform> getSupportedPlatforms() { if (supportedPlatforms == null) { supportedPlatforms = new com.amazonaws.internal.SdkInternalList<SupportedPlatform>(); } return supportedPlatforms; }
class class_name[name] begin[{] method[getSupportedPlatforms, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.supportedPlatforms], ==, literal[null]]] begin[{] assign[member[.supportedPlatforms], ClassCreator(arguments=[], 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=SupportedPlatform, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.supportedPlatforms]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[SupportedPlatform] operator[>] identifier[getSupportedPlatforms] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[supportedPlatforms] operator[==] Other[null] operator[SEP] { identifier[supportedPlatforms] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[SupportedPlatform] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[supportedPlatforms] operator[SEP] }
public static final byte[] fromHex(String hexDump) { List<Integer> list = new ArrayList<>(); String[] lines = hexDump.split("\n"); if (lines.length < 2) { throw new IllegalArgumentException("not a hex dump"); } if (!lines[0].contains(Title)) { throw new IllegalArgumentException("not a hex dump"); } for (int ll=1;ll<lines.length;ll++) { String line = lines[ll]; int i1 = line.indexOf(':'); if (i1 == -1) { throw new IllegalArgumentException("not a hex dump"); } int i2 = line.indexOf(" ", i1+2); if (i2 == -1) { throw new IllegalArgumentException("not a hex dump"); } String[] fields = line.substring(i1+2, i2).split(" "); for (int ii=0;ii<fields.length;ii++) { list.add(Integer.parseInt(fields[ii], 16)); } } byte[] bytes = new byte[list.size()]; for (int ii=0;ii<bytes.length;ii++) { bytes[ii] = list.get(ii).byteValue(); } return bytes; }
class class_name[name] begin[{] method[fromHex, return_type[type[byte]], modifier[final public static], parameter[hexDump]] begin[{] local_variable[type[List], list] local_variable[type[String], lines] if[binary_operation[member[lines.length], <, literal[2]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not a hex dump")], 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[.lines]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not a hex dump")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=lines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=line)], 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=indexOf, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=i1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not a hex dump")], 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)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), BinaryOperation(operandl=MemberReference(member=i1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=i2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not a hex dump")], 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)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), MemberReference(member=i2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=fields)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=lines, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=ll)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ll, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[byte], bytes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[MethodInvocation(arguments=[], member=byteValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.bytes]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[fromHex] operator[SEP] identifier[String] identifier[hexDump] operator[SEP] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[lines] operator[=] identifier[hexDump] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lines] operator[SEP] identifier[length] operator[<] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[lines] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[Title] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[ll] operator[=] Other[1] operator[SEP] identifier[ll] operator[<] identifier[lines] operator[SEP] identifier[length] operator[SEP] identifier[ll] operator[++] operator[SEP] { identifier[String] identifier[line] operator[=] identifier[lines] operator[SEP] identifier[ll] operator[SEP] operator[SEP] Keyword[int] identifier[i1] operator[=] identifier[line] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i1] operator[==] operator[-] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[i2] operator[=] identifier[line] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[i1] operator[+] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i2] operator[==] operator[-] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[fields] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] identifier[i1] operator[+] Other[2] , identifier[i2] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] operator[SEP] identifier[ii] operator[<] identifier[fields] operator[SEP] identifier[length] operator[SEP] identifier[ii] operator[++] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[fields] operator[SEP] identifier[ii] operator[SEP] , Other[16] operator[SEP] operator[SEP] operator[SEP] } } Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] operator[SEP] identifier[ii] operator[<] identifier[bytes] operator[SEP] identifier[length] operator[SEP] identifier[ii] operator[++] operator[SEP] { identifier[bytes] operator[SEP] identifier[ii] operator[SEP] operator[=] identifier[list] operator[SEP] identifier[get] operator[SEP] identifier[ii] operator[SEP] operator[SEP] identifier[byteValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[bytes] operator[SEP] }
Map<String, Object> consume() { Container values = stack.getLast(); stack.clear(); return ((Container.Table) values).consume(); }
class class_name[name] begin[{] method[consume, return_type[type[Map]], modifier[default], parameter[]] begin[{] local_variable[type[Container], values] call[stack.clear, parameter[]] return[Cast(expression=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Container, sub_type=ReferenceType(arguments=None, dimensions=None, name=Table, sub_type=None)))] end[}] END[}]
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[consume] operator[SEP] operator[SEP] { identifier[Container] identifier[values] operator[=] identifier[stack] operator[SEP] identifier[getLast] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Container] operator[SEP] identifier[Table] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP] }
private String[] readXMLDeclaration(Reader r) throws KNXMLException { final StringBuffer buf = new StringBuffer(100); try { for (int c = 0; (c = r.read()) != -1 && c != '?';) buf.append((char) c); } catch (final IOException e) { throw new KNXMLException("reading XML declaration, " + e.getMessage(), buf .toString(), 0); } String s = buf.toString().trim(); String version = null; String encoding = null; String standalone = null; for (int state = 0; state < 3; ++state) if (state == 0 && s.startsWith("version")) { version = getAttValue(s = s.substring(7)); s = s.substring(s.indexOf(version) + version.length() + 1).trim(); } else if (state == 1 && s.startsWith("encoding")) { encoding = getAttValue(s = s.substring(8)); s = s.substring(s.indexOf(encoding) + encoding.length() + 1).trim(); } else if (state == 1 || state == 2) { if (s.startsWith("standalone")) { standalone = getAttValue(s); if (!standalone.equals("yes") && !standalone.equals("no")) throw new KNXMLException("invalid standalone pseudo-attribute", standalone, 0); break; } } else throw new KNXMLException("unknown XML declaration pseudo-attribute", s, 0); return new String[] { version, encoding, standalone }; }
class class_name[name] begin[{] method[readXMLDeclaration, return_type[type[String]], modifier[private], parameter[r]] begin[{] local_variable[type[StringBuffer], buf] TryStatement(block=[ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='?'), operator=!=), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="reading XML declaration, "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KNXMLException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) local_variable[type[String], s] local_variable[type[String], version] local_variable[type[String], encoding] local_variable[type[String], standalone] ForStatement(body=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="version")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="encoding")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), operator=||), else_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown XML declaration pseudo-attribute"), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KNXMLException, sub_type=None)), label=None), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="standalone")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=standalone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yes")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=standalone, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=standalone, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid standalone pseudo-attribute"), MemberReference(member=standalone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KNXMLException, sub_type=None)), label=None)), BreakStatement(goto=None, label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None))], member=getAttValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=encoding, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None))], member=getAttValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=version, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=state)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=state, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=standalone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
Keyword[private] identifier[String] operator[SEP] operator[SEP] identifier[readXMLDeclaration] operator[SEP] identifier[Reader] identifier[r] operator[SEP] Keyword[throws] identifier[KNXMLException] { Keyword[final] identifier[StringBuffer] identifier[buf] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[100] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[r] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[&&] identifier[c] operator[!=] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[KNXMLException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[0] operator[SEP] operator[SEP] } identifier[String] identifier[s] operator[=] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[version] operator[=] Other[null] operator[SEP] identifier[String] identifier[encoding] operator[=] Other[null] operator[SEP] identifier[String] identifier[standalone] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[state] operator[=] Other[0] operator[SEP] identifier[state] operator[<] Other[3] operator[SEP] operator[++] identifier[state] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[==] Other[0] operator[&&] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[version] operator[=] identifier[getAttValue] operator[SEP] identifier[s] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[7] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] identifier[version] operator[SEP] operator[+] identifier[version] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[state] operator[==] Other[1] operator[&&] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[encoding] operator[=] identifier[getAttValue] operator[SEP] identifier[s] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[8] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] identifier[encoding] operator[SEP] operator[+] identifier[encoding] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[state] operator[==] Other[1] operator[||] identifier[state] operator[==] Other[2] operator[SEP] { Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[standalone] operator[=] identifier[getAttValue] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[standalone] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[standalone] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[KNXMLException] operator[SEP] literal[String] , identifier[standalone] , Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] Keyword[throw] Keyword[new] identifier[KNXMLException] operator[SEP] literal[String] , identifier[s] , Other[0] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[version] , identifier[encoding] , identifier[standalone] } operator[SEP] }
public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); }
class class_name[name] begin[{] method[backendHealth, return_type[type[ApplicationGatewayBackendHealthInner]], modifier[public], parameter[resourceGroupName, applicationGatewayName]] begin[{] return[call[.backendHealthWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.applicationGatewayName]]]] end[}] END[}]
Keyword[public] identifier[ApplicationGatewayBackendHealthInner] identifier[backendHealth] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[applicationGatewayName] operator[SEP] { Keyword[return] identifier[backendHealthWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[applicationGatewayName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
private void parseAndExpr() throws TTXPathException { parseComparisionExpr(); while (is("and", true)) { mPipeBuilder.addExpressionSingle(); parseComparisionExpr(); mPipeBuilder.addAndExpression(getTransaction()); } }
class class_name[name] begin[{] method[parseAndExpr, return_type[void], modifier[private], parameter[]] begin[{] call[.parseComparisionExpr, parameter[]] while[call[.is, parameter[literal["and"], literal[true]]]] begin[{] call[mPipeBuilder.addExpressionSingle, parameter[]] call[.parseComparisionExpr, parameter[]] call[mPipeBuilder.addAndExpression, parameter[call[.getTransaction, parameter[]]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseAndExpr] operator[SEP] operator[SEP] Keyword[throws] identifier[TTXPathException] { identifier[parseComparisionExpr] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[is] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] { identifier[mPipeBuilder] operator[SEP] identifier[addExpressionSingle] operator[SEP] operator[SEP] operator[SEP] identifier[parseComparisionExpr] operator[SEP] operator[SEP] operator[SEP] identifier[mPipeBuilder] operator[SEP] identifier[addAndExpression] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public Expression expression(Member author, String content, Expression inReplyTo) { Expression expression = new Expression(instance); expression.setAuthor(author); expression.setContent(content); expression.setInReplyTo(inReplyTo); expression.save(); return expression; }
class class_name[name] begin[{] method[expression, return_type[type[Expression]], modifier[public], parameter[author, content, inReplyTo]] begin[{] local_variable[type[Expression], expression] call[expression.setAuthor, parameter[member[.author]]] call[expression.setContent, parameter[member[.content]]] call[expression.setInReplyTo, parameter[member[.inReplyTo]]] call[expression.save, parameter[]] return[member[.expression]] end[}] END[}]
Keyword[public] identifier[Expression] identifier[expression] operator[SEP] identifier[Member] identifier[author] , identifier[String] identifier[content] , identifier[Expression] identifier[inReplyTo] operator[SEP] { identifier[Expression] identifier[expression] operator[=] Keyword[new] identifier[Expression] operator[SEP] identifier[instance] operator[SEP] operator[SEP] identifier[expression] operator[SEP] identifier[setAuthor] operator[SEP] identifier[author] operator[SEP] operator[SEP] identifier[expression] operator[SEP] identifier[setContent] operator[SEP] identifier[content] operator[SEP] operator[SEP] identifier[expression] operator[SEP] identifier[setInReplyTo] operator[SEP] identifier[inReplyTo] operator[SEP] operator[SEP] identifier[expression] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[expression] operator[SEP] }
public void add(DOCUMENT doc) { if (doc != null) { documents.add(doc); int id = documents.size() - 1; for (KEY key : documentMapper.apply(doc)) { index.put(key, id); } } }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[doc]] begin[{] if[binary_operation[member[.doc], !=, literal[null]]] begin[{] call[documents.add, parameter[member[.doc]]] local_variable[type[int], id] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=documentMapper, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KEY, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[DOCUMENT] identifier[doc] operator[SEP] { Keyword[if] operator[SEP] identifier[doc] operator[!=] Other[null] operator[SEP] { identifier[documents] operator[SEP] identifier[add] operator[SEP] identifier[doc] operator[SEP] operator[SEP] Keyword[int] identifier[id] operator[=] identifier[documents] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] identifier[KEY] identifier[key] operator[:] identifier[documentMapper] operator[SEP] identifier[apply] operator[SEP] identifier[doc] operator[SEP] operator[SEP] { identifier[index] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[id] operator[SEP] operator[SEP] } } }
@Override public int mbcCaseFold(int flag, byte[]bytes, IntHolder pp, int end, byte[]lower) { int p = pp.value; int lowerP = 0; if (bytes[p] == (byte)0xdf && (flag & Config.INTERNAL_ENC_CASE_FOLD_MULTI_CHAR) != 0) { lower[lowerP++] = 's'; lower[lowerP] = 's'; pp.value++; return 2; } lower[lowerP] = LowerCaseTable[bytes[p] & 0xff]; pp.value++; return 1; }
class class_name[name] begin[{] method[mbcCaseFold, return_type[type[int]], modifier[public], parameter[flag, bytes, pp, end, lower]] begin[{] local_variable[type[int], p] local_variable[type[int], lowerP] if[binary_operation[binary_operation[member[.bytes], ==, Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xdf), type=BasicType(dimensions=[], name=byte))], &&, binary_operation[binary_operation[member[.flag], &, member[Config.INTERNAL_ENC_CASE_FOLD_MULTI_CHAR]], !=, literal[0]]]] begin[{] assign[member[.lower], literal['s']] assign[member[.lower], literal['s']] member[pp.value] return[literal[2]] else begin[{] None end[}] assign[member[.lower], member[.LowerCaseTable]] member[pp.value] return[literal[1]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[mbcCaseFold] operator[SEP] Keyword[int] identifier[flag] , Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , identifier[IntHolder] identifier[pp] , Keyword[int] identifier[end] , Keyword[byte] operator[SEP] operator[SEP] identifier[lower] operator[SEP] { Keyword[int] identifier[p] operator[=] identifier[pp] operator[SEP] identifier[value] operator[SEP] Keyword[int] identifier[lowerP] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[bytes] operator[SEP] identifier[p] operator[SEP] operator[==] operator[SEP] Keyword[byte] operator[SEP] literal[Integer] operator[&&] operator[SEP] identifier[flag] operator[&] identifier[Config] operator[SEP] identifier[INTERNAL_ENC_CASE_FOLD_MULTI_CHAR] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[lower] operator[SEP] identifier[lowerP] operator[++] operator[SEP] operator[=] literal[String] operator[SEP] identifier[lower] operator[SEP] identifier[lowerP] operator[SEP] operator[=] literal[String] operator[SEP] identifier[pp] operator[SEP] identifier[value] operator[++] operator[SEP] Keyword[return] Other[2] operator[SEP] } identifier[lower] operator[SEP] identifier[lowerP] operator[SEP] operator[=] identifier[LowerCaseTable] operator[SEP] identifier[bytes] operator[SEP] identifier[p] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[pp] operator[SEP] identifier[value] operator[++] operator[SEP] Keyword[return] Other[1] operator[SEP] }
public Filter addFilter(FilterType type, String name) { long cPtr = VideoJNI.FilterGraph_addFilter(swigCPtr, this, FilterType.getCPtr(type), type, name); return (cPtr == 0) ? null : new Filter(cPtr, false); }
class class_name[name] begin[{] method[addFilter, return_type[type[Filter]], modifier[public], parameter[type, name]] begin[{] local_variable[type[long], cPtr] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=ClassCreator(arguments=[MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Filter, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Filter] identifier[addFilter] operator[SEP] identifier[FilterType] identifier[type] , identifier[String] identifier[name] operator[SEP] { Keyword[long] identifier[cPtr] operator[=] identifier[VideoJNI] operator[SEP] identifier[FilterGraph_addFilter] operator[SEP] identifier[swigCPtr] , Keyword[this] , identifier[FilterType] operator[SEP] identifier[getCPtr] operator[SEP] identifier[type] operator[SEP] , identifier[type] , identifier[name] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[cPtr] operator[==] Other[0] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[Filter] operator[SEP] identifier[cPtr] , literal[boolean] operator[SEP] operator[SEP] }
public void initDriver(File shpFile, ShapeType shapeType, DbaseFileHeader dbaseHeader) throws IOException { String path = shpFile.getAbsolutePath(); String nameWithoutExt = path.substring(0,path.lastIndexOf('.')); this.shpFile = new File(nameWithoutExt+".shp"); this.shxFile = new File(nameWithoutExt+".shx"); this.dbfFile = new File(nameWithoutExt+".dbf"); FileOutputStream shpFos = new FileOutputStream(shpFile); FileOutputStream shxFos = new FileOutputStream(shxFile); shapefileWriter = new ShapefileWriter(shpFos.getChannel(), shxFos.getChannel()); this.shapeType = shapeType; shapefileWriter.writeHeaders(shapeType); dbfDriver.initDriver(dbfFile, dbaseHeader); }
class class_name[name] begin[{] method[initDriver, return_type[void], modifier[public], parameter[shpFile, shapeType, dbaseHeader]] begin[{] local_variable[type[String], path] local_variable[type[String], nameWithoutExt] assign[THIS[member[None.shpFile]], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=nameWithoutExt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".shp"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] assign[THIS[member[None.shxFile]], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=nameWithoutExt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".shx"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] assign[THIS[member[None.dbfFile]], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=nameWithoutExt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".dbf"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] local_variable[type[FileOutputStream], shpFos] local_variable[type[FileOutputStream], shxFos] assign[member[.shapefileWriter], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=shpFos, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=shxFos, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShapefileWriter, sub_type=None))] assign[THIS[member[None.shapeType]], member[.shapeType]] call[shapefileWriter.writeHeaders, parameter[member[.shapeType]]] call[dbfDriver.initDriver, parameter[member[.dbfFile], member[.dbaseHeader]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[initDriver] operator[SEP] identifier[File] identifier[shpFile] , identifier[ShapeType] identifier[shapeType] , identifier[DbaseFileHeader] identifier[dbaseHeader] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[path] operator[=] identifier[shpFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[nameWithoutExt] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[path] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[shpFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[nameWithoutExt] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[shxFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[nameWithoutExt] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[dbfFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[nameWithoutExt] operator[+] literal[String] operator[SEP] operator[SEP] identifier[FileOutputStream] identifier[shpFos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[shpFile] operator[SEP] operator[SEP] identifier[FileOutputStream] identifier[shxFos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[shxFile] operator[SEP] operator[SEP] identifier[shapefileWriter] operator[=] Keyword[new] identifier[ShapefileWriter] operator[SEP] identifier[shpFos] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] , identifier[shxFos] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[shapeType] operator[=] identifier[shapeType] operator[SEP] identifier[shapefileWriter] operator[SEP] identifier[writeHeaders] operator[SEP] identifier[shapeType] operator[SEP] operator[SEP] identifier[dbfDriver] operator[SEP] identifier[initDriver] operator[SEP] identifier[dbfFile] , identifier[dbaseHeader] operator[SEP] operator[SEP] }
private String createStartPhysicalQuery(PhysicalReplicationOptions options) { StringBuilder builder = new StringBuilder(); builder.append("START_REPLICATION"); if (options.getSlotName() != null) { builder.append(" SLOT ").append(options.getSlotName()); } builder.append(" PHYSICAL ").append(options.getStartLSNPosition().asString()); return builder.toString(); }
class class_name[name] begin[{] method[createStartPhysicalQuery, return_type[type[String]], modifier[private], parameter[options]] begin[{] local_variable[type[StringBuilder], builder] call[builder.append, parameter[literal["START_REPLICATION"]]] if[binary_operation[call[options.getSlotName, parameter[]], !=, literal[null]]] begin[{] call[builder.append, parameter[literal[" SLOT "]]] else begin[{] None end[}] call[builder.append, parameter[literal[" PHYSICAL "]]] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[createStartPhysicalQuery] operator[SEP] identifier[PhysicalReplicationOptions] identifier[options] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[getSlotName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[options] operator[SEP] identifier[getSlotName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[options] operator[SEP] identifier[getStartLSNPosition] operator[SEP] operator[SEP] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public String getContextName() { ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get(); if (ctx == null) { throw new UnsupportedOperationException(); } return ctx.getContextName(); }
class class_name[name] begin[{] method[getContextName, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[ExternalContext], ctx] if[binary_operation[member[.ctx], ==, 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=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] return[call[ctx.getContextName, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getContextName] operator[SEP] operator[SEP] { identifier[ExternalContext] identifier[ctx] operator[=] identifier[_MyFacesExternalContextHelper] operator[SEP] identifier[firstInstance] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ctx] operator[SEP] identifier[getContextName] operator[SEP] operator[SEP] operator[SEP] }
public final SearchAgentsPagedResponse searchAgents(String parent) { SearchAgentsRequest request = SearchAgentsRequest.newBuilder().setParent(parent).build(); return searchAgents(request); }
class class_name[name] begin[{] method[searchAgents, return_type[type[SearchAgentsPagedResponse]], modifier[final public], parameter[parent]] begin[{] local_variable[type[SearchAgentsRequest], request] return[call[.searchAgents, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[SearchAgentsPagedResponse] identifier[searchAgents] operator[SEP] identifier[String] identifier[parent] operator[SEP] { identifier[SearchAgentsRequest] identifier[request] operator[=] identifier[SearchAgentsRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[searchAgents] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override public void eUnset(int featureID) { switch (featureID) { case XtextPackage.PARSER_RULE__DEFINES_HIDDEN_TOKENS: setDefinesHiddenTokens(DEFINES_HIDDEN_TOKENS_EDEFAULT); return; case XtextPackage.PARSER_RULE__HIDDEN_TOKENS: getHiddenTokens().clear(); return; case XtextPackage.PARSER_RULE__PARAMETERS: getParameters().clear(); return; case XtextPackage.PARSER_RULE__FRAGMENT: setFragment(FRAGMENT_EDEFAULT); return; case XtextPackage.PARSER_RULE__WILDCARD: setWildcard(WILDCARD_EDEFAULT); return; } super.eUnset(featureID); }
class class_name[name] begin[{] method[eUnset, return_type[void], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=PARSER_RULE__DEFINES_HIDDEN_TOKENS, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEFINES_HIDDEN_TOKENS_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDefinesHiddenTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=PARSER_RULE__HIDDEN_TOKENS, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getHiddenTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=PARSER_RULE__PARAMETERS, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=PARSER_RULE__FRAGMENT, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FRAGMENT_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFragment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=PARSER_RULE__WILDCARD, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WILDCARD_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setWildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eUnset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eUnset] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[XtextPackage] operator[SEP] identifier[PARSER_RULE__DEFINES_HIDDEN_TOKENS] operator[:] identifier[setDefinesHiddenTokens] operator[SEP] identifier[DEFINES_HIDDEN_TOKENS_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[XtextPackage] operator[SEP] identifier[PARSER_RULE__HIDDEN_TOKENS] operator[:] identifier[getHiddenTokens] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[XtextPackage] operator[SEP] identifier[PARSER_RULE__PARAMETERS] operator[:] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[XtextPackage] operator[SEP] identifier[PARSER_RULE__FRAGMENT] operator[:] identifier[setFragment] operator[SEP] identifier[FRAGMENT_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[XtextPackage] operator[SEP] identifier[PARSER_RULE__WILDCARD] operator[:] identifier[setWildcard] operator[SEP] identifier[WILDCARD_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eUnset] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
private void processLookup(final TSDB tsdb, final HttpQuery query, final SearchQuery search_query) { if (search_query.getMetric() == null && (search_query.getTags() == null || search_query.getTags().size() < 1)) { throw new BadRequestException( "Missing metric and tags. Please supply at least one value."); } final long start = System.currentTimeMillis(); class MetricCB implements Callback<Object, String> { final Map<String, Object> series; MetricCB(final Map<String, Object> series) { this.series = series; } @Override public Object call(final String name) throws Exception { series.put("metric", name); return null; } } class TagsCB implements Callback<Object, HashMap<String, String>> { final Map<String, Object> series; TagsCB(final Map<String, Object> series) { this.series = series; } @Override public Object call(final HashMap<String, String> names) throws Exception { series.put("tags", names); return null; } } class Serialize implements Callback<Object, ArrayList<Object>> { final List<Object> results; Serialize(final List<Object> results) { this.results = results; } @Override public Object call(final ArrayList<Object> ignored) throws Exception { search_query.setResults(results); search_query.setTime(System.currentTimeMillis() - start); query.sendReply(query.serializer().formatSearchResultsV1(search_query)); return null; } } class LookupCB implements Callback<Deferred<Object>, List<byte[]>> { @Override public Deferred<Object> call(final List<byte[]> tsuids) throws Exception { final List<Object> results = new ArrayList<Object>(tsuids.size()); search_query.setTotalResults(tsuids.size()); final ArrayList<Deferred<Object>> deferreds = new ArrayList<Deferred<Object>>(tsuids.size()); for (final byte[] tsuid : tsuids) { // has to be concurrent if the uid table is split across servers final Map<String, Object> series = new ConcurrentHashMap<String, Object>(3); results.add(series); series.put("tsuid", UniqueId.uidToString(tsuid)); byte[] metric_uid = Arrays.copyOfRange(tsuid, 0, TSDB.metrics_width()); deferreds.add(tsdb.getUidName(UniqueIdType.METRIC, metric_uid) .addCallback(new MetricCB(series))); final List<byte[]> tag_ids = UniqueId.getTagPairsFromTSUID(tsuid); deferreds.add(Tags.resolveIdsAsync(tsdb, tag_ids) .addCallback(new TagsCB(series))); } return Deferred.group(deferreds).addCallback(new Serialize(results)); } } class ErrCB implements Callback<Object, Exception> { @Override public Object call(final Exception e) throws Exception { if (e instanceof NoSuchUniqueId) { query.sendReply(HttpResponseStatus.NOT_FOUND, query.serializer().formatErrorV1( new BadRequestException(HttpResponseStatus.NOT_FOUND, "Unable to resolve one or more TSUIDs", (NoSuchUniqueId)e))); } else if (e instanceof NoSuchUniqueName) { query.sendReply(HttpResponseStatus.NOT_FOUND, query.serializer().formatErrorV1( new BadRequestException(HttpResponseStatus.NOT_FOUND, "Unable to resolve one or more UIDs", (NoSuchUniqueName)e))); } else if (e instanceof DeferredGroupException) { final Throwable ex = Exceptions.getCause((DeferredGroupException)e); if (ex instanceof NoSuchUniqueId) { query.sendReply(HttpResponseStatus.NOT_FOUND, query.serializer().formatErrorV1( new BadRequestException(HttpResponseStatus.NOT_FOUND, "Unable to resolve one or more TSUIDs", (NoSuchUniqueId)ex))); } else if (ex instanceof NoSuchUniqueName) { query.sendReply(HttpResponseStatus.NOT_FOUND, query.serializer().formatErrorV1( new BadRequestException(HttpResponseStatus.NOT_FOUND, "Unable to resolve one or more UIDs", (NoSuchUniqueName)ex))); } else { query.sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, query.serializer().formatErrorV1( new BadRequestException(HttpResponseStatus.INTERNAL_SERVER_ERROR, "Unexpected exception", ex))); } } else { query.sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, query.serializer().formatErrorV1( new BadRequestException(HttpResponseStatus.INTERNAL_SERVER_ERROR, "Unexpected exception", e))); } return null; } } new TimeSeriesLookup(tsdb, search_query).lookupAsync() .addCallback(new LookupCB()) .addErrback(new ErrCB()); }
class class_name[name] begin[{] method[processLookup, return_type[void], modifier[private], parameter[tsdb, query, search_query]] begin[{] if[binary_operation[binary_operation[call[search_query.getMetric, parameter[]], ==, literal[null]], &&, binary_operation[binary_operation[call[search_query.getTags, parameter[]], ==, literal[null]], ||, binary_operation[call[search_query.getTags, parameter[]], <, literal[1]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing metric and tags. Please supply at least one value.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[long], start] class class_name[MetricCB] begin[{] type[Map] field[series] method[MetricCB, modifier[default], parameter[series]] begin[{] assign[THIS[member[None.series]], member[.series]] end[}] method[call, return_type[type[Object]], modifier[public], parameter[name]] begin[{] call[series.put, parameter[literal["metric"], member[.name]]] return[literal[null]] end[}] END[}] class class_name[TagsCB] begin[{] type[Map] field[series] method[TagsCB, modifier[default], parameter[series]] begin[{] assign[THIS[member[None.series]], member[.series]] end[}] method[call, return_type[type[Object]], modifier[public], parameter[names]] begin[{] call[series.put, parameter[literal["tags"], member[.names]]] return[literal[null]] end[}] END[}] class class_name[Serialize] begin[{] type[List] field[results] method[Serialize, modifier[default], parameter[results]] begin[{] assign[THIS[member[None.results]], member[.results]] end[}] method[call, return_type[type[Object]], modifier[public], parameter[ignored]] begin[{] call[search_query.setResults, parameter[member[.results]]] call[search_query.setTime, parameter[binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.start]]]] call[query.sendReply, parameter[call[query.serializer, parameter[]]]] return[literal[null]] end[}] END[}] class class_name[LookupCB] begin[{] method[call, return_type[type[Deferred]], modifier[public], parameter[tsuids]] begin[{] local_variable[type[List], results] call[search_query.setTotalResults, parameter[call[tsuids.size, parameter[]]]] local_variable[type[ArrayList], deferreds] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], 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=Object, sub_type=None))], dimensions=None, name=ConcurrentHashMap, sub_type=None)), name=series)], modifiers={'final'}, 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=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=series, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="tsuid"), MethodInvocation(arguments=[MemberReference(member=tsuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=uidToString, postfix_operators=[], prefix_operators=[], qualifier=UniqueId, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tsuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=metrics_width, postfix_operators=[], prefix_operators=[], qualifier=TSDB, selectors=[], type_arguments=None)], member=copyOfRange, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), name=metric_uid)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=METRIC, postfix_operators=[], prefix_operators=[], qualifier=UniqueIdType, selectors=[]), MemberReference(member=metric_uid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUidName, postfix_operators=[], prefix_operators=[], qualifier=tsdb, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=series, 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=MetricCB, sub_type=None))], member=addCallback, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=deferreds, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tsuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTagPairsFromTSUID, postfix_operators=[], prefix_operators=[], qualifier=UniqueId, selectors=[], type_arguments=None), name=tag_ids)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=BasicType(dimensions=[None], name=byte))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=tsdb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag_ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveIdsAsync, postfix_operators=[], prefix_operators=[], qualifier=Tags, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=series, 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=TagsCB, sub_type=None))], member=addCallback, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=deferreds, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=tsuids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tsuid)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte))), label=None) return[call[Deferred.group, parameter[member[.deferreds]]]] end[}] END[}] class class_name[ErrCB] begin[{] method[call, return_type[type[Object]], modifier[public], parameter[e]] begin[{] if[binary_operation[member[.e], instanceof, type[NoSuchUniqueId]]] begin[{] call[query.sendReply, parameter[member[HttpResponseStatus.NOT_FOUND], call[query.serializer, parameter[]]]] else begin[{] if[binary_operation[member[.e], instanceof, type[NoSuchUniqueName]]] begin[{] call[query.sendReply, parameter[member[HttpResponseStatus.NOT_FOUND], call[query.serializer, parameter[]]]] else begin[{] if[binary_operation[member[.e], instanceof, type[DeferredGroupException]]] begin[{] local_variable[type[Throwable], ex] if[binary_operation[member[.ex], instanceof, type[NoSuchUniqueId]]] begin[{] call[query.sendReply, parameter[member[HttpResponseStatus.NOT_FOUND], call[query.serializer, parameter[]]]] else begin[{] if[binary_operation[member[.ex], instanceof, type[NoSuchUniqueName]]] begin[{] call[query.sendReply, parameter[member[HttpResponseStatus.NOT_FOUND], call[query.serializer, parameter[]]]] else begin[{] call[query.sendReply, parameter[member[HttpResponseStatus.INTERNAL_SERVER_ERROR], call[query.serializer, parameter[]]]] end[}] end[}] else begin[{] call[query.sendReply, parameter[member[HttpResponseStatus.INTERNAL_SERVER_ERROR], call[query.serializer, parameter[]]]] end[}] end[}] end[}] return[literal[null]] end[}] END[}] ClassCreator(arguments=[MemberReference(member=tsdb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=search_query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=lookupAsync, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LookupCB, sub_type=None))], member=addCallback, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrCB, sub_type=None))], member=addErrback, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TimeSeriesLookup, sub_type=None)) end[}] END[}]
Keyword[private] Keyword[void] identifier[processLookup] operator[SEP] Keyword[final] identifier[TSDB] identifier[tsdb] , Keyword[final] identifier[HttpQuery] identifier[query] , Keyword[final] identifier[SearchQuery] identifier[search_query] operator[SEP] { Keyword[if] operator[SEP] identifier[search_query] operator[SEP] identifier[getMetric] operator[SEP] operator[SEP] operator[==] Other[null] operator[&&] operator[SEP] identifier[search_query] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[search_query] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[BadRequestException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[class] identifier[MetricCB] Keyword[implements] identifier[Callback] operator[<] identifier[Object] , identifier[String] operator[>] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[series] operator[SEP] identifier[MetricCB] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[series] operator[SEP] { Keyword[this] operator[SEP] identifier[series] operator[=] identifier[series] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[call] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Exception] { identifier[series] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } Keyword[class] identifier[TagsCB] Keyword[implements] identifier[Callback] operator[<] identifier[Object] , identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[>] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[series] operator[SEP] identifier[TagsCB] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[series] operator[SEP] { Keyword[this] operator[SEP] identifier[series] operator[=] identifier[series] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[call] operator[SEP] Keyword[final] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[names] operator[SEP] Keyword[throws] identifier[Exception] { identifier[series] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[names] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } Keyword[class] identifier[Serialize] Keyword[implements] identifier[Callback] operator[<] identifier[Object] , identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[>] { Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[results] operator[SEP] identifier[Serialize] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[results] operator[SEP] { Keyword[this] operator[SEP] identifier[results] operator[=] identifier[results] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[call] operator[SEP] Keyword[final] identifier[ArrayList] operator[<] identifier[Object] operator[>] identifier[ignored] operator[SEP] Keyword[throws] identifier[Exception] { identifier[search_query] operator[SEP] identifier[setResults] operator[SEP] identifier[results] operator[SEP] operator[SEP] identifier[search_query] operator[SEP] identifier[setTime] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sendReply] operator[SEP] identifier[query] operator[SEP] identifier[serializer] operator[SEP] operator[SEP] operator[SEP] identifier[formatSearchResultsV1] operator[SEP] identifier[search_query] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } Keyword[class] identifier[LookupCB] Keyword[implements] identifier[Callback] operator[<] identifier[Deferred] operator[<] identifier[Object] operator[>] , identifier[List] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[>] { annotation[@] identifier[Override] Keyword[public] identifier[Deferred] operator[<] identifier[Object] operator[>] identifier[call] operator[SEP] Keyword[final] identifier[List] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[tsuids] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[results] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] identifier[tsuids] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[search_query] operator[SEP] identifier[setTotalResults] operator[SEP] identifier[tsuids] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ArrayList] operator[<] identifier[Deferred] operator[<] identifier[Object] operator[>] operator[>] identifier[deferreds] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Deferred] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] identifier[tsuids] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[tsuid] operator[:] identifier[tsuids] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[series] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[series] operator[SEP] operator[SEP] identifier[series] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[UniqueId] operator[SEP] identifier[uidToString] operator[SEP] identifier[tsuid] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[metric_uid] operator[=] identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[tsuid] , Other[0] , identifier[TSDB] operator[SEP] identifier[metrics_width] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[deferreds] operator[SEP] identifier[add] operator[SEP] identifier[tsdb] operator[SEP] identifier[getUidName] operator[SEP] identifier[UniqueIdType] operator[SEP] identifier[METRIC] , identifier[metric_uid] operator[SEP] operator[SEP] identifier[addCallback] operator[SEP] Keyword[new] identifier[MetricCB] operator[SEP] identifier[series] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[tag_ids] operator[=] identifier[UniqueId] operator[SEP] identifier[getTagPairsFromTSUID] operator[SEP] identifier[tsuid] operator[SEP] operator[SEP] identifier[deferreds] operator[SEP] identifier[add] operator[SEP] identifier[Tags] operator[SEP] identifier[resolveIdsAsync] operator[SEP] identifier[tsdb] , identifier[tag_ids] operator[SEP] operator[SEP] identifier[addCallback] operator[SEP] Keyword[new] identifier[TagsCB] operator[SEP] identifier[series] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Deferred] operator[SEP] identifier[group] operator[SEP] identifier[deferreds] operator[SEP] operator[SEP] identifier[addCallback] operator[SEP] Keyword[new] identifier[Serialize] operator[SEP] identifier[results] operator[SEP] operator[SEP] operator[SEP] } } Keyword[class] identifier[ErrCB] Keyword[implements] identifier[Callback] operator[<] identifier[Object] , identifier[Exception] operator[>] { annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[call] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[NoSuchUniqueId] operator[SEP] { identifier[query] operator[SEP] identifier[sendReply] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , identifier[query] operator[SEP] identifier[serializer] operator[SEP] operator[SEP] operator[SEP] identifier[formatErrorV1] operator[SEP] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , literal[String] , operator[SEP] identifier[NoSuchUniqueId] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[NoSuchUniqueName] operator[SEP] { identifier[query] operator[SEP] identifier[sendReply] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , identifier[query] operator[SEP] identifier[serializer] operator[SEP] operator[SEP] operator[SEP] identifier[formatErrorV1] operator[SEP] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , literal[String] , operator[SEP] identifier[NoSuchUniqueName] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[DeferredGroupException] operator[SEP] { Keyword[final] identifier[Throwable] identifier[ex] operator[=] identifier[Exceptions] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] identifier[DeferredGroupException] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ex] Keyword[instanceof] identifier[NoSuchUniqueId] operator[SEP] { identifier[query] operator[SEP] identifier[sendReply] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , identifier[query] operator[SEP] identifier[serializer] operator[SEP] operator[SEP] operator[SEP] identifier[formatErrorV1] operator[SEP] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , literal[String] , operator[SEP] identifier[NoSuchUniqueId] operator[SEP] identifier[ex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ex] Keyword[instanceof] identifier[NoSuchUniqueName] operator[SEP] { identifier[query] operator[SEP] identifier[sendReply] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , identifier[query] operator[SEP] identifier[serializer] operator[SEP] operator[SEP] operator[SEP] identifier[formatErrorV1] operator[SEP] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[NOT_FOUND] , literal[String] , operator[SEP] identifier[NoSuchUniqueName] operator[SEP] identifier[ex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[query] operator[SEP] identifier[sendReply] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[INTERNAL_SERVER_ERROR] , identifier[query] operator[SEP] identifier[serializer] operator[SEP] operator[SEP] operator[SEP] identifier[formatErrorV1] operator[SEP] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[INTERNAL_SERVER_ERROR] , literal[String] , identifier[ex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[query] operator[SEP] identifier[sendReply] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[INTERNAL_SERVER_ERROR] , identifier[query] operator[SEP] identifier[serializer] operator[SEP] operator[SEP] operator[SEP] identifier[formatErrorV1] operator[SEP] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[INTERNAL_SERVER_ERROR] , literal[String] , identifier[e] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } } Keyword[new] identifier[TimeSeriesLookup] operator[SEP] identifier[tsdb] , identifier[search_query] operator[SEP] operator[SEP] identifier[lookupAsync] operator[SEP] operator[SEP] operator[SEP] identifier[addCallback] operator[SEP] Keyword[new] identifier[LookupCB] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addErrback] operator[SEP] Keyword[new] identifier[ErrCB] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static List<DataSinkNode> createPreOptimizedPlan(Plan program) { GraphCreatingVisitor graphCreator = new GraphCreatingVisitor(-1, 1); program.accept(graphCreator); return graphCreator.sinks; }
class class_name[name] begin[{] method[createPreOptimizedPlan, return_type[type[List]], modifier[public static], parameter[program]] begin[{] local_variable[type[GraphCreatingVisitor], graphCreator] call[program.accept, parameter[member[.graphCreator]]] return[member[graphCreator.sinks]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[DataSinkNode] operator[>] identifier[createPreOptimizedPlan] operator[SEP] identifier[Plan] identifier[program] operator[SEP] { identifier[GraphCreatingVisitor] identifier[graphCreator] operator[=] Keyword[new] identifier[GraphCreatingVisitor] operator[SEP] operator[-] Other[1] , Other[1] operator[SEP] operator[SEP] identifier[program] operator[SEP] identifier[accept] operator[SEP] identifier[graphCreator] operator[SEP] operator[SEP] Keyword[return] identifier[graphCreator] operator[SEP] identifier[sinks] operator[SEP] }
public ServiceCall<LanguageModels> listLanguageModels(ListLanguageModelsOptions listLanguageModelsOptions) { String[] pathSegments = { "v1/customizations" }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("speech_to_text", "v1", "listLanguageModels"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); if (listLanguageModelsOptions != null) { if (listLanguageModelsOptions.language() != null) { builder.query("language", listLanguageModelsOptions.language()); } } return createServiceCall(builder.build(), ResponseConverterUtils.getObject(LanguageModels.class)); }
class class_name[name] begin[{] method[listLanguageModels, return_type[type[ServiceCall]], modifier[public], parameter[listLanguageModelsOptions]] begin[{] local_variable[type[String], pathSegments] local_variable[type[RequestBuilder], builder] local_variable[type[Map], sdkHeaders] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None)], member=header, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=sdkHeaders, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=header)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) call[builder.header, parameter[literal["Accept"], literal["application/json"]]] if[binary_operation[member[.listLanguageModelsOptions], !=, literal[null]]] begin[{] if[binary_operation[call[listLanguageModelsOptions.language, parameter[]], !=, literal[null]]] begin[{] call[builder.query, parameter[literal["language"], call[listLanguageModelsOptions.language, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] return[call[.createServiceCall, parameter[call[builder.build, parameter[]], call[ResponseConverterUtils.getObject, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LanguageModels, sub_type=None))]]]]] end[}] END[}]
Keyword[public] identifier[ServiceCall] operator[<] identifier[LanguageModels] operator[>] identifier[listLanguageModels] operator[SEP] identifier[ListLanguageModelsOptions] identifier[listLanguageModelsOptions] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[pathSegments] operator[=] { literal[String] } operator[SEP] identifier[RequestBuilder] identifier[builder] operator[=] identifier[RequestBuilder] operator[SEP] identifier[get] operator[SEP] identifier[RequestBuilder] operator[SEP] identifier[constructHttpUrl] operator[SEP] identifier[getEndPoint] operator[SEP] operator[SEP] , identifier[pathSegments] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[sdkHeaders] operator[=] identifier[SdkCommon] operator[SEP] identifier[getSdkHeaders] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[header] operator[:] identifier[sdkHeaders] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[header] operator[SEP] identifier[header] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[header] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[header] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listLanguageModelsOptions] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[listLanguageModelsOptions] operator[SEP] identifier[language] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[builder] operator[SEP] identifier[query] operator[SEP] literal[String] , identifier[listLanguageModelsOptions] operator[SEP] identifier[language] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[createServiceCall] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] , identifier[ResponseConverterUtils] operator[SEP] identifier[getObject] operator[SEP] identifier[LanguageModels] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] }
private ForkedRunner createForkedRunner() throws MojoExecutionException { try { if (this.project == null) { this.getLog().error("this.project is null"); } return new ForkedRunner(getLog(), this.jmxPort, this.vmArgs, this.project.getTestClasspathElements(), this.stepImplementationArtifacts, this.artifactResolver, this.artifactFactory, this.mavenProjectBuilder, this.localRepository, this.remoteRepositories, this.artifactMetadataSource); } catch (final DependencyResolutionRequiredException e) { throw new MojoExecutionException("Unable to resolve dependencies", e); } }
class class_name[name] begin[{] method[createForkedRunner, return_type[type[ForkedRunner]], modifier[private], parameter[]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=project, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), 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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getLog, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="this.project is null")], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)])), ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=jmxPort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=vmArgs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=project, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getTestClasspathElements, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=stepImplementationArtifacts, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=artifactResolver, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=artifactFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mavenProjectBuilder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=localRepository, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=remoteRepositories, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=artifactMetadataSource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ForkedRunner, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to resolve dependencies"), 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=MojoExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DependencyResolutionRequiredException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[ForkedRunner] identifier[createForkedRunner] operator[SEP] operator[SEP] Keyword[throws] identifier[MojoExecutionException] { Keyword[try] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[project] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ForkedRunner] operator[SEP] identifier[getLog] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[jmxPort] , Keyword[this] operator[SEP] identifier[vmArgs] , Keyword[this] operator[SEP] identifier[project] operator[SEP] identifier[getTestClasspathElements] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[stepImplementationArtifacts] , Keyword[this] operator[SEP] identifier[artifactResolver] , Keyword[this] operator[SEP] identifier[artifactFactory] , Keyword[this] operator[SEP] identifier[mavenProjectBuilder] , Keyword[this] operator[SEP] identifier[localRepository] , Keyword[this] operator[SEP] identifier[remoteRepositories] , Keyword[this] operator[SEP] identifier[artifactMetadataSource] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[DependencyResolutionRequiredException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MojoExecutionException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
static BindTransform getLanguageTransform(TypeName type) { String typeName = type.toString(); if (Integer.class.getCanonicalName().equals(typeName)) { return new IntegerBindTransform(true); } if (Boolean.class.getCanonicalName().equals(typeName)) { return new BooleanBindTransform(true); } if (Long.class.getCanonicalName().equals(typeName)) { return new LongBindTransform(true); } if (Double.class.getCanonicalName().equals(typeName)) { return new DoubleBindTransform(true); } if (Float.class.getCanonicalName().equals(typeName)) { return new FloatBindTransform(true); } if (Short.class.getCanonicalName().equals(typeName)) { return new ShortBindTransform(true); } if (Byte.class.getCanonicalName().equals(typeName)) { return new ByteBindTransform(true); } if (Character.class.getCanonicalName().equals(typeName)) { return new CharacterBindTransform(true); } if (String.class.getCanonicalName().equals(typeName)) { return new StringBindTransform(); } return null; }
class class_name[name] begin[{] method[getLanguageTransform, return_type[type[BindTransform]], modifier[static], parameter[type]] begin[{] local_variable[type[String], typeName] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BooleanBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LongBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DoubleBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FloatBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShortBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Character, sub_type=None))] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CharacterBindTransform, sub_type=None))] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBindTransform, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[static] identifier[BindTransform] identifier[getLanguageTransform] operator[SEP] identifier[TypeName] identifier[type] operator[SEP] { identifier[String] identifier[typeName] operator[=] identifier[type] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[IntegerBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[BooleanBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[LongBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Double] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[DoubleBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Float] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[FloatBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Short] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[ShortBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Byte] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[ByteBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Character] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[CharacterBindTransform] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[StringBindTransform] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public void removeDataModelListener(DataModelListener listener) { if (listener == null) { throw new NullPointerException(); } if (listeners != null) { listeners.remove(listener); if (listeners.isEmpty()) { listeners = null; } } }
class class_name[name] begin[{] method[removeDataModelListener, return_type[void], modifier[public], parameter[listener]] begin[{] if[binary_operation[member[.listener], ==, 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[}] if[binary_operation[member[.listeners], !=, literal[null]]] begin[{] call[listeners.remove, parameter[member[.listener]]] if[call[listeners.isEmpty, parameter[]]] begin[{] assign[member[.listeners], literal[null]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeDataModelListener] operator[SEP] identifier[DataModelListener] identifier[listener] operator[SEP] { Keyword[if] operator[SEP] identifier[listener] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[listeners] operator[!=] Other[null] operator[SEP] { identifier[listeners] operator[SEP] identifier[remove] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listeners] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[listeners] operator[=] Other[null] operator[SEP] } } }
public static String canonize(String ipv6Address) throws IllegalArgumentException { if (ipv6Address == null) { return null; } // Definitely not an IPv6, return untouched input. if (!mayBeIPv6Address(ipv6Address)) { return ipv6Address; } // Length without zone ID (%zone) or IPv4 address int ipv6AddressLength = ipv6Address.length(); if (isIPv4AddressInIPv6(ipv6Address)) { // IPv4 in IPv6 // e.g. 0:0:0:0:0:FFFF:127.0.0.1 int lastColonPos = ipv6Address.lastIndexOf(":"); int lastColonsPos = ipv6Address.lastIndexOf("::"); if (lastColonsPos >= 0 && lastColonPos == lastColonsPos + 1) { // IPv6 part ends with two consecutive colons, last colon is part of IPv6 format. // e.g. ::127.0.0.1 ipv6AddressLength = lastColonPos + 1; } else { // IPv6 part ends with only one colon, last colon is not part of IPv6 format. // e.g. ::FFFF:127.0.0.1 ipv6AddressLength = lastColonPos; } } else if (ipv6Address.contains(":") && ipv6Address.contains("%")) { // Zone ID // e.g. fe80:0:0:0:f0f0:c0c0:1919:1234%4 ipv6AddressLength = ipv6Address.lastIndexOf("%"); } StringBuilder result = new StringBuilder(); char [][] groups = new char[IPV6_LEN][MAX_GROUP_LENGTH]; int groupCounter = 0; int charInGroupCounter = 0; // Index of the current zeroGroup, -1 means not found. int zeroGroupIndex = -1; int zeroGroupLength = 0; // maximum length zero group, if there is more then one, then first one int maxZeroGroupIndex = -1; int maxZeroGroupLength = 0; boolean isZero = true; boolean groupStart = true; /* * Two consecutive colons, initial expansion. * e.g. 2001:db8:0:0:1::1 -> 2001:db8:0:0:1:0:0:1 */ StringBuilder expanded = new StringBuilder(ipv6Address); int colonsPos = ipv6Address.indexOf("::"); int length = ipv6AddressLength; int change = 0; if (colonsPos >= 0 && colonsPos < ipv6AddressLength - 2) { int colonCounter = 0; for (int i = 0; i < ipv6AddressLength; i++) { if (ipv6Address.charAt(i) == ':') { colonCounter++; } } if (colonsPos == 0) { expanded.insert(0, "0"); change = change + 1; } for (int i = 0; i < IPV6_LEN - colonCounter; i++) { expanded.insert(colonsPos + 1, "0:"); change = change + 2; } if (colonsPos == ipv6AddressLength - 2) { expanded.setCharAt(colonsPos + change + 1, '0'); } else { expanded.deleteCharAt(colonsPos + change + 1); change = change - 1; } length = length + change; } // Processing one char at the time for (int charCounter = 0; charCounter < length; charCounter++) { char c = expanded.charAt(charCounter); if (c >= 'A' && c <= 'F') { c = (char) (c + 32); } if (c != ':') { groups[groupCounter][charInGroupCounter] = c; if (!(groupStart && c == '0')) { ++charInGroupCounter; groupStart = false; } if (c != '0') { isZero = false; } } if (c == ':' || charCounter == (length - 1)) { // We reached end of current group if (isZero) { ++zeroGroupLength; if (zeroGroupIndex == -1) { zeroGroupIndex = groupCounter; } } if (!isZero || charCounter == (length - 1)) { // We reached end of zero group if (zeroGroupLength > maxZeroGroupLength) { maxZeroGroupLength = zeroGroupLength; maxZeroGroupIndex = zeroGroupIndex; } zeroGroupLength = 0; zeroGroupIndex = -1; } ++groupCounter; charInGroupCounter = 0; isZero = true; groupStart = true; } } int numberOfGroups = groupCounter; // Output results for (groupCounter = 0; groupCounter < numberOfGroups; groupCounter++) { if (maxZeroGroupLength <= 1 || groupCounter < maxZeroGroupIndex || groupCounter >= maxZeroGroupIndex + maxZeroGroupLength) { for (int j = 0; j < MAX_GROUP_LENGTH; j++) { if (groups[groupCounter][j] != 0) { result.append(groups[groupCounter][j]); } } if (groupCounter < (numberOfGroups - 1) && (groupCounter != maxZeroGroupIndex - 1 || maxZeroGroupLength <= 1)) { result.append(':'); } } else if (groupCounter == maxZeroGroupIndex) { result.append("::"); } } // Solve problem with three colons in IPv4 in IPv6 format // e.g. 0:0:0:0:0:0:127.0.0.1 -> :::127.0.0.1 -> ::127.0.0.1 int resultLength = result.length(); if (result.charAt(resultLength - 1) == ':' && ipv6AddressLength < ipv6Address.length() && ipv6Address.charAt(ipv6AddressLength) == ':') { result.delete(resultLength - 1, resultLength); } /* * Append IPv4 from IPv4-in-IPv6 format or Zone ID */ for (int i = ipv6AddressLength; i < ipv6Address.length(); i++) { result.append(ipv6Address.charAt(i)); } return result.toString(); }
class class_name[name] begin[{] method[canonize, return_type[type[String]], modifier[public static], parameter[ipv6Address]] begin[{] if[binary_operation[member[.ipv6Address], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[.mayBeIPv6Address, parameter[member[.ipv6Address]]]] begin[{] return[member[.ipv6Address]] else begin[{] None end[}] local_variable[type[int], ipv6AddressLength] if[call[.isIPv4AddressInIPv6, parameter[member[.ipv6Address]]]] begin[{] local_variable[type[int], lastColonPos] local_variable[type[int], lastColonsPos] if[binary_operation[binary_operation[member[.lastColonsPos], >=, literal[0]], &&, binary_operation[member[.lastColonPos], ==, binary_operation[member[.lastColonsPos], +, literal[1]]]]] begin[{] assign[member[.ipv6AddressLength], binary_operation[member[.lastColonPos], +, literal[1]]] else begin[{] assign[member[.ipv6AddressLength], member[.lastColonPos]] end[}] else begin[{] if[binary_operation[call[ipv6Address.contains, parameter[literal[":"]]], &&, call[ipv6Address.contains, parameter[literal["%"]]]]] begin[{] assign[member[.ipv6AddressLength], call[ipv6Address.lastIndexOf, parameter[literal["%"]]]] else begin[{] None end[}] end[}] local_variable[type[StringBuilder], result] local_variable[type[char], groups] local_variable[type[int], groupCounter] local_variable[type[int], charInGroupCounter] local_variable[type[int], zeroGroupIndex] local_variable[type[int], zeroGroupLength] local_variable[type[int], maxZeroGroupIndex] local_variable[type[int], maxZeroGroupLength] local_variable[type[boolean], isZero] local_variable[type[boolean], groupStart] local_variable[type[StringBuilder], expanded] local_variable[type[int], colonsPos] local_variable[type[int], length] local_variable[type[int], change] if[binary_operation[binary_operation[member[.colonsPos], >=, literal[0]], &&, binary_operation[member[.colonsPos], <, binary_operation[member[.ipv6AddressLength], -, literal[2]]]]] begin[{] local_variable[type[int], colonCounter] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=ipv6Address, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=colonCounter, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ipv6AddressLength, 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) if[binary_operation[member[.colonsPos], ==, literal[0]]] begin[{] call[expanded.insert, parameter[literal[0], literal["0"]]] assign[member[.change], binary_operation[member[.change], +, literal[1]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=colonsPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0:")], member=insert, postfix_operators=[], prefix_operators=[], qualifier=expanded, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=change, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=change, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=IPV6_LEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=colonCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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) if[binary_operation[member[.colonsPos], ==, binary_operation[member[.ipv6AddressLength], -, literal[2]]]] begin[{] call[expanded.setCharAt, parameter[binary_operation[binary_operation[member[.colonsPos], +, member[.change]], +, literal[1]], literal['0']]] else begin[{] call[expanded.deleteCharAt, parameter[binary_operation[binary_operation[member[.colonsPos], +, member[.change]], +, literal[1]]]] assign[member[.change], binary_operation[member[.change], -, literal[1]]] end[}] assign[member[.length], binary_operation[member[.length], +, member[.change]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=charCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=expanded, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='F'), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=+), type=BasicType(dimensions=[], name=char))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':'), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=charInGroupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=groupStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=charInGroupCounter, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=groupStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isZero, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=charCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=isZero, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=zeroGroupLength, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=zeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=zeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isZero, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=charCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=zeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxZeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxZeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=zeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxZeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=zeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=zeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=zeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None)])), StatementExpression(expression=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=charInGroupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isZero, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=groupStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=charCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=charCounter)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=charCounter, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[int], numberOfGroups] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=maxZeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxZeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=maxZeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxZeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operator=>=), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxZeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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="::")], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_GROUP_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=numberOfGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=maxZeroGroupIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=maxZeroGroupLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<=), operator=||), 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=':')], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=groupCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=groupCounter, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[int], resultLength] if[binary_operation[binary_operation[binary_operation[call[result.charAt, parameter[binary_operation[member[.resultLength], -, literal[1]]]], ==, literal[':']], &&, binary_operation[member[.ipv6AddressLength], <, call[ipv6Address.length, parameter[]]]], &&, binary_operation[call[ipv6Address.charAt, parameter[member[.ipv6AddressLength]]], ==, literal[':']]]] begin[{] call[result.delete, parameter[binary_operation[member[.resultLength], -, literal[1]], member[.resultLength]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=ipv6Address, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=ipv6Address, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=ipv6AddressLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[canonize] operator[SEP] identifier[String] identifier[ipv6Address] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[if] operator[SEP] identifier[ipv6Address] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[mayBeIPv6Address] operator[SEP] identifier[ipv6Address] operator[SEP] operator[SEP] { Keyword[return] identifier[ipv6Address] operator[SEP] } Keyword[int] identifier[ipv6AddressLength] operator[=] identifier[ipv6Address] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isIPv4AddressInIPv6] operator[SEP] identifier[ipv6Address] operator[SEP] operator[SEP] { Keyword[int] identifier[lastColonPos] operator[=] identifier[ipv6Address] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[lastColonsPos] operator[=] identifier[ipv6Address] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastColonsPos] operator[>=] Other[0] operator[&&] identifier[lastColonPos] operator[==] identifier[lastColonsPos] operator[+] Other[1] operator[SEP] { identifier[ipv6AddressLength] operator[=] identifier[lastColonPos] operator[+] Other[1] operator[SEP] } Keyword[else] { identifier[ipv6AddressLength] operator[=] identifier[lastColonPos] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[ipv6Address] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[ipv6Address] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[ipv6AddressLength] operator[=] identifier[ipv6Address] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[groups] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[IPV6_LEN] operator[SEP] operator[SEP] identifier[MAX_GROUP_LENGTH] operator[SEP] operator[SEP] Keyword[int] identifier[groupCounter] operator[=] Other[0] operator[SEP] Keyword[int] identifier[charInGroupCounter] operator[=] Other[0] operator[SEP] Keyword[int] identifier[zeroGroupIndex] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[zeroGroupLength] operator[=] Other[0] operator[SEP] Keyword[int] identifier[maxZeroGroupIndex] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[maxZeroGroupLength] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[isZero] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[groupStart] operator[=] literal[boolean] operator[SEP] identifier[StringBuilder] identifier[expanded] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[ipv6Address] operator[SEP] operator[SEP] Keyword[int] identifier[colonsPos] operator[=] identifier[ipv6Address] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[ipv6AddressLength] operator[SEP] Keyword[int] identifier[change] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[colonsPos] operator[>=] Other[0] operator[&&] identifier[colonsPos] operator[<] identifier[ipv6AddressLength] operator[-] Other[2] operator[SEP] { Keyword[int] identifier[colonCounter] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ipv6AddressLength] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[ipv6Address] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[colonCounter] operator[++] operator[SEP] } } Keyword[if] operator[SEP] identifier[colonsPos] operator[==] Other[0] operator[SEP] { identifier[expanded] operator[SEP] identifier[insert] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[change] operator[=] identifier[change] operator[+] Other[1] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[IPV6_LEN] operator[-] identifier[colonCounter] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[expanded] operator[SEP] identifier[insert] operator[SEP] identifier[colonsPos] operator[+] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[change] operator[=] identifier[change] operator[+] Other[2] operator[SEP] } Keyword[if] operator[SEP] identifier[colonsPos] operator[==] identifier[ipv6AddressLength] operator[-] Other[2] operator[SEP] { identifier[expanded] operator[SEP] identifier[setCharAt] operator[SEP] identifier[colonsPos] operator[+] identifier[change] operator[+] Other[1] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[expanded] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[colonsPos] operator[+] identifier[change] operator[+] Other[1] operator[SEP] operator[SEP] identifier[change] operator[=] identifier[change] operator[-] Other[1] operator[SEP] } identifier[length] operator[=] identifier[length] operator[+] identifier[change] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[charCounter] operator[=] Other[0] operator[SEP] identifier[charCounter] operator[<] identifier[length] operator[SEP] identifier[charCounter] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[expanded] operator[SEP] identifier[charAt] operator[SEP] identifier[charCounter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] { identifier[c] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[c] operator[+] Other[32] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[c] operator[!=] literal[String] operator[SEP] { identifier[groups] operator[SEP] identifier[groupCounter] operator[SEP] operator[SEP] identifier[charInGroupCounter] operator[SEP] operator[=] identifier[c] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[groupStart] operator[&&] identifier[c] operator[==] literal[String] operator[SEP] operator[SEP] { operator[++] identifier[charInGroupCounter] operator[SEP] identifier[groupStart] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[c] operator[!=] literal[String] operator[SEP] { identifier[isZero] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[||] identifier[charCounter] operator[==] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isZero] operator[SEP] { operator[++] identifier[zeroGroupLength] operator[SEP] Keyword[if] operator[SEP] identifier[zeroGroupIndex] operator[==] operator[-] Other[1] operator[SEP] { identifier[zeroGroupIndex] operator[=] identifier[groupCounter] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isZero] operator[||] identifier[charCounter] operator[==] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[zeroGroupLength] operator[>] identifier[maxZeroGroupLength] operator[SEP] { identifier[maxZeroGroupLength] operator[=] identifier[zeroGroupLength] operator[SEP] identifier[maxZeroGroupIndex] operator[=] identifier[zeroGroupIndex] operator[SEP] } identifier[zeroGroupLength] operator[=] Other[0] operator[SEP] identifier[zeroGroupIndex] operator[=] operator[-] Other[1] operator[SEP] } operator[++] identifier[groupCounter] operator[SEP] identifier[charInGroupCounter] operator[=] Other[0] operator[SEP] identifier[isZero] operator[=] literal[boolean] operator[SEP] identifier[groupStart] operator[=] literal[boolean] operator[SEP] } } Keyword[int] identifier[numberOfGroups] operator[=] identifier[groupCounter] operator[SEP] Keyword[for] operator[SEP] identifier[groupCounter] operator[=] Other[0] operator[SEP] identifier[groupCounter] operator[<] identifier[numberOfGroups] operator[SEP] identifier[groupCounter] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[maxZeroGroupLength] operator[<=] Other[1] operator[||] identifier[groupCounter] operator[<] identifier[maxZeroGroupIndex] operator[||] identifier[groupCounter] operator[>=] identifier[maxZeroGroupIndex] operator[+] identifier[maxZeroGroupLength] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[MAX_GROUP_LENGTH] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[groups] operator[SEP] identifier[groupCounter] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[groups] operator[SEP] identifier[groupCounter] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[groupCounter] operator[<] operator[SEP] identifier[numberOfGroups] operator[-] Other[1] operator[SEP] operator[&&] operator[SEP] identifier[groupCounter] operator[!=] identifier[maxZeroGroupIndex] operator[-] Other[1] operator[||] identifier[maxZeroGroupLength] operator[<=] Other[1] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[groupCounter] operator[==] identifier[maxZeroGroupIndex] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[int] identifier[resultLength] operator[=] identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[charAt] operator[SEP] identifier[resultLength] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[ipv6AddressLength] operator[<] identifier[ipv6Address] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[ipv6Address] operator[SEP] identifier[charAt] operator[SEP] identifier[ipv6AddressLength] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[result] operator[SEP] identifier[delete] operator[SEP] identifier[resultLength] operator[-] Other[1] , identifier[resultLength] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[ipv6AddressLength] operator[SEP] identifier[i] operator[<] identifier[ipv6Address] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ipv6Address] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public final void updateByte(final int n) { this.currentByte = n; if ((panel != null) && (n % 10000 == 0)) { panel.setCurrentByte(n); } }
class class_name[name] begin[{] method[updateByte, return_type[void], modifier[final public], parameter[n]] begin[{] assign[THIS[member[None.currentByte]], member[.n]] if[binary_operation[binary_operation[member[.panel], !=, literal[null]], &&, binary_operation[binary_operation[member[.n], %, literal[10000]], ==, literal[0]]]] begin[{] call[panel.setCurrentByte, parameter[member[.n]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[updateByte] operator[SEP] Keyword[final] Keyword[int] identifier[n] operator[SEP] { Keyword[this] operator[SEP] identifier[currentByte] operator[=] identifier[n] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[panel] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[n] operator[%] Other[10000] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[panel] operator[SEP] identifier[setCurrentByte] operator[SEP] identifier[n] operator[SEP] operator[SEP] } }
public void tell (ClientObject caller, Name target, String message, TellListener listener) throws InvocationException { BodyObject source = _locator.forClient(caller); // ensure that the caller has normal chat privileges InvocationException.requireAccess(source, ChatCodes.CHAT_ACCESS); // deliver the tell message to the target deliverTell(createTellMessage(source, message), target, listener); // inform the auto-responder if needed BodyObject targobj; if (_autoRespond != null && (targobj = _locator.lookupBody(target)) != null) { _autoRespond.sentTell(source, targobj, message); } }
class class_name[name] begin[{] method[tell, return_type[void], modifier[public], parameter[caller, target, message, listener]] begin[{] local_variable[type[BodyObject], source] call[InvocationException.requireAccess, parameter[member[.source], member[ChatCodes.CHAT_ACCESS]]] call[.deliverTell, parameter[call[.createTellMessage, parameter[member[.source], member[.message]]], member[.target], member[.listener]]] local_variable[type[BodyObject], targobj] if[binary_operation[binary_operation[member[._autoRespond], !=, literal[null]], &&, binary_operation[assign[member[.targobj], call[_locator.lookupBody, parameter[member[.target]]]], !=, literal[null]]]] begin[{] call[_autoRespond.sentTell, parameter[member[.source], member[.targobj], member[.message]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[tell] operator[SEP] identifier[ClientObject] identifier[caller] , identifier[Name] identifier[target] , identifier[String] identifier[message] , identifier[TellListener] identifier[listener] operator[SEP] Keyword[throws] identifier[InvocationException] { identifier[BodyObject] identifier[source] operator[=] identifier[_locator] operator[SEP] identifier[forClient] operator[SEP] identifier[caller] operator[SEP] operator[SEP] identifier[InvocationException] operator[SEP] identifier[requireAccess] operator[SEP] identifier[source] , identifier[ChatCodes] operator[SEP] identifier[CHAT_ACCESS] operator[SEP] operator[SEP] identifier[deliverTell] operator[SEP] identifier[createTellMessage] operator[SEP] identifier[source] , identifier[message] operator[SEP] , identifier[target] , identifier[listener] operator[SEP] operator[SEP] identifier[BodyObject] identifier[targobj] operator[SEP] Keyword[if] operator[SEP] identifier[_autoRespond] operator[!=] Other[null] operator[&&] operator[SEP] identifier[targobj] operator[=] identifier[_locator] operator[SEP] identifier[lookupBody] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[_autoRespond] operator[SEP] identifier[sentTell] operator[SEP] identifier[source] , identifier[targobj] , identifier[message] operator[SEP] operator[SEP] } }
public void loadAxioms(final Set<? extends Axiom> inclusions) { long start = System.currentTimeMillis(); if(log.isInfoEnabled()) log.info("Loading " + inclusions.size() + " axioms"); Set<Inclusion> normInclusions = normalise(inclusions); if(log.isInfoEnabled()) log.info("Processing " + normInclusions.size() + " normalised axioms"); Statistics.INSTANCE.setTime("normalisation", System.currentTimeMillis() - start); start = System.currentTimeMillis(); for (Inclusion i : normInclusions) { addTerm(i.getNormalForm()); } Statistics.INSTANCE.setTime("indexing", System.currentTimeMillis() - start); }
class class_name[name] begin[{] method[loadAxioms, return_type[void], modifier[public], parameter[inclusions]] begin[{] local_variable[type[long], start] if[call[log.isInfoEnabled, parameter[]]] begin[{] call[log.info, parameter[binary_operation[binary_operation[literal["Loading "], +, call[inclusions.size, parameter[]]], +, literal[" axioms"]]]] else begin[{] None end[}] local_variable[type[Set], normInclusions] if[call[log.isInfoEnabled, parameter[]]] begin[{] call[log.info, parameter[binary_operation[binary_operation[literal["Processing "], +, call[normInclusions.size, parameter[]]], +, literal[" normalised axioms"]]]] else begin[{] None end[}] call[Statistics.INSTANCE.setTime, parameter[literal["normalisation"], binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.start]]]] assign[member[.start], call[System.currentTimeMillis, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNormalForm, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None)], member=addTerm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=normInclusions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Inclusion, sub_type=None))), label=None) call[Statistics.INSTANCE.setTime, parameter[literal["indexing"], binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.start]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[loadAxioms] operator[SEP] Keyword[final] identifier[Set] operator[<] operator[?] Keyword[extends] identifier[Axiom] operator[>] identifier[inclusions] operator[SEP] { Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[inclusions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Inclusion] operator[>] identifier[normInclusions] operator[=] identifier[normalise] operator[SEP] identifier[inclusions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[normInclusions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Statistics] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[setTime] operator[SEP] literal[String] , identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] operator[SEP] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Inclusion] identifier[i] operator[:] identifier[normInclusions] operator[SEP] { identifier[addTerm] operator[SEP] identifier[i] operator[SEP] identifier[getNormalForm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Statistics] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[setTime] operator[SEP] literal[String] , identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] operator[SEP] }
@Deprecated public static void setUnreadMessagesListener(final UnreadMessagesListener listener) { dispatchConversationTask(new ConversationDispatchTask() { @Override protected boolean execute(Conversation conversation) { conversation.getMessageManager().setHostUnreadMessagesListener(listener); return true; } }, "set unread message listener"); }
class class_name[name] begin[{] method[setUnreadMessagesListener, return_type[void], modifier[public static], parameter[listener]] begin[{] call[.dispatchConversationTask, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getMessageManager, postfix_operators=[], prefix_operators=[], qualifier=conversation, selectors=[MethodInvocation(arguments=[MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHostUnreadMessagesListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], documentation=None, modifiers={'protected'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=conversation, type=ReferenceType(arguments=None, dimensions=[], name=Conversation, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConversationDispatchTask, sub_type=None)), literal["set unread message listener"]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] Keyword[void] identifier[setUnreadMessagesListener] operator[SEP] Keyword[final] identifier[UnreadMessagesListener] identifier[listener] operator[SEP] { identifier[dispatchConversationTask] operator[SEP] Keyword[new] identifier[ConversationDispatchTask] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[execute] operator[SEP] identifier[Conversation] identifier[conversation] operator[SEP] { identifier[conversation] operator[SEP] identifier[getMessageManager] operator[SEP] operator[SEP] operator[SEP] identifier[setHostUnreadMessagesListener] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } , literal[String] operator[SEP] operator[SEP] }
private void deleteAllWebserverConfigs(final String prefix) { File file = new File(m_targetPath); if (file.exists() && file.isDirectory()) { File[] configFiles = file.listFiles(new FilenameFilter() { /** * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String) */ public boolean accept(File dir, String name) { if (name.startsWith(prefix)) { return true; } return false; } }); for (File f : configFiles) { getReport().println(Messages.get().container(Messages.RPT_DELETING_FILE_1, f), I_CmsReport.FORMAT_OK); f.delete(); } } }
class class_name[name] begin[{] method[deleteAllWebserverConfigs, return_type[void], modifier[private], parameter[prefix]] begin[{] local_variable[type[File], file] if[binary_operation[call[file.exists, parameter[]], &&, call[file.isDirectory, parameter[]]]] begin[{] local_variable[type[File], configFiles] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getReport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_DELETING_FILE_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_OK, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=configFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[deleteAllWebserverConfigs] operator[SEP] Keyword[final] identifier[String] identifier[prefix] operator[SEP] { identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[m_targetPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[file] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[File] operator[SEP] operator[SEP] identifier[configFiles] operator[=] identifier[file] operator[SEP] identifier[listFiles] operator[SEP] Keyword[new] identifier[FilenameFilter] operator[SEP] operator[SEP] { Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[File] identifier[dir] , identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[startsWith] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } } operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[f] operator[:] identifier[configFiles] operator[SEP] { identifier[getReport] operator[SEP] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_DELETING_FILE_1] , identifier[f] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] } } }
public static char lastChar(String str) { if (str == null || str.length() == 0) return 0; return str.charAt(str.length() - 1); }
class class_name[name] begin[{] method[lastChar, return_type[type[char]], modifier[public static], parameter[str]] begin[{] if[binary_operation[binary_operation[member[.str], ==, literal[null]], ||, binary_operation[call[str.length, parameter[]], ==, literal[0]]]] begin[{] return[literal[0]] else begin[{] None end[}] return[call[str.charAt, parameter[binary_operation[call[str.length, parameter[]], -, literal[1]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[char] identifier[lastChar] operator[SEP] identifier[String] identifier[str] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[||] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[return] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] }
public ResourceHandler build() { if (resourceProviderFactory == null) { throw new IllegalStateException("No resourceProviderFactory has been set"); } return new ResourceHandler(resourceProviderFactory, pathToServeFrom, defaultFile, extensionToResourceType); }
class class_name[name] begin[{] method[build, return_type[type[ResourceHandler]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.resourceProviderFactory], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No resourceProviderFactory has been 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) else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=resourceProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pathToServeFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=extensionToResourceType, 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=ResourceHandler, sub_type=None))] end[}] END[}]
Keyword[public] identifier[ResourceHandler] identifier[build] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceProviderFactory] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ResourceHandler] operator[SEP] identifier[resourceProviderFactory] , identifier[pathToServeFrom] , identifier[defaultFile] , identifier[extensionToResourceType] operator[SEP] operator[SEP] }
public synchronized void mark(int limit) throws IllegalArgumentException { if (limit>_buf.length) { byte[] new_buf=new byte[limit]; System.arraycopy(_buf,_pos,new_buf,_pos,_avail-_pos); _buf=new_buf; if (_byteBuffer!=null) _byteBuffer.setBuffer(_buf); } _mark=_pos; }
class class_name[name] begin[{] method[mark, return_type[void], modifier[synchronized public], parameter[limit]] begin[{] if[binary_operation[member[.limit], >, member[_buf.length]]] begin[{] local_variable[type[byte], new_buf] call[System.arraycopy, parameter[member[._buf], member[._pos], member[.new_buf], member[._pos], binary_operation[member[._avail], -, member[._pos]]]] assign[member[._buf], member[.new_buf]] if[binary_operation[member[._byteBuffer], !=, literal[null]]] begin[{] call[_byteBuffer.setBuffer, parameter[member[._buf]]] else begin[{] None end[}] else begin[{] None end[}] assign[member[._mark], member[._pos]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[mark] operator[SEP] Keyword[int] identifier[limit] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[if] operator[SEP] identifier[limit] operator[>] identifier[_buf] operator[SEP] identifier[length] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[new_buf] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[limit] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[_buf] , identifier[_pos] , identifier[new_buf] , identifier[_pos] , identifier[_avail] operator[-] identifier[_pos] operator[SEP] operator[SEP] identifier[_buf] operator[=] identifier[new_buf] operator[SEP] Keyword[if] operator[SEP] identifier[_byteBuffer] operator[!=] Other[null] operator[SEP] identifier[_byteBuffer] operator[SEP] identifier[setBuffer] operator[SEP] identifier[_buf] operator[SEP] operator[SEP] } identifier[_mark] operator[=] identifier[_pos] operator[SEP] }
public static int[] intsFrom(InputStream is) { ArrayList<Integer> ints = new ArrayList<Integer>(); for (String line : new LineReader(is)) { if (line.length() > 0 && !line.startsWith("#")) if (line.charAt(0) == '\"')// remove quotes ints.add(Integer.parseInt(line.substring(1, line.length() - 1))); else ints.add(Integer.parseInt(line)); } // copy it, because we can't cast from Integer to int... int[] ret = new int[ints.size()]; for (int i = 0; i < ints.size(); i++) { ret[i] = ints.get(i); } return ret; }
class class_name[name] begin[{] method[intsFrom, return_type[type[int]], modifier[public static], parameter[is]] begin[{] local_variable[type[ArrayList], ints] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#")], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=line, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"'), operator===), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ints, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ints, selectors=[], type_arguments=None), label=None)))]), control=EnhancedForControl(iterable=ClassCreator(arguments=[MemberReference(member=is, 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=LineReader, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[int], ret] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ints, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=ints, 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[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[intsFrom] operator[SEP] identifier[InputStream] identifier[is] operator[SEP] { identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[ints] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[line] operator[:] Keyword[new] identifier[LineReader] operator[SEP] identifier[is] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[!] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] identifier[ints] operator[SEP] identifier[add] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[ints] operator[SEP] identifier[add] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[line] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] operator[SEP] operator[SEP] identifier[ret] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[ints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ret] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[ints] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public static IModel<String> newResourceModel(final String resourceKey, final Component component, final IModel<?> model, final String defaultValue, final Object... parameters) { if ((parameters != null) && (parameters.length > 0)) { for (int i = 0; i < parameters.length; i++) { if ((parameters[i] != null) && (parameters[i] instanceof ResourceBundleKey)) { final ResourceBundleKey parameter = (ResourceBundleKey)parameters[i]; final IModel<String> parameterValue = newResourceModel(parameter, component); parameters[i] = parameterValue.getObject(); } } } return new StringResourceModel(resourceKey, component, model).setDefaultValue(defaultValue) .setParameters(parameters); }
class class_name[name] begin[{] method[newResourceModel, return_type[type[IModel]], modifier[public static], parameter[resourceKey, component, model, defaultValue, parameters]] begin[{] if[binary_operation[binary_operation[member[.parameters], !=, literal[null]], &&, binary_operation[member[parameters.length], >, literal[0]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=ResourceBundleKey, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=ResourceBundleKey, sub_type=None)), name=parameter)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ResourceBundleKey, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newResourceModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=parameterValue)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=IModel, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=parameterValue, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=resourceKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDefaultValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParameters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringResourceModel, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[IModel] operator[<] identifier[String] operator[>] identifier[newResourceModel] operator[SEP] Keyword[final] identifier[String] identifier[resourceKey] , Keyword[final] identifier[Component] identifier[component] , Keyword[final] identifier[IModel] operator[<] operator[?] operator[>] identifier[model] , Keyword[final] identifier[String] identifier[defaultValue] , Keyword[final] identifier[Object] operator[...] identifier[parameters] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[parameters] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parameters] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[ResourceBundleKey] operator[SEP] operator[SEP] { Keyword[final] identifier[ResourceBundleKey] identifier[parameter] operator[=] operator[SEP] identifier[ResourceBundleKey] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[final] identifier[IModel] operator[<] identifier[String] operator[>] identifier[parameterValue] operator[=] identifier[newResourceModel] operator[SEP] identifier[parameter] , identifier[component] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[parameterValue] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] Keyword[new] identifier[StringResourceModel] operator[SEP] identifier[resourceKey] , identifier[component] , identifier[model] operator[SEP] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] identifier[setParameters] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] }
public static void copyStreamToWriter( InputStream in, Writer out, String encoding, boolean close ) throws IOException { InputStreamReader reader = new InputStreamReader( in, encoding ); copyReaderToWriter( reader, out, close ); }
class class_name[name] begin[{] method[copyStreamToWriter, return_type[void], modifier[public static], parameter[in, out, encoding, close]] begin[{] local_variable[type[InputStreamReader], reader] call[.copyReaderToWriter, parameter[member[.reader], member[.out], member[.close]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[copyStreamToWriter] operator[SEP] identifier[InputStream] identifier[in] , identifier[Writer] identifier[out] , identifier[String] identifier[encoding] , Keyword[boolean] identifier[close] operator[SEP] Keyword[throws] identifier[IOException] { identifier[InputStreamReader] identifier[reader] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[in] , identifier[encoding] operator[SEP] operator[SEP] identifier[copyReaderToWriter] operator[SEP] identifier[reader] , identifier[out] , identifier[close] operator[SEP] operator[SEP] }
public static SSLSocketFactory getSslSocketFactory(Properties info) throws PSQLException { String classname = PGProperty.SSL_FACTORY.get(info); if (classname == null || "org.postgresql.ssl.jdbc4.LibPQFactory".equals(classname) || "org.postgresql.ssl.LibPQFactory".equals(classname)) { return new LibPQFactory(info); } try { return (SSLSocketFactory) ObjectFactory.instantiate(classname, info, true, PGProperty.SSL_FACTORY_ARG.get(info)); } catch (Exception e) { throw new PSQLException( GT.tr("The SSLSocketFactory class provided {0} could not be instantiated.", classname), PSQLState.CONNECTION_FAILURE, e); } }
class class_name[name] begin[{] method[getSslSocketFactory, return_type[type[SSLSocketFactory]], modifier[public static], parameter[info]] begin[{] local_variable[type[String], classname] if[binary_operation[binary_operation[binary_operation[member[.classname], ==, literal[null]], ||, literal["org.postgresql.ssl.jdbc4.LibPQFactory"]], ||, literal["org.postgresql.ssl.LibPQFactory"]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=info, 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=LibPQFactory, sub_type=None))] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MethodInvocation(arguments=[MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=PGProperty.SSL_FACTORY_ARG, selectors=[], type_arguments=None)], member=instantiate, postfix_operators=[], prefix_operators=[], qualifier=ObjectFactory, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SSLSocketFactory, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The SSLSocketFactory class provided {0} could not be instantiated."), MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tr, postfix_operators=[], prefix_operators=[], qualifier=GT, selectors=[], type_arguments=None), MemberReference(member=CONNECTION_FAILURE, postfix_operators=[], prefix_operators=[], qualifier=PSQLState, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PSQLException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[SSLSocketFactory] identifier[getSslSocketFactory] operator[SEP] identifier[Properties] identifier[info] operator[SEP] Keyword[throws] identifier[PSQLException] { identifier[String] identifier[classname] operator[=] identifier[PGProperty] operator[SEP] identifier[SSL_FACTORY] operator[SEP] identifier[get] operator[SEP] identifier[info] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classname] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[classname] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[classname] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[LibPQFactory] operator[SEP] identifier[info] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] operator[SEP] identifier[SSLSocketFactory] operator[SEP] identifier[ObjectFactory] operator[SEP] identifier[instantiate] operator[SEP] identifier[classname] , identifier[info] , literal[boolean] , identifier[PGProperty] operator[SEP] identifier[SSL_FACTORY_ARG] operator[SEP] identifier[get] operator[SEP] identifier[info] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[PSQLException] operator[SEP] identifier[GT] operator[SEP] identifier[tr] operator[SEP] literal[String] , identifier[classname] operator[SEP] , identifier[PSQLState] operator[SEP] identifier[CONNECTION_FAILURE] , identifier[e] operator[SEP] operator[SEP] } }
public final void connect(String address, int port) { connect(address, port, 30L, TimeUnit.SECONDS, () -> System.err.println("Couldn't connect to the server! Maybe it's offline?")); }
class class_name[name] begin[{] method[connect, return_type[void], modifier[final public], parameter[address, port]] begin[{] call[.connect, parameter[member[.address], member[.port], literal[30L], member[TimeUnit.SECONDS], LambdaExpression(body=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't connect to the server! Maybe it's offline?")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), parameters=[])]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[connect] operator[SEP] identifier[String] identifier[address] , Keyword[int] identifier[port] operator[SEP] { identifier[connect] operator[SEP] identifier[address] , identifier[port] , Other[30L] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] , operator[SEP] operator[SEP] operator[->] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] }
private String pullImageLink(String encoded) { try { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new StringReader(encoded)); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { if (eventType == XmlPullParser.START_TAG && "img".equals(xpp.getName())) { int count = xpp.getAttributeCount(); for (int x = 0; x < count; x++) { if (xpp.getAttributeName(x).equalsIgnoreCase("src")) return pattern.matcher(xpp.getAttributeValue(x)).replaceAll(""); } } eventType = xpp.next(); } } catch (Exception e) { log(TAG, "Error pulling image link from description!\n" + e.getMessage(), Log.WARN); } return ""; }
class class_name[name] begin[{] method[pullImageLink, return_type[type[String]], modifier[private], parameter[encoded]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=XmlPullParserFactory, selectors=[], type_arguments=None), name=factory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XmlPullParserFactory, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newPullParser, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=xpp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XmlPullParser, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=encoded, 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=StringReader, sub_type=None))], member=setInput, postfix_operators=[], prefix_operators=[], qualifier=xpp, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEventType, postfix_operators=[], prefix_operators=[], qualifier=xpp, selectors=[], type_arguments=None), name=eventType)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=START_TAG, postfix_operators=[], prefix_operators=[], qualifier=XmlPullParser, selectors=[]), operator===), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=xpp, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="img"), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributeCount, postfix_operators=[], prefix_operators=[], qualifier=xpp, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributeName, postfix_operators=[], prefix_operators=[], qualifier=xpp, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="src")], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributeValue, postfix_operators=[], prefix_operators=[], qualifier=xpp, selectors=[], type_arguments=None)], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, 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=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=xpp, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=END_DOCUMENT, postfix_operators=[], prefix_operators=[], qualifier=XmlPullParser, selectors=[]), operator=!=), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error pulling image link from description!\n"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=WARN, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=, 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[}]
Keyword[private] identifier[String] identifier[pullImageLink] operator[SEP] identifier[String] identifier[encoded] operator[SEP] { Keyword[try] { identifier[XmlPullParserFactory] identifier[factory] operator[=] identifier[XmlPullParserFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[XmlPullParser] identifier[xpp] operator[=] identifier[factory] operator[SEP] identifier[newPullParser] operator[SEP] operator[SEP] operator[SEP] identifier[xpp] operator[SEP] identifier[setInput] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[encoded] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[eventType] operator[=] identifier[xpp] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[eventType] operator[!=] identifier[XmlPullParser] operator[SEP] identifier[END_DOCUMENT] operator[SEP] { Keyword[if] operator[SEP] identifier[eventType] operator[==] identifier[XmlPullParser] operator[SEP] identifier[START_TAG] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[xpp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[count] operator[=] identifier[xpp] operator[SEP] identifier[getAttributeCount] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[count] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[xpp] operator[SEP] identifier[getAttributeName] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[xpp] operator[SEP] identifier[getAttributeValue] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[eventType] operator[=] identifier[xpp] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[Log] operator[SEP] identifier[WARN] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] }
public static String concatenate(String[] values, String sepStr) { assert values != null; assert sepStr != null; // Watch for the empty case first. if (values.length == 0) { return ""; } // This handles any size >= 1. StringBuilder buffer = new StringBuilder(); boolean bFirst = true; for (String value : values) { if (bFirst) { bFirst = false; } else { buffer.append(sepStr); } buffer.append(value); } return buffer.toString(); }
class class_name[name] begin[{] method[concatenate, return_type[type[String]], modifier[public static], parameter[values, sepStr]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=sepStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) if[binary_operation[member[values.length], ==, literal[0]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuilder], buffer] local_variable[type[boolean], bFirst] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=bFirst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sepStr, 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=bFirst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[concatenate] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[values] , identifier[String] identifier[sepStr] operator[SEP] { Keyword[assert] identifier[values] operator[!=] Other[null] operator[SEP] Keyword[assert] identifier[sepStr] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[bFirst] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[value] operator[:] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[bFirst] operator[SEP] { identifier[bFirst] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[sepStr] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static int checkedCast(long value) { int valueI = (int) value; if (valueI != value) { throw new IllegalArgumentException(String.format("Overflow casting %d to an int", value)); } return valueI; }
class class_name[name] begin[{] method[checkedCast, return_type[type[int]], modifier[public static], parameter[value]] begin[{] local_variable[type[int], valueI] if[binary_operation[member[.valueI], !=, member[.value]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Overflow casting %d to an int"), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.valueI]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[checkedCast] operator[SEP] Keyword[long] identifier[value] operator[SEP] { Keyword[int] identifier[valueI] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[valueI] operator[!=] identifier[value] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[value] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[valueI] operator[SEP] }
void add(T item) { int i = nextIndex.getAndIncrement() % data.length(); data.set(i, item); }
class class_name[name] begin[{] method[add, return_type[void], modifier[default], parameter[item]] begin[{] local_variable[type[int], i] call[data.set, parameter[member[.i], member[.item]]] end[}] END[}]
Keyword[void] identifier[add] operator[SEP] identifier[T] identifier[item] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[nextIndex] operator[SEP] identifier[getAndIncrement] operator[SEP] operator[SEP] operator[%] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[item] operator[SEP] operator[SEP] }
public static Collection<Thread> findThreadsByName(final String threadName, final ThreadGroup threadGroup) { return findThreads(threadGroup, false, new NamePredicate(threadName)); }
class class_name[name] begin[{] method[findThreadsByName, return_type[type[Collection]], modifier[public static], parameter[threadName, threadGroup]] begin[{] return[call[.findThreads, parameter[member[.threadGroup], literal[false], ClassCreator(arguments=[MemberReference(member=threadName, 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=NamePredicate, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[Thread] operator[>] identifier[findThreadsByName] operator[SEP] Keyword[final] identifier[String] identifier[threadName] , Keyword[final] identifier[ThreadGroup] identifier[threadGroup] operator[SEP] { Keyword[return] identifier[findThreads] operator[SEP] identifier[threadGroup] , literal[boolean] , Keyword[new] identifier[NamePredicate] operator[SEP] identifier[threadName] operator[SEP] operator[SEP] operator[SEP] }
public static <T extends Throwable> T exceptionThrownBy( Statement statement, Class<T> type) { try { statement.evaluate(); } catch (Throwable e) { if (type.isAssignableFrom(e.getClass())) return (T) e; else throw new ExceptionWithWrongTypeThrownFailure(type, e); } throw new ExceptionNotThrownFailure(); }
class class_name[name] begin[{] method[exceptionThrownBy, return_type[type[T]], modifier[public static], parameter[statement, type]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExceptionWithWrongTypeThrownFailure, sub_type=None)), label=None), label=None, then_statement=ReturnStatement(expression=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExceptionNotThrownFailure, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Throwable] operator[>] identifier[T] identifier[exceptionThrownBy] operator[SEP] identifier[Statement] identifier[statement] , identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] { Keyword[try] { identifier[statement] operator[SEP] identifier[evaluate] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[e] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[e] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[ExceptionWithWrongTypeThrownFailure] operator[SEP] identifier[type] , identifier[e] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[ExceptionNotThrownFailure] operator[SEP] operator[SEP] operator[SEP] }
@Override public DescriptorValue calculate(IAtomContainer atomContainer) { IAtomContainer ac; try { ac = (IAtomContainer) atomContainer.clone(); } catch (CloneNotSupportedException e) { return getDummyDescriptorValue(e); } List<String> profiles = new ArrayList<String>(); // calculate the set of all rings IRingSet rs; try { rs = (new AllRingsFinder()).findAllRings(ac); } catch (CDKException e) { return getDummyDescriptorValue(e); } // check aromaticity if the descriptor parameter is set to true if (checkAromaticity) { try { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac); Aromaticity.cdkLegacy().apply(ac); } catch (CDKException e) { return getDummyDescriptorValue(e); } } // iterate over all atoms of ac for (IAtom atom : ac.atoms()) { if (atom.getSymbol().equals("N") || atom.getSymbol().equals("O") || atom.getSymbol().equals("S") || atom.getSymbol().equals("P")) { int singleBondCount = 0; int doubleBondCount = 0; int tripleBondCount = 0; int aromaticBondCount = 0; double maxBondOrder = 0; double bondOrderSum = 0; int hCount = 0; int isIn3MemberRing = 0; // counting the number of single/double/triple/aromatic bonds List<IBond> connectedBonds = ac.getConnectedBondsList(atom); for (IBond connectedBond : connectedBonds) { if (connectedBond.getFlag(CDKConstants.ISAROMATIC)) aromaticBondCount++; else if (connectedBond.getOrder() == Order.SINGLE) singleBondCount++; else if (connectedBond.getOrder() == Order.DOUBLE) doubleBondCount++; else if (connectedBond.getOrder() == Order.TRIPLE) tripleBondCount++; } int formalCharge = atom.getFormalCharge(); List<IAtom> connectedAtoms = ac.getConnectedAtomsList(atom); int numberOfNeighbours = connectedAtoms.size(); // EXPLICIT hydrogens: count the number of hydrogen atoms for (int neighbourIndex = 0; neighbourIndex < numberOfNeighbours; neighbourIndex++) if (((IAtom) connectedAtoms.get(neighbourIndex)).getSymbol().equals("H")) hCount++; // IMPLICIT hydrogens: count the number of hydrogen atoms and adjust other atom profile properties Integer implicitHAtoms = atom.getImplicitHydrogenCount(); if (implicitHAtoms == CDKConstants.UNSET) { implicitHAtoms = 0; } for (int hydrogenIndex = 0; hydrogenIndex < implicitHAtoms; hydrogenIndex++) { hCount++; numberOfNeighbours++; singleBondCount++; } // Calculate bond order sum using the counters of single/double/triple/aromatic bonds bondOrderSum += singleBondCount * 1.0; bondOrderSum += doubleBondCount * 2.0; bondOrderSum += tripleBondCount * 3.0; bondOrderSum += aromaticBondCount * 1.5; // setting maxBondOrder if (singleBondCount > 0) maxBondOrder = 1.0; if (aromaticBondCount > 0) maxBondOrder = 1.5; if (doubleBondCount > 0) maxBondOrder = 2.0; if (tripleBondCount > 0) maxBondOrder = 3.0; // isIn3MemberRing checker if (rs.contains(atom)) { IRingSet rsAtom = rs.getRings(atom); for (int ringSetIndex = 0; ringSetIndex < rsAtom.getAtomContainerCount(); ringSetIndex++) { IRing ring = (IRing) rsAtom.getAtomContainer(ringSetIndex); if (ring.getRingSize() == 3) isIn3MemberRing = 1; } } // create a profile of the current atom (atoms[atomIndex]) according to the profile definition in the constructor String profile = atom.getSymbol() + "+" + maxBondOrder + "+" + bondOrderSum + "+" + numberOfNeighbours + "+" + hCount + "+" + formalCharge + "+" + aromaticBondCount + "+" + isIn3MemberRing + "+" + singleBondCount + "+" + doubleBondCount + "+" + tripleBondCount; //logger.debug("tpsa profile: "+ profile); profiles.add(profile); } } // END OF ATOM LOOP // calculate the tpsa for the AtomContainer ac double tpsa = 0; for (int profileIndex = 0; profileIndex < profiles.size(); profileIndex++) { if (map.containsKey(profiles.get(profileIndex))) { tpsa += (Double) map.get(profiles.get(profileIndex)); //logger.debug("tpsa contribs: " + profiles.elementAt(profileIndex) + "\t" + ((Double)map.get(profiles.elementAt(profileIndex))).doubleValue()); } } profiles.clear(); // remove all profiles from the profiles-Vector //logger.debug("tpsa: " + tpsa); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(tpsa), getDescriptorNames()); }
class class_name[name] begin[{] method[calculate, return_type[type[DescriptorValue]], modifier[public], parameter[atomContainer]] begin[{] local_variable[type[IAtomContainer], ac] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=atomContainer, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IAtomContainer, sub_type=None))), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDummyDescriptorValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CloneNotSupportedException']))], finally_block=None, label=None, resources=None) local_variable[type[List], profiles] local_variable[type[IRingSet], rs] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findAllRings, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AllRingsFinder, sub_type=None))), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDummyDescriptorValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CDKException']))], finally_block=None, label=None, resources=None) if[member[.checkAromaticity]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=percieveAtomTypesAndConfigureAtoms, postfix_operators=[], prefix_operators=[], qualifier=AtomContainerManipulator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=cdkLegacy, postfix_operators=[], prefix_operators=[], qualifier=Aromaticity, selectors=[MethodInvocation(arguments=[MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDummyDescriptorValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CDKException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="N")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="O")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="S")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="P")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=singleBondCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=doubleBondCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=tripleBondCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=aromaticBondCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=maxBondOrder)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=bondOrderSum)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=hCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=isIn3MemberRing)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnectedBondsList, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), name=connectedBonds)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ISAROMATIC, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[])], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=connectedBond, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=connectedBond, selectors=[], type_arguments=None), operandr=MemberReference(member=SINGLE, postfix_operators=[], prefix_operators=[], qualifier=Order, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=connectedBond, selectors=[], type_arguments=None), operandr=MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=Order, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=connectedBond, selectors=[], type_arguments=None), operandr=MemberReference(member=TRIPLE, postfix_operators=[], prefix_operators=[], qualifier=Order, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MemberReference(member=tripleBondCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)), label=None, then_statement=StatementExpression(expression=MemberReference(member=doubleBondCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)), label=None, then_statement=StatementExpression(expression=MemberReference(member=singleBondCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)), label=None, then_statement=StatementExpression(expression=MemberReference(member=aromaticBondCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=connectedBonds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=connectedBond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFormalCharge, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), name=formalCharge)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnectedAtomsList, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), name=connectedAtoms)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=connectedAtoms, selectors=[], type_arguments=None), name=numberOfNeighbours)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=IfStatement(condition=Cast(expression=MethodInvocation(arguments=[MemberReference(member=neighbourIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=connectedAtoms, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), else_statement=None, label=None, then_statement=StatementExpression(expression=MemberReference(member=hCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=neighbourIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfNeighbours, 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=neighbourIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=neighbourIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getImplicitHydrogenCount, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), name=implicitHAtoms)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=implicitHAtoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=UNSET, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=implicitHAtoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=hCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=numberOfNeighbours, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=singleBondCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=hydrogenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=implicitHAtoms, 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=hydrogenIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=hydrogenIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bondOrderSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=singleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bondOrderSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=doubleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.0), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bondOrderSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=tripleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3.0), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bondOrderSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=aromaticBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.5), operator=*)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=singleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxBondOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aromaticBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxBondOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.5)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=doubleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxBondOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.0)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tripleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxBondOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3.0)), label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRings, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=rsAtom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IRingSet, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ringSetIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtomContainer, postfix_operators=[], prefix_operators=[], qualifier=rsAtom, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IRing, sub_type=None)), name=ring)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IRing, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRingSize, postfix_operators=[], prefix_operators=[], qualifier=ring, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=isIn3MemberRing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ringSetIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomContainerCount, postfix_operators=[], prefix_operators=[], qualifier=rsAtom, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ringSetIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ringSetIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=maxBondOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=bondOrderSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=numberOfNeighbours, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=hCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=formalCharge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=aromaticBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=isIn3MemberRing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=singleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=doubleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), operator=+), operandr=MemberReference(member=tripleBondCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=profile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=profile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=profiles, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=atoms, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))), label=None) local_variable[type[double], tpsa] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=profileIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=profiles, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tpsa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=profileIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=profiles, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=profileIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=profiles, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=profileIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=profileIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[profiles.clear, parameter[]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getSpecification, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParameterNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), ClassCreator(arguments=[MemberReference(member=tpsa, 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=DoubleResult, sub_type=None)), MethodInvocation(arguments=[], member=getDescriptorNames, 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=DescriptorValue, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescriptorValue] identifier[calculate] operator[SEP] identifier[IAtomContainer] identifier[atomContainer] operator[SEP] { identifier[IAtomContainer] identifier[ac] operator[SEP] Keyword[try] { identifier[ac] operator[=] operator[SEP] identifier[IAtomContainer] operator[SEP] identifier[atomContainer] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CloneNotSupportedException] identifier[e] operator[SEP] { Keyword[return] identifier[getDummyDescriptorValue] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[profiles] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[IRingSet] identifier[rs] operator[SEP] Keyword[try] { identifier[rs] operator[=] operator[SEP] Keyword[new] identifier[AllRingsFinder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[findAllRings] operator[SEP] identifier[ac] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CDKException] identifier[e] operator[SEP] { Keyword[return] identifier[getDummyDescriptorValue] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[checkAromaticity] operator[SEP] { Keyword[try] { identifier[AtomContainerManipulator] operator[SEP] identifier[percieveAtomTypesAndConfigureAtoms] operator[SEP] identifier[ac] operator[SEP] operator[SEP] identifier[Aromaticity] operator[SEP] identifier[cdkLegacy] operator[SEP] operator[SEP] operator[SEP] identifier[apply] operator[SEP] identifier[ac] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CDKException] identifier[e] operator[SEP] { Keyword[return] identifier[getDummyDescriptorValue] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[IAtom] identifier[atom] operator[:] identifier[ac] operator[SEP] identifier[atoms] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[int] identifier[singleBondCount] operator[=] Other[0] operator[SEP] Keyword[int] identifier[doubleBondCount] operator[=] Other[0] operator[SEP] Keyword[int] identifier[tripleBondCount] operator[=] Other[0] operator[SEP] Keyword[int] identifier[aromaticBondCount] operator[=] Other[0] operator[SEP] Keyword[double] identifier[maxBondOrder] operator[=] Other[0] operator[SEP] Keyword[double] identifier[bondOrderSum] operator[=] Other[0] operator[SEP] Keyword[int] identifier[hCount] operator[=] Other[0] operator[SEP] Keyword[int] identifier[isIn3MemberRing] operator[=] Other[0] operator[SEP] identifier[List] operator[<] identifier[IBond] operator[>] identifier[connectedBonds] operator[=] identifier[ac] operator[SEP] identifier[getConnectedBondsList] operator[SEP] identifier[atom] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IBond] identifier[connectedBond] operator[:] identifier[connectedBonds] operator[SEP] { Keyword[if] operator[SEP] identifier[connectedBond] operator[SEP] identifier[getFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[ISAROMATIC] operator[SEP] operator[SEP] identifier[aromaticBondCount] operator[++] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[connectedBond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[==] identifier[Order] operator[SEP] identifier[SINGLE] operator[SEP] identifier[singleBondCount] operator[++] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[connectedBond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[==] identifier[Order] operator[SEP] identifier[DOUBLE] operator[SEP] identifier[doubleBondCount] operator[++] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[connectedBond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[==] identifier[Order] operator[SEP] identifier[TRIPLE] operator[SEP] identifier[tripleBondCount] operator[++] operator[SEP] } Keyword[int] identifier[formalCharge] operator[=] identifier[atom] operator[SEP] identifier[getFormalCharge] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[IAtom] operator[>] identifier[connectedAtoms] operator[=] identifier[ac] operator[SEP] identifier[getConnectedAtomsList] operator[SEP] identifier[atom] operator[SEP] operator[SEP] Keyword[int] identifier[numberOfNeighbours] operator[=] identifier[connectedAtoms] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[neighbourIndex] operator[=] Other[0] operator[SEP] identifier[neighbourIndex] operator[<] identifier[numberOfNeighbours] operator[SEP] identifier[neighbourIndex] operator[++] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[IAtom] operator[SEP] identifier[connectedAtoms] operator[SEP] identifier[get] operator[SEP] identifier[neighbourIndex] operator[SEP] operator[SEP] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[hCount] operator[++] operator[SEP] identifier[Integer] identifier[implicitHAtoms] operator[=] identifier[atom] operator[SEP] identifier[getImplicitHydrogenCount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[implicitHAtoms] operator[==] identifier[CDKConstants] operator[SEP] identifier[UNSET] operator[SEP] { identifier[implicitHAtoms] operator[=] Other[0] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[hydrogenIndex] operator[=] Other[0] operator[SEP] identifier[hydrogenIndex] operator[<] identifier[implicitHAtoms] operator[SEP] identifier[hydrogenIndex] operator[++] operator[SEP] { identifier[hCount] operator[++] operator[SEP] identifier[numberOfNeighbours] operator[++] operator[SEP] identifier[singleBondCount] operator[++] operator[SEP] } identifier[bondOrderSum] operator[+=] identifier[singleBondCount] operator[*] literal[Float] operator[SEP] identifier[bondOrderSum] operator[+=] identifier[doubleBondCount] operator[*] literal[Float] operator[SEP] identifier[bondOrderSum] operator[+=] identifier[tripleBondCount] operator[*] literal[Float] operator[SEP] identifier[bondOrderSum] operator[+=] identifier[aromaticBondCount] operator[*] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[singleBondCount] operator[>] Other[0] operator[SEP] identifier[maxBondOrder] operator[=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[aromaticBondCount] operator[>] Other[0] operator[SEP] identifier[maxBondOrder] operator[=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[doubleBondCount] operator[>] Other[0] operator[SEP] identifier[maxBondOrder] operator[=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[tripleBondCount] operator[>] Other[0] operator[SEP] identifier[maxBondOrder] operator[=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[rs] operator[SEP] identifier[contains] operator[SEP] identifier[atom] operator[SEP] operator[SEP] { identifier[IRingSet] identifier[rsAtom] operator[=] identifier[rs] operator[SEP] identifier[getRings] operator[SEP] identifier[atom] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ringSetIndex] operator[=] Other[0] operator[SEP] identifier[ringSetIndex] operator[<] identifier[rsAtom] operator[SEP] identifier[getAtomContainerCount] operator[SEP] operator[SEP] operator[SEP] identifier[ringSetIndex] operator[++] operator[SEP] { identifier[IRing] identifier[ring] operator[=] operator[SEP] identifier[IRing] operator[SEP] identifier[rsAtom] operator[SEP] identifier[getAtomContainer] operator[SEP] identifier[ringSetIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ring] operator[SEP] identifier[getRingSize] operator[SEP] operator[SEP] operator[==] Other[3] operator[SEP] identifier[isIn3MemberRing] operator[=] Other[1] operator[SEP] } } identifier[String] identifier[profile] operator[=] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[maxBondOrder] operator[+] literal[String] operator[+] identifier[bondOrderSum] operator[+] literal[String] operator[+] identifier[numberOfNeighbours] operator[+] literal[String] operator[+] identifier[hCount] operator[+] literal[String] operator[+] identifier[formalCharge] operator[+] literal[String] operator[+] identifier[aromaticBondCount] operator[+] literal[String] operator[+] identifier[isIn3MemberRing] operator[+] literal[String] operator[+] identifier[singleBondCount] operator[+] literal[String] operator[+] identifier[doubleBondCount] operator[+] literal[String] operator[+] identifier[tripleBondCount] operator[SEP] identifier[profiles] operator[SEP] identifier[add] operator[SEP] identifier[profile] operator[SEP] operator[SEP] } } Keyword[double] identifier[tpsa] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[profileIndex] operator[=] Other[0] operator[SEP] identifier[profileIndex] operator[<] identifier[profiles] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[profileIndex] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[map] operator[SEP] identifier[containsKey] operator[SEP] identifier[profiles] operator[SEP] identifier[get] operator[SEP] identifier[profileIndex] operator[SEP] operator[SEP] operator[SEP] { identifier[tpsa] operator[+=] operator[SEP] identifier[Double] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[profiles] operator[SEP] identifier[get] operator[SEP] identifier[profileIndex] operator[SEP] operator[SEP] operator[SEP] } } identifier[profiles] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DescriptorValue] operator[SEP] identifier[getSpecification] operator[SEP] operator[SEP] , identifier[getParameterNames] operator[SEP] operator[SEP] , identifier[getParameters] operator[SEP] operator[SEP] , Keyword[new] identifier[DoubleResult] operator[SEP] identifier[tpsa] operator[SEP] , identifier[getDescriptorNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private static List<Object> processMultiBulkReply(final RedisInputStream is) { int num = Integer.parseInt(is.readLine()); log.trace("[RedisProtocol] Reply multi-bulk-reply. *{}", num); if (num == -1) { return null; } List<Object> ret = new ArrayList<Object>(num); for (int i = 0; i < num; i++) { try { ret.add(process(is)); } catch (JedisDataException e) { ret.add(e); } } return ret; }
class class_name[name] begin[{] method[processMultiBulkReply, return_type[type[List]], modifier[private static], parameter[is]] begin[{] local_variable[type[int], num] call[log.trace, parameter[literal["[RedisProtocol] Reply multi-bulk-reply. *{}"], member[.num]]] if[binary_operation[member[.num], ==, literal[1]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], ret] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JedisDataException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=num, 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[.ret]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Object] operator[>] identifier[processMultiBulkReply] operator[SEP] Keyword[final] identifier[RedisInputStream] identifier[is] operator[SEP] { Keyword[int] identifier[num] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[is] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[num] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[num] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[Object] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] identifier[num] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[num] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[try] { identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[process] operator[SEP] identifier[is] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JedisDataException] identifier[e] operator[SEP] { identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[ret] operator[SEP] }
public CallOptions withExecutor(@Nullable Executor executor) { CallOptions newOptions = new CallOptions(this); newOptions.executor = executor; return newOptions; }
class class_name[name] begin[{] method[withExecutor, return_type[type[CallOptions]], modifier[public], parameter[executor]] begin[{] local_variable[type[CallOptions], newOptions] assign[member[newOptions.executor], member[.executor]] return[member[.newOptions]] end[}] END[}]
Keyword[public] identifier[CallOptions] identifier[withExecutor] operator[SEP] annotation[@] identifier[Nullable] identifier[Executor] identifier[executor] operator[SEP] { identifier[CallOptions] identifier[newOptions] operator[=] Keyword[new] identifier[CallOptions] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[newOptions] operator[SEP] identifier[executor] operator[=] identifier[executor] operator[SEP] Keyword[return] identifier[newOptions] operator[SEP] }
private void resize(int newSize) { char [][]newKeys = new char[newSize][]; int []newValues = new int[newSize]; _mask = newKeys.length - 1; for (int i = 0; i < _keys.length; i++) { char []key = _keys[i]; if (key == null) continue; int hash = hash(key, key.length) & _mask; while (true) { if (newKeys[hash] == null) { newKeys[hash] = _keys[i]; newValues[hash] = _values[i]; break; } hash = (hash + 1) & _mask; } } _keys = newKeys; _values = newValues; }
class class_name[name] begin[{] method[resize, return_type[void], modifier[private], parameter[newSize]] begin[{] local_variable[type[char], newKeys] local_variable[type[int], newValues] assign[member[._mask], binary_operation[member[newKeys.length], -, literal[1]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=_keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=key)], modifiers=set(), type=BasicType(dimensions=[None], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=key, 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=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[])], member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=_mask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), name=hash)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=hash, 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=newKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=_keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=newValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=_values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=_mask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&)), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=_keys, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[._keys], member[.newKeys]] assign[member[._values], member[.newValues]] end[}] END[}]
Keyword[private] Keyword[void] identifier[resize] operator[SEP] Keyword[int] identifier[newSize] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[newKeys] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[newSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[newValues] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[newSize] operator[SEP] operator[SEP] identifier[_mask] operator[=] identifier[newKeys] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_keys] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] identifier[key] operator[=] identifier[_keys] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[int] identifier[hash] operator[=] identifier[hash] operator[SEP] identifier[key] , identifier[key] operator[SEP] identifier[length] operator[SEP] operator[&] identifier[_mask] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[newKeys] operator[SEP] identifier[hash] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[newKeys] operator[SEP] identifier[hash] operator[SEP] operator[=] identifier[_keys] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[newValues] operator[SEP] identifier[hash] operator[SEP] operator[=] identifier[_values] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[hash] operator[=] operator[SEP] identifier[hash] operator[+] Other[1] operator[SEP] operator[&] identifier[_mask] operator[SEP] } } identifier[_keys] operator[=] identifier[newKeys] operator[SEP] identifier[_values] operator[=] identifier[newValues] operator[SEP] }
public AppServiceCertificateResourceInner updateCertificate(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificatePatchResource keyVaultCertificate) { return updateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).toBlocking().single().body(); }
class class_name[name] begin[{] method[updateCertificate, return_type[type[AppServiceCertificateResourceInner]], modifier[public], parameter[resourceGroupName, certificateOrderName, name, keyVaultCertificate]] begin[{] return[call[.updateCertificateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.certificateOrderName], member[.name], member[.keyVaultCertificate]]]] end[}] END[}]
Keyword[public] identifier[AppServiceCertificateResourceInner] identifier[updateCertificate] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[certificateOrderName] , identifier[String] identifier[name] , identifier[AppServiceCertificatePatchResource] identifier[keyVaultCertificate] operator[SEP] { Keyword[return] identifier[updateCertificateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[certificateOrderName] , identifier[name] , identifier[keyVaultCertificate] 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 double logcdf(double x, double k, double theta, double shift) { final double e = FastMath.exp((x - shift) * theta); return e < Double.POSITIVE_INFINITY ? GammaDistribution.logregularizedGammaP(k, e) : 0.; }
class class_name[name] begin[{] method[logcdf, return_type[type[double]], modifier[public static], parameter[x, k, theta, shift]] begin[{] local_variable[type[double], e] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=POSITIVE_INFINITY, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.), if_true=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logregularizedGammaP, postfix_operators=[], prefix_operators=[], qualifier=GammaDistribution, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[logcdf] operator[SEP] Keyword[double] identifier[x] , Keyword[double] identifier[k] , Keyword[double] identifier[theta] , Keyword[double] identifier[shift] operator[SEP] { Keyword[final] Keyword[double] identifier[e] operator[=] identifier[FastMath] operator[SEP] identifier[exp] operator[SEP] operator[SEP] identifier[x] operator[-] identifier[shift] operator[SEP] operator[*] identifier[theta] operator[SEP] operator[SEP] Keyword[return] identifier[e] operator[<] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[?] identifier[GammaDistribution] operator[SEP] identifier[logregularizedGammaP] operator[SEP] identifier[k] , identifier[e] operator[SEP] operator[:] literal[Float] operator[SEP] }
@Setup(Level.Trial) public void setup() throws Exception { test = benchmarks.get(list + "-" + type); if (test == null) { throw new RuntimeException("Can't find requested test " + list + " " + type); } test.setSize(size); test.setRandomSeed(size); // TODO Use iteration some how test.setup(); }
class class_name[name] begin[{] method[setup, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.test], call[benchmarks.get, parameter[binary_operation[binary_operation[member[.list], +, literal["-"]], +, member[.type]]]]] if[binary_operation[member[.test], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't find requested test "), operandr=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MemberReference(member=type, 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=RuntimeException, sub_type=None)), label=None) else begin[{] None end[}] call[test.setSize, parameter[member[.size]]] call[test.setRandomSeed, parameter[member[.size]]] call[test.setup, parameter[]] end[}] END[}]
annotation[@] identifier[Setup] operator[SEP] identifier[Level] operator[SEP] identifier[Trial] operator[SEP] Keyword[public] Keyword[void] identifier[setup] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[test] operator[=] identifier[benchmarks] operator[SEP] identifier[get] operator[SEP] identifier[list] operator[+] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[test] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[list] operator[+] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP] } identifier[test] operator[SEP] identifier[setSize] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[test] operator[SEP] identifier[setRandomSeed] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[test] operator[SEP] identifier[setup] operator[SEP] operator[SEP] operator[SEP] }
public void setJsonCredentialsFile(String jsonCredentialsPath) { if (!Utility.isNullOrEmpty(jsonCredentialsPath)) { setJsonCredentialsFile(new File(jsonCredentialsPath)); } else { setJsonCredentialsFile((File) null); } }
class class_name[name] begin[{] method[setJsonCredentialsFile, return_type[void], modifier[public], parameter[jsonCredentialsPath]] begin[{] if[call[Utility.isNullOrEmpty, parameter[member[.jsonCredentialsPath]]]] begin[{] call[.setJsonCredentialsFile, parameter[ClassCreator(arguments=[MemberReference(member=jsonCredentialsPath, 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=File, sub_type=None))]] else begin[{] call[.setJsonCredentialsFile, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setJsonCredentialsFile] operator[SEP] identifier[String] identifier[jsonCredentialsPath] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Utility] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[jsonCredentialsPath] operator[SEP] operator[SEP] { identifier[setJsonCredentialsFile] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[jsonCredentialsPath] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[setJsonCredentialsFile] operator[SEP] operator[SEP] identifier[File] operator[SEP] Other[null] operator[SEP] operator[SEP] } }
@Pure public static URL convertFileToURL(File file) { if (file == null) { return null; } try { File thefile = file; if (isWindowsNativeFilename(file.toString())) { thefile = normalizeWindowsNativeFilename(file.toString()); if (thefile == null) { thefile = file; } } final URL url; if (thefile.isAbsolute()) { url = thefile.toURI().toURL(); } else { url = new URL(URISchemeType.FILE.name(), "", thefile.toString()); //$NON-NLS-1$ } return toShortestURL(url); } catch (MalformedURLException e) { return null; } }
class class_name[name] begin[{] method[convertFileToURL, return_type[type[URL]], modifier[public static], parameter[file]] begin[{] if[binary_operation[member[.file], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=thefile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], member=isWindowsNativeFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=thefile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], member=normalizeWindowsNativeFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=thefile, 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=thefile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=url)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isAbsolute, postfix_operators=[], prefix_operators=[], qualifier=thefile, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=URISchemeType.FILE, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=thefile, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=thefile, selectors=[MethodInvocation(arguments=[], member=toURL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toShortestURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] identifier[URL] identifier[convertFileToURL] operator[SEP] identifier[File] identifier[file] operator[SEP] { Keyword[if] operator[SEP] identifier[file] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { identifier[File] identifier[thefile] operator[=] identifier[file] operator[SEP] Keyword[if] operator[SEP] identifier[isWindowsNativeFilename] operator[SEP] identifier[file] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[thefile] operator[=] identifier[normalizeWindowsNativeFilename] operator[SEP] identifier[file] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thefile] operator[==] Other[null] operator[SEP] { identifier[thefile] operator[=] identifier[file] operator[SEP] } } Keyword[final] identifier[URL] identifier[url] operator[SEP] Keyword[if] operator[SEP] identifier[thefile] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] { identifier[url] operator[=] identifier[thefile] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[URISchemeType] operator[SEP] identifier[FILE] operator[SEP] identifier[name] operator[SEP] operator[SEP] , literal[String] , identifier[thefile] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[toShortestURL] operator[SEP] identifier[url] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public EClass getResourceObjectInclude() { if (resourceObjectIncludeEClass == null) { resourceObjectIncludeEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(529); } return resourceObjectIncludeEClass; }
class class_name[name] begin[{] method[getResourceObjectInclude, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.resourceObjectIncludeEClass], ==, literal[null]]] begin[{] assign[member[.resourceObjectIncludeEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=529)], 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[.resourceObjectIncludeEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getResourceObjectInclude] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceObjectIncludeEClass] operator[==] Other[null] operator[SEP] { identifier[resourceObjectIncludeEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[AfplibPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[529] operator[SEP] operator[SEP] } Keyword[return] identifier[resourceObjectIncludeEClass] operator[SEP] }
private void writeMessage(ModbusMessage msg) throws ModbusIOException { open(); notifyListenersBeforeWrite(msg); writeMessageOut(msg); long startTime = System.nanoTime(); // Wait here for the message to have been sent double bytesPerSec = commPort.getBaudRate() / (((commPort.getNumDataBits() == 0) ? 8 : commPort.getNumDataBits()) + ((commPort.getNumStopBits() == 0) ? 1 : commPort.getNumStopBits()) + ((commPort.getParity() == SerialPort.NO_PARITY) ? 0 : 1)); double delay = 1000000000.0 * msg.getOutputLength() / bytesPerSec; double delayMilliSeconds = Math.floor(delay / 1000000); double delayNanoSeconds = delay % 1000000; try { // For delays less than a millisecond, we need to chew CPU cycles unfortunately // There are some fiddle factors here to allow for some oddities in the hardware if (delayMilliSeconds == 0.0) { int priority = Thread.currentThread().getPriority(); Thread.currentThread().setPriority(Thread.MIN_PRIORITY); long end = startTime + ((int) (delayNanoSeconds * 1.3)); while (System.nanoTime() < end) { // noop } Thread.currentThread().setPriority(priority); } else { Thread.sleep((int) (delayMilliSeconds * 1.4), (int) delayNanoSeconds); } } catch (Exception e) { logger.debug("nothing to do"); } notifyListenersAfterWrite(msg); }
class class_name[name] begin[{] method[writeMessage, return_type[void], modifier[private], parameter[msg]] begin[{] call[.open, parameter[]] call[.notifyListenersBeforeWrite, parameter[member[.msg]]] call[.writeMessageOut, parameter[member[.msg]]] local_variable[type[long], startTime] local_variable[type[double], bytesPerSec] local_variable[type[double], delay] local_variable[type[double], delayMilliSeconds] local_variable[type[double], delayNanoSeconds] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=delayMilliSeconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=BinaryOperation(operandl=MemberReference(member=delayMilliSeconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.4), operator=*), type=BasicType(dimensions=[], name=int)), Cast(expression=MemberReference(member=delayNanoSeconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=getPriority, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=priority)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[MemberReference(member=MIN_PRIORITY, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[])], member=setPriority, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=startTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=BinaryOperation(operandl=MemberReference(member=delayNanoSeconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.3), operator=*), type=BasicType(dimensions=[], name=int)), operator=+), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=long)), WhileStatement(body=BlockStatement(label=None, statements=[]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=nanoTime, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setPriority, 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="nothing to do")], member=debug, 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) call[.notifyListenersAfterWrite, parameter[member[.msg]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[writeMessage] operator[SEP] identifier[ModbusMessage] identifier[msg] operator[SEP] Keyword[throws] identifier[ModbusIOException] { identifier[open] operator[SEP] operator[SEP] operator[SEP] identifier[notifyListenersBeforeWrite] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[writeMessageOut] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[long] identifier[startTime] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[bytesPerSec] operator[=] identifier[commPort] operator[SEP] identifier[getBaudRate] operator[SEP] operator[SEP] operator[/] operator[SEP] operator[SEP] operator[SEP] identifier[commPort] operator[SEP] identifier[getNumDataBits] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[?] Other[8] operator[:] identifier[commPort] operator[SEP] identifier[getNumDataBits] operator[SEP] operator[SEP] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[commPort] operator[SEP] identifier[getNumStopBits] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[?] Other[1] operator[:] identifier[commPort] operator[SEP] identifier[getNumStopBits] operator[SEP] operator[SEP] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[commPort] operator[SEP] identifier[getParity] operator[SEP] operator[SEP] operator[==] identifier[SerialPort] operator[SEP] identifier[NO_PARITY] operator[SEP] operator[?] Other[0] operator[:] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[delay] operator[=] literal[Float] operator[*] identifier[msg] operator[SEP] identifier[getOutputLength] operator[SEP] operator[SEP] operator[/] identifier[bytesPerSec] operator[SEP] Keyword[double] identifier[delayMilliSeconds] operator[=] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[delay] operator[/] Other[1000000] operator[SEP] operator[SEP] Keyword[double] identifier[delayNanoSeconds] operator[=] identifier[delay] operator[%] Other[1000000] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[delayMilliSeconds] operator[==] literal[Float] operator[SEP] { Keyword[int] identifier[priority] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getPriority] operator[SEP] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setPriority] operator[SEP] identifier[Thread] operator[SEP] identifier[MIN_PRIORITY] operator[SEP] operator[SEP] Keyword[long] identifier[end] operator[=] identifier[startTime] operator[+] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[delayNanoSeconds] operator[*] literal[Float] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[<] identifier[end] operator[SEP] { } identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setPriority] operator[SEP] identifier[priority] operator[SEP] operator[SEP] } Keyword[else] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[delayMilliSeconds] operator[*] literal[Float] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[delayNanoSeconds] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[notifyListenersAfterWrite] operator[SEP] identifier[msg] operator[SEP] operator[SEP] }
private static boolean isEpicChanged(Feature feature, Epic epic) { if (!feature.getsEpicAssetState().equalsIgnoreCase(epic.getStatus())) { return true; } if (!feature.getsEpicName().equalsIgnoreCase(epic.getName()) || !feature.getsEpicNumber().equalsIgnoreCase(epic.getNumber())) { return true; } if (!StringUtils.isEmpty(feature.getChangeDate()) && !StringUtils.isEmpty(epic.getChangeDate()) && !Objects.equals(Utilities.parseDateWithoutFraction(feature.getChangeDate()), Utilities.parseDateWithoutFraction(epic.getChangeDate()))) { return true; } if (!StringUtils.isEmpty(feature.getsEpicBeginDate()) && !StringUtils.isEmpty(epic.getBeginDate()) && !Objects.equals(Utilities.parseDateWithoutFraction(feature.getsEpicBeginDate()), Utilities.parseDateWithoutFraction(epic.getBeginDate()))) { return true; } return !StringUtils.isEmpty(feature.getsEpicEndDate()) && !StringUtils.isEmpty(epic.getEndDate()) && !Objects.equals(Utilities.parseDateWithoutFraction(feature.getsEpicEndDate()), Utilities.parseDateWithoutFraction(epic.getEndDate())); }
class class_name[name] begin[{] method[isEpicChanged, return_type[type[boolean]], modifier[private static], parameter[feature, epic]] begin[{] if[call[feature.getsEpicAssetState, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[call[feature.getsEpicName, parameter[]], ||, call[feature.getsEpicNumber, parameter[]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[call[StringUtils.isEmpty, parameter[call[feature.getChangeDate, parameter[]]]], &&, call[StringUtils.isEmpty, parameter[call[epic.getChangeDate, parameter[]]]]], &&, call[Objects.equals, parameter[call[Utilities.parseDateWithoutFraction, parameter[call[feature.getChangeDate, parameter[]]]], call[Utilities.parseDateWithoutFraction, parameter[call[epic.getChangeDate, parameter[]]]]]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[call[StringUtils.isEmpty, parameter[call[feature.getsEpicBeginDate, parameter[]]]], &&, call[StringUtils.isEmpty, parameter[call[epic.getBeginDate, parameter[]]]]], &&, call[Objects.equals, parameter[call[Utilities.parseDateWithoutFraction, parameter[call[feature.getsEpicBeginDate, parameter[]]]], call[Utilities.parseDateWithoutFraction, parameter[call[epic.getBeginDate, parameter[]]]]]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[binary_operation[binary_operation[call[StringUtils.isEmpty, parameter[call[feature.getsEpicEndDate, parameter[]]]], &&, call[StringUtils.isEmpty, parameter[call[epic.getEndDate, parameter[]]]]], &&, call[Objects.equals, parameter[call[Utilities.parseDateWithoutFraction, parameter[call[feature.getsEpicEndDate, parameter[]]]], call[Utilities.parseDateWithoutFraction, parameter[call[epic.getEndDate, parameter[]]]]]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isEpicChanged] operator[SEP] identifier[Feature] identifier[feature] , identifier[Epic] identifier[epic] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[feature] operator[SEP] identifier[getsEpicAssetState] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[epic] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[feature] operator[SEP] identifier[getsEpicName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[epic] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[!] identifier[feature] operator[SEP] identifier[getsEpicNumber] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[epic] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[feature] operator[SEP] identifier[getChangeDate] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[epic] operator[SEP] identifier[getChangeDate] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[Utilities] operator[SEP] identifier[parseDateWithoutFraction] operator[SEP] identifier[feature] operator[SEP] identifier[getChangeDate] operator[SEP] operator[SEP] operator[SEP] , identifier[Utilities] operator[SEP] identifier[parseDateWithoutFraction] operator[SEP] identifier[epic] operator[SEP] identifier[getChangeDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[feature] operator[SEP] identifier[getsEpicBeginDate] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[epic] operator[SEP] identifier[getBeginDate] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[Utilities] operator[SEP] identifier[parseDateWithoutFraction] operator[SEP] identifier[feature] operator[SEP] identifier[getsEpicBeginDate] operator[SEP] operator[SEP] operator[SEP] , identifier[Utilities] operator[SEP] identifier[parseDateWithoutFraction] operator[SEP] identifier[epic] operator[SEP] identifier[getBeginDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[feature] operator[SEP] identifier[getsEpicEndDate] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[epic] operator[SEP] identifier[getEndDate] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[Utilities] operator[SEP] identifier[parseDateWithoutFraction] operator[SEP] identifier[feature] operator[SEP] identifier[getsEpicEndDate] operator[SEP] operator[SEP] operator[SEP] , identifier[Utilities] operator[SEP] identifier[parseDateWithoutFraction] operator[SEP] identifier[epic] operator[SEP] identifier[getEndDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public Point getCenter() { Point upperLeft = this.getLocation(); Dimension dimensions = this.getSize(); return new Point(upperLeft.getX() + dimensions.getWidth() / 2, upperLeft.getY() + dimensions.getHeight() / 2); }
class class_name[name] begin[{] method[getCenter, return_type[type[Point]], modifier[public], parameter[]] begin[{] local_variable[type[Point], upperLeft] local_variable[type[Dimension], dimensions] return[ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=upperLeft, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=dimensions, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operator=+), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getY, postfix_operators=[], prefix_operators=[], qualifier=upperLeft, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=dimensions, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Point] identifier[getCenter] operator[SEP] operator[SEP] { identifier[Point] identifier[upperLeft] operator[=] Keyword[this] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] identifier[Dimension] identifier[dimensions] operator[=] Keyword[this] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Point] operator[SEP] identifier[upperLeft] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[+] identifier[dimensions] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[/] Other[2] , identifier[upperLeft] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[+] identifier[dimensions] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[/] Other[2] operator[SEP] operator[SEP] }
public static CommercePriceListUserSegmentEntryRel fetchByUuid_First( String uuid, OrderByComparator<CommercePriceListUserSegmentEntryRel> orderByComparator) { return getPersistence().fetchByUuid_First(uuid, orderByComparator); }
class class_name[name] begin[{] method[fetchByUuid_First, return_type[type[CommercePriceListUserSegmentEntryRel]], modifier[public static], parameter[uuid, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommercePriceListUserSegmentEntryRel] identifier[fetchByUuid_First] operator[SEP] identifier[String] identifier[uuid] , identifier[OrderByComparator] operator[<] identifier[CommercePriceListUserSegmentEntryRel] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByUuid_First] operator[SEP] identifier[uuid] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public static <T> Collection<T> immutableCollectionCopy(Collection<T> collection) { if (collection == null) return null; if (collection.isEmpty()) return Collections.emptySet(); if (collection.size() == 1) return Collections.singleton(collection.iterator().next()); Collection<? extends T> copy = ObjectDuplicator.duplicateCollection(collection); if (copy == null) copy = attemptCopyConstructor(collection, Collection.class); if (copy == null) copy = new ArrayList<>(collection); return new ImmutableCollectionWrapper<>(copy); }
class class_name[name] begin[{] method[immutableCollectionCopy, return_type[type[Collection]], modifier[public static], parameter[collection]] begin[{] if[binary_operation[member[.collection], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[collection.isEmpty, parameter[]]] begin[{] return[call[Collections.emptySet, parameter[]]] else begin[{] None end[}] if[binary_operation[call[collection.size, parameter[]], ==, literal[1]]] begin[{] return[call[Collections.singleton, parameter[call[collection.iterator, parameter[]]]]] else begin[{] None end[}] local_variable[type[Collection], copy] if[binary_operation[member[.copy], ==, literal[null]]] begin[{] assign[member[.copy], call[.attemptCopyConstructor, parameter[member[.collection], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Collection, sub_type=None))]]] else begin[{] None end[}] if[binary_operation[member[.copy], ==, literal[null]]] begin[{] assign[member[.copy], ClassCreator(arguments=[MemberReference(member=collection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=copy, 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=ImmutableCollectionWrapper, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Collection] operator[<] identifier[T] operator[>] identifier[immutableCollectionCopy] operator[SEP] identifier[Collection] operator[<] identifier[T] operator[>] identifier[collection] operator[SEP] { Keyword[if] operator[SEP] identifier[collection] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[collection] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[collection] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[singleton] operator[SEP] identifier[collection] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[copy] operator[=] identifier[ObjectDuplicator] operator[SEP] identifier[duplicateCollection] operator[SEP] identifier[collection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[copy] operator[==] Other[null] operator[SEP] identifier[copy] operator[=] identifier[attemptCopyConstructor] operator[SEP] identifier[collection] , identifier[Collection] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[copy] operator[==] Other[null] operator[SEP] identifier[copy] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[collection] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ImmutableCollectionWrapper] operator[<] operator[>] operator[SEP] identifier[copy] operator[SEP] operator[SEP] }
public static ImmutableList<JoinOrFilterNode> extractFilterAndInnerJoinNodes(InnerJoinNode topJoinNode, IntermediateQuery query) { ImmutableList.Builder<JoinOrFilterNode> joinAndFilterNodeBuilder = ImmutableList.builder(); Queue<JoinOrFilterNode> nodesToExplore = new LinkedList<>(); nodesToExplore.add(topJoinNode); joinAndFilterNodeBuilder.add(topJoinNode); while (!nodesToExplore.isEmpty()) { JoinOrFilterNode joinNode = nodesToExplore.poll(); /** * Children: only considers the inner joins and the filter nodes. */ for (QueryNode child : query.getChildren(joinNode)) { if ((child instanceof InnerJoinNode) || (child instanceof FilterNode)) { JoinOrFilterNode joinOrFilterChild = (JoinOrFilterNode) child; // Continues exploring nodesToExplore.add(joinOrFilterChild); joinAndFilterNodeBuilder.add(joinOrFilterChild); } } } return joinAndFilterNodeBuilder.build(); }
class class_name[name] begin[{] method[extractFilterAndInnerJoinNodes, return_type[type[ImmutableList]], modifier[public static], parameter[topJoinNode, query]] begin[{] local_variable[type[ImmutableList], joinAndFilterNodeBuilder] local_variable[type[Queue], nodesToExplore] call[nodesToExplore.add, parameter[member[.topJoinNode]]] call[joinAndFilterNodeBuilder.add, parameter[member[.topJoinNode]]] while[call[nodesToExplore.isEmpty, parameter[]]] begin[{] local_variable[type[JoinOrFilterNode], joinNode] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=InnerJoinNode, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=FilterNode, sub_type=None), operator=instanceof), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JoinOrFilterNode, sub_type=None)), name=joinOrFilterChild)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JoinOrFilterNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=joinOrFilterChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=nodesToExplore, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=joinOrFilterChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=joinAndFilterNodeBuilder, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=joinNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryNode, sub_type=None))), label=None) end[}] return[call[joinAndFilterNodeBuilder.build, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ImmutableList] operator[<] identifier[JoinOrFilterNode] operator[>] identifier[extractFilterAndInnerJoinNodes] operator[SEP] identifier[InnerJoinNode] identifier[topJoinNode] , identifier[IntermediateQuery] identifier[query] operator[SEP] { identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[JoinOrFilterNode] operator[>] identifier[joinAndFilterNodeBuilder] operator[=] identifier[ImmutableList] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[Queue] operator[<] identifier[JoinOrFilterNode] operator[>] identifier[nodesToExplore] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[nodesToExplore] operator[SEP] identifier[add] operator[SEP] identifier[topJoinNode] operator[SEP] operator[SEP] identifier[joinAndFilterNodeBuilder] operator[SEP] identifier[add] operator[SEP] identifier[topJoinNode] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[nodesToExplore] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JoinOrFilterNode] identifier[joinNode] operator[=] identifier[nodesToExplore] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[QueryNode] identifier[child] operator[:] identifier[query] operator[SEP] identifier[getChildren] operator[SEP] identifier[joinNode] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[child] Keyword[instanceof] identifier[InnerJoinNode] operator[SEP] operator[||] operator[SEP] identifier[child] Keyword[instanceof] identifier[FilterNode] operator[SEP] operator[SEP] { identifier[JoinOrFilterNode] identifier[joinOrFilterChild] operator[=] operator[SEP] identifier[JoinOrFilterNode] operator[SEP] identifier[child] operator[SEP] identifier[nodesToExplore] operator[SEP] identifier[add] operator[SEP] identifier[joinOrFilterChild] operator[SEP] operator[SEP] identifier[joinAndFilterNodeBuilder] operator[SEP] identifier[add] operator[SEP] identifier[joinOrFilterChild] operator[SEP] operator[SEP] } } } Keyword[return] identifier[joinAndFilterNodeBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public List<SearchResult> search(String query) throws MovieMeterException { String url = buildSearchUrl(query); try { return mapper.readValue(requestWebPage(url), new TypeReference<List<SearchResult>>() { }); } catch (IOException ex) { throw new MovieMeterException(ApiExceptionType.MAPPING_FAILED, "Failed to map search results", url, ex); } }
class class_name[name] begin[{] method[search, return_type[type[List]], modifier[public], parameter[query]] begin[{] local_variable[type[String], url] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requestWebPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SearchResult, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=TypeReference, sub_type=None))], member=readValue, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=MAPPING_FAILED, postfix_operators=[], prefix_operators=[], qualifier=ApiExceptionType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to map search results"), MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MovieMeterException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[SearchResult] operator[>] identifier[search] operator[SEP] identifier[String] identifier[query] operator[SEP] Keyword[throws] identifier[MovieMeterException] { identifier[String] identifier[url] operator[=] identifier[buildSearchUrl] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[mapper] operator[SEP] identifier[readValue] operator[SEP] identifier[requestWebPage] operator[SEP] identifier[url] operator[SEP] , Keyword[new] identifier[TypeReference] operator[<] identifier[List] operator[<] identifier[SearchResult] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[MovieMeterException] operator[SEP] identifier[ApiExceptionType] operator[SEP] identifier[MAPPING_FAILED] , literal[String] , identifier[url] , identifier[ex] operator[SEP] operator[SEP] } }
@Deprecated public static DataSource getDataSource(String name) { if (PORTAL_DB.equals(name)) { return PortalDbLocator.getPortalDb(); } final ApplicationContext applicationContext = PortalApplicationContextLocator.getApplicationContext(); final DataSource dataSource = (DataSource) applicationContext.getBean(name, DataSource.class); return dataSource; }
class class_name[name] begin[{] method[getDataSource, return_type[type[DataSource]], modifier[public static], parameter[name]] begin[{] if[call[PORTAL_DB.equals, parameter[member[.name]]]] begin[{] return[call[PortalDbLocator.getPortalDb, parameter[]]] else begin[{] None end[}] local_variable[type[ApplicationContext], applicationContext] local_variable[type[DataSource], dataSource] return[member[.dataSource]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[DataSource] identifier[getDataSource] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[PORTAL_DB] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[return] identifier[PortalDbLocator] operator[SEP] identifier[getPortalDb] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[ApplicationContext] identifier[applicationContext] operator[=] identifier[PortalApplicationContextLocator] operator[SEP] identifier[getApplicationContext] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[DataSource] identifier[dataSource] operator[=] operator[SEP] identifier[DataSource] operator[SEP] identifier[applicationContext] operator[SEP] identifier[getBean] operator[SEP] identifier[name] , identifier[DataSource] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[dataSource] operator[SEP] }
public void setProperty(String strProperty, String strValue) { if (strValue != null) m_properties.put(strProperty, strValue); else m_properties.remove(strProperty); }
class class_name[name] begin[{] method[setProperty, return_type[void], modifier[public], parameter[strProperty, strValue]] begin[{] if[binary_operation[member[.strValue], !=, literal[null]]] begin[{] call[m_properties.put, parameter[member[.strProperty], member[.strValue]]] else begin[{] call[m_properties.remove, parameter[member[.strProperty]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setProperty] operator[SEP] identifier[String] identifier[strProperty] , identifier[String] identifier[strValue] operator[SEP] { Keyword[if] operator[SEP] identifier[strValue] operator[!=] Other[null] operator[SEP] identifier[m_properties] operator[SEP] identifier[put] operator[SEP] identifier[strProperty] , identifier[strValue] operator[SEP] operator[SEP] Keyword[else] identifier[m_properties] operator[SEP] identifier[remove] operator[SEP] identifier[strProperty] operator[SEP] operator[SEP] }
@Override public DescribeConfigRulesResult describeConfigRules(DescribeConfigRulesRequest request) { request = beforeClientExecution(request); return executeDescribeConfigRules(request); }
class class_name[name] begin[{] method[describeConfigRules, return_type[type[DescribeConfigRulesResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDescribeConfigRules, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescribeConfigRulesResult] identifier[describeConfigRules] operator[SEP] identifier[DescribeConfigRulesRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeConfigRules] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public Criteria all(Collection<?> c) { notNull(c, "collection can not be null"); this.criteriaType = RelationalOperator.ALL; this.right = new ValueListNode(c); return this; }
class class_name[name] begin[{] method[all, return_type[type[Criteria]], modifier[public], parameter[c]] begin[{] call[.notNull, parameter[member[.c], literal["collection can not be null"]]] assign[THIS[member[None.criteriaType]], member[RelationalOperator.ALL]] assign[THIS[member[None.right]], ClassCreator(arguments=[MemberReference(member=c, 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=ValueListNode, sub_type=None))] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Criteria] identifier[all] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] identifier[c] operator[SEP] { identifier[notNull] operator[SEP] identifier[c] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[criteriaType] operator[=] identifier[RelationalOperator] operator[SEP] identifier[ALL] operator[SEP] Keyword[this] operator[SEP] identifier[right] operator[=] Keyword[new] identifier[ValueListNode] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static boolean isPointNearMultiLatLng(LatLng point, MultiLatLng multiLatLng, double tolerance) { boolean near = false; for (LatLng multiPoint : multiLatLng.getLatLngs()) { near = isPointNearPoint(point, multiPoint, tolerance); if (near) { break; } } return near; }
class class_name[name] begin[{] method[isPointNearMultiLatLng, return_type[type[boolean]], modifier[public static], parameter[point, multiLatLng, tolerance]] begin[{] local_variable[type[boolean], near] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=near, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=point, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=multiPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPointNearPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=near, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getLatLngs, postfix_operators=[], prefix_operators=[], qualifier=multiLatLng, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=multiPoint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LatLng, sub_type=None))), label=None) return[member[.near]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isPointNearMultiLatLng] operator[SEP] identifier[LatLng] identifier[point] , identifier[MultiLatLng] identifier[multiLatLng] , Keyword[double] identifier[tolerance] operator[SEP] { Keyword[boolean] identifier[near] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[LatLng] identifier[multiPoint] operator[:] identifier[multiLatLng] operator[SEP] identifier[getLatLngs] operator[SEP] operator[SEP] operator[SEP] { identifier[near] operator[=] identifier[isPointNearPoint] operator[SEP] identifier[point] , identifier[multiPoint] , identifier[tolerance] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[near] operator[SEP] { Keyword[break] operator[SEP] } } Keyword[return] identifier[near] operator[SEP] }
public java.util.List<VolumeInfo> getVolumeInfos() { if (volumeInfos == null) { volumeInfos = new com.amazonaws.internal.SdkInternalList<VolumeInfo>(); } return volumeInfos; }
class class_name[name] begin[{] method[getVolumeInfos, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.volumeInfos], ==, literal[null]]] begin[{] assign[member[.volumeInfos], ClassCreator(arguments=[], 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=VolumeInfo, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.volumeInfos]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[VolumeInfo] operator[>] identifier[getVolumeInfos] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[volumeInfos] operator[==] Other[null] operator[SEP] { identifier[volumeInfos] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[VolumeInfo] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[volumeInfos] operator[SEP] }
public void marshall(ListProjectsRequest listProjectsRequest, ProtocolMarshaller protocolMarshaller) { if (listProjectsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listProjectsRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listProjectsRequest.getNextToken(), NEXTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[listProjectsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listProjectsRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=listProjectsRequest, selectors=[], type_arguments=None), MemberReference(member=MAXRESULTS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=listProjectsRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[ListProjectsRequest] identifier[listProjectsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listProjectsRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listProjectsRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listProjectsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override protected void serializeObject( JsonWriter writer, T value, JsonSerializationContext ctx, Set<String> ignoredProperties, IdentitySerializationInfo identityInfo, ObjectIdSerializer<?> idWriter, String typeName, String typeInformation ) { serializer.serialize( writer, value, ctx ); }
class class_name[name] begin[{] method[serializeObject, return_type[void], modifier[protected], parameter[writer, value, ctx, ignoredProperties, identityInfo, idWriter, typeName, typeInformation]] begin[{] call[serializer.serialize, parameter[member[.writer], member[.value], member[.ctx]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[serializeObject] operator[SEP] identifier[JsonWriter] identifier[writer] , identifier[T] identifier[value] , identifier[JsonSerializationContext] identifier[ctx] , identifier[Set] operator[<] identifier[String] operator[>] identifier[ignoredProperties] , identifier[IdentitySerializationInfo] identifier[identityInfo] , identifier[ObjectIdSerializer] operator[<] operator[?] operator[>] identifier[idWriter] , identifier[String] identifier[typeName] , identifier[String] identifier[typeInformation] operator[SEP] { identifier[serializer] operator[SEP] identifier[serialize] operator[SEP] identifier[writer] , identifier[value] , identifier[ctx] operator[SEP] operator[SEP] }
private int compareValue(Object v1, Object v2) { if (v1 instanceof Integer) return Integer.compare((Integer) v1, (Integer) v2); if (v1 instanceof Float) return Float.compare((Float) v1, (Float) v2); if (v1 instanceof Double) return Double.compare((Double) v1, (Double) v2); if (v1 instanceof Long) return Long.compare((Long) v1, (Long) v2); if (v1 instanceof Character) return Character.compare((Character) v1, (Character) v2); if (v1 instanceof Short) return Short.compare((Short) v1, (Short) v2); return 0; }
class class_name[name] begin[{] method[compareValue, return_type[type[int]], modifier[private], parameter[v1, v2]] begin[{] if[binary_operation[member[.v1], instanceof, type[Integer]]] begin[{] return[call[Integer.compare, parameter[Cast(expression=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), Cast(expression=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]]] else begin[{] None end[}] if[binary_operation[member[.v1], instanceof, type[Float]]] begin[{] return[call[Float.compare, parameter[Cast(expression=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), Cast(expression=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))]]] else begin[{] None end[}] if[binary_operation[member[.v1], instanceof, type[Double]]] begin[{] return[call[Double.compare, parameter[Cast(expression=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), Cast(expression=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))]]] else begin[{] None end[}] if[binary_operation[member[.v1], instanceof, type[Long]]] begin[{] return[call[Long.compare, parameter[Cast(expression=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), Cast(expression=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))]]] else begin[{] None end[}] if[binary_operation[member[.v1], instanceof, type[Character]]] begin[{] return[call[Character.compare, parameter[Cast(expression=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Character, sub_type=None)), Cast(expression=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Character, sub_type=None))]]] else begin[{] None end[}] if[binary_operation[member[.v1], instanceof, type[Short]]] begin[{] return[call[Short.compare, parameter[Cast(expression=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None)), Cast(expression=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None))]]] else begin[{] None end[}] return[literal[0]] end[}] END[}]
Keyword[private] Keyword[int] identifier[compareValue] operator[SEP] identifier[Object] identifier[v1] , identifier[Object] identifier[v2] operator[SEP] { Keyword[if] operator[SEP] identifier[v1] Keyword[instanceof] identifier[Integer] operator[SEP] Keyword[return] identifier[Integer] operator[SEP] identifier[compare] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[v1] , operator[SEP] identifier[Integer] operator[SEP] identifier[v2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v1] Keyword[instanceof] identifier[Float] operator[SEP] Keyword[return] identifier[Float] operator[SEP] identifier[compare] operator[SEP] operator[SEP] identifier[Float] operator[SEP] identifier[v1] , operator[SEP] identifier[Float] operator[SEP] identifier[v2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v1] Keyword[instanceof] identifier[Double] operator[SEP] Keyword[return] identifier[Double] operator[SEP] identifier[compare] operator[SEP] operator[SEP] identifier[Double] operator[SEP] identifier[v1] , operator[SEP] identifier[Double] operator[SEP] identifier[v2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v1] Keyword[instanceof] identifier[Long] operator[SEP] Keyword[return] identifier[Long] operator[SEP] identifier[compare] operator[SEP] operator[SEP] identifier[Long] operator[SEP] identifier[v1] , operator[SEP] identifier[Long] operator[SEP] identifier[v2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v1] Keyword[instanceof] identifier[Character] operator[SEP] Keyword[return] identifier[Character] operator[SEP] identifier[compare] operator[SEP] operator[SEP] identifier[Character] operator[SEP] identifier[v1] , operator[SEP] identifier[Character] operator[SEP] identifier[v2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v1] Keyword[instanceof] identifier[Short] operator[SEP] Keyword[return] identifier[Short] operator[SEP] identifier[compare] operator[SEP] operator[SEP] identifier[Short] operator[SEP] identifier[v1] , operator[SEP] identifier[Short] operator[SEP] identifier[v2] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP] }
@NonNull protected View inflate(@NonNull ViewGroup parent, @LayoutRes int layoutResource) { return layoutInflater(parent).inflate(layoutResource, parent, false); }
class class_name[name] begin[{] method[inflate, return_type[type[View]], modifier[protected], parameter[parent, layoutResource]] begin[{] return[call[.layoutInflater, parameter[member[.parent]]]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[protected] identifier[View] identifier[inflate] operator[SEP] annotation[@] identifier[NonNull] identifier[ViewGroup] identifier[parent] , annotation[@] identifier[LayoutRes] Keyword[int] identifier[layoutResource] operator[SEP] { Keyword[return] identifier[layoutInflater] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[inflate] operator[SEP] identifier[layoutResource] , identifier[parent] , literal[boolean] operator[SEP] operator[SEP] }
private void initInConstructor() { htmlStartSB = new StringBuilder(tagName == null ? 0 : tagName.length() + 2 + ((attributes == null ? 0 : attributes.length) * 16)); htmlEndSB = new StringBuilder( tagName == null ? 16 : tagName.length() + 3); }
class class_name[name] begin[{] method[initInConstructor, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.htmlStartSB], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=tagName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), operandr=BinaryOperation(operandl=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=*), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))] assign[member[.htmlEndSB], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=tagName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[void] identifier[initInConstructor] operator[SEP] operator[SEP] { identifier[htmlStartSB] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[tagName] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[tagName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[2] operator[+] operator[SEP] operator[SEP] identifier[attributes] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[attributes] operator[SEP] identifier[length] operator[SEP] operator[*] Other[16] operator[SEP] operator[SEP] operator[SEP] identifier[htmlEndSB] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[tagName] operator[==] Other[null] operator[?] Other[16] operator[:] identifier[tagName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[3] operator[SEP] operator[SEP] }
public HttpRequestContext handleStart(C carrier, Q request) { checkNotNull(carrier, "carrier"); checkNotNull(request, "request"); SpanBuilder spanBuilder = null; String spanName = getSpanName(request, extractor); // de-serialize the context SpanContext spanContext = null; try { spanContext = textFormat.extract(carrier, getter); } catch (SpanContextParseException e) { // TODO: Currently we cannot distinguish between context parse error and missing context. // Logging would be annoying so we just ignore this error and do not even log a message. } if (spanContext == null || publicEndpoint) { spanBuilder = tracer.spanBuilder(spanName); } else { spanBuilder = tracer.spanBuilderWithRemoteParent(spanName, spanContext); } Span span = spanBuilder.setSpanKind(Kind.SERVER).startSpan(); if (publicEndpoint && spanContext != null) { span.addLink(Link.fromSpanContext(spanContext, Type.PARENT_LINKED_SPAN)); } if (span.getOptions().contains(Options.RECORD_EVENTS)) { addSpanRequestAttributes(span, request, extractor); } return getNewContext(span, tagger.getCurrentTagContext()); }
class class_name[name] begin[{] method[handleStart, return_type[type[HttpRequestContext]], modifier[public], parameter[carrier, request]] begin[{] call[.checkNotNull, parameter[member[.carrier], literal["carrier"]]] call[.checkNotNull, parameter[member[.request], literal["request"]]] local_variable[type[SpanBuilder], spanBuilder] local_variable[type[String], spanName] local_variable[type[SpanContext], spanContext] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=spanContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=carrier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=getter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extract, postfix_operators=[], prefix_operators=[], qualifier=textFormat, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SpanContextParseException']))], finally_block=None, label=None, resources=None) if[binary_operation[binary_operation[member[.spanContext], ==, literal[null]], ||, member[.publicEndpoint]]] begin[{] assign[member[.spanBuilder], call[tracer.spanBuilder, parameter[member[.spanName]]]] else begin[{] assign[member[.spanBuilder], call[tracer.spanBuilderWithRemoteParent, parameter[member[.spanName], member[.spanContext]]]] end[}] local_variable[type[Span], span] if[binary_operation[member[.publicEndpoint], &&, binary_operation[member[.spanContext], !=, literal[null]]]] begin[{] call[span.addLink, parameter[call[Link.fromSpanContext, parameter[member[.spanContext], member[Type.PARENT_LINKED_SPAN]]]]] else begin[{] None end[}] if[call[span.getOptions, parameter[]]] begin[{] call[.addSpanRequestAttributes, parameter[member[.span], member[.request], member[.extractor]]] else begin[{] None end[}] return[call[.getNewContext, parameter[member[.span], call[tagger.getCurrentTagContext, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[HttpRequestContext] identifier[handleStart] operator[SEP] identifier[C] identifier[carrier] , identifier[Q] identifier[request] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[carrier] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[request] , literal[String] operator[SEP] operator[SEP] identifier[SpanBuilder] identifier[spanBuilder] operator[=] Other[null] operator[SEP] identifier[String] identifier[spanName] operator[=] identifier[getSpanName] operator[SEP] identifier[request] , identifier[extractor] operator[SEP] operator[SEP] identifier[SpanContext] identifier[spanContext] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[spanContext] operator[=] identifier[textFormat] operator[SEP] identifier[extract] operator[SEP] identifier[carrier] , identifier[getter] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SpanContextParseException] identifier[e] operator[SEP] { } Keyword[if] operator[SEP] identifier[spanContext] operator[==] Other[null] operator[||] identifier[publicEndpoint] operator[SEP] { identifier[spanBuilder] operator[=] identifier[tracer] operator[SEP] identifier[spanBuilder] operator[SEP] identifier[spanName] operator[SEP] operator[SEP] } Keyword[else] { identifier[spanBuilder] operator[=] identifier[tracer] operator[SEP] identifier[spanBuilderWithRemoteParent] operator[SEP] identifier[spanName] , identifier[spanContext] operator[SEP] operator[SEP] } identifier[Span] identifier[span] operator[=] identifier[spanBuilder] operator[SEP] identifier[setSpanKind] operator[SEP] identifier[Kind] operator[SEP] identifier[SERVER] operator[SEP] operator[SEP] identifier[startSpan] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[publicEndpoint] operator[&&] identifier[spanContext] operator[!=] Other[null] operator[SEP] { identifier[span] operator[SEP] identifier[addLink] operator[SEP] identifier[Link] operator[SEP] identifier[fromSpanContext] operator[SEP] identifier[spanContext] , identifier[Type] operator[SEP] identifier[PARENT_LINKED_SPAN] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[span] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[Options] operator[SEP] identifier[RECORD_EVENTS] operator[SEP] operator[SEP] { identifier[addSpanRequestAttributes] operator[SEP] identifier[span] , identifier[request] , identifier[extractor] operator[SEP] operator[SEP] } Keyword[return] identifier[getNewContext] operator[SEP] identifier[span] , identifier[tagger] operator[SEP] identifier[getCurrentTagContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }