code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static void quickSort(int fromIndex, int toIndex, IntComparator c, Swapper swapper) { quickSort1(fromIndex, toIndex-fromIndex, c, swapper); }
class class_name[name] begin[{] method[quickSort, return_type[void], modifier[public static], parameter[fromIndex, toIndex, c, swapper]] begin[{] call[.quickSort1, parameter[member[.fromIndex], binary_operation[member[.toIndex], -, member[.fromIndex]], member[.c], member[.swapper]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[quickSort] operator[SEP] Keyword[int] identifier[fromIndex] , Keyword[int] identifier[toIndex] , identifier[IntComparator] identifier[c] , identifier[Swapper] identifier[swapper] operator[SEP] { identifier[quickSort1] operator[SEP] identifier[fromIndex] , identifier[toIndex] operator[-] identifier[fromIndex] , identifier[c] , identifier[swapper] operator[SEP] operator[SEP] }
private static Service<NetworkInterfaceBinding> createInterfaceService(String name, ParsedInterfaceCriteria criteria) { return NetworkInterfaceService.create(name, criteria); }
class class_name[name] begin[{] method[createInterfaceService, return_type[type[Service]], modifier[private static], parameter[name, criteria]] begin[{] return[call[NetworkInterfaceService.create, parameter[member[.name], member[.criteria]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Service] operator[<] identifier[NetworkInterfaceBinding] operator[>] identifier[createInterfaceService] operator[SEP] identifier[String] identifier[name] , identifier[ParsedInterfaceCriteria] identifier[criteria] operator[SEP] { Keyword[return] identifier[NetworkInterfaceService] operator[SEP] identifier[create] operator[SEP] identifier[name] , identifier[criteria] operator[SEP] operator[SEP] }
protected boolean addToAttributeValueMap(final String key, final String value) { final Collection<AbstractHtml5SharedObject> sharedObjects = getSharedObjects(); boolean listenerInvoked = false; final Collection<WriteLock> writeLocks = lockAndGetWriteLocks(); try { final Map<String, String> attributeValueMap = getAttributeValueMap(); final String previousValue = attributeValueMap.put(key, value); if (!Objects.equals(previousValue, value)) { setModified(true); invokeValueChangeListeners(sharedObjects); listenerInvoked = true; } } finally { for (final Lock lock : writeLocks) { lock.unlock(); } } pushQueues(sharedObjects, listenerInvoked); return listenerInvoked; }
class class_name[name] begin[{] method[addToAttributeValueMap, return_type[type[boolean]], modifier[protected], parameter[key, value]] begin[{] local_variable[type[Collection], sharedObjects] local_variable[type[boolean], listenerInvoked] local_variable[type[Collection], writeLocks] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributeValueMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=attributeValueMap)], 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=String, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=attributeValueMap, selectors=[], type_arguments=None), name=previousValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=previousValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=Objects, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setModified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sharedObjects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeValueChangeListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=listenerInvoked, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))], catches=None, finally_block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=writeLocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=lock)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Lock, sub_type=None))), label=None)], label=None, resources=None) call[.pushQueues, parameter[member[.sharedObjects], member[.listenerInvoked]]] return[member[.listenerInvoked]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[addToAttributeValueMap] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[String] identifier[value] operator[SEP] { Keyword[final] identifier[Collection] operator[<] identifier[AbstractHtml5SharedObject] operator[>] identifier[sharedObjects] operator[=] identifier[getSharedObjects] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[listenerInvoked] operator[=] literal[boolean] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[WriteLock] operator[>] identifier[writeLocks] operator[=] identifier[lockAndGetWriteLocks] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[attributeValueMap] operator[=] identifier[getAttributeValueMap] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[previousValue] operator[=] identifier[attributeValueMap] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[previousValue] , identifier[value] operator[SEP] operator[SEP] { identifier[setModified] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[invokeValueChangeListeners] operator[SEP] identifier[sharedObjects] operator[SEP] operator[SEP] identifier[listenerInvoked] operator[=] literal[boolean] operator[SEP] } } Keyword[finally] { Keyword[for] operator[SEP] Keyword[final] identifier[Lock] identifier[lock] operator[:] identifier[writeLocks] operator[SEP] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } } identifier[pushQueues] operator[SEP] identifier[sharedObjects] , identifier[listenerInvoked] operator[SEP] operator[SEP] Keyword[return] identifier[listenerInvoked] operator[SEP] }
protected void putToCache(String cacheName, String key, Object value, long ttlSeconds) { if (cacheItemsExpireAfterWrite) { putToCache(cacheName, key, value, ttlSeconds, 0); } else { putToCache(cacheName, key, value, 0, ttlSeconds); } }
class class_name[name] begin[{] method[putToCache, return_type[void], modifier[protected], parameter[cacheName, key, value, ttlSeconds]] begin[{] if[member[.cacheItemsExpireAfterWrite]] begin[{] call[.putToCache, parameter[member[.cacheName], member[.key], member[.value], member[.ttlSeconds], literal[0]]] else begin[{] call[.putToCache, parameter[member[.cacheName], member[.key], member[.value], literal[0], member[.ttlSeconds]]] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[putToCache] operator[SEP] identifier[String] identifier[cacheName] , identifier[String] identifier[key] , identifier[Object] identifier[value] , Keyword[long] identifier[ttlSeconds] operator[SEP] { Keyword[if] operator[SEP] identifier[cacheItemsExpireAfterWrite] operator[SEP] { identifier[putToCache] operator[SEP] identifier[cacheName] , identifier[key] , identifier[value] , identifier[ttlSeconds] , Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[putToCache] operator[SEP] identifier[cacheName] , identifier[key] , identifier[value] , Other[0] , identifier[ttlSeconds] operator[SEP] operator[SEP] } }
public CompletableFuture<Acknowledge> suspend(final Exception cause) { CompletableFuture<Acknowledge> suspendFuture = callAsyncWithoutFencing( () -> suspendExecution(cause), RpcUtils.INF_TIMEOUT); return suspendFuture.whenComplete((acknowledge, throwable) -> stop()); }
class class_name[name] begin[{] method[suspend, return_type[type[CompletableFuture]], modifier[public], parameter[cause]] begin[{] local_variable[type[CompletableFuture], suspendFuture] return[call[suspendFuture.whenComplete, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=acknowledge), InferredFormalParameter(name=throwable)])]]] end[}] END[}]
Keyword[public] identifier[CompletableFuture] operator[<] identifier[Acknowledge] operator[>] identifier[suspend] operator[SEP] Keyword[final] identifier[Exception] identifier[cause] operator[SEP] { identifier[CompletableFuture] operator[<] identifier[Acknowledge] operator[>] identifier[suspendFuture] operator[=] identifier[callAsyncWithoutFencing] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[suspendExecution] operator[SEP] identifier[cause] operator[SEP] , identifier[RpcUtils] operator[SEP] identifier[INF_TIMEOUT] operator[SEP] operator[SEP] Keyword[return] identifier[suspendFuture] operator[SEP] identifier[whenComplete] operator[SEP] operator[SEP] identifier[acknowledge] , identifier[throwable] operator[SEP] operator[->] identifier[stop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean isMachineRunning( TargetHandlerParameters parameters, String machineId ) throws TargetException { boolean result = false; try { AmazonEC2 ec2 = createEc2Client( parameters.getTargetProperties()); DescribeInstancesRequest dis = new DescribeInstancesRequest(); dis.setInstanceIds(Collections.singletonList(machineId)); DescribeInstancesResult disresult = ec2.describeInstances( dis ); result = ! disresult.getReservations().isEmpty(); } catch( AmazonServiceException e ) { // nothing, the instance does not exist } catch( AmazonClientException e ) { this.logger.severe( "An error occurred while checking whether a machine is running on Amazon EC2. " + e.getMessage()); throw new TargetException( e ); } return result; }
class class_name[name] begin[{] method[isMachineRunning, return_type[type[boolean]], modifier[public], parameter[parameters, machineId]] begin[{] local_variable[type[boolean], result] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTargetProperties, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None)], member=createEc2Client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=ec2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AmazonEC2, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DescribeInstancesRequest, sub_type=None)), name=dis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DescribeInstancesRequest, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=machineId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singletonList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=setInstanceIds, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=describeInstances, postfix_operators=[], prefix_operators=[], qualifier=ec2, selectors=[], type_arguments=None), name=disresult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DescribeInstancesResult, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getReservations, postfix_operators=[], prefix_operators=['!'], qualifier=disresult, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AmazonServiceException'])), CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred while checking whether a machine is running on Amazon EC2. "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=severe, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TargetException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AmazonClientException']))], finally_block=None, label=None, resources=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isMachineRunning] operator[SEP] identifier[TargetHandlerParameters] identifier[parameters] , identifier[String] identifier[machineId] operator[SEP] Keyword[throws] identifier[TargetException] { Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[AmazonEC2] identifier[ec2] operator[=] identifier[createEc2Client] operator[SEP] identifier[parameters] operator[SEP] identifier[getTargetProperties] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DescribeInstancesRequest] identifier[dis] operator[=] Keyword[new] identifier[DescribeInstancesRequest] operator[SEP] operator[SEP] operator[SEP] identifier[dis] operator[SEP] identifier[setInstanceIds] operator[SEP] identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] identifier[machineId] operator[SEP] operator[SEP] operator[SEP] identifier[DescribeInstancesResult] identifier[disresult] operator[=] identifier[ec2] operator[SEP] identifier[describeInstances] operator[SEP] identifier[dis] operator[SEP] operator[SEP] identifier[result] operator[=] operator[!] identifier[disresult] operator[SEP] identifier[getReservations] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[AmazonServiceException] identifier[e] operator[SEP] { } Keyword[catch] operator[SEP] identifier[AmazonClientException] identifier[e] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[TargetException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public void set(final String name, final String email, final Map<String, Map<String, ConfigPropertyValue>> data, final ConfigChangeMode changeMode, final String message) { try { RepoHelper.write(repo, name, email, data, changeMode, message); } catch (Exception e) { try { RepoHelper.reset(repo); } catch (Exception ee) { throw new RuntimeException("Error writing updated repository, then could not reset work tree", e); } throw new RuntimeException("Error writing updated repository, work tree reset", e); } // Push the changes to the remote if (hasRemote) { try { RepoHelper.push(repo, "origin", credentials); } catch (Throwable t) { throw new RuntimeException("Saved changes to the local repository but push to remote failed!", t); } } }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[name, email, data, changeMode, message]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=repo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=email, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=changeMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=RepoHelper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=repo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reset, postfix_operators=[], prefix_operators=[], qualifier=RepoHelper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error writing updated repository, then could not reset work tree"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ee, types=['Exception']))], finally_block=None, label=None, resources=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error writing updated repository, work tree reset"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[member[.hasRemote]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=repo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="origin"), MemberReference(member=credentials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=RepoHelper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Saved changes to the local repository but push to remote failed!"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[set] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[email] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[ConfigPropertyValue] operator[>] operator[>] identifier[data] , Keyword[final] identifier[ConfigChangeMode] identifier[changeMode] , Keyword[final] identifier[String] identifier[message] operator[SEP] { Keyword[try] { identifier[RepoHelper] operator[SEP] identifier[write] operator[SEP] identifier[repo] , identifier[name] , identifier[email] , identifier[data] , identifier[changeMode] , identifier[message] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[try] { identifier[RepoHelper] operator[SEP] identifier[reset] operator[SEP] identifier[repo] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ee] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[hasRemote] operator[SEP] { Keyword[try] { identifier[RepoHelper] operator[SEP] identifier[push] operator[SEP] identifier[repo] , literal[String] , identifier[credentials] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] } } }
private synchronized void doNodeLeft(final String nodeID) { log.info(String.format("%s - %s left the cluster", this, nodeID)); context.run(new Runnable() { @Override public void run() { synchronized (nodes) { // If we were the first node to remove the nodes then we need // to inform listeners that the node left the cluster over the // event bus. Collection<String> removedNodes = nodes.remove(nodeID); if (removedNodes != null) { synchronized (groups) { for (final String node : removedNodes) { for (final String group : groups.keySet()) { groups.remove(group, node); vertx.runOnContext(new Handler<Void>() { @Override public void handle(Void event) { vertx.eventBus().publish(String.format("%s.leave", group), node); } }); } vertx.runOnContext(new Handler<Void>() { @Override public void handle(Void event) { vertx.eventBus().publish(String.format("%s.leave", cluster), node); } }); } } // Check for any network masters that left the cluster. synchronized (networks) { for (final String name : networks) { String address = nodeSelectors.get(name); if (address != null && removedNodes.contains(address)) { // If the node to which the network was assigned is one of the nodes // that left the cluster then redeploy the network. If no changes // have been made to the network then this will simply result in the // network's manager being redeployed. selectNode(name, new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { if (result.succeeded() && result.result() != null) { // Just redeploy the network by sending a deploy message to the appropriate node. JsonObject message = new JsonObject() .putString("action", "deploy") .putString("type", "network") .putString("network", name); vertx.eventBus().send(result.result(), message); } } }); } } } // Redeploy any failed deployments. synchronized (deployments) { Collection<String> sdeploymentsInfo = deployments.get(cluster); for (final String sdeploymentInfo : sdeploymentsInfo) { final JsonObject deploymentInfo = new JsonObject(sdeploymentInfo); // If the deployment node is equal to the node that left the cluster then // remove the deployment from the deployments list and attempt to redeploy it. if (deploymentInfo.getString("node").equals(nodeID)) { // If the deployment is an HA deployment then attempt to redeploy it on this node. if (deployments.remove(cluster, sdeploymentInfo) && deploymentInfo.getBoolean("ha", false)) { doRedeploy(deploymentInfo); } } } } } } } }); }
class class_name[name] begin[{] method[doNodeLeft, return_type[void], modifier[synchronized private], parameter[nodeID]] begin[{] call[log.info, parameter[call[String.format, parameter[literal["%s - %s left the cluster"], THIS[], member[.nodeID]]]]] call[context.run, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nodeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[], type_arguments=None), name=removedNodes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=removedNodes, 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=[SynchronizedStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=groups, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=eventBus, postfix_operators=[], prefix_operators=[], qualifier=vertx, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.leave"), MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=publish, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=Handler, sub_type=None))], member=runOnContext, postfix_operators=[], prefix_operators=[], qualifier=vertx, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=groups, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=group)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=eventBus, postfix_operators=[], prefix_operators=[], qualifier=vertx, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.leave"), MemberReference(member=cluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=publish, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=Handler, sub_type=None))], member=runOnContext, postfix_operators=[], prefix_operators=[], qualifier=vertx, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=removedNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], label=None, lock=MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), SynchronizedStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeSelectors, selectors=[], type_arguments=None), name=address)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=removedNodes, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=succeeded, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="action"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="deploy")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="network")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="network"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None)), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=eventBus, postfix_operators=[], prefix_operators=[], qualifier=vertx, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=send, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None))], dimensions=None, name=Handler, sub_type=None))], member=selectNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=networks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], label=None, lock=MemberReference(member=networks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=deployments, selectors=[], type_arguments=None), name=sdeploymentsInfo)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=sdeploymentInfo, 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=JsonObject, sub_type=None)), name=deploymentInfo)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="node")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=deploymentInfo, selectors=[MethodInvocation(arguments=[MemberReference(member=nodeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=cluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sdeploymentInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=deployments, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ha"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=deploymentInfo, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=deploymentInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doRedeploy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=sdeploymentsInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sdeploymentInfo)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], label=None, lock=MemberReference(member=deployments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))], label=None, lock=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[synchronized] Keyword[void] identifier[doNodeLeft] operator[SEP] Keyword[final] identifier[String] identifier[nodeID] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] , identifier[nodeID] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[run] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[nodes] operator[SEP] { identifier[Collection] operator[<] identifier[String] operator[>] identifier[removedNodes] operator[=] identifier[nodes] operator[SEP] identifier[remove] operator[SEP] identifier[nodeID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[removedNodes] operator[!=] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[groups] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[node] operator[:] identifier[removedNodes] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[group] operator[:] identifier[groups] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[groups] operator[SEP] identifier[remove] operator[SEP] identifier[group] , identifier[node] operator[SEP] operator[SEP] identifier[vertx] operator[SEP] identifier[runOnContext] operator[SEP] Keyword[new] identifier[Handler] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[Void] identifier[event] operator[SEP] { identifier[vertx] operator[SEP] identifier[eventBus] operator[SEP] operator[SEP] operator[SEP] identifier[publish] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[group] operator[SEP] , identifier[node] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } identifier[vertx] operator[SEP] identifier[runOnContext] operator[SEP] Keyword[new] identifier[Handler] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[Void] identifier[event] operator[SEP] { identifier[vertx] operator[SEP] identifier[eventBus] operator[SEP] operator[SEP] operator[SEP] identifier[publish] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[cluster] operator[SEP] , identifier[node] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } } Keyword[synchronized] operator[SEP] identifier[networks] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[:] identifier[networks] operator[SEP] { identifier[String] identifier[address] operator[=] identifier[nodeSelectors] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[address] operator[!=] Other[null] operator[&&] identifier[removedNodes] operator[SEP] identifier[contains] operator[SEP] identifier[address] operator[SEP] operator[SEP] { identifier[selectNode] operator[SEP] identifier[name] , Keyword[new] identifier[Handler] operator[<] identifier[AsyncResult] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[AsyncResult] operator[<] identifier[String] operator[>] identifier[result] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[succeeded] operator[SEP] operator[SEP] operator[&&] identifier[result] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[JsonObject] identifier[message] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[vertx] operator[SEP] identifier[eventBus] operator[SEP] operator[SEP] operator[SEP] identifier[send] operator[SEP] identifier[result] operator[SEP] identifier[result] operator[SEP] operator[SEP] , identifier[message] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] } } } Keyword[synchronized] operator[SEP] identifier[deployments] operator[SEP] { identifier[Collection] operator[<] identifier[String] operator[>] identifier[sdeploymentsInfo] operator[=] identifier[deployments] operator[SEP] identifier[get] operator[SEP] identifier[cluster] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[sdeploymentInfo] operator[:] identifier[sdeploymentsInfo] operator[SEP] { Keyword[final] identifier[JsonObject] identifier[deploymentInfo] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] identifier[sdeploymentInfo] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deploymentInfo] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[nodeID] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[deployments] operator[SEP] identifier[remove] operator[SEP] identifier[cluster] , identifier[sdeploymentInfo] operator[SEP] operator[&&] identifier[deploymentInfo] operator[SEP] identifier[getBoolean] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] { identifier[doRedeploy] operator[SEP] identifier[deploymentInfo] operator[SEP] operator[SEP] } } } } } } } } operator[SEP] operator[SEP] }
public static void isSubscribed (Activity context, Entity e, SubscriptionType type, SubscriptionCheckListener listener) { subscriptionUtils.isSubscribed(context, e, type, listener); }
class class_name[name] begin[{] method[isSubscribed, return_type[void], modifier[public static], parameter[context, e, type, listener]] begin[{] call[subscriptionUtils.isSubscribed, parameter[member[.context], member[.e], member[.type], member[.listener]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[isSubscribed] operator[SEP] identifier[Activity] identifier[context] , identifier[Entity] identifier[e] , identifier[SubscriptionType] identifier[type] , identifier[SubscriptionCheckListener] identifier[listener] operator[SEP] { identifier[subscriptionUtils] operator[SEP] identifier[isSubscribed] operator[SEP] identifier[context] , identifier[e] , identifier[type] , identifier[listener] operator[SEP] operator[SEP] }
private Object readResolve() throws ObjectStreamException { try { return of(eraValue); } catch (DateTimeException e) { InvalidObjectException ex = new InvalidObjectException("Invalid era"); ex.initCause(e); throw ex; } }
class class_name[name] begin[{] method[readResolve, return_type[type[Object]], modifier[private], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=eraValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid era")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidObjectException, sub_type=None)), name=ex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InvalidObjectException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DateTimeException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[Object] identifier[readResolve] operator[SEP] operator[SEP] Keyword[throws] identifier[ObjectStreamException] { Keyword[try] { Keyword[return] identifier[of] operator[SEP] identifier[eraValue] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DateTimeException] identifier[e] operator[SEP] { identifier[InvalidObjectException] identifier[ex] operator[=] Keyword[new] identifier[InvalidObjectException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ex] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[ex] operator[SEP] } }
public void handleDelete(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource) throws ServletException, IOException { if (!resource.exists() || !passConditionalHeaders(request, response, resource)) return; try { // delete the file if (resource.delete()) { response.setStatus(HttpResponse.__204_No_Content); response.flushBuffer(); } else response.sendError(HttpResponse.__403_Forbidden); } catch (SecurityException sex) { log.warn(LogSupport.EXCEPTION, sex); response.sendError(HttpResponse.__403_Forbidden, sex.getMessage()); } }
class class_name[name] begin[{] method[handleDelete, return_type[void], modifier[public], parameter[request, response, pathInContext, resource]] begin[{] if[binary_operation[call[resource.exists, parameter[]], ||, call[.passConditionalHeaders, parameter[member[.request], member[.response], member[.resource]]]]] begin[{] return[None] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=__403_Forbidden, postfix_operators=[], prefix_operators=[], qualifier=HttpResponse, selectors=[])], member=sendError, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=__204_No_Content, postfix_operators=[], prefix_operators=[], qualifier=HttpResponse, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flushBuffer, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EXCEPTION, postfix_operators=[], prefix_operators=[], qualifier=LogSupport, selectors=[]), MemberReference(member=sex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=__403_Forbidden, postfix_operators=[], prefix_operators=[], qualifier=HttpResponse, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=sex, selectors=[], type_arguments=None)], member=sendError, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=sex, types=['SecurityException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[handleDelete] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] , identifier[String] identifier[pathInContext] , identifier[Resource] identifier[resource] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[resource] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[||] operator[!] identifier[passConditionalHeaders] operator[SEP] identifier[request] , identifier[response] , identifier[resource] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[resource] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] { identifier[response] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpResponse] operator[SEP] identifier[__204_No_Content] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] identifier[response] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpResponse] operator[SEP] identifier[__403_Forbidden] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[sex] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[LogSupport] operator[SEP] identifier[EXCEPTION] , identifier[sex] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpResponse] operator[SEP] identifier[__403_Forbidden] , identifier[sex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public ArrayList<String> dedicatedCloud_serviceName_upgradeRessource_GET(String serviceName, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException { String qPath = "/order/dedicatedCloud/{serviceName}/upgradeRessource"; StringBuilder sb = path(qPath, serviceName); query(sb, "upgradeType", upgradeType); query(sb, "upgradedRessourceId", upgradedRessourceId); query(sb, "upgradedRessourceType", upgradedRessourceType); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t1); }
class class_name[name] begin[{] method[dedicatedCloud_serviceName_upgradeRessource_GET, return_type[type[ArrayList]], modifier[public], parameter[serviceName, upgradeType, upgradedRessourceId, upgradedRessourceType]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.query, parameter[member[.sb], literal["upgradeType"], member[.upgradeType]]] call[.query, parameter[member[.sb], literal["upgradedRessourceId"], member[.upgradedRessourceId]]] call[.query, parameter[member[.sb], literal["upgradedRessourceType"], member[.upgradedRessourceType]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], member[.t1]]]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[dedicatedCloud_serviceName_upgradeRessource_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[OvhUpgradeTypeEnum] identifier[upgradeType] , identifier[Long] identifier[upgradedRessourceId] , identifier[OvhUpgradeRessourceTypeEnum] identifier[upgradedRessourceType] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[upgradeType] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[upgradedRessourceId] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[upgradedRessourceType] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t1] operator[SEP] operator[SEP] }
public void setGravity(double gravity) { if(Double.isInfinite(gravity) || Double.isNaN(gravity) || gravity <= 0) throw new IllegalArgumentException("Gravity must be positive, not " + gravity); this.gravity = gravity; }
class class_name[name] begin[{] method[setGravity, return_type[void], modifier[public], parameter[gravity]] begin[{] if[binary_operation[binary_operation[call[Double.isInfinite, parameter[member[.gravity]]], ||, call[Double.isNaN, parameter[member[.gravity]]]], ||, binary_operation[member[.gravity], <=, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Gravity must be positive, not "), operandr=MemberReference(member=gravity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.gravity]], member[.gravity]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setGravity] operator[SEP] Keyword[double] identifier[gravity] operator[SEP] { Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[isInfinite] operator[SEP] identifier[gravity] operator[SEP] operator[||] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[gravity] operator[SEP] operator[||] identifier[gravity] operator[<=] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[gravity] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[gravity] operator[=] identifier[gravity] operator[SEP] }
public String groupHtml(CmsWorkplace wp) { StringBuffer html = new StringBuffer(2048); Iterator<CmsTool> itItem = m_container.elementList().iterator(); while (itItem.hasNext()) { CmsTool item = itItem.next(); html.append(item.buttonHtml(wp)); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(html.toString())) { html.insert(0, ((CmsToolDialog)wp).iconsBlockAreaStart(getName())); html.append(((CmsToolDialog)wp).iconsBlockAreaEnd()); } return html.toString(); }
class class_name[name] begin[{] method[groupHtml, return_type[type[String]], modifier[public], parameter[wp]] begin[{] local_variable[type[StringBuffer], html] local_variable[type[Iterator], itItem] while[call[itItem.hasNext, parameter[]]] begin[{] local_variable[type[CmsTool], item] call[html.append, parameter[call[item.buttonHtml, parameter[member[.wp]]]]] end[}] if[call[CmsStringUtil.isNotEmptyOrWhitespaceOnly, parameter[call[html.toString, parameter[]]]]] begin[{] call[html.insert, parameter[literal[0], Cast(expression=MemberReference(member=wp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CmsToolDialog, sub_type=None))]] call[html.append, parameter[Cast(expression=MemberReference(member=wp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CmsToolDialog, sub_type=None))]] else begin[{] None end[}] return[call[html.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[groupHtml] operator[SEP] identifier[CmsWorkplace] identifier[wp] operator[SEP] { identifier[StringBuffer] identifier[html] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[2048] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[CmsTool] operator[>] identifier[itItem] operator[=] identifier[m_container] operator[SEP] identifier[elementList] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itItem] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[CmsTool] identifier[item] operator[=] identifier[itItem] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[item] operator[SEP] identifier[buttonHtml] operator[SEP] identifier[wp] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isNotEmptyOrWhitespaceOnly] operator[SEP] identifier[html] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[html] operator[SEP] identifier[insert] operator[SEP] Other[0] , operator[SEP] operator[SEP] identifier[CmsToolDialog] operator[SEP] identifier[wp] operator[SEP] operator[SEP] identifier[iconsBlockAreaStart] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] operator[SEP] operator[SEP] identifier[CmsToolDialog] operator[SEP] identifier[wp] operator[SEP] operator[SEP] identifier[iconsBlockAreaEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[html] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isInClosurizedFile(Node node, NodeMetadata metadata) { Node script = NodeUtil.getEnclosingScript(node); if (script == null) { return false; } Node child = script.getFirstChild(); while (child != null) { if (NodeUtil.isExprCall(child)) { if (Matchers.googRequire().matches(child.getFirstChild(), metadata)) { return true; } // goog.require or goog.module. } else if (child.isVar() && child.getBooleanProp(Node.IS_NAMESPACE)) { return true; } child = child.getNext(); } return false; }
class class_name[name] begin[{] method[isInClosurizedFile, return_type[type[boolean]], modifier[public static], parameter[node, metadata]] begin[{] local_variable[type[Node], script] if[binary_operation[member[.script], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Node], child] while[binary_operation[member[.child], !=, literal[null]]] begin[{] if[call[NodeUtil.isExprCall, parameter[member[.child]]]] begin[{] if[call[Matchers.googRequire, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] else begin[{] if[binary_operation[call[child.isVar, parameter[]], &&, call[child.getBooleanProp, parameter[member[Node.IS_NAMESPACE]]]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] assign[member[.child], call[child.getNext, parameter[]]] end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isInClosurizedFile] operator[SEP] identifier[Node] identifier[node] , identifier[NodeMetadata] identifier[metadata] operator[SEP] { identifier[Node] identifier[script] operator[=] identifier[NodeUtil] operator[SEP] identifier[getEnclosingScript] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[script] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[Node] identifier[child] operator[=] identifier[script] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[child] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[NodeUtil] operator[SEP] identifier[isExprCall] operator[SEP] identifier[child] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Matchers] operator[SEP] identifier[googRequire] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] identifier[child] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] , identifier[metadata] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[isVar] operator[SEP] operator[SEP] operator[&&] identifier[child] operator[SEP] identifier[getBooleanProp] operator[SEP] identifier[Node] operator[SEP] identifier[IS_NAMESPACE] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[child] operator[=] identifier[child] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private Map<String,Object> createMessageHeaders(KubernetesCommand<?> command) { Map<String, Object> headers = new HashMap<String, Object>(); headers.put(KubernetesMessageHeaders.COMMAND, command.getName()); for (Map.Entry<String, Object> entry : command.getParameters().entrySet()) { headers.put(entry.getKey(), entry.getValue()); } return headers; }
class class_name[name] begin[{] method[createMessageHeaders, return_type[type[Map]], modifier[private], parameter[command]] begin[{] local_variable[type[Map], headers] call[headers.put, parameter[member[KubernetesMessageHeaders.COMMAND], call[command.getName, parameter[]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=headers, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.headers]] end[}] END[}]
Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[createMessageHeaders] operator[SEP] identifier[KubernetesCommand] operator[<] operator[?] operator[>] identifier[command] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[headers] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[put] operator[SEP] identifier[KubernetesMessageHeaders] operator[SEP] identifier[COMMAND] , identifier[command] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[command] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[headers] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[headers] operator[SEP] }
public OvhRouteTcp serviceName_tcp_route_routeId_GET(String serviceName, Long routeId) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/tcp/route/{routeId}"; StringBuilder sb = path(qPath, serviceName, routeId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhRouteTcp.class); }
class class_name[name] begin[{] method[serviceName_tcp_route_routeId_GET, return_type[type[OvhRouteTcp]], modifier[public], parameter[serviceName, routeId]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhRouteTcp, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhRouteTcp] identifier[serviceName_tcp_route_routeId_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[Long] identifier[routeId] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[routeId] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhRouteTcp] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
static void printString(String s, int minWidth) { for (int i = minWidth; i < 0; i++) { // negative width means pad leading spaces, not fixed width. System.out.print(' '); } for (int i = s.length(); i < minWidth; i++) { System.out.print(' '); } System.out.print(s); }
class class_name[name] begin[{] method[printString, return_type[void], modifier[static], parameter[s, minWidth]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=print, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=minWidth, 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) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=print, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[System.out.print, parameter[member[.s]]] end[}] END[}]
Keyword[static] Keyword[void] identifier[printString] operator[SEP] identifier[String] identifier[s] , Keyword[int] identifier[minWidth] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[minWidth] operator[SEP] identifier[i] operator[<] Other[0] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[minWidth] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[s] operator[SEP] operator[SEP] }
private void addResponseHeaderParameters(InternalRequest request, ResponseHeaderOverrides responseHeaders) { if (responseHeaders != null) { if (responseHeaders.getCacheControl() != null) { request.addParameter(ResponseHeaderOverrides.RESPONSE_HEADER_CACHE_CONTROL, responseHeaders.getCacheControl()); } if (responseHeaders.getContentDisposition() != null) { request.addParameter(ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_DISPOSITION, responseHeaders.getContentDisposition()); } if (responseHeaders.getContentEncoding() != null) { request.addParameter(ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_ENCODING, responseHeaders.getContentEncoding()); } if (responseHeaders.getContentLanguage() != null) { request.addParameter(ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_LANGUAGE, responseHeaders.getContentLanguage()); } if (responseHeaders.getContentType() != null) { request.addParameter(ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_TYPE, responseHeaders.getContentType()); } if (responseHeaders.getExpires() != null) { request.addParameter(ResponseHeaderOverrides.RESPONSE_HEADER_EXPIRES, responseHeaders.getExpires()); } } }
class class_name[name] begin[{] method[addResponseHeaderParameters, return_type[void], modifier[private], parameter[request, responseHeaders]] begin[{] if[binary_operation[member[.responseHeaders], !=, literal[null]]] begin[{] if[binary_operation[call[responseHeaders.getCacheControl, parameter[]], !=, literal[null]]] begin[{] call[request.addParameter, parameter[member[ResponseHeaderOverrides.RESPONSE_HEADER_CACHE_CONTROL], call[responseHeaders.getCacheControl, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[responseHeaders.getContentDisposition, parameter[]], !=, literal[null]]] begin[{] call[request.addParameter, parameter[member[ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_DISPOSITION], call[responseHeaders.getContentDisposition, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[responseHeaders.getContentEncoding, parameter[]], !=, literal[null]]] begin[{] call[request.addParameter, parameter[member[ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_ENCODING], call[responseHeaders.getContentEncoding, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[responseHeaders.getContentLanguage, parameter[]], !=, literal[null]]] begin[{] call[request.addParameter, parameter[member[ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_LANGUAGE], call[responseHeaders.getContentLanguage, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[responseHeaders.getContentType, parameter[]], !=, literal[null]]] begin[{] call[request.addParameter, parameter[member[ResponseHeaderOverrides.RESPONSE_HEADER_CONTENT_TYPE], call[responseHeaders.getContentType, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[responseHeaders.getExpires, parameter[]], !=, literal[null]]] begin[{] call[request.addParameter, parameter[member[ResponseHeaderOverrides.RESPONSE_HEADER_EXPIRES], call[responseHeaders.getExpires, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addResponseHeaderParameters] operator[SEP] identifier[InternalRequest] identifier[request] , identifier[ResponseHeaderOverrides] identifier[responseHeaders] operator[SEP] { Keyword[if] operator[SEP] identifier[responseHeaders] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[responseHeaders] operator[SEP] identifier[getCacheControl] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[ResponseHeaderOverrides] operator[SEP] identifier[RESPONSE_HEADER_CACHE_CONTROL] , identifier[responseHeaders] operator[SEP] identifier[getCacheControl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[responseHeaders] operator[SEP] identifier[getContentDisposition] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[ResponseHeaderOverrides] operator[SEP] identifier[RESPONSE_HEADER_CONTENT_DISPOSITION] , identifier[responseHeaders] operator[SEP] identifier[getContentDisposition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[responseHeaders] operator[SEP] identifier[getContentEncoding] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[ResponseHeaderOverrides] operator[SEP] identifier[RESPONSE_HEADER_CONTENT_ENCODING] , identifier[responseHeaders] operator[SEP] identifier[getContentEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[responseHeaders] operator[SEP] identifier[getContentLanguage] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[ResponseHeaderOverrides] operator[SEP] identifier[RESPONSE_HEADER_CONTENT_LANGUAGE] , identifier[responseHeaders] operator[SEP] identifier[getContentLanguage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[responseHeaders] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[ResponseHeaderOverrides] operator[SEP] identifier[RESPONSE_HEADER_CONTENT_TYPE] , identifier[responseHeaders] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[responseHeaders] operator[SEP] identifier[getExpires] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[ResponseHeaderOverrides] operator[SEP] identifier[RESPONSE_HEADER_EXPIRES] , identifier[responseHeaders] operator[SEP] identifier[getExpires] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
private ListenableFuture<?> writeBlocksToTargets(Collection<DBBPool.BBContainer> outputBuffers, int[] serialized) { Preconditions.checkArgument(m_tableTasks.size() == serialized.length); Preconditions.checkArgument(outputBuffers.size() == serialized.length); final List<ListenableFuture<?>> writeFutures = new ArrayList<ListenableFuture<?>>(outputBuffers.size()); // The containers, the data targets, and the serialized byte counts should all line up Iterator<DBBPool.BBContainer> containerIter = outputBuffers.iterator(); int serializedIndex = 0; for (SnapshotTableTask task : m_tableTasks) { final DBBPool.BBContainer container = containerIter.next(); /* * Finalize the buffer by setting position to 0 and limit to the last used byte */ final ByteBuffer buf = container.b(); buf.limit(serialized[serializedIndex++] + task.m_target.getHeaderSize()); buf.position(0); Callable<DBBPool.BBContainer> valueForTarget = Callables.returning(container); if (task.m_filters != null) { for (SnapshotDataFilter filter : task.m_filters) { valueForTarget = filter.filter(valueForTarget); } } ListenableFuture<?> writeFuture = task.m_target.write(valueForTarget, m_tableId); if (writeFuture != null) { writeFutures.add(writeFuture); } } // Wraps all write futures in one future return Futures.allAsList(writeFutures); }
class class_name[name] begin[{] method[writeBlocksToTargets, return_type[type[ListenableFuture]], modifier[private], parameter[outputBuffers, serialized]] begin[{] call[Preconditions.checkArgument, parameter[binary_operation[call[m_tableTasks.size, parameter[]], ==, member[serialized.length]]]] call[Preconditions.checkArgument, parameter[binary_operation[call[outputBuffers.size, parameter[]], ==, member[serialized.length]]]] local_variable[type[List], writeFutures] local_variable[type[Iterator], containerIter] local_variable[type[int], serializedIndex] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=containerIter, selectors=[], type_arguments=None), name=container)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=DBBPool, sub_type=ReferenceType(arguments=None, dimensions=None, name=BBContainer, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=b, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), name=buf)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ByteBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=serialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=serializedIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MethodInvocation(arguments=[], member=getHeaderSize, postfix_operators=[], prefix_operators=[], qualifier=task.m_target, selectors=[], type_arguments=None), operator=+)], member=limit, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=position, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=returning, postfix_operators=[], prefix_operators=[], qualifier=Callables, selectors=[], type_arguments=None), name=valueForTarget)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DBBPool, sub_type=ReferenceType(arguments=None, dimensions=None, name=BBContainer, sub_type=None)))], dimensions=[], name=Callable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_filters, postfix_operators=[], prefix_operators=[], qualifier=task, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueForTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=valueForTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=filter, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=m_filters, postfix_operators=[], prefix_operators=[], qualifier=task, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SnapshotDataFilter, sub_type=None))), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=valueForTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_tableId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=task.m_target, selectors=[], type_arguments=None), name=writeFuture)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ListenableFuture, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=writeFuture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writeFuture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=writeFutures, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=m_tableTasks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=task)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SnapshotTableTask, sub_type=None))), label=None) return[call[Futures.allAsList, parameter[member[.writeFutures]]]] end[}] END[}]
Keyword[private] identifier[ListenableFuture] operator[<] operator[?] operator[>] identifier[writeBlocksToTargets] operator[SEP] identifier[Collection] operator[<] identifier[DBBPool] operator[SEP] identifier[BBContainer] operator[>] identifier[outputBuffers] , Keyword[int] operator[SEP] operator[SEP] identifier[serialized] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[m_tableTasks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[serialized] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[outputBuffers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[serialized] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ListenableFuture] operator[<] operator[?] operator[>] operator[>] identifier[writeFutures] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ListenableFuture] operator[<] operator[?] operator[>] operator[>] operator[SEP] identifier[outputBuffers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[DBBPool] operator[SEP] identifier[BBContainer] operator[>] identifier[containerIter] operator[=] identifier[outputBuffers] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[serializedIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[SnapshotTableTask] identifier[task] operator[:] identifier[m_tableTasks] operator[SEP] { Keyword[final] identifier[DBBPool] operator[SEP] identifier[BBContainer] identifier[container] operator[=] identifier[containerIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[buf] operator[=] identifier[container] operator[SEP] identifier[b] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[limit] operator[SEP] identifier[serialized] operator[SEP] identifier[serializedIndex] operator[++] operator[SEP] operator[+] identifier[task] operator[SEP] identifier[m_target] operator[SEP] identifier[getHeaderSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[position] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Callable] operator[<] identifier[DBBPool] operator[SEP] identifier[BBContainer] operator[>] identifier[valueForTarget] operator[=] identifier[Callables] operator[SEP] identifier[returning] operator[SEP] identifier[container] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[m_filters] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[SnapshotDataFilter] identifier[filter] operator[:] identifier[task] operator[SEP] identifier[m_filters] operator[SEP] { identifier[valueForTarget] operator[=] identifier[filter] operator[SEP] identifier[filter] operator[SEP] identifier[valueForTarget] operator[SEP] operator[SEP] } } identifier[ListenableFuture] operator[<] operator[?] operator[>] identifier[writeFuture] operator[=] identifier[task] operator[SEP] identifier[m_target] operator[SEP] identifier[write] operator[SEP] identifier[valueForTarget] , identifier[m_tableId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[writeFuture] operator[!=] Other[null] operator[SEP] { identifier[writeFutures] operator[SEP] identifier[add] operator[SEP] identifier[writeFuture] operator[SEP] operator[SEP] } } Keyword[return] identifier[Futures] operator[SEP] identifier[allAsList] operator[SEP] identifier[writeFutures] operator[SEP] operator[SEP] }
public void setDecimalSeparatorString(String decimalSeparatorString) { if (decimalSeparatorString == null) { throw new NullPointerException("The input decimal separator is null"); } this.decimalSeparatorString = decimalSeparatorString; if (decimalSeparatorString.length() == 1) { this.decimalSeparator = decimalSeparatorString.charAt(0); } else { // Use the default decimal separator character as fallback this.decimalSeparator = DEF_DECIMAL_SEPARATOR; } }
class class_name[name] begin[{] method[setDecimalSeparatorString, return_type[void], modifier[public], parameter[decimalSeparatorString]] begin[{] if[binary_operation[member[.decimalSeparatorString], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The input decimal separator is null")], 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[}] assign[THIS[member[None.decimalSeparatorString]], member[.decimalSeparatorString]] if[binary_operation[call[decimalSeparatorString.length, parameter[]], ==, literal[1]]] begin[{] assign[THIS[member[None.decimalSeparator]], call[decimalSeparatorString.charAt, parameter[literal[0]]]] else begin[{] assign[THIS[member[None.decimalSeparator]], member[.DEF_DECIMAL_SEPARATOR]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDecimalSeparatorString] operator[SEP] identifier[String] identifier[decimalSeparatorString] operator[SEP] { Keyword[if] operator[SEP] identifier[decimalSeparatorString] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[decimalSeparatorString] operator[=] identifier[decimalSeparatorString] operator[SEP] Keyword[if] operator[SEP] identifier[decimalSeparatorString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { Keyword[this] operator[SEP] identifier[decimalSeparator] operator[=] identifier[decimalSeparatorString] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[decimalSeparator] operator[=] identifier[DEF_DECIMAL_SEPARATOR] operator[SEP] } }
public static void clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv, int[] tris, int nt, int[] areas) { float walkableThr = (float) Math.cos(walkableSlopeAngle / 180.0f * Math.PI); float norm[] = new float[3]; for (int i = 0; i < nt; ++i) { int tri = i * 3; calcTriNormal(verts, tris[tri], tris[tri + 1], tris[tri + 2], norm); // Check if the face is walkable. if (norm[1] <= walkableThr) areas[i] = RC_NULL_AREA; } }
class class_name[name] begin[{] method[clearUnwalkableTriangles, return_type[void], modifier[public static], parameter[ctx, walkableSlopeAngle, verts, nv, tris, nt, areas]] begin[{] local_variable[type[float], walkableThr] local_variable[type[float], norm] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), name=tri)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tris, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=tri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=tris, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=tri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), MemberReference(member=tris, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=tri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))]), MemberReference(member=norm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=calcTriNormal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=norm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=walkableThr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=areas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=RC_NULL_AREA, 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=nt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[clearUnwalkableTriangles] operator[SEP] identifier[Context] identifier[ctx] , Keyword[float] identifier[walkableSlopeAngle] , Keyword[float] operator[SEP] operator[SEP] identifier[verts] , Keyword[int] identifier[nv] , Keyword[int] operator[SEP] operator[SEP] identifier[tris] , Keyword[int] identifier[nt] , Keyword[int] operator[SEP] operator[SEP] identifier[areas] operator[SEP] { Keyword[float] identifier[walkableThr] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[walkableSlopeAngle] operator[/] literal[Float] operator[*] identifier[Math] operator[SEP] identifier[PI] operator[SEP] operator[SEP] Keyword[float] identifier[norm] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[float] operator[SEP] Other[3] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nt] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[int] identifier[tri] operator[=] identifier[i] operator[*] Other[3] operator[SEP] identifier[calcTriNormal] operator[SEP] identifier[verts] , identifier[tris] operator[SEP] identifier[tri] operator[SEP] , identifier[tris] operator[SEP] identifier[tri] operator[+] Other[1] operator[SEP] , identifier[tris] operator[SEP] identifier[tri] operator[+] Other[2] operator[SEP] , identifier[norm] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[norm] operator[SEP] Other[1] operator[SEP] operator[<=] identifier[walkableThr] operator[SEP] identifier[areas] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[RC_NULL_AREA] operator[SEP] } }
@UiChild(tagname="rightButton", limit=1) public void setRightButton(JQMButton button) { if (right != null) remove(right); button.setPosOnBand(PosOnBand.RIGHT); right = button; add(right); }
class class_name[name] begin[{] method[setRightButton, return_type[void], modifier[public], parameter[button]] begin[{] if[binary_operation[member[.right], !=, literal[null]]] begin[{] call[.remove, parameter[member[.right]]] else begin[{] None end[}] call[button.setPosOnBand, parameter[member[PosOnBand.RIGHT]]] assign[member[.right], member[.button]] call[.add, parameter[member[.right]]] end[}] END[}]
annotation[@] identifier[UiChild] operator[SEP] identifier[tagname] operator[=] literal[String] , identifier[limit] operator[=] Other[1] operator[SEP] Keyword[public] Keyword[void] identifier[setRightButton] operator[SEP] identifier[JQMButton] identifier[button] operator[SEP] { Keyword[if] operator[SEP] identifier[right] operator[!=] Other[null] operator[SEP] identifier[remove] operator[SEP] identifier[right] operator[SEP] operator[SEP] identifier[button] operator[SEP] identifier[setPosOnBand] operator[SEP] identifier[PosOnBand] operator[SEP] identifier[RIGHT] operator[SEP] operator[SEP] identifier[right] operator[=] identifier[button] operator[SEP] identifier[add] operator[SEP] identifier[right] operator[SEP] operator[SEP] }
private void addThemeLinks(PageParameters parameters){ if (parameters.getAllNamed().size() < 2) { add(new UpdateThemeLink("defaultTheme", "chart")); add(new UpdateThemeLink("grid", "chart")); add(new UpdateThemeLink("skies", "chart")); add(new UpdateThemeLink("gray", "chart")); add(new UpdateThemeLink("darkblue", "chart")); } else { String chartString = parameters.getAllNamed().get(1).getValue(); add(new UpdateThemeLink("defaultTheme", chartString)); add(new UpdateThemeLink("grid", chartString)); add(new UpdateThemeLink("skies", chartString)); add(new UpdateThemeLink("gray", chartString)); add(new UpdateThemeLink("darkblue", chartString)); } }
class class_name[name] begin[{] method[addThemeLinks, return_type[void], modifier[private], parameter[parameters]] begin[{] if[binary_operation[call[parameters.getAllNamed, parameter[]], <, literal[2]]] begin[{] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="defaultTheme"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chart")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="grid"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chart")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="skies"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chart")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="gray"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chart")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="darkblue"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chart")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UpdateThemeLink, sub_type=None))]] else begin[{] local_variable[type[String], chartString] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="defaultTheme"), MemberReference(member=chartString, 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=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="grid"), MemberReference(member=chartString, 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=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="skies"), MemberReference(member=chartString, 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=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="gray"), MemberReference(member=chartString, 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=UpdateThemeLink, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="darkblue"), MemberReference(member=chartString, 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=UpdateThemeLink, sub_type=None))]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addThemeLinks] operator[SEP] identifier[PageParameters] identifier[parameters] operator[SEP] { Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[getAllNamed] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] { identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[chartString] operator[=] identifier[parameters] operator[SEP] identifier[getAllNamed] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , identifier[chartString] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , identifier[chartString] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , identifier[chartString] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , identifier[chartString] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[UpdateThemeLink] operator[SEP] literal[String] , identifier[chartString] operator[SEP] operator[SEP] operator[SEP] } }
@BetaApi public final Operation createSnapshotDisk( String disk, Boolean guestFlush, Snapshot snapshotResource) { CreateSnapshotDiskHttpRequest request = CreateSnapshotDiskHttpRequest.newBuilder() .setDisk(disk) .setGuestFlush(guestFlush) .setSnapshotResource(snapshotResource) .build(); return createSnapshotDisk(request); }
class class_name[name] begin[{] method[createSnapshotDisk, return_type[type[Operation]], modifier[final public], parameter[disk, guestFlush, snapshotResource]] begin[{] local_variable[type[CreateSnapshotDiskHttpRequest], request] return[call[.createSnapshotDisk, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[createSnapshotDisk] operator[SEP] identifier[String] identifier[disk] , identifier[Boolean] identifier[guestFlush] , identifier[Snapshot] identifier[snapshotResource] operator[SEP] { identifier[CreateSnapshotDiskHttpRequest] identifier[request] operator[=] identifier[CreateSnapshotDiskHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setDisk] operator[SEP] identifier[disk] operator[SEP] operator[SEP] identifier[setGuestFlush] operator[SEP] identifier[guestFlush] operator[SEP] operator[SEP] identifier[setSnapshotResource] operator[SEP] identifier[snapshotResource] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[createSnapshotDisk] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static MutableRoaringBitmap xor(ImmutableRoaringBitmap... bitmaps) { return groupByKey(bitmaps) .entrySet() .parallelStream() .collect(XOR); }
class class_name[name] begin[{] method[xor, return_type[type[MutableRoaringBitmap]], modifier[public static], parameter[bitmaps]] begin[{] return[call[.groupByKey, parameter[member[.bitmaps]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MutableRoaringBitmap] identifier[xor] operator[SEP] identifier[ImmutableRoaringBitmap] operator[...] identifier[bitmaps] operator[SEP] { Keyword[return] identifier[groupByKey] operator[SEP] identifier[bitmaps] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[parallelStream] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[XOR] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public static boolean hasSameContentOf(final ODocument iCurrent, final ODatabaseDocumentInternal iMyDb, final ODocument iOther, final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper, final boolean iCheckAlsoIdentity) { if (iOther == null) return false; if (iCheckAlsoIdentity && iCurrent.getIdentity().isValid() && !iCurrent.getIdentity().equals(iOther.getIdentity())) return false; if (iMyDb != null) makeDbCall(iMyDb, new ODbRelatedCall<Object>() { public Object call(ODatabaseDocumentInternal database) { if (iCurrent.getInternalStatus() == STATUS.NOT_LOADED) iCurrent.reload(); return null; } }); if (iOtherDb != null) makeDbCall(iOtherDb, new ODbRelatedCall<Object>() { public Object call(ODatabaseDocumentInternal database) { if (iOther.getInternalStatus() == STATUS.NOT_LOADED) iOther.reload(); return null; } }); if (iMyDb != null) makeDbCall(iMyDb, new ODbRelatedCall<Object>() { public Object call(ODatabaseDocumentInternal database) { iCurrent.checkForFields(); return null; } }); else iCurrent.checkForFields(); if (iOtherDb != null) makeDbCall(iOtherDb, new ODbRelatedCall<Object>() { public Object call(ODatabaseDocumentInternal database) { iOther.checkForFields(); return null; } }); else iOther.checkForFields(); if (iCurrent.fields() != iOther.fields()) return false; // CHECK FIELD-BY-FIELD Object myFieldValue; Object otherFieldValue; for (Entry<String, Object> f : iCurrent) { myFieldValue = f.getValue(); otherFieldValue = iOther._fields.get(f.getKey()).value; if (myFieldValue == otherFieldValue) continue; // CHECK FOR NULLS if (myFieldValue == null) { if (otherFieldValue != null) return false; } else if (otherFieldValue == null) return false; if (myFieldValue != null) if (myFieldValue instanceof Set && otherFieldValue instanceof Set) { if (!compareSets(iMyDb, (Set<?>) myFieldValue, iOtherDb, (Set<?>) otherFieldValue, ridMapper)) return false; } else if (myFieldValue instanceof Collection && otherFieldValue instanceof Collection) { if (!compareCollections(iMyDb, (Collection<?>) myFieldValue, iOtherDb, (Collection<?>) otherFieldValue, ridMapper)) return false; } else if (myFieldValue instanceof ORidBag && otherFieldValue instanceof ORidBag) { if (!compareBags(iMyDb, (ORidBag) myFieldValue, iOtherDb, (ORidBag) otherFieldValue, ridMapper)) return false; } else if (myFieldValue instanceof Map && otherFieldValue instanceof Map) { if (!compareMaps(iMyDb, (Map<Object, Object>) myFieldValue, iOtherDb, (Map<Object, Object>) otherFieldValue, ridMapper)) return false; } else if (myFieldValue instanceof ODocument && otherFieldValue instanceof ODocument) { if (!hasSameContentOf((ODocument) myFieldValue, iMyDb, (ODocument) otherFieldValue, iOtherDb, ridMapper)) return false; } else { if (!compareScalarValues(myFieldValue, iMyDb, otherFieldValue, iOtherDb, ridMapper)) return false; } } return true; }
class class_name[name] begin[{] method[hasSameContentOf, return_type[type[boolean]], modifier[public static], parameter[iCurrent, iMyDb, iOther, iOtherDb, ridMapper, iCheckAlsoIdentity]] begin[{] if[binary_operation[member[.iOther], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.iCheckAlsoIdentity], &&, call[iCurrent.getIdentity, parameter[]]], &&, call[iCurrent.getIdentity, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.iMyDb], !=, literal[null]]] begin[{] call[.makeDbCall, parameter[member[.iMyDb], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getInternalStatus, postfix_operators=[], prefix_operators=[], qualifier=iCurrent, selectors=[], type_arguments=None), operandr=MemberReference(member=NOT_LOADED, postfix_operators=[], prefix_operators=[], qualifier=STATUS, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=reload, postfix_operators=[], prefix_operators=[], qualifier=iCurrent, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=database, type=ReferenceType(arguments=None, dimensions=[], name=ODatabaseDocumentInternal, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=ODbRelatedCall, sub_type=None))]] else begin[{] None end[}] if[binary_operation[member[.iOtherDb], !=, literal[null]]] begin[{] call[.makeDbCall, parameter[member[.iOtherDb], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getInternalStatus, postfix_operators=[], prefix_operators=[], qualifier=iOther, selectors=[], type_arguments=None), operandr=MemberReference(member=NOT_LOADED, postfix_operators=[], prefix_operators=[], qualifier=STATUS, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=reload, postfix_operators=[], prefix_operators=[], qualifier=iOther, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=database, type=ReferenceType(arguments=None, dimensions=[], name=ODatabaseDocumentInternal, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=ODbRelatedCall, sub_type=None))]] else begin[{] None end[}] if[binary_operation[member[.iMyDb], !=, literal[null]]] begin[{] call[.makeDbCall, parameter[member[.iMyDb], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkForFields, postfix_operators=[], prefix_operators=[], qualifier=iCurrent, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=database, type=ReferenceType(arguments=None, dimensions=[], name=ODatabaseDocumentInternal, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=ODbRelatedCall, sub_type=None))]] else begin[{] call[iCurrent.checkForFields, parameter[]] end[}] if[binary_operation[member[.iOtherDb], !=, literal[null]]] begin[{] call[.makeDbCall, parameter[member[.iOtherDb], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkForFields, postfix_operators=[], prefix_operators=[], qualifier=iOther, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=database, type=ReferenceType(arguments=None, dimensions=[], name=ODatabaseDocumentInternal, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=ODbRelatedCall, sub_type=None))]] else begin[{] call[iOther.checkForFields, parameter[]] end[}] if[binary_operation[call[iCurrent.fields, parameter[]], !=, call[iOther.fields, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Object], myFieldValue] local_variable[type[Object], otherFieldValue] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=iOther._fields, selectors=[MemberReference(member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=otherFieldValue, 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=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=otherFieldValue, 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=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=myFieldValue, 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=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Set, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Set, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ORidBag, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ORidBag, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ODocument, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ODocument, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iMyDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iOtherDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ridMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareScalarValues, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Cast(expression=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ODocument, sub_type=None)), MemberReference(member=iMyDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ODocument, sub_type=None)), MemberReference(member=iOtherDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ridMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasSameContentOf, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=iMyDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), MemberReference(member=iOtherDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), MemberReference(member=ridMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareMaps, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=iMyDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ORidBag, sub_type=None)), MemberReference(member=iOtherDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ORidBag, sub_type=None)), MemberReference(member=ridMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareBags, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=iMyDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Collection, sub_type=None)), MemberReference(member=iOtherDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Collection, sub_type=None)), MemberReference(member=ridMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareCollections, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=iMyDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=myFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Set, sub_type=None)), MemberReference(member=iOtherDb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=otherFieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Set, sub_type=None)), MemberReference(member=ridMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareSets, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))])))]), control=EnhancedForControl(iterable=MemberReference(member=iCurrent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], 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=Object, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[literal[true]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[boolean] identifier[hasSameContentOf] operator[SEP] Keyword[final] identifier[ODocument] identifier[iCurrent] , Keyword[final] identifier[ODatabaseDocumentInternal] identifier[iMyDb] , Keyword[final] identifier[ODocument] identifier[iOther] , Keyword[final] identifier[ODatabaseDocumentInternal] identifier[iOtherDb] , identifier[RIDMapper] identifier[ridMapper] , Keyword[final] Keyword[boolean] identifier[iCheckAlsoIdentity] operator[SEP] { Keyword[if] operator[SEP] identifier[iOther] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[iCheckAlsoIdentity] operator[&&] identifier[iCurrent] operator[SEP] identifier[getIdentity] operator[SEP] operator[SEP] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[iCurrent] operator[SEP] identifier[getIdentity] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[iOther] operator[SEP] identifier[getIdentity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[iMyDb] operator[!=] Other[null] operator[SEP] identifier[makeDbCall] operator[SEP] identifier[iMyDb] , Keyword[new] identifier[ODbRelatedCall] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[ODatabaseDocumentInternal] identifier[database] operator[SEP] { Keyword[if] operator[SEP] identifier[iCurrent] operator[SEP] identifier[getInternalStatus] operator[SEP] operator[SEP] operator[==] identifier[STATUS] operator[SEP] identifier[NOT_LOADED] operator[SEP] identifier[iCurrent] operator[SEP] identifier[reload] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iOtherDb] operator[!=] Other[null] operator[SEP] identifier[makeDbCall] operator[SEP] identifier[iOtherDb] , Keyword[new] identifier[ODbRelatedCall] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[ODatabaseDocumentInternal] identifier[database] operator[SEP] { Keyword[if] operator[SEP] identifier[iOther] operator[SEP] identifier[getInternalStatus] operator[SEP] operator[SEP] operator[==] identifier[STATUS] operator[SEP] identifier[NOT_LOADED] operator[SEP] identifier[iOther] operator[SEP] identifier[reload] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iMyDb] operator[!=] Other[null] operator[SEP] identifier[makeDbCall] operator[SEP] identifier[iMyDb] , Keyword[new] identifier[ODbRelatedCall] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[ODatabaseDocumentInternal] identifier[database] operator[SEP] { identifier[iCurrent] operator[SEP] identifier[checkForFields] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] Keyword[else] identifier[iCurrent] operator[SEP] identifier[checkForFields] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iOtherDb] operator[!=] Other[null] operator[SEP] identifier[makeDbCall] operator[SEP] identifier[iOtherDb] , Keyword[new] identifier[ODbRelatedCall] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[ODatabaseDocumentInternal] identifier[database] operator[SEP] { identifier[iOther] operator[SEP] identifier[checkForFields] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] Keyword[else] identifier[iOther] operator[SEP] identifier[checkForFields] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iCurrent] operator[SEP] identifier[fields] operator[SEP] operator[SEP] operator[!=] identifier[iOther] operator[SEP] identifier[fields] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[Object] identifier[myFieldValue] operator[SEP] identifier[Object] identifier[otherFieldValue] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[f] operator[:] identifier[iCurrent] operator[SEP] { identifier[myFieldValue] operator[=] identifier[f] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[otherFieldValue] operator[=] identifier[iOther] operator[SEP] identifier[_fields] operator[SEP] identifier[get] operator[SEP] identifier[f] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[myFieldValue] operator[==] identifier[otherFieldValue] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[myFieldValue] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[otherFieldValue] operator[!=] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[otherFieldValue] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[myFieldValue] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[myFieldValue] Keyword[instanceof] identifier[Set] operator[&&] identifier[otherFieldValue] Keyword[instanceof] identifier[Set] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[compareSets] operator[SEP] identifier[iMyDb] , operator[SEP] identifier[Set] operator[<] operator[?] operator[>] operator[SEP] identifier[myFieldValue] , identifier[iOtherDb] , operator[SEP] identifier[Set] operator[<] operator[?] operator[>] operator[SEP] identifier[otherFieldValue] , identifier[ridMapper] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[myFieldValue] Keyword[instanceof] identifier[Collection] operator[&&] identifier[otherFieldValue] Keyword[instanceof] identifier[Collection] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[compareCollections] operator[SEP] identifier[iMyDb] , operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] operator[SEP] identifier[myFieldValue] , identifier[iOtherDb] , operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] operator[SEP] identifier[otherFieldValue] , identifier[ridMapper] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[myFieldValue] Keyword[instanceof] identifier[ORidBag] operator[&&] identifier[otherFieldValue] Keyword[instanceof] identifier[ORidBag] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[compareBags] operator[SEP] identifier[iMyDb] , operator[SEP] identifier[ORidBag] operator[SEP] identifier[myFieldValue] , identifier[iOtherDb] , operator[SEP] identifier[ORidBag] operator[SEP] identifier[otherFieldValue] , identifier[ridMapper] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[myFieldValue] Keyword[instanceof] identifier[Map] operator[&&] identifier[otherFieldValue] Keyword[instanceof] identifier[Map] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[compareMaps] operator[SEP] identifier[iMyDb] , operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] operator[SEP] identifier[myFieldValue] , identifier[iOtherDb] , operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] operator[SEP] identifier[otherFieldValue] , identifier[ridMapper] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[myFieldValue] Keyword[instanceof] identifier[ODocument] operator[&&] identifier[otherFieldValue] Keyword[instanceof] identifier[ODocument] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[hasSameContentOf] operator[SEP] operator[SEP] identifier[ODocument] operator[SEP] identifier[myFieldValue] , identifier[iMyDb] , operator[SEP] identifier[ODocument] operator[SEP] identifier[otherFieldValue] , identifier[iOtherDb] , identifier[ridMapper] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[compareScalarValues] operator[SEP] identifier[myFieldValue] , identifier[iMyDb] , identifier[otherFieldValue] , identifier[iOtherDb] , identifier[ridMapper] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public final EObject ruleReferenceOrLiteral() throws RecognitionException { EObject current = null; AntlrDatatypeRuleToken lv_name_0_0 = null; enterRule(); try { // InternalSimpleAntlr.g:1241:28: ( ( (lv_name_0_0= ruleQName ) ) ) // InternalSimpleAntlr.g:1242:1: ( (lv_name_0_0= ruleQName ) ) { // InternalSimpleAntlr.g:1242:1: ( (lv_name_0_0= ruleQName ) ) // InternalSimpleAntlr.g:1243:1: (lv_name_0_0= ruleQName ) { // InternalSimpleAntlr.g:1243:1: (lv_name_0_0= ruleQName ) // InternalSimpleAntlr.g:1244:3: lv_name_0_0= ruleQName { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getReferenceOrLiteralAccess().getNameQNameParserRuleCall_0()); } pushFollow(FOLLOW_2); lv_name_0_0=ruleQName(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getReferenceOrLiteralRule()); } set( current, "name", lv_name_0_0, "org.eclipse.xtext.generator.parser.antlr.debug.SimpleAntlr.QName"); afterParserOrEnumRuleCall(); } } } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; }
class class_name[name] begin[{] method[ruleReferenceOrLiteral, return_type[type[EObject]], modifier[final public], parameter[]] begin[{] local_variable[type[EObject], current] local_variable[type[AntlrDatatypeRuleToken], lv_name_0_0] call[.enterRule, parameter[]] TryStatement(block=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, 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=[MethodInvocation(arguments=[], member=getReferenceOrLiteralAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getNameQNameParserRuleCall_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lv_name_0_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleQName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=current, 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=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReferenceOrLiteralRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=createModelElementForParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name"), MemberReference(member=lv_name_0_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.eclipse.xtext.generator.parser.antlr.debug.SimpleAntlr.QName")], member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=afterParserOrEnumRuleCall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])])]), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, 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=[], member=leaveRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[member[.current]] end[}] END[}]
Keyword[public] Keyword[final] identifier[EObject] identifier[ruleReferenceOrLiteral] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { identifier[EObject] identifier[current] operator[=] Other[null] operator[SEP] identifier[AntlrDatatypeRuleToken] identifier[lv_name_0_0] operator[=] Other[null] operator[SEP] identifier[enterRule] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { { { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getReferenceOrLiteralAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getNameQNameParserRuleCall_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_2] operator[SEP] operator[SEP] identifier[lv_name_0_0] operator[=] identifier[ruleQName] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[current] operator[==] Other[null] operator[SEP] { identifier[current] operator[=] identifier[createModelElementForParent] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getReferenceOrLiteralRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[set] operator[SEP] identifier[current] , literal[String] , identifier[lv_name_0_0] , literal[String] operator[SEP] operator[SEP] identifier[afterParserOrEnumRuleCall] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[leaveRule] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] identifier[current] operator[SEP] }
public EventHandlerGroup<T> after(final EventProcessor... processors) { for (final EventProcessor processor : processors) { consumerRepository.add(processor); } return new EventHandlerGroup<>(this, consumerRepository, Util.getSequencesFor(processors)); }
class class_name[name] begin[{] method[after, return_type[type[EventHandlerGroup]], modifier[public], parameter[processors]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=processor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=consumerRepository, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=processors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=processor)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=EventProcessor, sub_type=None))), label=None) return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=consumerRepository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=processors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSequencesFor, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=EventHandlerGroup, sub_type=None))] end[}] END[}]
Keyword[public] identifier[EventHandlerGroup] operator[<] identifier[T] operator[>] identifier[after] operator[SEP] Keyword[final] identifier[EventProcessor] operator[...] identifier[processors] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[EventProcessor] identifier[processor] operator[:] identifier[processors] operator[SEP] { identifier[consumerRepository] operator[SEP] identifier[add] operator[SEP] identifier[processor] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[EventHandlerGroup] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[consumerRepository] , identifier[Util] operator[SEP] identifier[getSequencesFor] operator[SEP] identifier[processors] operator[SEP] operator[SEP] operator[SEP] }
public ListResolverRuleAssociationsResult withResolverRuleAssociations(ResolverRuleAssociation... resolverRuleAssociations) { if (this.resolverRuleAssociations == null) { setResolverRuleAssociations(new java.util.ArrayList<ResolverRuleAssociation>(resolverRuleAssociations.length)); } for (ResolverRuleAssociation ele : resolverRuleAssociations) { this.resolverRuleAssociations.add(ele); } return this; }
class class_name[name] begin[{] method[withResolverRuleAssociations, return_type[type[ListResolverRuleAssociationsResult]], modifier[public], parameter[resolverRuleAssociations]] begin[{] if[binary_operation[THIS[member[None.resolverRuleAssociations]], ==, literal[null]]] begin[{] call[.setResolverRuleAssociations, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resolverRuleAssociations, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResolverRuleAssociation, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=resolverRuleAssociations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resolverRuleAssociations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResolverRuleAssociation, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ListResolverRuleAssociationsResult] identifier[withResolverRuleAssociations] operator[SEP] identifier[ResolverRuleAssociation] operator[...] identifier[resolverRuleAssociations] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[resolverRuleAssociations] operator[==] Other[null] operator[SEP] { identifier[setResolverRuleAssociations] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ResolverRuleAssociation] operator[>] operator[SEP] identifier[resolverRuleAssociations] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ResolverRuleAssociation] identifier[ele] operator[:] identifier[resolverRuleAssociations] operator[SEP] { Keyword[this] operator[SEP] identifier[resolverRuleAssociations] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static long toMJD( int year, int month, int dayOfMonth ) { checkDate(year, month, dayOfMonth); long y = year; int m = month; if (m < 3) { y--; m += 12; } long days = ( (y * 365) + Math.floorDiv(y, 4) + (((m + 1) * 153) / 5) - 123 + dayOfMonth ); if ((year >= 1901) && (year < 2100)) { days -= 15; } else { days = days - Math.floorDiv(y, 100) + Math.floorDiv(y, 400); } return days - OFFSET; }
class class_name[name] begin[{] method[toMJD, return_type[type[long]], modifier[public static], parameter[year, month, dayOfMonth]] begin[{] call[.checkDate, parameter[member[.year], member[.month], member[.dayOfMonth]]] local_variable[type[long], y] local_variable[type[int], m] if[binary_operation[member[.m], <, literal[3]]] begin[{] member[.y] assign[member[.m], literal[12]] else begin[{] None end[}] local_variable[type[long], days] if[binary_operation[binary_operation[member[.year], >=, literal[1901]], &&, binary_operation[member[.year], <, literal[2100]]]] begin[{] assign[member[.days], literal[15]] else begin[{] assign[member[.days], binary_operation[binary_operation[member[.days], -, call[Math.floorDiv, parameter[member[.y], literal[100]]]], +, call[Math.floorDiv, parameter[member[.y], literal[400]]]]] end[}] return[binary_operation[member[.days], -, member[.OFFSET]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[toMJD] operator[SEP] Keyword[int] identifier[year] , Keyword[int] identifier[month] , Keyword[int] identifier[dayOfMonth] operator[SEP] { identifier[checkDate] operator[SEP] identifier[year] , identifier[month] , identifier[dayOfMonth] operator[SEP] operator[SEP] Keyword[long] identifier[y] operator[=] identifier[year] operator[SEP] Keyword[int] identifier[m] operator[=] identifier[month] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[<] Other[3] operator[SEP] { identifier[y] operator[--] operator[SEP] identifier[m] operator[+=] Other[12] operator[SEP] } Keyword[long] identifier[days] operator[=] operator[SEP] operator[SEP] identifier[y] operator[*] Other[365] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[floorDiv] operator[SEP] identifier[y] , Other[4] operator[SEP] operator[+] operator[SEP] operator[SEP] operator[SEP] identifier[m] operator[+] Other[1] operator[SEP] operator[*] Other[153] operator[SEP] operator[/] Other[5] operator[SEP] operator[-] Other[123] operator[+] identifier[dayOfMonth] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[year] operator[>=] Other[1901] operator[SEP] operator[&&] operator[SEP] identifier[year] operator[<] Other[2100] operator[SEP] operator[SEP] { identifier[days] operator[-=] Other[15] operator[SEP] } Keyword[else] { identifier[days] operator[=] identifier[days] operator[-] identifier[Math] operator[SEP] identifier[floorDiv] operator[SEP] identifier[y] , Other[100] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[floorDiv] operator[SEP] identifier[y] , Other[400] operator[SEP] operator[SEP] } Keyword[return] identifier[days] operator[-] identifier[OFFSET] operator[SEP] }
public static XContentBuilder marshall(ApiDefinitionBean bean) throws StorageException { try (XContentBuilder builder = XContentFactory.jsonBuilder()) { preMarshall(bean); builder .startObject() .field("data", bean.getData()) .endObject(); postMarshall(bean); return builder; } catch (IOException e) { throw new StorageException(e); } }
class class_name[name] begin[{] method[marshall, return_type[type[XContentBuilder]], modifier[public static], parameter[bean]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=preMarshall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=startObject, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data"), MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=bean, selectors=[], type_arguments=None)], member=field, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=endObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=postMarshall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StorageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=builder, type=ReferenceType(arguments=None, dimensions=[], name=XContentBuilder, sub_type=None), value=MethodInvocation(arguments=[], member=jsonBuilder, postfix_operators=[], prefix_operators=[], qualifier=XContentFactory, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[public] Keyword[static] identifier[XContentBuilder] identifier[marshall] operator[SEP] identifier[ApiDefinitionBean] identifier[bean] operator[SEP] Keyword[throws] identifier[StorageException] { Keyword[try] operator[SEP] identifier[XContentBuilder] identifier[builder] operator[=] identifier[XContentFactory] operator[SEP] identifier[jsonBuilder] operator[SEP] operator[SEP] operator[SEP] { identifier[preMarshall] operator[SEP] identifier[bean] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[startObject] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[SEP] literal[String] , identifier[bean] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[endObject] operator[SEP] operator[SEP] operator[SEP] identifier[postMarshall] operator[SEP] identifier[bean] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[StorageException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
@Override public final void recycle() { speedX = 1.0; speedY = 1.0; destinationReached = true; renderDebug = false; skip = false; moving = false; pathStopped = false; pathStoppedRequested = true; pathFoundChanged = false; currentStep = 0; path = null; moveX = 0.0; moveY = 0.0; sharedPathIds.clear(); }
class class_name[name] begin[{] method[recycle, return_type[void], modifier[final public], parameter[]] begin[{] assign[member[.speedX], literal[1.0]] assign[member[.speedY], literal[1.0]] assign[member[.destinationReached], literal[true]] assign[member[.renderDebug], literal[false]] assign[member[.skip], literal[false]] assign[member[.moving], literal[false]] assign[member[.pathStopped], literal[false]] assign[member[.pathStoppedRequested], literal[true]] assign[member[.pathFoundChanged], literal[false]] assign[member[.currentStep], literal[0]] assign[member[.path], literal[null]] assign[member[.moveX], literal[0.0]] assign[member[.moveY], literal[0.0]] call[sharedPathIds.clear, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[recycle] operator[SEP] operator[SEP] { identifier[speedX] operator[=] literal[Float] operator[SEP] identifier[speedY] operator[=] literal[Float] operator[SEP] identifier[destinationReached] operator[=] literal[boolean] operator[SEP] identifier[renderDebug] operator[=] literal[boolean] operator[SEP] identifier[skip] operator[=] literal[boolean] operator[SEP] identifier[moving] operator[=] literal[boolean] operator[SEP] identifier[pathStopped] operator[=] literal[boolean] operator[SEP] identifier[pathStoppedRequested] operator[=] literal[boolean] operator[SEP] identifier[pathFoundChanged] operator[=] literal[boolean] operator[SEP] identifier[currentStep] operator[=] Other[0] operator[SEP] identifier[path] operator[=] Other[null] operator[SEP] identifier[moveX] operator[=] literal[Float] operator[SEP] identifier[moveY] operator[=] literal[Float] operator[SEP] identifier[sharedPathIds] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] }
private static <E> boolean addAllImpl( Multiset<E> self, AbstractMapBasedMultiset<? extends E> elements) { if (elements.isEmpty()) { return false; } elements.addTo(self); return true; }
class class_name[name] begin[{] method[addAllImpl, return_type[type[boolean]], modifier[private static], parameter[self, elements]] begin[{] if[call[elements.isEmpty, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] call[elements.addTo, parameter[member[.self]]] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[E] operator[>] Keyword[boolean] identifier[addAllImpl] operator[SEP] identifier[Multiset] operator[<] identifier[E] operator[>] identifier[self] , identifier[AbstractMapBasedMultiset] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] identifier[elements] operator[SEP] { Keyword[if] operator[SEP] identifier[elements] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[elements] operator[SEP] identifier[addTo] operator[SEP] identifier[self] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
private Iterator<Record> readBatch(final DeltaPlacement placement, final Collection<Key> keys, final ReadConsistency consistency) { checkNotNull(keys, "keys"); // Convert the keys to ByteBuffer Cassandra row keys List<Map.Entry<ByteBuffer, Key>> rowKeys = Lists.newArrayListWithCapacity(keys.size()); for (Key key : keys) { AstyanaxTable table = (AstyanaxTable) key.getTable(); AstyanaxStorage storage = table.getReadStorage(); rowKeys.add(Maps.immutableEntry(storage.getRowKey(key.getKey()), key)); } // Sort the keys by their byte array encoding to get some locality w/queries. Collections.sort(rowKeys, Ordering.natural().onResultOf(entry -> entry.getKey())); // Group them into batches. Cassandra may have to seek each row so prefer smaller batches. List<List<Map.Entry<ByteBuffer, Key>>> batches = Lists.partition(rowKeys, _driverConfig.getMaxRandomRowsBatchSize()); // This algorithm is arranged such that rows are return in pages with size _fetchSize. The rows are grouped // into row groups by common row key. The first RECORD_CACHE_SIZE rows are cached for the row group // and any remaining rows are cached using soft references. This places an upper bound on the memory // requirements needed while iterating. If at any time a soft reference is lost C* is re-queried to // fetch the missing columns. return Iterators.concat(Iterators.transform(batches.iterator(), rowKeySubset -> { Timer.Context timerCtx = _readBatchTimer.time(); try { return rowQuery(rowKeySubset, consistency, placement); } finally { timerCtx.stop(); } })); }
class class_name[name] begin[{] method[readBatch, return_type[type[Iterator]], modifier[private], parameter[placement, keys, consistency]] begin[{] call[.checkNotNull, parameter[member[.keys], literal["keys"]]] local_variable[type[List], rowKeys] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getTable, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AstyanaxTable, sub_type=None)), name=table)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AstyanaxTable, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getReadStorage, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), name=storage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AstyanaxStorage, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None)], member=getRowKey, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=immutableEntry, postfix_operators=[], prefix_operators=[], qualifier=Maps, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=rowKeys, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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) call[Collections.sort, parameter[member[.rowKeys], call[Ordering.natural, parameter[]]]] local_variable[type[List], batches] return[call[Iterators.concat, parameter[call[Iterators.transform, parameter[call[batches.iterator, parameter[]], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=time, postfix_operators=[], prefix_operators=[], qualifier=_readBatchTimer, selectors=[], type_arguments=None), name=timerCtx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Timer, sub_type=ReferenceType(arguments=None, dimensions=None, name=Context, sub_type=None))), TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=rowKeySubset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=consistency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=placement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rowQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=timerCtx, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], parameters=[MemberReference(member=rowKeySubset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]]] end[}] END[}]
Keyword[private] identifier[Iterator] operator[<] identifier[Record] operator[>] identifier[readBatch] operator[SEP] Keyword[final] identifier[DeltaPlacement] identifier[placement] , Keyword[final] identifier[Collection] operator[<] identifier[Key] operator[>] identifier[keys] , Keyword[final] identifier[ReadConsistency] identifier[consistency] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[keys] , literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[ByteBuffer] , identifier[Key] operator[>] operator[>] identifier[rowKeys] operator[=] identifier[Lists] operator[SEP] identifier[newArrayListWithCapacity] operator[SEP] identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Key] identifier[key] operator[:] identifier[keys] operator[SEP] { identifier[AstyanaxTable] identifier[table] operator[=] operator[SEP] identifier[AstyanaxTable] operator[SEP] identifier[key] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] identifier[AstyanaxStorage] identifier[storage] operator[=] identifier[table] operator[SEP] identifier[getReadStorage] operator[SEP] operator[SEP] operator[SEP] identifier[rowKeys] operator[SEP] identifier[add] operator[SEP] identifier[Maps] operator[SEP] identifier[immutableEntry] operator[SEP] identifier[storage] operator[SEP] identifier[getRowKey] operator[SEP] identifier[key] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] , identifier[key] operator[SEP] operator[SEP] operator[SEP] } identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[rowKeys] , identifier[Ordering] operator[SEP] identifier[natural] operator[SEP] operator[SEP] operator[SEP] identifier[onResultOf] operator[SEP] identifier[entry] operator[->] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[ByteBuffer] , identifier[Key] operator[>] operator[>] operator[>] identifier[batches] operator[=] identifier[Lists] operator[SEP] identifier[partition] operator[SEP] identifier[rowKeys] , identifier[_driverConfig] operator[SEP] identifier[getMaxRandomRowsBatchSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Iterators] operator[SEP] identifier[concat] operator[SEP] identifier[Iterators] operator[SEP] identifier[transform] operator[SEP] identifier[batches] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[rowKeySubset] operator[->] { identifier[Timer] operator[SEP] identifier[Context] identifier[timerCtx] operator[=] identifier[_readBatchTimer] operator[SEP] identifier[time] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[rowQuery] operator[SEP] identifier[rowKeySubset] , identifier[consistency] , identifier[placement] operator[SEP] operator[SEP] } Keyword[finally] { identifier[timerCtx] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] operator[SEP] }
@Override public void handleComment( final char[] buffer, final int contentOffset, final int contentLen, final int outerOffset, final int outerLen, final int line, final int col) throws ParseException { this.someSelectorsMatch = false; for (int i = 0; i < this.selectorsLen; i++) { this.selectorMatches[i] = this.selectorFilters[i].matchComment(false, this.markupLevel, this.markupBlocks[this.markupLevel]); if (this.selectorMatches[i]) { this.someSelectorsMatch = true; } } if (this.someSelectorsMatch) { markCurrentSelection(); this.selectedHandler.handleComment( buffer, contentOffset, contentLen, outerOffset, outerLen, line, col); unmarkCurrentSelection(); return; } unmarkCurrentSelection(); this.nonSelectedHandler.handleComment( buffer, contentOffset, contentLen, outerOffset, outerLen, line, col); }
class class_name[name] begin[{] method[handleComment, return_type[void], modifier[public], parameter[buffer, contentOffset, contentLen, outerOffset, outerLen, line, col]] begin[{] assign[THIS[member[None.someSelectorsMatch]], literal[false]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=selectorMatches, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=selectorFilters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=markupLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=markupBlocks, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=markupLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))])], member=matchComment, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=selectorMatches, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=someSelectorsMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=selectorsLen, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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) if[THIS[member[None.someSelectorsMatch]]] begin[{] call[.markCurrentSelection, parameter[]] THIS[member[None.selectedHandler]call[None.handleComment, parameter[member[.buffer], member[.contentOffset], member[.contentLen], member[.outerOffset], member[.outerLen], member[.line], member[.col]]]] call[.unmarkCurrentSelection, parameter[]] return[None] else begin[{] None end[}] call[.unmarkCurrentSelection, parameter[]] THIS[member[None.nonSelectedHandler]call[None.handleComment, parameter[member[.buffer], member[.contentOffset], member[.contentLen], member[.outerOffset], member[.outerLen], member[.line], member[.col]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handleComment] operator[SEP] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[buffer] , Keyword[final] Keyword[int] identifier[contentOffset] , Keyword[final] Keyword[int] identifier[contentLen] , Keyword[final] Keyword[int] identifier[outerOffset] , Keyword[final] Keyword[int] identifier[outerLen] , Keyword[final] Keyword[int] identifier[line] , Keyword[final] Keyword[int] identifier[col] operator[SEP] Keyword[throws] identifier[ParseException] { Keyword[this] operator[SEP] identifier[someSelectorsMatch] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[selectorsLen] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[this] operator[SEP] identifier[selectorMatches] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[this] operator[SEP] identifier[selectorFilters] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[matchComment] operator[SEP] literal[boolean] , Keyword[this] operator[SEP] identifier[markupLevel] , Keyword[this] operator[SEP] identifier[markupBlocks] operator[SEP] Keyword[this] operator[SEP] identifier[markupLevel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[selectorMatches] operator[SEP] identifier[i] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[someSelectorsMatch] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[someSelectorsMatch] operator[SEP] { identifier[markCurrentSelection] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[selectedHandler] operator[SEP] identifier[handleComment] operator[SEP] identifier[buffer] , identifier[contentOffset] , identifier[contentLen] , identifier[outerOffset] , identifier[outerLen] , identifier[line] , identifier[col] operator[SEP] operator[SEP] identifier[unmarkCurrentSelection] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[unmarkCurrentSelection] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[nonSelectedHandler] operator[SEP] identifier[handleComment] operator[SEP] identifier[buffer] , identifier[contentOffset] , identifier[contentLen] , identifier[outerOffset] , identifier[outerLen] , identifier[line] , identifier[col] operator[SEP] operator[SEP] }
public TypeBindException newTypeBindExceptionOnParse(final Cell cell, final Object cellValue) { final String message = MessageBuilder.create("cell.typeBind.failParse") .var("property", field.getNameWithClass()) .var("cellAddress", POIUtils.formatCellAddress(cell)) .var("cellValue", cellValue.toString()) .varWithClass("type", field.getType()) .format(); final TypeBindException bindException = new TypeBindException(message, field.getType(), cellValue); return bindException; }
class class_name[name] begin[{] method[newTypeBindExceptionOnParse, return_type[type[TypeBindException]], modifier[public], parameter[cell, cellValue]] begin[{] local_variable[type[String], message] local_variable[type[TypeBindException], bindException] return[member[.bindException]] end[}] END[}]
Keyword[public] identifier[TypeBindException] identifier[newTypeBindExceptionOnParse] operator[SEP] Keyword[final] identifier[Cell] identifier[cell] , Keyword[final] identifier[Object] identifier[cellValue] operator[SEP] { Keyword[final] identifier[String] identifier[message] operator[=] identifier[MessageBuilder] operator[SEP] identifier[create] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[var] operator[SEP] literal[String] , identifier[field] operator[SEP] identifier[getNameWithClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[var] operator[SEP] literal[String] , identifier[POIUtils] operator[SEP] identifier[formatCellAddress] operator[SEP] identifier[cell] operator[SEP] operator[SEP] operator[SEP] identifier[var] operator[SEP] literal[String] , identifier[cellValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[varWithClass] operator[SEP] literal[String] , identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[format] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[TypeBindException] identifier[bindException] operator[=] Keyword[new] identifier[TypeBindException] operator[SEP] identifier[message] , identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[cellValue] operator[SEP] operator[SEP] Keyword[return] identifier[bindException] operator[SEP] }
public static String join(String[] input, char separator) { //simple case, no escaping StringBuilder stringBuilder = new StringBuilder(); for (String s : input) { if (stringBuilder.length() > 0) { stringBuilder.append(separator); } stringBuilder.append(s); } return stringBuilder.toString(); }
class class_name[name] begin[{] method[join, return_type[type[String]], modifier[public static], parameter[input, separator]] begin[{] local_variable[type[StringBuilder], stringBuilder] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=stringBuilder, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=stringBuilder, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=stringBuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[stringBuilder.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[join] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[input] , Keyword[char] identifier[separator] operator[SEP] { identifier[StringBuilder] identifier[stringBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[input] operator[SEP] { Keyword[if] operator[SEP] identifier[stringBuilder] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[separator] operator[SEP] operator[SEP] } identifier[stringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] operator[SEP] } Keyword[return] identifier[stringBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static int calculateHintTTL(Mutation mutation) { int ttl = maxHintTTL; for (ColumnFamily cf : mutation.getColumnFamilies()) ttl = Math.min(ttl, cf.metadata().getGcGraceSeconds()); return ttl; } public void start() { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { mbs.registerMBean(this, new ObjectName(MBEAN_NAME)); } catch (Exception e) { throw new RuntimeException(e); } logger.debug("Created HHOM instance, registered MBean."); Runnable runnable = new Runnable() { public void run() { scheduleAllDeliveries(); metrics.log(); } }; executor.scheduleWithFixedDelay(runnable, 10, 10, TimeUnit.MINUTES); } private static void deleteHint(ByteBuffer tokenBytes, CellName columnName, long timestamp) { Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, tokenBytes); mutation.delete(SystemKeyspace.HINTS_CF, columnName, timestamp); mutation.applyUnsafe(); // don't bother with commitlog since we're going to flush as soon as we're done with delivery } public void deleteHintsForEndpoint(final String ipOrHostname) { try { InetAddress endpoint = InetAddress.getByName(ipOrHostname); deleteHintsForEndpoint(endpoint); } catch (UnknownHostException e) { logger.warn("Unable to find {}, not a hostname or ipaddr of a node", ipOrHostname); throw new RuntimeException(e); } } public void deleteHintsForEndpoint(final InetAddress endpoint) { if (!StorageService.instance.getTokenMetadata().isMember(endpoint)) return; UUID hostId = StorageService.instance.getTokenMetadata().getHostId(endpoint); ByteBuffer hostIdBytes = ByteBuffer.wrap(UUIDGen.decompose(hostId)); final Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, hostIdBytes); mutation.delete(SystemKeyspace.HINTS_CF, System.currentTimeMillis()); // execute asynchronously to avoid blocking caller (which may be processing gossip) Runnable runnable = new Runnable() { public void run() { try { logger.info("Deleting any stored hints for {}", endpoint); mutation.apply(); hintStore.forceBlockingFlush(); compact(); } catch (Exception e) { JVMStabilityInspector.inspectThrowable(e); logger.warn("Could not delete hints for {}: {}", endpoint, e); } } }; executor.submit(runnable); } //foobar public void truncateAllHints() throws ExecutionException, InterruptedException { Runnable runnable = new Runnable() { public void run() { try { logger.info("Truncating all stored hints."); Keyspace.open(Keyspace.SYSTEM_KS).getColumnFamilyStore(SystemKeyspace.HINTS_CF).truncateBlocking(); } catch (Exception e) { logger.warn("Could not truncate all hints.", e); } } }; executor.submit(runnable).get(); } @VisibleForTesting protected synchronized void compact() { ArrayList<Descriptor> descriptors = new ArrayList<>(); for (SSTable sstable : hintStore.getDataTracker().getUncompactingSSTables()) descriptors.add(sstable.descriptor); if (descriptors.isEmpty()) return; try { CompactionManager.instance.submitUserDefined(hintStore, descriptors, (int) (System.currentTimeMillis() / 1000)).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } private static boolean pagingFinished(ColumnFamily hintColumnFamily, Composite startColumn) { // done if no hints found or the start column (same as last column processed in previous iteration) is the only one return hintColumnFamily == null || (!startColumn.isEmpty() && hintColumnFamily.getSortedColumns().size() == 1 && hintColumnFamily.getColumn((CellName)startColumn) != null); }
class class_name[name] begin[{] method[calculateHintTTL, return_type[type[int]], modifier[public static], parameter[mutation]] begin[{] local_variable[type[int], ttl] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ttl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ttl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=metadata, postfix_operators=[], prefix_operators=[], qualifier=cf, selectors=[MethodInvocation(arguments=[], member=getGcGraceSeconds, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumnFamilies, postfix_operators=[], prefix_operators=[], qualifier=mutation, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnFamily, sub_type=None))), label=None) return[member[.ttl]] end[}] method[start, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[MBeanServer], mbs] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassCreator(arguments=[MemberReference(member=MBEAN_NAME, 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=ObjectName, sub_type=None))], member=registerMBean, postfix_operators=[], prefix_operators=[], qualifier=mbs, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[logger.debug, parameter[literal["Created HHOM instance, registered MBean."]]] local_variable[type[Runnable], runnable] call[executor.scheduleWithFixedDelay, parameter[member[.runnable], literal[10], literal[10], member[TimeUnit.MINUTES]]] end[}] method[deleteHint, return_type[void], modifier[private static], parameter[tokenBytes, columnName, timestamp]] begin[{] local_variable[type[Mutation], mutation] call[mutation.delete, parameter[member[SystemKeyspace.HINTS_CF], member[.columnName], member[.timestamp]]] call[mutation.applyUnsafe, parameter[]] end[}] method[deleteHintsForEndpoint, return_type[void], modifier[public], parameter[ipOrHostname]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ipOrHostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByName, postfix_operators=[], prefix_operators=[], qualifier=InetAddress, selectors=[], type_arguments=None), name=endpoint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=endpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteHintsForEndpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to find {}, not a hostname or ipaddr of a node"), MemberReference(member=ipOrHostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnknownHostException']))], finally_block=None, label=None, resources=None) end[}] method[deleteHintsForEndpoint, return_type[void], modifier[public], parameter[endpoint]] begin[{] if[call[StorageService.instance.getTokenMetadata, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[UUID], hostId] local_variable[type[ByteBuffer], hostIdBytes] local_variable[type[Mutation], mutation] call[mutation.delete, parameter[member[SystemKeyspace.HINTS_CF], call[System.currentTimeMillis, parameter[]]]] local_variable[type[Runnable], runnable] call[executor.submit, parameter[member[.runnable]]] end[}] method[truncateAllHints, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Runnable], runnable] call[executor.submit, parameter[member[.runnable]]] end[}] method[compact, return_type[void], modifier[synchronized protected], parameter[]] begin[{] local_variable[type[ArrayList], descriptors] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=sstable, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=descriptors, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDataTracker, postfix_operators=[], prefix_operators=[], qualifier=hintStore, selectors=[MethodInvocation(arguments=[], member=getUncompactingSSTables, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sstable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SSTable, sub_type=None))), label=None) if[call[descriptors.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hintStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descriptors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=/), type=BasicType(dimensions=[], name=int))], member=submitUserDefined, postfix_operators=[], prefix_operators=[], qualifier=CompactionManager.instance, selectors=[MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException', 'ExecutionException']))], finally_block=None, label=None, resources=None) end[}] method[pagingFinished, return_type[type[boolean]], modifier[private static], parameter[hintColumnFamily, startColumn]] begin[{] return[binary_operation[binary_operation[member[.hintColumnFamily], ==, literal[null]], ||, binary_operation[binary_operation[call[startColumn.isEmpty, parameter[]], &&, binary_operation[call[hintColumnFamily.getSortedColumns, parameter[]], ==, literal[1]]], &&, binary_operation[call[hintColumnFamily.getColumn, parameter[Cast(expression=MemberReference(member=startColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CellName, sub_type=None))]], !=, literal[null]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[calculateHintTTL] operator[SEP] identifier[Mutation] identifier[mutation] operator[SEP] { Keyword[int] identifier[ttl] operator[=] identifier[maxHintTTL] operator[SEP] Keyword[for] operator[SEP] identifier[ColumnFamily] identifier[cf] operator[:] identifier[mutation] operator[SEP] identifier[getColumnFamilies] operator[SEP] operator[SEP] operator[SEP] identifier[ttl] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[ttl] , identifier[cf] operator[SEP] identifier[metadata] operator[SEP] operator[SEP] operator[SEP] identifier[getGcGraceSeconds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ttl] operator[SEP] } Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] { identifier[MBeanServer] identifier[mbs] operator[=] identifier[ManagementFactory] operator[SEP] identifier[getPlatformMBeanServer] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[mbs] operator[SEP] identifier[registerMBean] operator[SEP] Keyword[this] , Keyword[new] identifier[ObjectName] operator[SEP] identifier[MBEAN_NAME] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Runnable] identifier[runnable] operator[=] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[scheduleAllDeliveries] operator[SEP] operator[SEP] operator[SEP] identifier[metrics] operator[SEP] identifier[log] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] identifier[executor] operator[SEP] identifier[scheduleWithFixedDelay] operator[SEP] identifier[runnable] , Other[10] , Other[10] , identifier[TimeUnit] operator[SEP] identifier[MINUTES] operator[SEP] operator[SEP] } Keyword[private] Keyword[static] Keyword[void] identifier[deleteHint] operator[SEP] identifier[ByteBuffer] identifier[tokenBytes] , identifier[CellName] identifier[columnName] , Keyword[long] identifier[timestamp] operator[SEP] { identifier[Mutation] identifier[mutation] operator[=] Keyword[new] identifier[Mutation] operator[SEP] identifier[Keyspace] operator[SEP] identifier[SYSTEM_KS] , identifier[tokenBytes] operator[SEP] operator[SEP] identifier[mutation] operator[SEP] identifier[delete] operator[SEP] identifier[SystemKeyspace] operator[SEP] identifier[HINTS_CF] , identifier[columnName] , identifier[timestamp] operator[SEP] operator[SEP] identifier[mutation] operator[SEP] identifier[applyUnsafe] operator[SEP] operator[SEP] operator[SEP] } Keyword[public] Keyword[void] identifier[deleteHintsForEndpoint] operator[SEP] Keyword[final] identifier[String] identifier[ipOrHostname] operator[SEP] { Keyword[try] { identifier[InetAddress] identifier[endpoint] operator[=] identifier[InetAddress] operator[SEP] identifier[getByName] operator[SEP] identifier[ipOrHostname] operator[SEP] operator[SEP] identifier[deleteHintsForEndpoint] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnknownHostException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[ipOrHostname] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[public] Keyword[void] identifier[deleteHintsForEndpoint] operator[SEP] Keyword[final] identifier[InetAddress] identifier[endpoint] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[StorageService] operator[SEP] identifier[instance] operator[SEP] identifier[getTokenMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[isMember] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[UUID] identifier[hostId] operator[=] identifier[StorageService] operator[SEP] identifier[instance] operator[SEP] identifier[getTokenMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getHostId] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[hostIdBytes] operator[=] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[UUIDGen] operator[SEP] identifier[decompose] operator[SEP] identifier[hostId] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Mutation] identifier[mutation] operator[=] Keyword[new] identifier[Mutation] operator[SEP] identifier[Keyspace] operator[SEP] identifier[SYSTEM_KS] , identifier[hostIdBytes] operator[SEP] operator[SEP] identifier[mutation] operator[SEP] identifier[delete] operator[SEP] identifier[SystemKeyspace] operator[SEP] identifier[HINTS_CF] , identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Runnable] identifier[runnable] operator[=] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[endpoint] operator[SEP] operator[SEP] identifier[mutation] operator[SEP] identifier[apply] operator[SEP] operator[SEP] operator[SEP] identifier[hintStore] operator[SEP] identifier[forceBlockingFlush] operator[SEP] operator[SEP] operator[SEP] identifier[compact] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[JVMStabilityInspector] operator[SEP] identifier[inspectThrowable] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[endpoint] , identifier[e] operator[SEP] operator[SEP] } } } operator[SEP] identifier[executor] operator[SEP] identifier[submit] operator[SEP] identifier[runnable] operator[SEP] operator[SEP] } Keyword[public] Keyword[void] identifier[truncateAllHints] operator[SEP] operator[SEP] Keyword[throws] identifier[ExecutionException] , identifier[InterruptedException] { identifier[Runnable] identifier[runnable] operator[=] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Keyspace] operator[SEP] identifier[open] operator[SEP] identifier[Keyspace] operator[SEP] identifier[SYSTEM_KS] operator[SEP] operator[SEP] identifier[getColumnFamilyStore] operator[SEP] identifier[SystemKeyspace] operator[SEP] identifier[HINTS_CF] operator[SEP] operator[SEP] identifier[truncateBlocking] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } operator[SEP] identifier[executor] operator[SEP] identifier[submit] operator[SEP] identifier[runnable] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[VisibleForTesting] Keyword[protected] Keyword[synchronized] Keyword[void] identifier[compact] operator[SEP] operator[SEP] { identifier[ArrayList] operator[<] identifier[Descriptor] operator[>] identifier[descriptors] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SSTable] identifier[sstable] operator[:] identifier[hintStore] operator[SEP] identifier[getDataTracker] operator[SEP] operator[SEP] operator[SEP] identifier[getUncompactingSSTables] operator[SEP] operator[SEP] operator[SEP] identifier[descriptors] operator[SEP] identifier[add] operator[SEP] identifier[sstable] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[descriptors] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[try] { identifier[CompactionManager] operator[SEP] identifier[instance] operator[SEP] identifier[submitUserDefined] operator[SEP] identifier[hintStore] , identifier[descriptors] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[/] Other[1000] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] operator[|] identifier[ExecutionException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[private] Keyword[static] Keyword[boolean] identifier[pagingFinished] operator[SEP] identifier[ColumnFamily] identifier[hintColumnFamily] , identifier[Composite] identifier[startColumn] operator[SEP] { Keyword[return] identifier[hintColumnFamily] operator[==] Other[null] operator[||] operator[SEP] operator[!] identifier[startColumn] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[hintColumnFamily] operator[SEP] identifier[getSortedColumns] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[hintColumnFamily] operator[SEP] identifier[getColumn] operator[SEP] operator[SEP] identifier[CellName] operator[SEP] identifier[startColumn] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] }
@Override public <T extends SyntacticItem> T getAncestor(Class<T> kind) { return parent.getAncestor(this, kind); }
class class_name[name] begin[{] method[getAncestor, return_type[type[T]], modifier[public], parameter[kind]] begin[{] return[call[parent.getAncestor, parameter[THIS[], member[.kind]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[SyntacticItem] operator[>] identifier[T] identifier[getAncestor] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[kind] operator[SEP] { Keyword[return] identifier[parent] operator[SEP] identifier[getAncestor] operator[SEP] Keyword[this] , identifier[kind] operator[SEP] operator[SEP] }
@Override public String resolve(String vipAddressMacro, IClientConfig niwsClientConfig) { if (vipAddressMacro == null || vipAddressMacro.length() == 0) { return vipAddressMacro; } return replaceMacrosFromConfig(vipAddressMacro); }
class class_name[name] begin[{] method[resolve, return_type[type[String]], modifier[public], parameter[vipAddressMacro, niwsClientConfig]] begin[{] if[binary_operation[binary_operation[member[.vipAddressMacro], ==, literal[null]], ||, binary_operation[call[vipAddressMacro.length, parameter[]], ==, literal[0]]]] begin[{] return[member[.vipAddressMacro]] else begin[{] None end[}] return[call[.replaceMacrosFromConfig, parameter[member[.vipAddressMacro]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[resolve] operator[SEP] identifier[String] identifier[vipAddressMacro] , identifier[IClientConfig] identifier[niwsClientConfig] operator[SEP] { Keyword[if] operator[SEP] identifier[vipAddressMacro] operator[==] Other[null] operator[||] identifier[vipAddressMacro] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[vipAddressMacro] operator[SEP] } Keyword[return] identifier[replaceMacrosFromConfig] operator[SEP] identifier[vipAddressMacro] operator[SEP] operator[SEP] }
public BlobToken visitBlob(EditsElement e, int length) throws IOException { return (BlobToken)visit(tokenizer.read(new BlobToken(e, length))); }
class class_name[name] begin[{] method[visitBlob, return_type[type[BlobToken]], modifier[public], parameter[e, length]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, 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=BlobToken, sub_type=None))], member=read, postfix_operators=[], prefix_operators=[], qualifier=tokenizer, selectors=[], type_arguments=None)], member=visit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BlobToken, sub_type=None))] end[}] END[}]
Keyword[public] identifier[BlobToken] identifier[visitBlob] operator[SEP] identifier[EditsElement] identifier[e] , Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] operator[SEP] identifier[BlobToken] operator[SEP] identifier[visit] operator[SEP] identifier[tokenizer] operator[SEP] identifier[read] operator[SEP] Keyword[new] identifier[BlobToken] operator[SEP] identifier[e] , identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void addGeneratedResource(FacesContext context, String resourceName, String rendererType, String value, UIViewRoot view) { final UIOutput resource = new UIOutput(); resource.getAttributes().put("name", resourceName); resource.setRendererType(rendererType); resource.getAttributes().put("library", value); view.addComponentResource(context, resource, HEAD); }
class class_name[name] begin[{] method[addGeneratedResource, return_type[void], modifier[private], parameter[context, resourceName, rendererType, value, view]] begin[{] local_variable[type[UIOutput], resource] call[resource.getAttributes, parameter[]] call[resource.setRendererType, parameter[member[.rendererType]]] call[resource.getAttributes, parameter[]] call[view.addComponentResource, parameter[member[.context], member[.resource], member[.HEAD]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addGeneratedResource] operator[SEP] identifier[FacesContext] identifier[context] , identifier[String] identifier[resourceName] , identifier[String] identifier[rendererType] , identifier[String] identifier[value] , identifier[UIViewRoot] identifier[view] operator[SEP] { Keyword[final] identifier[UIOutput] identifier[resource] operator[=] Keyword[new] identifier[UIOutput] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[resourceName] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setRendererType] operator[SEP] identifier[rendererType] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[value] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[addComponentResource] operator[SEP] identifier[context] , identifier[resource] , identifier[HEAD] operator[SEP] operator[SEP] }
public void transitionNonFileJournals(StorageInfo nsInfo, boolean checkEmpty, Transition transition, StartupOption startOpt) throws IOException { for (JournalManager jm : getJournalManagers()) { if (!(jm instanceof FileJournalManager)) { if (checkEmpty && jm.hasSomeJournalData()) { LOG.warn("Journal " + jm + " is not empty."); continue; } LOG.info(transition + ": " + jm); jm.transitionJournal(nsInfo, transition, startOpt); } } }
class class_name[name] begin[{] method[transitionNonFileJournals, return_type[void], modifier[public], parameter[nsInfo, checkEmpty, transition, startOpt]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=FileJournalManager, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=checkEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=hasSomeJournalData, postfix_operators=[], prefix_operators=[], qualifier=jm, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Journal "), operandr=MemberReference(member=jm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not empty."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=transition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=jm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nsInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=transition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startOpt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transitionJournal, postfix_operators=[], prefix_operators=[], qualifier=jm, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getJournalManagers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=jm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JournalManager, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[transitionNonFileJournals] operator[SEP] identifier[StorageInfo] identifier[nsInfo] , Keyword[boolean] identifier[checkEmpty] , identifier[Transition] identifier[transition] , identifier[StartupOption] identifier[startOpt] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[for] operator[SEP] identifier[JournalManager] identifier[jm] operator[:] identifier[getJournalManagers] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jm] Keyword[instanceof] identifier[FileJournalManager] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[checkEmpty] operator[&&] identifier[jm] operator[SEP] identifier[hasSomeJournalData] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[jm] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[transition] operator[+] literal[String] operator[+] identifier[jm] operator[SEP] operator[SEP] identifier[jm] operator[SEP] identifier[transitionJournal] operator[SEP] identifier[nsInfo] , identifier[transition] , identifier[startOpt] operator[SEP] operator[SEP] } } }
private byte[] readImage(String uriWithParams) { try { String pathAndQuery = OpenCms.getLinkManager().getRootPath(m_cms, uriWithParams); URI uri = new URI(pathAndQuery); String path = uri.getPath(); String query = uri.getQuery(); String scaleParams = null; if (query != null) { Matcher matcher = SCALE_PARAMS_PATTERN.matcher(query); if (matcher.find()) { scaleParams = matcher.group(1); } } CmsFile imageFile = m_rootCms.readFile(path); byte[] result = imageFile.getContents(); if (scaleParams != null) { CmsImageScaler scaler = new CmsImageScaler(scaleParams); result = scaler.scaleImage(imageFile); } return result; } catch (Exception e) { LOG.error("Problem with reading image " + uriWithParams + ": " + e.getLocalizedMessage(), e); return null; } }
class class_name[name] begin[{] method[readImage, return_type[type[byte]], modifier[private], parameter[uriWithParams]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLinkManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uriWithParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRootPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=pathAndQuery)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=pathAndQuery, 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=URI, sub_type=None)), name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getQuery, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), name=query)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=scaleParams)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=SCALE_PARAMS_PATTERN, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=scaleParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None)), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFile, postfix_operators=[], prefix_operators=[], qualifier=m_rootCms, selectors=[], type_arguments=None), name=imageFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsFile, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getContents, postfix_operators=[], prefix_operators=[], qualifier=imageFile, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=scaleParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=scaleParams, 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=CmsImageScaler, sub_type=None)), name=scaler)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsImageScaler, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=imageFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scaleImage, postfix_operators=[], prefix_operators=[], qualifier=scaler, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Problem with reading image "), operandr=MemberReference(member=uriWithParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[readImage] operator[SEP] identifier[String] identifier[uriWithParams] operator[SEP] { Keyword[try] { identifier[String] identifier[pathAndQuery] operator[=] identifier[OpenCms] operator[SEP] identifier[getLinkManager] operator[SEP] operator[SEP] operator[SEP] identifier[getRootPath] operator[SEP] identifier[m_cms] , identifier[uriWithParams] operator[SEP] operator[SEP] identifier[URI] identifier[uri] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[pathAndQuery] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[uri] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[query] operator[=] identifier[uri] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[scaleParams] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[query] operator[!=] Other[null] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[SCALE_PARAMS_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[scaleParams] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] } } identifier[CmsFile] identifier[imageFile] operator[=] identifier[m_rootCms] operator[SEP] identifier[readFile] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[imageFile] operator[SEP] identifier[getContents] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scaleParams] operator[!=] Other[null] operator[SEP] { identifier[CmsImageScaler] identifier[scaler] operator[=] Keyword[new] identifier[CmsImageScaler] operator[SEP] identifier[scaleParams] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[scaler] operator[SEP] identifier[scaleImage] operator[SEP] identifier[imageFile] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[uriWithParams] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public static void assertXMLNotEqual(String err, Document control, Document test) { Diff diff = new Diff(control, test); assertXMLEqual(err, diff, false); }
class class_name[name] begin[{] method[assertXMLNotEqual, return_type[void], modifier[public static], parameter[err, control, test]] begin[{] local_variable[type[Diff], diff] call[.assertXMLEqual, parameter[member[.err], member[.diff], literal[false]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[assertXMLNotEqual] operator[SEP] identifier[String] identifier[err] , identifier[Document] identifier[control] , identifier[Document] identifier[test] operator[SEP] { identifier[Diff] identifier[diff] operator[=] Keyword[new] identifier[Diff] operator[SEP] identifier[control] , identifier[test] operator[SEP] operator[SEP] identifier[assertXMLEqual] operator[SEP] identifier[err] , identifier[diff] , literal[boolean] operator[SEP] operator[SEP] }
protected void checkFormatting() { //previous character was formatting, keep format field set if (FontOptions.getFormatting(currentText, charIndex - 1) != null) return; format = FontOptions.getFormatting(currentText, charIndex); if (format == null) return; if (applyStyles) applyStyle(format); if (skipChars && !litteral) { globalIndex += 2; charIndex += 2; checkFormatting(); } }
class class_name[name] begin[{] method[checkFormatting, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[call[FontOptions.getFormatting, parameter[member[.currentText], binary_operation[member[.charIndex], -, literal[1]]]], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] assign[member[.format], call[FontOptions.getFormatting, parameter[member[.currentText], member[.charIndex]]]] if[binary_operation[member[.format], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[member[.applyStyles]] begin[{] call[.applyStyle, parameter[member[.format]]] else begin[{] None end[}] if[binary_operation[member[.skipChars], &&, member[.litteral]]] begin[{] assign[member[.globalIndex], literal[2]] assign[member[.charIndex], literal[2]] call[.checkFormatting, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[checkFormatting] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[FontOptions] operator[SEP] identifier[getFormatting] operator[SEP] identifier[currentText] , identifier[charIndex] operator[-] Other[1] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[format] operator[=] identifier[FontOptions] operator[SEP] identifier[getFormatting] operator[SEP] identifier[currentText] , identifier[charIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[format] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[applyStyles] operator[SEP] identifier[applyStyle] operator[SEP] identifier[format] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[skipChars] operator[&&] operator[!] identifier[litteral] operator[SEP] { identifier[globalIndex] operator[+=] Other[2] operator[SEP] identifier[charIndex] operator[+=] Other[2] operator[SEP] identifier[checkFormatting] operator[SEP] operator[SEP] operator[SEP] } }
public void setCommercePriceListService( com.liferay.commerce.price.list.service.CommercePriceListService commercePriceListService) { this.commercePriceListService = commercePriceListService; }
class class_name[name] begin[{] method[setCommercePriceListService, return_type[void], modifier[public], parameter[commercePriceListService]] begin[{] assign[THIS[member[None.commercePriceListService]], member[.commercePriceListService]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCommercePriceListService] operator[SEP] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[price] operator[SEP] identifier[list] operator[SEP] identifier[service] operator[SEP] identifier[CommercePriceListService] identifier[commercePriceListService] operator[SEP] { Keyword[this] operator[SEP] identifier[commercePriceListService] operator[=] identifier[commercePriceListService] operator[SEP] }
@SuppressWarnings("unchecked") public T parse(String input) throws Exception { validate(input); setContent(input); return (T) this; }
class class_name[name] begin[{] method[parse, return_type[type[T]], modifier[public], parameter[input]] begin[{] call[.validate, parameter[member[.input]]] call[.setContent, parameter[member[.input]]] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[T] identifier[parse] operator[SEP] identifier[String] identifier[input] operator[SEP] Keyword[throws] identifier[Exception] { identifier[validate] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[setContent] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] Keyword[this] operator[SEP] }
public SDVariable argmin(String name, SDVariable in, int... dimensions) { return argmin(name, in, false, dimensions); }
class class_name[name] begin[{] method[argmin, return_type[type[SDVariable]], modifier[public], parameter[name, in, dimensions]] begin[{] return[call[.argmin, parameter[member[.name], member[.in], literal[false], member[.dimensions]]]] end[}] END[}]
Keyword[public] identifier[SDVariable] identifier[argmin] operator[SEP] identifier[String] identifier[name] , identifier[SDVariable] identifier[in] , Keyword[int] operator[...] identifier[dimensions] operator[SEP] { Keyword[return] identifier[argmin] operator[SEP] identifier[name] , identifier[in] , literal[boolean] , identifier[dimensions] operator[SEP] operator[SEP] }
@SuppressWarnings({"PMD.AvoidCatchingThrowable","PMD.AvoidInstanceofChecksInCatchClause"}) public static Runnable swallowExceptions(Runnable in) { return () -> { try { in.run(); } catch (Error tt) { LOGGER.error("Error (will be rethrown)", tt); throw tt; } catch (Throwable t) { LOGGER.error("Uncaught exception swallowed", t); // Ignore the IDE warning - consider Lombok's SneakyThrows, which is an abomination but heavily used by heathens, whom I pray for. if (t instanceof InterruptedException) { Thread.currentThread().interrupt(); } } }; }
class class_name[name] begin[{] method[swallowExceptions, return_type[type[Runnable]], modifier[public static], parameter[in]] begin[{] return[LambdaExpression(body=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error (will be rethrown)"), MemberReference(member=tt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=tt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=tt, types=['Error'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Uncaught exception swallowed"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=InterruptedException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)], parameters=[])] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[public] Keyword[static] identifier[Runnable] identifier[swallowExceptions] operator[SEP] identifier[Runnable] identifier[in] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] operator[->] { Keyword[try] { identifier[in] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Error] identifier[tt] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[tt] operator[SEP] operator[SEP] Keyword[throw] identifier[tt] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[InterruptedException] operator[SEP] { identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] }
public String getTextContent() throws DOMException { // dynamic load to support jre 1.4 and 1.5 try { Method m = node.getClass().getMethod("getTextContent", new Class[] {}); return Caster.toString(m.invoke(node, ArrayUtil.OBJECT_EMPTY)); } catch (Exception e) { throw new PageRuntimeException(Caster.toPageException(e)); } }
class class_name[name] begin[{] method[getTextContent, return_type[type[String]], modifier[public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getTextContent"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OBJECT_EMPTY, postfix_operators=[], prefix_operators=[], qualifier=ArrayUtil, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Caster, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toPageException, postfix_operators=[], prefix_operators=[], qualifier=Caster, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PageRuntimeException, 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] identifier[String] identifier[getTextContent] operator[SEP] operator[SEP] Keyword[throws] identifier[DOMException] { Keyword[try] { identifier[Method] identifier[m] operator[=] identifier[node] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] Keyword[return] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[m] operator[SEP] identifier[invoke] operator[SEP] identifier[node] , identifier[ArrayUtil] operator[SEP] identifier[OBJECT_EMPTY] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[PageRuntimeException] operator[SEP] identifier[Caster] operator[SEP] identifier[toPageException] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] } }
public void setColumn (final ColumnVector cv, final int c) throws MatrixException { if ((c < 0) || (c >= m_nCols)) { throw new MatrixException (MatrixException.INVALID_INDEX); } if (m_nRows != cv.m_nRows) { throw new MatrixException (MatrixException.INVALID_DIMENSIONS); } for (int r = 0; r < m_nRows; ++r) { m_aValues[r][c] = cv.m_aValues[r][0]; } }
class class_name[name] begin[{] method[setColumn, return_type[void], modifier[public], parameter[cv, c]] begin[{] if[binary_operation[binary_operation[member[.c], <, literal[0]], ||, binary_operation[member[.c], >=, member[.m_nCols]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_INDEX, postfix_operators=[], prefix_operators=[], qualifier=MatrixException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MatrixException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.m_nRows], !=, member[cv.m_nRows]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_DIMENSIONS, postfix_operators=[], prefix_operators=[], qualifier=MatrixException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MatrixException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_aValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=m_aValues, postfix_operators=[], prefix_operators=[], qualifier=cv, selectors=[ArraySelector(index=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_nRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=r, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setColumn] operator[SEP] Keyword[final] identifier[ColumnVector] identifier[cv] , Keyword[final] Keyword[int] identifier[c] operator[SEP] Keyword[throws] identifier[MatrixException] { Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[c] operator[>=] identifier[m_nCols] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[MatrixException] operator[SEP] identifier[MatrixException] operator[SEP] identifier[INVALID_INDEX] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m_nRows] operator[!=] identifier[cv] operator[SEP] identifier[m_nRows] operator[SEP] { Keyword[throw] Keyword[new] identifier[MatrixException] operator[SEP] identifier[MatrixException] operator[SEP] identifier[INVALID_DIMENSIONS] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[r] operator[=] Other[0] operator[SEP] identifier[r] operator[<] identifier[m_nRows] operator[SEP] operator[++] identifier[r] operator[SEP] { identifier[m_aValues] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[c] operator[SEP] operator[=] identifier[cv] operator[SEP] identifier[m_aValues] operator[SEP] identifier[r] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] } }
private ChannelFuture goAway(ChannelHandlerContext ctx, Http2Exception cause, ChannelPromise promise) { long errorCode = cause != null ? cause.error().code() : NO_ERROR.code(); int lastKnownStream = connection().remote().lastStreamCreated(); return goAway(ctx, lastKnownStream, errorCode, Http2CodecUtil.toByteBuf(ctx, cause), promise); }
class class_name[name] begin[{] method[goAway, return_type[type[ChannelFuture]], modifier[private], parameter[ctx, cause, promise]] begin[{] local_variable[type[long], errorCode] local_variable[type[int], lastKnownStream] return[call[.goAway, parameter[member[.ctx], member[.lastKnownStream], member[.errorCode], call[Http2CodecUtil.toByteBuf, parameter[member[.ctx], member[.cause]]], member[.promise]]]] end[}] END[}]
Keyword[private] identifier[ChannelFuture] identifier[goAway] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[Http2Exception] identifier[cause] , identifier[ChannelPromise] identifier[promise] operator[SEP] { Keyword[long] identifier[errorCode] operator[=] identifier[cause] operator[!=] Other[null] operator[?] identifier[cause] operator[SEP] identifier[error] operator[SEP] operator[SEP] operator[SEP] identifier[code] operator[SEP] operator[SEP] operator[:] identifier[NO_ERROR] operator[SEP] identifier[code] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lastKnownStream] operator[=] identifier[connection] operator[SEP] operator[SEP] operator[SEP] identifier[remote] operator[SEP] operator[SEP] operator[SEP] identifier[lastStreamCreated] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[goAway] operator[SEP] identifier[ctx] , identifier[lastKnownStream] , identifier[errorCode] , identifier[Http2CodecUtil] operator[SEP] identifier[toByteBuf] operator[SEP] identifier[ctx] , identifier[cause] operator[SEP] , identifier[promise] operator[SEP] operator[SEP] }
public final void increaseWrittenBytes(int increment, long currentTime) { if (increment <= 0) { return; } writtenBytes += increment; lastWriteTime = currentTime; idleCountForBoth.set(0); idleCountForWrite.set(0); // if (getService() instanceof AbstractIoService) { // ((AbstractIoService) getService()).getStatistics().increaseWrittenBytes(increment, currentTime); // } increaseScheduledWriteBytes(-increment); }
class class_name[name] begin[{] method[increaseWrittenBytes, return_type[void], modifier[final public], parameter[increment, currentTime]] begin[{] if[binary_operation[member[.increment], <=, literal[0]]] begin[{] return[None] else begin[{] None end[}] assign[member[.writtenBytes], member[.increment]] assign[member[.lastWriteTime], member[.currentTime]] call[idleCountForBoth.set, parameter[literal[0]]] call[idleCountForWrite.set, parameter[literal[0]]] call[.increaseScheduledWriteBytes, parameter[member[.increment]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[increaseWrittenBytes] operator[SEP] Keyword[int] identifier[increment] , Keyword[long] identifier[currentTime] operator[SEP] { Keyword[if] operator[SEP] identifier[increment] operator[<=] Other[0] operator[SEP] { Keyword[return] operator[SEP] } identifier[writtenBytes] operator[+=] identifier[increment] operator[SEP] identifier[lastWriteTime] operator[=] identifier[currentTime] operator[SEP] identifier[idleCountForBoth] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[idleCountForWrite] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[increaseScheduledWriteBytes] operator[SEP] operator[-] identifier[increment] operator[SEP] operator[SEP] }
public double getElapsedTimeCurrentThread(int stage) { if (stage == ProfilingEvent.START.ordinal()) { return 0; } Accumulator acc = getAccForThread(); return acc == null ? Double.NaN : (acc.currentTimes[stage] - acc.currentTimes[stage - 1]) / MILLION; }
class class_name[name] begin[{] method[getElapsedTimeCurrentThread, return_type[type[double]], modifier[public], parameter[stage]] begin[{] if[binary_operation[member[.stage], ==, call[ProfilingEvent.START.ordinal, parameter[]]]] begin[{] return[literal[0]] else begin[{] None end[}] local_variable[type[Accumulator], acc] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=acc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=currentTimes, postfix_operators=[], prefix_operators=[], qualifier=acc, selectors=[ArraySelector(index=MemberReference(member=stage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=currentTimes, postfix_operators=[], prefix_operators=[], qualifier=acc, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=stage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), operator=-), operandr=MemberReference(member=MILLION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), if_true=MemberReference(member=NaN, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[double] identifier[getElapsedTimeCurrentThread] operator[SEP] Keyword[int] identifier[stage] operator[SEP] { Keyword[if] operator[SEP] identifier[stage] operator[==] identifier[ProfilingEvent] operator[SEP] identifier[START] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[0] operator[SEP] } identifier[Accumulator] identifier[acc] operator[=] identifier[getAccForThread] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[acc] operator[==] Other[null] operator[?] identifier[Double] operator[SEP] identifier[NaN] operator[:] operator[SEP] identifier[acc] operator[SEP] identifier[currentTimes] operator[SEP] identifier[stage] operator[SEP] operator[-] identifier[acc] operator[SEP] identifier[currentTimes] operator[SEP] identifier[stage] operator[-] Other[1] operator[SEP] operator[SEP] operator[/] identifier[MILLION] operator[SEP] }
public FileUpload getFile(final String paramName) { if (requestFiles == null) { return null; } FileUpload[] values = requestFiles.get(paramName); if ((values != null) && (values.length > 0)) { return values[0]; } return null; }
class class_name[name] begin[{] method[getFile, return_type[type[FileUpload]], modifier[public], parameter[paramName]] begin[{] if[binary_operation[member[.requestFiles], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[FileUpload], values] if[binary_operation[binary_operation[member[.values], !=, literal[null]], &&, binary_operation[member[values.length], >, literal[0]]]] begin[{] return[member[.values]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[FileUpload] identifier[getFile] operator[SEP] Keyword[final] identifier[String] identifier[paramName] operator[SEP] { Keyword[if] operator[SEP] identifier[requestFiles] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[FileUpload] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[requestFiles] operator[SEP] identifier[get] operator[SEP] identifier[paramName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[values] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] operator[SEP] { Keyword[return] identifier[values] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public synchronized VNFFGAgent getVNFFGAgent() { if (this.vnffgAgent == null) { if (isService) { this.vnffgAgent = new VNFFGAgent( this.serviceName, this.projectId, this.sslEnabled, this.nfvoIp, this.nfvoPort, this.version, this.serviceKey); } else { this.vnffgAgent = new VNFFGAgent( this.username, this.password, this.projectId, this.sslEnabled, this.nfvoIp, this.nfvoPort, this.version); } } return this.vnffgAgent; }
class class_name[name] begin[{] method[getVNFFGAgent, return_type[type[VNFFGAgent]], modifier[synchronized public], parameter[]] begin[{] if[binary_operation[THIS[member[None.vnffgAgent]], ==, literal[null]]] begin[{] if[member[.isService]] begin[{] assign[THIS[member[None.vnffgAgent]], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serviceName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=projectId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sslEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nfvoIp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nfvoPort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=version, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serviceKey, 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=VNFFGAgent, sub_type=None))] else begin[{] assign[THIS[member[None.vnffgAgent]], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=username, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=password, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=projectId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sslEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nfvoIp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nfvoPort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=version, 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=VNFFGAgent, sub_type=None))] end[}] else begin[{] None end[}] return[THIS[member[None.vnffgAgent]]] end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[VNFFGAgent] identifier[getVNFFGAgent] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[vnffgAgent] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isService] operator[SEP] { Keyword[this] operator[SEP] identifier[vnffgAgent] operator[=] Keyword[new] identifier[VNFFGAgent] operator[SEP] Keyword[this] operator[SEP] identifier[serviceName] , Keyword[this] operator[SEP] identifier[projectId] , Keyword[this] operator[SEP] identifier[sslEnabled] , Keyword[this] operator[SEP] identifier[nfvoIp] , Keyword[this] operator[SEP] identifier[nfvoPort] , Keyword[this] operator[SEP] identifier[version] , Keyword[this] operator[SEP] identifier[serviceKey] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[vnffgAgent] operator[=] Keyword[new] identifier[VNFFGAgent] operator[SEP] Keyword[this] operator[SEP] identifier[username] , Keyword[this] operator[SEP] identifier[password] , Keyword[this] operator[SEP] identifier[projectId] , Keyword[this] operator[SEP] identifier[sslEnabled] , Keyword[this] operator[SEP] identifier[nfvoIp] , Keyword[this] operator[SEP] identifier[nfvoPort] , Keyword[this] operator[SEP] identifier[version] operator[SEP] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] identifier[vnffgAgent] operator[SEP] }
public void removeExpectedAnswer(String realm) { if (answers != null) { answers.remove(realm); } try { if (isAnswersFilled()) { resendRequest(); } } catch (Throwable t) { logger.error("removeExpectedAnswer failed with exception: " + t.getLocalizedMessage(), t); } }
class class_name[name] begin[{] method[removeExpectedAnswer, return_type[void], modifier[public], parameter[realm]] begin[{] if[binary_operation[member[.answers], !=, literal[null]]] begin[{] call[answers.remove, parameter[member[.realm]]] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isAnswersFilled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=resendRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="removeExpectedAnswer failed with exception: "), operandr=MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[removeExpectedAnswer] operator[SEP] identifier[String] identifier[realm] operator[SEP] { Keyword[if] operator[SEP] identifier[answers] operator[!=] Other[null] operator[SEP] { identifier[answers] operator[SEP] identifier[remove] operator[SEP] identifier[realm] operator[SEP] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[isAnswersFilled] operator[SEP] operator[SEP] operator[SEP] { identifier[resendRequest] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[t] operator[SEP] operator[SEP] } }
public double getChartValue(double screenPoint) { // a check if all axis data are the exact same values if (min == max) { return min; } double minVal = min; double maxVal = max; // min & max is not set in category charts with string labels if (min > max) { if (getDirection() == Direction.X) { if (axesChartStyler instanceof CategoryStyler) { AxesChartSeriesCategory axesChartSeries = (AxesChartSeriesCategory) chart.getSeriesMap().values().iterator().next(); int count = axesChartSeries.getXData().size(); minVal = 0; maxVal = count; } } } double workingSpace; double startOffset; if (direction == Direction.X) { startOffset = bounds.getX(); workingSpace = bounds.getWidth(); } else { startOffset = 0; //bounds.getY(); workingSpace = bounds.getHeight(); screenPoint = bounds.getHeight() - screenPoint + bounds.getY(); // y increments top to bottom } // tick space - a percentage of the working space available for ticks double tickSpace = axesChartStyler.getPlotContentSize() * workingSpace; // in plot space // this prevents an infinite loop when the plot gets sized really small. if (tickSpace < axesChartStyler.getXAxisTickMarkSpacingHint()) { return minVal; } // where the tick should begin in the working space in pixels double margin = Utils.getTickStartOffset( workingSpace, tickSpace); // given tickLabelPositon (screenPoint) find value // double tickLabelPosition = // margin + ((value - min) / (max - min) * tickSpace); double value = ((screenPoint - margin - startOffset) * (maxVal - minVal) / tickSpace) + minVal; return value; }
class class_name[name] begin[{] method[getChartValue, return_type[type[double]], modifier[public], parameter[screenPoint]] begin[{] if[binary_operation[member[.min], ==, member[.max]]] begin[{] return[member[.min]] else begin[{] None end[}] local_variable[type[double], minVal] local_variable[type[double], maxVal] if[binary_operation[member[.min], >, member[.max]]] begin[{] if[binary_operation[call[.getDirection, parameter[]], ==, member[Direction.X]]] begin[{] if[binary_operation[member[.axesChartStyler], instanceof, type[CategoryStyler]]] begin[{] local_variable[type[AxesChartSeriesCategory], axesChartSeries] local_variable[type[int], count] assign[member[.minVal], literal[0]] assign[member[.maxVal], member[.count]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[double], workingSpace] local_variable[type[double], startOffset] if[binary_operation[member[.direction], ==, member[Direction.X]]] begin[{] assign[member[.startOffset], call[bounds.getX, parameter[]]] assign[member[.workingSpace], call[bounds.getWidth, parameter[]]] else begin[{] assign[member[.startOffset], literal[0]] assign[member[.workingSpace], call[bounds.getHeight, parameter[]]] assign[member[.screenPoint], binary_operation[binary_operation[call[bounds.getHeight, parameter[]], -, member[.screenPoint]], +, call[bounds.getY, parameter[]]]] end[}] local_variable[type[double], tickSpace] if[binary_operation[member[.tickSpace], <, call[axesChartStyler.getXAxisTickMarkSpacingHint, parameter[]]]] begin[{] return[member[.minVal]] else begin[{] None end[}] local_variable[type[double], margin] local_variable[type[double], value] return[member[.value]] end[}] END[}]
Keyword[public] Keyword[double] identifier[getChartValue] operator[SEP] Keyword[double] identifier[screenPoint] operator[SEP] { Keyword[if] operator[SEP] identifier[min] operator[==] identifier[max] operator[SEP] { Keyword[return] identifier[min] operator[SEP] } Keyword[double] identifier[minVal] operator[=] identifier[min] operator[SEP] Keyword[double] identifier[maxVal] operator[=] identifier[max] operator[SEP] Keyword[if] operator[SEP] identifier[min] operator[>] identifier[max] operator[SEP] { Keyword[if] operator[SEP] identifier[getDirection] operator[SEP] operator[SEP] operator[==] identifier[Direction] operator[SEP] identifier[X] operator[SEP] { Keyword[if] operator[SEP] identifier[axesChartStyler] Keyword[instanceof] identifier[CategoryStyler] operator[SEP] { identifier[AxesChartSeriesCategory] identifier[axesChartSeries] operator[=] operator[SEP] identifier[AxesChartSeriesCategory] operator[SEP] identifier[chart] operator[SEP] identifier[getSeriesMap] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] identifier[axesChartSeries] operator[SEP] identifier[getXData] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[minVal] operator[=] Other[0] operator[SEP] identifier[maxVal] operator[=] identifier[count] operator[SEP] } } } Keyword[double] identifier[workingSpace] operator[SEP] Keyword[double] identifier[startOffset] operator[SEP] Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[Direction] operator[SEP] identifier[X] operator[SEP] { identifier[startOffset] operator[=] identifier[bounds] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] identifier[workingSpace] operator[=] identifier[bounds] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[startOffset] operator[=] Other[0] operator[SEP] identifier[workingSpace] operator[=] identifier[bounds] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] identifier[screenPoint] operator[=] identifier[bounds] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[-] identifier[screenPoint] operator[+] identifier[bounds] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[SEP] } Keyword[double] identifier[tickSpace] operator[=] identifier[axesChartStyler] operator[SEP] identifier[getPlotContentSize] operator[SEP] operator[SEP] operator[*] identifier[workingSpace] operator[SEP] Keyword[if] operator[SEP] identifier[tickSpace] operator[<] identifier[axesChartStyler] operator[SEP] identifier[getXAxisTickMarkSpacingHint] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[minVal] operator[SEP] } Keyword[double] identifier[margin] operator[=] identifier[Utils] operator[SEP] identifier[getTickStartOffset] operator[SEP] identifier[workingSpace] , identifier[tickSpace] operator[SEP] operator[SEP] Keyword[double] identifier[value] operator[=] operator[SEP] operator[SEP] identifier[screenPoint] operator[-] identifier[margin] operator[-] identifier[startOffset] operator[SEP] operator[*] operator[SEP] identifier[maxVal] operator[-] identifier[minVal] operator[SEP] operator[/] identifier[tickSpace] operator[SEP] operator[+] identifier[minVal] operator[SEP] Keyword[return] identifier[value] operator[SEP] }
public int compareTo(BinaryComparable other) { if (this == other) return 0; return WritableComparator.compareBytes(getBytes(), 0, getLength(), other.getBytes(), 0, other.getLength()); }
class class_name[name] begin[{] method[compareTo, return_type[type[int]], modifier[public], parameter[other]] begin[{] if[binary_operation[THIS[], ==, member[.other]]] begin[{] return[literal[0]] else begin[{] None end[}] return[call[WritableComparator.compareBytes, parameter[call[.getBytes, parameter[]], literal[0], call[.getLength, parameter[]], call[other.getBytes, parameter[]], literal[0], call[other.getLength, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] identifier[BinaryComparable] identifier[other] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[==] identifier[other] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[return] identifier[WritableComparator] operator[SEP] identifier[compareBytes] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] , Other[0] , identifier[getLength] operator[SEP] operator[SEP] , identifier[other] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] , Other[0] , identifier[other] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public ServiceFuture<PersistedFace> getFaceAsync(String personGroupId, UUID personId, UUID persistedFaceId, final ServiceCallback<PersistedFace> serviceCallback) { return ServiceFuture.fromResponse(getFaceWithServiceResponseAsync(personGroupId, personId, persistedFaceId), serviceCallback); }
class class_name[name] begin[{] method[getFaceAsync, return_type[type[ServiceFuture]], modifier[public], parameter[personGroupId, personId, persistedFaceId, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.getFaceWithServiceResponseAsync, parameter[member[.personGroupId], member[.personId], member[.persistedFaceId]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[PersistedFace] operator[>] identifier[getFaceAsync] operator[SEP] identifier[String] identifier[personGroupId] , identifier[UUID] identifier[personId] , identifier[UUID] identifier[persistedFaceId] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[PersistedFace] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getFaceWithServiceResponseAsync] operator[SEP] identifier[personGroupId] , identifier[personId] , identifier[persistedFaceId] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
@SuppressWarnings("unused") // called through reflection by RequestServer public ModelIdV3 calcModelId(int version, ModelBuildersV3 m) { m.model_builders = new ModelBuilderSchema.IcedHashMapStringModelBuilderSchema(); String model_id = H2O.calcNextUniqueModelId(m.algo); ModelIdV3 mm = new ModelIdV3(); mm.model_id = model_id; return mm; }
class class_name[name] begin[{] method[calcModelId, return_type[type[ModelIdV3]], modifier[public], parameter[version, m]] begin[{] assign[member[m.model_builders], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelBuilderSchema, sub_type=ReferenceType(arguments=None, dimensions=None, name=IcedHashMapStringModelBuilderSchema, sub_type=None)))] local_variable[type[String], model_id] local_variable[type[ModelIdV3], mm] assign[member[mm.model_id], member[.model_id]] return[member[.mm]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[ModelIdV3] identifier[calcModelId] operator[SEP] Keyword[int] identifier[version] , identifier[ModelBuildersV3] identifier[m] operator[SEP] { identifier[m] operator[SEP] identifier[model_builders] operator[=] Keyword[new] identifier[ModelBuilderSchema] operator[SEP] identifier[IcedHashMapStringModelBuilderSchema] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[model_id] operator[=] identifier[H2O] operator[SEP] identifier[calcNextUniqueModelId] operator[SEP] identifier[m] operator[SEP] identifier[algo] operator[SEP] operator[SEP] identifier[ModelIdV3] identifier[mm] operator[=] Keyword[new] identifier[ModelIdV3] operator[SEP] operator[SEP] operator[SEP] identifier[mm] operator[SEP] identifier[model_id] operator[=] identifier[model_id] operator[SEP] Keyword[return] identifier[mm] operator[SEP] }
public Observable<ServiceResponse<Page<SiteInner>>> resumeNextWithServiceResponseAsync(final String nextPageLink) { return resumeNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<SiteInner>>, Observable<ServiceResponse<Page<SiteInner>>>>() { @Override public Observable<ServiceResponse<Page<SiteInner>>> call(ServiceResponse<Page<SiteInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(resumeNextWithServiceResponseAsync(nextPageLink)); } }); }
class class_name[name] begin[{] method[resumeNextWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] return[call[.resumeNextSinglePageAsync, parameter[member[.nextPageLink]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] operator[>] identifier[resumeNextWithServiceResponseAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[resumeNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[concatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] identifier[page] operator[SEP] { identifier[String] identifier[nextPageLink] operator[=] identifier[page] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextPageLink] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] } Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[concatWith] operator[SEP] identifier[resumeNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { hostcpu_responses result = (hostcpu_responses) service.get_payload_formatter().string_to_resource(hostcpu_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.hostcpu_response_array); } hostcpu[] result_hostcpu = new hostcpu[result.hostcpu_response_array.length]; for(int i = 0; i < result.hostcpu_response_array.length; i++) { result_hostcpu[i] = result.hostcpu_response_array[i].hostcpu[0]; } return result_hostcpu; }
class class_name[name] begin[{] method[get_nitro_bulk_response, return_type[type[base_resource]], modifier[protected], parameter[service, response]] begin[{] local_variable[type[hostcpu_responses], result] if[binary_operation[member[result.errorcode], !=, literal[0]]] begin[{] if[binary_operation[member[result.errorcode], ==, member[.SESSION_NOT_EXISTS]]] begin[{] call[service.clear_session, parameter[]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), MemberReference(member=errorcode, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), Cast(expression=MemberReference(member=hostcpu_response_array, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=base_response, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=nitro_exception, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[hostcpu], result_hostcpu] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result_hostcpu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=hostcpu_response_array, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=hostcpu, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=result.hostcpu_response_array, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result_hostcpu]] end[}] END[}]
Keyword[protected] identifier[base_resource] operator[SEP] operator[SEP] identifier[get_nitro_bulk_response] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[response] operator[SEP] Keyword[throws] identifier[Exception] { identifier[hostcpu_responses] identifier[result] operator[=] operator[SEP] identifier[hostcpu_responses] operator[SEP] identifier[service] operator[SEP] identifier[get_payload_formatter] operator[SEP] operator[SEP] operator[SEP] identifier[string_to_resource] operator[SEP] identifier[hostcpu_responses] operator[SEP] Keyword[class] , identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[errorcode] operator[!=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[errorcode] operator[==] identifier[SESSION_NOT_EXISTS] operator[SEP] identifier[service] operator[SEP] identifier[clear_session] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[nitro_exception] operator[SEP] identifier[result] operator[SEP] identifier[message] , identifier[result] operator[SEP] identifier[errorcode] , operator[SEP] identifier[base_response] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[hostcpu_response_array] operator[SEP] operator[SEP] } identifier[hostcpu] operator[SEP] operator[SEP] identifier[result_hostcpu] operator[=] Keyword[new] identifier[hostcpu] operator[SEP] identifier[result] operator[SEP] identifier[hostcpu_response_array] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[result] operator[SEP] identifier[hostcpu_response_array] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result_hostcpu] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[result] operator[SEP] identifier[hostcpu_response_array] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[hostcpu] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] identifier[result_hostcpu] operator[SEP] }
public Float32Array get(Float32Array buffer) { buffer.set(0, m00); buffer.set(1, m01); buffer.set(2, m02); buffer.set(3, m03); buffer.set(4, m10); buffer.set(5, m11); buffer.set(6, m12); buffer.set(7, m13); buffer.set(8, m20); buffer.set(9, m21); buffer.set(10, m22); buffer.set(11, m23); buffer.set(12, m30); buffer.set(13, m31); buffer.set(14, m32); buffer.set(15, m33); return buffer; }
class class_name[name] begin[{] method[get, return_type[type[Float32Array]], modifier[public], parameter[buffer]] begin[{] call[buffer.set, parameter[literal[0], member[.m00]]] call[buffer.set, parameter[literal[1], member[.m01]]] call[buffer.set, parameter[literal[2], member[.m02]]] call[buffer.set, parameter[literal[3], member[.m03]]] call[buffer.set, parameter[literal[4], member[.m10]]] call[buffer.set, parameter[literal[5], member[.m11]]] call[buffer.set, parameter[literal[6], member[.m12]]] call[buffer.set, parameter[literal[7], member[.m13]]] call[buffer.set, parameter[literal[8], member[.m20]]] call[buffer.set, parameter[literal[9], member[.m21]]] call[buffer.set, parameter[literal[10], member[.m22]]] call[buffer.set, parameter[literal[11], member[.m23]]] call[buffer.set, parameter[literal[12], member[.m30]]] call[buffer.set, parameter[literal[13], member[.m31]]] call[buffer.set, parameter[literal[14], member[.m32]]] call[buffer.set, parameter[literal[15], member[.m33]]] return[member[.buffer]] end[}] END[}]
Keyword[public] identifier[Float32Array] identifier[get] operator[SEP] identifier[Float32Array] identifier[buffer] operator[SEP] { identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[0] , identifier[m00] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[1] , identifier[m01] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[2] , identifier[m02] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[3] , identifier[m03] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[4] , identifier[m10] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[5] , identifier[m11] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[6] , identifier[m12] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[7] , identifier[m13] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[8] , identifier[m20] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[9] , identifier[m21] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[10] , identifier[m22] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[11] , identifier[m23] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[12] , identifier[m30] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[13] , identifier[m31] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[14] , identifier[m32] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[set] operator[SEP] Other[15] , identifier[m33] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] }
public String getPageContent(String pageTitle) throws Exception { String result = this.getPageContent(pageTitle, "", false); return result; }
class class_name[name] begin[{] method[getPageContent, return_type[type[String]], modifier[public], parameter[pageTitle]] begin[{] local_variable[type[String], result] return[member[.result]] end[}] END[}]
Keyword[public] identifier[String] identifier[getPageContent] operator[SEP] identifier[String] identifier[pageTitle] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[result] operator[=] Keyword[this] operator[SEP] identifier[getPageContent] operator[SEP] identifier[pageTitle] , literal[String] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public String convertServiceStatusToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertServiceStatusToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertServiceStatusToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void sessionMaxInactiveTimeSet(ISession session, int old, int newval) { // ArrayList sessionStateObservers = null; /* * Check to see if there is a non-empty list of sessionStateObservers. */ if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) { return; } // synchronized(_sessionStateObservers) { // sessionStateObservers = (ArrayList)_sessionStateObservers.clone(); // } ISessionStateObserver sessionStateObserver = null; for (int i = 0; i < _sessionStateObservers.size(); i++) { sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i); sessionStateObserver.sessionMaxInactiveTimeSet(session, old, newval); } }
class class_name[name] begin[{] method[sessionMaxInactiveTimeSet, return_type[void], modifier[public], parameter[session, old, newval]] begin[{] if[binary_operation[binary_operation[member[._sessionStateObservers], ==, literal[null]], ||, binary_operation[call[_sessionStateObservers.size, parameter[]], <, literal[1]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[ISessionStateObserver], sessionStateObserver] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sessionStateObserver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_sessionStateObservers, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ISessionStateObserver, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=old, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sessionMaxInactiveTimeSet, postfix_operators=[], prefix_operators=[], qualifier=sessionStateObserver, 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=_sessionStateObservers, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[sessionMaxInactiveTimeSet] operator[SEP] identifier[ISession] identifier[session] , Keyword[int] identifier[old] , Keyword[int] identifier[newval] operator[SEP] { Keyword[if] operator[SEP] identifier[_sessionStateObservers] operator[==] Other[null] operator[||] identifier[_sessionStateObservers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] { Keyword[return] operator[SEP] } identifier[ISessionStateObserver] identifier[sessionStateObserver] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_sessionStateObservers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sessionStateObserver] operator[=] operator[SEP] identifier[ISessionStateObserver] operator[SEP] identifier[_sessionStateObservers] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[sessionStateObserver] operator[SEP] identifier[sessionMaxInactiveTimeSet] operator[SEP] identifier[session] , identifier[old] , identifier[newval] operator[SEP] operator[SEP] } }
public Packer setFillY(final boolean how) { if (how == true) { gc.fill = GridBagConstraints.VERTICAL; gc.weighty = 1; } else { gc.weighty = 0; gc.fill = 0; } setConstraints(comp, gc); return this; }
class class_name[name] begin[{] method[setFillY, return_type[type[Packer]], modifier[public], parameter[how]] begin[{] if[binary_operation[member[.how], ==, literal[true]]] begin[{] assign[member[gc.fill], member[GridBagConstraints.VERTICAL]] assign[member[gc.weighty], literal[1]] else begin[{] assign[member[gc.weighty], literal[0]] assign[member[gc.fill], literal[0]] end[}] call[.setConstraints, parameter[member[.comp], member[.gc]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Packer] identifier[setFillY] operator[SEP] Keyword[final] Keyword[boolean] identifier[how] operator[SEP] { Keyword[if] operator[SEP] identifier[how] operator[==] literal[boolean] operator[SEP] { identifier[gc] operator[SEP] identifier[fill] operator[=] identifier[GridBagConstraints] operator[SEP] identifier[VERTICAL] operator[SEP] identifier[gc] operator[SEP] identifier[weighty] operator[=] Other[1] operator[SEP] } Keyword[else] { identifier[gc] operator[SEP] identifier[weighty] operator[=] Other[0] operator[SEP] identifier[gc] operator[SEP] identifier[fill] operator[=] Other[0] operator[SEP] } identifier[setConstraints] operator[SEP] identifier[comp] , identifier[gc] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static Matcher enumDefinition() { return new Matcher() { @Override public boolean matches(Node node, NodeMetadata metadata) { JSType jsType = node.getJSType(); return jsType != null && jsType.isEnumType(); } }; }
class class_name[name] begin[{] method[enumDefinition, return_type[type[Matcher]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getJSType, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), name=jsType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSType, sub_type=None)), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=jsType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEnumType, postfix_operators=[], prefix_operators=[], qualifier=jsType, selectors=[], type_arguments=None), operator=&&), label=None)], documentation=None, modifiers={'public'}, name=matches, parameters=[FormalParameter(annotations=[], modifiers=set(), name=node, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=metadata, type=ReferenceType(arguments=None, dimensions=[], name=NodeMetadata, 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=Matcher, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Matcher] identifier[enumDefinition] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Matcher] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[Node] identifier[node] , identifier[NodeMetadata] identifier[metadata] operator[SEP] { identifier[JSType] identifier[jsType] operator[=] identifier[node] operator[SEP] identifier[getJSType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[jsType] operator[!=] Other[null] operator[&&] identifier[jsType] operator[SEP] identifier[isEnumType] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public void buildSignature(XMLNode node, Content methodDocTree) { methodDocTree.addContent(writer.getSignature(currentMethod)); }
class class_name[name] begin[{] method[buildSignature, return_type[void], modifier[public], parameter[node, methodDocTree]] begin[{] call[methodDocTree.addContent, parameter[call[writer.getSignature, parameter[member[.currentMethod]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[buildSignature] operator[SEP] identifier[XMLNode] identifier[node] , identifier[Content] identifier[methodDocTree] operator[SEP] { identifier[methodDocTree] operator[SEP] identifier[addContent] operator[SEP] identifier[writer] operator[SEP] identifier[getSignature] operator[SEP] identifier[currentMethod] operator[SEP] operator[SEP] operator[SEP] }
@Override protected void configure() { bind(new TypeLiteral<String>() { }).annotatedWith(Names.named("simulatorContentType")).toInstance("txt"); bind(new TypeLiteral<String>() { }).annotatedWith(Names.named("encoding")).toInstance("Cp278"); bind(new TypeLiteral<Integer>() { }).annotatedWith(Names.named("headerLength")).toInstance(48); bind(new TypeLiteral<Integer>() { }).annotatedWith(Names.named("headerBodyLengthBeginIndex")).toInstance(4); bind(new TypeLiteral<Integer>() { }).annotatedWith(Names.named("headerBodyLengthEndIndex")).toInstance(8); }
class class_name[name] begin[{] method[configure, return_type[void], modifier[protected], parameter[]] begin[{] call[.bind, parameter[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=TypeLiteral, sub_type=None))]] call[.bind, parameter[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=TypeLiteral, sub_type=None))]] call[.bind, parameter[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=TypeLiteral, sub_type=None))]] call[.bind, parameter[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=TypeLiteral, sub_type=None))]] call[.bind, parameter[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=TypeLiteral, sub_type=None))]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[configure] operator[SEP] operator[SEP] { identifier[bind] operator[SEP] Keyword[new] identifier[TypeLiteral] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[annotatedWith] operator[SEP] identifier[Names] operator[SEP] identifier[named] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[toInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[bind] operator[SEP] Keyword[new] identifier[TypeLiteral] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[annotatedWith] operator[SEP] identifier[Names] operator[SEP] identifier[named] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[toInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[bind] operator[SEP] Keyword[new] identifier[TypeLiteral] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[annotatedWith] operator[SEP] identifier[Names] operator[SEP] identifier[named] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[toInstance] operator[SEP] Other[48] operator[SEP] operator[SEP] identifier[bind] operator[SEP] Keyword[new] identifier[TypeLiteral] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[annotatedWith] operator[SEP] identifier[Names] operator[SEP] identifier[named] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[toInstance] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[bind] operator[SEP] Keyword[new] identifier[TypeLiteral] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[annotatedWith] operator[SEP] identifier[Names] operator[SEP] identifier[named] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[toInstance] operator[SEP] Other[8] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<NextHopResultInner>> beginGetNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (networkWatcherName == null) { throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); final String apiVersion = "2018-04-01"; return service.beginGetNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<NextHopResultInner>>>() { @Override public Observable<ServiceResponse<NextHopResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<NextHopResultInner> clientResponse = beginGetNextHopDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[beginGetNextHopWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, networkWatcherName, parameters]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.networkWatcherName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter networkWatcherName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.parameters], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[Validator.validate, parameter[member[.parameters]]] local_variable[type[String], apiVersion] return[call[service.beginGetNextHop, parameter[member[.resourceGroupName], member[.networkWatcherName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.parameters], member[.apiVersion], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[NextHopResultInner] operator[>] operator[>] identifier[beginGetNextHopWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[networkWatcherName] , identifier[NextHopParameters] identifier[parameters] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[networkWatcherName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[apiVersion] operator[=] literal[String] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[beginGetNextHop] operator[SEP] identifier[resourceGroupName] , identifier[networkWatcherName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[parameters] , identifier[apiVersion] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[NextHopResultInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[NextHopResultInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[NextHopResultInner] operator[>] identifier[clientResponse] operator[=] identifier[beginGetNextHopDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public static <C extends Sequence<D>, D extends Compound> DistanceMatrix fractionalDissimilarityScore( MultipleSequenceAlignment<C, D> msa, SubstitutionMatrix<D> M) { // Calculate the similarity scores using the alignment package logger.info("{}:{}", "Determing Distances", 0); int n = msa.getSize(); DistanceMatrix DM = new BasicSymmetricalDistanceMatrix(n); int totalloopcount = (n / 2) * (n + 1); int end = msa.getLength(); String[] sequenceString = new String[n]; for (int i = 0; i < n; i++) { sequenceString[i] = msa.getAlignedSequence(i + 1) .getSequenceAsString(); } List<C> seqs = msa.getAlignedSequences(); int loopcount = 0; for (int i = 0; i < (n - 1); i++) { logger.info("{}:{}", "Determining Distances", (loopcount * 100) / totalloopcount); // Obtain the similarity scores for (int j = i; j < n; j++) { double score = 0; loopcount++; for (int k = 0; k < end; k++) { if (Comparison.isGap(sequenceString[i].charAt(k)) || Comparison.isGap(sequenceString[j].charAt(k))) continue; score += M.getValue(seqs.get(i).getCompoundAt(k + 1), seqs .get(j).getCompoundAt(k + 1)); } if (i == j) DM.setValue(i, j, 0.0); else { double dS = (M.getMaxValue() - score / msa.getLength()) / (M.getMaxValue() - M.getMinValue()); DM.setValue(i, j, dS); DM.setValue(j, i, dS); } } } return DM; }
class class_name[name] begin[{] method[fractionalDissimilarityScore, return_type[type[DistanceMatrix]], modifier[public static], parameter[msa, M]] begin[{] call[logger.info, parameter[literal["{}:{}"], literal["Determing Distances"], literal[0]]] local_variable[type[int], n] local_variable[type[DistanceMatrix], DM] local_variable[type[int], totalloopcount] local_variable[type[int], end] local_variable[type[String], sequenceString] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sequenceString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getAlignedSequence, postfix_operators=[], prefix_operators=[], qualifier=msa, selectors=[MethodInvocation(arguments=[], member=getSequenceAsString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[List], seqs] local_variable[type[int], loopcount] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}:{}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Determining Distances"), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=loopcount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), operator=*), operandr=MemberReference(member=totalloopcount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=score)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MemberReference(member=loopcount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=sequenceString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=isGap, postfix_operators=[], prefix_operators=[], qualifier=Comparison, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=sequenceString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=isGap, postfix_operators=[], prefix_operators=[], qualifier=Comparison, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=seqs, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getCompoundAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=seqs, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getCompoundAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, 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=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMaxValue, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=msa, selectors=[], type_arguments=None), operator=/), operator=-), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMaxValue, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getMinValue, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), operator=-), operator=/), name=dS)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=DM, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=DM, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=DM, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.DM]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[C] Keyword[extends] identifier[Sequence] operator[<] identifier[D] operator[>] , identifier[D] Keyword[extends] identifier[Compound] operator[>] identifier[DistanceMatrix] identifier[fractionalDissimilarityScore] operator[SEP] identifier[MultipleSequenceAlignment] operator[<] identifier[C] , identifier[D] operator[>] identifier[msa] , identifier[SubstitutionMatrix] operator[<] identifier[D] operator[>] identifier[M] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , literal[String] , Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[msa] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] identifier[DistanceMatrix] identifier[DM] operator[=] Keyword[new] identifier[BasicSymmetricalDistanceMatrix] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[int] identifier[totalloopcount] operator[=] operator[SEP] identifier[n] operator[/] Other[2] operator[SEP] operator[*] operator[SEP] identifier[n] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[msa] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[sequenceString] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sequenceString] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[msa] operator[SEP] identifier[getAlignedSequence] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[getSequenceAsString] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[C] operator[>] identifier[seqs] operator[=] identifier[msa] operator[SEP] identifier[getAlignedSequences] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[loopcount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , literal[String] , operator[SEP] identifier[loopcount] operator[*] Other[100] operator[SEP] operator[/] identifier[totalloopcount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[SEP] identifier[j] operator[<] identifier[n] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[double] identifier[score] operator[=] Other[0] operator[SEP] identifier[loopcount] operator[++] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[end] operator[SEP] identifier[k] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[Comparison] operator[SEP] identifier[isGap] operator[SEP] identifier[sequenceString] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[charAt] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[||] identifier[Comparison] operator[SEP] identifier[isGap] operator[SEP] identifier[sequenceString] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[charAt] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[score] operator[+=] identifier[M] operator[SEP] identifier[getValue] operator[SEP] identifier[seqs] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getCompoundAt] operator[SEP] identifier[k] operator[+] Other[1] operator[SEP] , identifier[seqs] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getCompoundAt] operator[SEP] identifier[k] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[==] identifier[j] operator[SEP] identifier[DM] operator[SEP] identifier[setValue] operator[SEP] identifier[i] , identifier[j] , literal[Float] operator[SEP] operator[SEP] Keyword[else] { Keyword[double] identifier[dS] operator[=] operator[SEP] identifier[M] operator[SEP] identifier[getMaxValue] operator[SEP] operator[SEP] operator[-] identifier[score] operator[/] identifier[msa] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[/] operator[SEP] identifier[M] operator[SEP] identifier[getMaxValue] operator[SEP] operator[SEP] operator[-] identifier[M] operator[SEP] identifier[getMinValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DM] operator[SEP] identifier[setValue] operator[SEP] identifier[i] , identifier[j] , identifier[dS] operator[SEP] operator[SEP] identifier[DM] operator[SEP] identifier[setValue] operator[SEP] identifier[j] , identifier[i] , identifier[dS] operator[SEP] operator[SEP] } } } Keyword[return] identifier[DM] operator[SEP] }
MessagePublisher providePublisher(PublisherReliability reliability, Class<?> eventType) { Map<Class<?>, MessagePublisher> localPublishers = publishers.get(); if (localPublishers == null) { localPublishers = new HashMap<Class<?>, MessagePublisher>(); publishers.set(localPublishers); } MessagePublisher publisher = localPublishers.get(eventType); if (publisher == null) { publisher = new GenericPublisher(connectionFactory, reliability); localPublishers.put(eventType, publisher); } return publisher; }
class class_name[name] begin[{] method[providePublisher, return_type[type[MessagePublisher]], modifier[default], parameter[reliability, eventType]] begin[{] local_variable[type[Map], localPublishers] if[binary_operation[member[.localPublishers], ==, literal[null]]] begin[{] assign[member[.localPublishers], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MessagePublisher, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] call[publishers.set, parameter[member[.localPublishers]]] else begin[{] None end[}] local_variable[type[MessagePublisher], publisher] if[binary_operation[member[.publisher], ==, literal[null]]] begin[{] assign[member[.publisher], ClassCreator(arguments=[MemberReference(member=connectionFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reliability, 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=GenericPublisher, sub_type=None))] call[localPublishers.put, parameter[member[.eventType], member[.publisher]]] else begin[{] None end[}] return[member[.publisher]] end[}] END[}]
identifier[MessagePublisher] identifier[providePublisher] operator[SEP] identifier[PublisherReliability] identifier[reliability] , identifier[Class] operator[<] operator[?] operator[>] identifier[eventType] operator[SEP] { identifier[Map] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[MessagePublisher] operator[>] identifier[localPublishers] operator[=] identifier[publishers] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[localPublishers] operator[==] Other[null] operator[SEP] { identifier[localPublishers] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[MessagePublisher] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[publishers] operator[SEP] identifier[set] operator[SEP] identifier[localPublishers] operator[SEP] operator[SEP] } identifier[MessagePublisher] identifier[publisher] operator[=] identifier[localPublishers] operator[SEP] identifier[get] operator[SEP] identifier[eventType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[publisher] operator[==] Other[null] operator[SEP] { identifier[publisher] operator[=] Keyword[new] identifier[GenericPublisher] operator[SEP] identifier[connectionFactory] , identifier[reliability] operator[SEP] operator[SEP] identifier[localPublishers] operator[SEP] identifier[put] operator[SEP] identifier[eventType] , identifier[publisher] operator[SEP] operator[SEP] } Keyword[return] identifier[publisher] operator[SEP] }
public static double[][] computeWeightMatrix(int bpp) { final int dim = bpp * bpp * bpp; final double[][] m = new double[dim][dim]; // maximum occurring distance in manhattan between bins: final double max = 3. * (bpp - 1.); for(int x = 0; x < dim; x++) { final int rx = (x / bpp) / bpp; final int gx = (x / bpp) % bpp; final int bx = x % bpp; for(int y = x; y < dim; y++) { final int ry = (y / bpp) / bpp; final int gy = (y / bpp) % bpp; final int by = y % bpp; final double dr = Math.abs(rx - ry); final double dg = Math.abs(gx - gy); final double db = Math.abs(bx - by); final double val = 1 - (dr + dg + db) / max; m[x][y] = m[y][x] = val; } } return m; }
class class_name[name] begin[{] method[computeWeightMatrix, return_type[type[double]], modifier[public static], parameter[bpp]] begin[{] local_variable[type[int], dim] local_variable[type[double], m] local_variable[type[double], max] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=rx)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), name=gx)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), name=bx)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=ry)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), name=gy)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bpp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), name=by)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=rx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=dr)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=gx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=gy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=dg)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=bx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=by, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=db)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=db, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operator=-), name=val)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, 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) return[member[.m]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[computeWeightMatrix] operator[SEP] Keyword[int] identifier[bpp] operator[SEP] { Keyword[final] Keyword[int] identifier[dim] operator[=] identifier[bpp] operator[*] identifier[bpp] operator[*] identifier[bpp] operator[SEP] Keyword[final] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[dim] operator[SEP] operator[SEP] identifier[dim] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[max] operator[=] literal[Float] operator[*] operator[SEP] identifier[bpp] operator[-] literal[Float] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[dim] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[final] Keyword[int] identifier[rx] operator[=] operator[SEP] identifier[x] operator[/] identifier[bpp] operator[SEP] operator[/] identifier[bpp] operator[SEP] Keyword[final] Keyword[int] identifier[gx] operator[=] operator[SEP] identifier[x] operator[/] identifier[bpp] operator[SEP] operator[%] identifier[bpp] operator[SEP] Keyword[final] Keyword[int] identifier[bx] operator[=] identifier[x] operator[%] identifier[bpp] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[x] operator[SEP] identifier[y] operator[<] identifier[dim] operator[SEP] identifier[y] operator[++] operator[SEP] { Keyword[final] Keyword[int] identifier[ry] operator[=] operator[SEP] identifier[y] operator[/] identifier[bpp] operator[SEP] operator[/] identifier[bpp] operator[SEP] Keyword[final] Keyword[int] identifier[gy] operator[=] operator[SEP] identifier[y] operator[/] identifier[bpp] operator[SEP] operator[%] identifier[bpp] operator[SEP] Keyword[final] Keyword[int] identifier[by] operator[=] identifier[y] operator[%] identifier[bpp] operator[SEP] Keyword[final] Keyword[double] identifier[dr] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[rx] operator[-] identifier[ry] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[dg] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[gx] operator[-] identifier[gy] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[db] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[bx] operator[-] identifier[by] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[val] operator[=] Other[1] operator[-] operator[SEP] identifier[dr] operator[+] identifier[dg] operator[+] identifier[db] operator[SEP] operator[/] identifier[max] operator[SEP] identifier[m] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] identifier[m] operator[SEP] identifier[y] operator[SEP] operator[SEP] identifier[x] operator[SEP] operator[=] identifier[val] operator[SEP] } } Keyword[return] identifier[m] operator[SEP] }
public String[] getNames() { String[] headers = new String[columns.getColumns().size()]; for (int i = 0; i < columns.getColumns().size(); i++) { headers[i] = columns.getColumns().get(i).getName(); } return headers; }
class class_name[name] begin[{] method[getNames, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], headers] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[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), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=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) return[member[.headers]] end[}] END[}]
Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getNames] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[headers] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[columns] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] 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[columns] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[headers] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[columns] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[headers] operator[SEP] }
public static void setDefaultDebugSettingsForDevelopment(final WebApplication application) { ApplicationExtensions.setHtmlHotDeploy(application); ApplicationExtensions.setDebugSettingsForDevelopment(application); ApplicationExtensions.setExceptionSettingsForDevelopment(application); // set the behavior if an missing resource is found... application.getResourceSettings().setThrowExceptionOnMissingResource(true); }
class class_name[name] begin[{] method[setDefaultDebugSettingsForDevelopment, return_type[void], modifier[public static], parameter[application]] begin[{] call[ApplicationExtensions.setHtmlHotDeploy, parameter[member[.application]]] call[ApplicationExtensions.setDebugSettingsForDevelopment, parameter[member[.application]]] call[ApplicationExtensions.setExceptionSettingsForDevelopment, parameter[member[.application]]] call[application.getResourceSettings, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setDefaultDebugSettingsForDevelopment] operator[SEP] Keyword[final] identifier[WebApplication] identifier[application] operator[SEP] { identifier[ApplicationExtensions] operator[SEP] identifier[setHtmlHotDeploy] operator[SEP] identifier[application] operator[SEP] operator[SEP] identifier[ApplicationExtensions] operator[SEP] identifier[setDebugSettingsForDevelopment] operator[SEP] identifier[application] operator[SEP] operator[SEP] identifier[ApplicationExtensions] operator[SEP] identifier[setExceptionSettingsForDevelopment] operator[SEP] identifier[application] operator[SEP] operator[SEP] identifier[application] operator[SEP] identifier[getResourceSettings] operator[SEP] operator[SEP] operator[SEP] identifier[setThrowExceptionOnMissingResource] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
public ViewFactory getViewFactory() { if (m_viewFactory != null) return m_viewFactory; m_viewFactory = super.getViewFactory(); if (m_viewFactory != null) return m_viewFactory; String viewType = this.getProperty(ScreenModel.VIEW_TYPE); if (viewType == null) viewType = ScreenModel.SWING_TYPE; char viewPrefix = Character.toUpperCase(viewType.charAt(0)); if (ScreenModel.SWING_TYPE.equalsIgnoreCase(viewType)) viewPrefix = 'V'; // Special, swing starts with 'V' return m_viewFactory = ViewFactory.getViewFactory(viewType, viewPrefix); }
class class_name[name] begin[{] method[getViewFactory, return_type[type[ViewFactory]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.m_viewFactory], !=, literal[null]]] begin[{] return[member[.m_viewFactory]] else begin[{] None end[}] assign[member[.m_viewFactory], SuperMethodInvocation(arguments=[], member=getViewFactory, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] if[binary_operation[member[.m_viewFactory], !=, literal[null]]] begin[{] return[member[.m_viewFactory]] else begin[{] None end[}] local_variable[type[String], viewType] if[binary_operation[member[.viewType], ==, literal[null]]] begin[{] assign[member[.viewType], member[ScreenModel.SWING_TYPE]] else begin[{] None end[}] local_variable[type[char], viewPrefix] if[call[ScreenModel.SWING_TYPE.equalsIgnoreCase, parameter[member[.viewType]]]] begin[{] assign[member[.viewPrefix], literal['V']] else begin[{] None end[}] return[assign[member[.m_viewFactory], call[ViewFactory.getViewFactory, parameter[member[.viewType], member[.viewPrefix]]]]] end[}] END[}]
Keyword[public] identifier[ViewFactory] identifier[getViewFactory] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_viewFactory] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[m_viewFactory] operator[SEP] identifier[m_viewFactory] operator[=] Keyword[super] operator[SEP] identifier[getViewFactory] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_viewFactory] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[m_viewFactory] operator[SEP] identifier[String] identifier[viewType] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[ScreenModel] operator[SEP] identifier[VIEW_TYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[viewType] operator[==] Other[null] operator[SEP] identifier[viewType] operator[=] identifier[ScreenModel] operator[SEP] identifier[SWING_TYPE] operator[SEP] Keyword[char] identifier[viewPrefix] operator[=] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[viewType] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ScreenModel] operator[SEP] identifier[SWING_TYPE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[viewType] operator[SEP] operator[SEP] identifier[viewPrefix] operator[=] literal[String] operator[SEP] Keyword[return] identifier[m_viewFactory] operator[=] identifier[ViewFactory] operator[SEP] identifier[getViewFactory] operator[SEP] identifier[viewType] , identifier[viewPrefix] operator[SEP] operator[SEP] }
public SecurityGroupViewResultInner beginGetVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginGetVMSecurityRules, return_type[type[SecurityGroupViewResultInner]], modifier[public], parameter[resourceGroupName, networkWatcherName, targetResourceId]] begin[{] return[call[.beginGetVMSecurityRulesWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.networkWatcherName], member[.targetResourceId]]]] end[}] END[}]
Keyword[public] identifier[SecurityGroupViewResultInner] identifier[beginGetVMSecurityRules] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[networkWatcherName] , identifier[String] identifier[targetResourceId] operator[SEP] { Keyword[return] identifier[beginGetVMSecurityRulesWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[networkWatcherName] , identifier[targetResourceId] 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] }
private static XSSFVMLDrawing getVmlDrawingFromCell(final Cell cell) { XSSFSheet sourceSheet = (XSSFSheet) cell.getSheet(); for (POIXMLDocumentPart sourcePart : sourceSheet.getRelations()) { if ((sourcePart != null) && (sourcePart instanceof XSSFVMLDrawing)) { return (XSSFVMLDrawing) sourcePart; } } return null; }
class class_name[name] begin[{] method[getVmlDrawingFromCell, return_type[type[XSSFVMLDrawing]], modifier[private static], parameter[cell]] begin[{] local_variable[type[XSSFSheet], sourceSheet] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sourcePart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=sourcePart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=XSSFVMLDrawing, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=sourcePart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=XSSFVMLDrawing, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRelations, postfix_operators=[], prefix_operators=[], qualifier=sourceSheet, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sourcePart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=POIXMLDocumentPart, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] Keyword[static] identifier[XSSFVMLDrawing] identifier[getVmlDrawingFromCell] operator[SEP] Keyword[final] identifier[Cell] identifier[cell] operator[SEP] { identifier[XSSFSheet] identifier[sourceSheet] operator[=] operator[SEP] identifier[XSSFSheet] operator[SEP] identifier[cell] operator[SEP] identifier[getSheet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[POIXMLDocumentPart] identifier[sourcePart] operator[:] identifier[sourceSheet] operator[SEP] identifier[getRelations] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[sourcePart] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[sourcePart] Keyword[instanceof] identifier[XSSFVMLDrawing] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[XSSFVMLDrawing] operator[SEP] identifier[sourcePart] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static String ellipsize(String text, int maxLength, String end) { if (text != null && text.length() > maxLength) { return text.substring(0, maxLength - end.length()) + end; } return text; }
class class_name[name] begin[{] method[ellipsize, return_type[type[String]], modifier[public static], parameter[text, maxLength, end]] begin[{] if[binary_operation[binary_operation[member[.text], !=, literal[null]], &&, binary_operation[call[text.length, parameter[]], >, member[.maxLength]]]] begin[{] return[binary_operation[call[text.substring, parameter[literal[0], binary_operation[member[.maxLength], -, call[end.length, parameter[]]]]], +, member[.end]]] else begin[{] None end[}] return[member[.text]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[ellipsize] operator[SEP] identifier[String] identifier[text] , Keyword[int] identifier[maxLength] , identifier[String] identifier[end] operator[SEP] { Keyword[if] operator[SEP] identifier[text] operator[!=] Other[null] operator[&&] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[maxLength] operator[SEP] { Keyword[return] identifier[text] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[maxLength] operator[-] identifier[end] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[end] operator[SEP] } Keyword[return] identifier[text] operator[SEP] }
private boolean isRunningOutOfDiskSpace() { // If there's not enough space left to allocate two log segments return raft.getStorage().statistics().getUsableSpace() < raft.getStorage().maxLogSegmentSize() * SEGMENT_BUFFER_FACTOR // Or the used disk percentage has surpassed the free disk buffer percentage || raft.getStorage().statistics().getUsableSpace() / (double) raft.getStorage().statistics().getTotalSpace() < raft.getStorage().freeDiskBuffer(); }
class class_name[name] begin[{] method[isRunningOutOfDiskSpace, return_type[type[boolean]], modifier[private], parameter[]] begin[{] return[binary_operation[binary_operation[call[raft.getStorage, parameter[]], <, binary_operation[call[raft.getStorage, parameter[]], *, member[.SEGMENT_BUFFER_FACTOR]]], ||, binary_operation[binary_operation[call[raft.getStorage, parameter[]], /, Cast(expression=MethodInvocation(arguments=[], member=getStorage, postfix_operators=[], prefix_operators=[], qualifier=raft, selectors=[MethodInvocation(arguments=[], member=statistics, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTotalSpace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=BasicType(dimensions=[], name=double))], <, call[raft.getStorage, parameter[]]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isRunningOutOfDiskSpace] operator[SEP] operator[SEP] { Keyword[return] identifier[raft] operator[SEP] identifier[getStorage] operator[SEP] operator[SEP] operator[SEP] identifier[statistics] operator[SEP] operator[SEP] operator[SEP] identifier[getUsableSpace] operator[SEP] operator[SEP] operator[<] identifier[raft] operator[SEP] identifier[getStorage] operator[SEP] operator[SEP] operator[SEP] identifier[maxLogSegmentSize] operator[SEP] operator[SEP] operator[*] identifier[SEGMENT_BUFFER_FACTOR] operator[||] identifier[raft] operator[SEP] identifier[getStorage] operator[SEP] operator[SEP] operator[SEP] identifier[statistics] operator[SEP] operator[SEP] operator[SEP] identifier[getUsableSpace] operator[SEP] operator[SEP] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[raft] operator[SEP] identifier[getStorage] operator[SEP] operator[SEP] operator[SEP] identifier[statistics] operator[SEP] operator[SEP] operator[SEP] identifier[getTotalSpace] operator[SEP] operator[SEP] operator[<] identifier[raft] operator[SEP] identifier[getStorage] operator[SEP] operator[SEP] operator[SEP] identifier[freeDiskBuffer] operator[SEP] operator[SEP] operator[SEP] }
public boolean isLogger(String loggerName) throws Exception { Address addr = Address.root().add(SUBSYSTEM, LOGGING, LOGGER, loggerName); return null != readResource(addr); }
class class_name[name] begin[{] method[isLogger, return_type[type[boolean]], modifier[public], parameter[loggerName]] begin[{] local_variable[type[Address], addr] return[binary_operation[literal[null], !=, call[.readResource, parameter[member[.addr]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isLogger] operator[SEP] identifier[String] identifier[loggerName] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Address] identifier[addr] operator[=] identifier[Address] operator[SEP] identifier[root] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[SUBSYSTEM] , identifier[LOGGING] , identifier[LOGGER] , identifier[loggerName] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[!=] identifier[readResource] operator[SEP] identifier[addr] operator[SEP] operator[SEP] }
public static String parseEchoStatement(String statement) { Matcher matcher = EchoToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { return matcher.group(2); } return ""; } return null; }
class class_name[name] begin[{] method[parseEchoStatement, return_type[type[String]], modifier[public static], parameter[statement]] begin[{] local_variable[type[Matcher], matcher] if[call[matcher.matches, parameter[]]] begin[{] local_variable[type[String], commandWordTerminator] if[call[OneWhitespace.matcher, parameter[member[.commandWordTerminator]]]] begin[{] return[call[matcher.group, parameter[literal[2]]]] else begin[{] None end[}] return[literal[""]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[parseEchoStatement] operator[SEP] identifier[String] identifier[statement] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[EchoToken] operator[SEP] identifier[matcher] operator[SEP] identifier[statement] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[commandWordTerminator] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[OneWhitespace] operator[SEP] identifier[matcher] operator[SEP] identifier[commandWordTerminator] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public void marshall(ListWebhookItem listWebhookItem, ProtocolMarshaller protocolMarshaller) { if (listWebhookItem == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listWebhookItem.getDefinition(), DEFINITION_BINDING); protocolMarshaller.marshall(listWebhookItem.getUrl(), URL_BINDING); protocolMarshaller.marshall(listWebhookItem.getErrorMessage(), ERRORMESSAGE_BINDING); protocolMarshaller.marshall(listWebhookItem.getErrorCode(), ERRORCODE_BINDING); protocolMarshaller.marshall(listWebhookItem.getLastTriggered(), LASTTRIGGERED_BINDING); protocolMarshaller.marshall(listWebhookItem.getArn(), ARN_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[listWebhookItem, protocolMarshaller]] begin[{] if[binary_operation[member[.listWebhookItem], ==, 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=getDefinition, postfix_operators=[], prefix_operators=[], qualifier=listWebhookItem, selectors=[], type_arguments=None), MemberReference(member=DEFINITION_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=getUrl, postfix_operators=[], prefix_operators=[], qualifier=listWebhookItem, selectors=[], type_arguments=None), MemberReference(member=URL_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=getErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=listWebhookItem, selectors=[], type_arguments=None), MemberReference(member=ERRORMESSAGE_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=getErrorCode, postfix_operators=[], prefix_operators=[], qualifier=listWebhookItem, selectors=[], type_arguments=None), MemberReference(member=ERRORCODE_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=getLastTriggered, postfix_operators=[], prefix_operators=[], qualifier=listWebhookItem, selectors=[], type_arguments=None), MemberReference(member=LASTTRIGGERED_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=getArn, postfix_operators=[], prefix_operators=[], qualifier=listWebhookItem, selectors=[], type_arguments=None), MemberReference(member=ARN_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[ListWebhookItem] identifier[listWebhookItem] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listWebhookItem] 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[listWebhookItem] operator[SEP] identifier[getDefinition] operator[SEP] operator[SEP] , identifier[DEFINITION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listWebhookItem] operator[SEP] identifier[getUrl] operator[SEP] operator[SEP] , identifier[URL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listWebhookItem] operator[SEP] identifier[getErrorMessage] operator[SEP] operator[SEP] , identifier[ERRORMESSAGE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listWebhookItem] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] , identifier[ERRORCODE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listWebhookItem] operator[SEP] identifier[getLastTriggered] operator[SEP] operator[SEP] , identifier[LASTTRIGGERED_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listWebhookItem] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void processException(HttpServletRequest req, HttpServletResponse res) throws IOException { if (redirectURL != null) { res.sendRedirect(redirectURL); return; } if (message == null) { res.sendError(statusCode); } else { res.sendError(statusCode, message); } }
class class_name[name] begin[{] method[processException, return_type[void], modifier[public], parameter[req, res]] begin[{] if[binary_operation[member[.redirectURL], !=, literal[null]]] begin[{] call[res.sendRedirect, parameter[member[.redirectURL]]] return[None] else begin[{] None end[}] if[binary_operation[member[.message], ==, literal[null]]] begin[{] call[res.sendError, parameter[member[.statusCode]]] else begin[{] call[res.sendError, parameter[member[.statusCode], member[.message]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[processException] operator[SEP] identifier[HttpServletRequest] identifier[req] , identifier[HttpServletResponse] identifier[res] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[redirectURL] operator[!=] Other[null] operator[SEP] { identifier[res] operator[SEP] identifier[sendRedirect] operator[SEP] identifier[redirectURL] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[SEP] { identifier[res] operator[SEP] identifier[sendError] operator[SEP] identifier[statusCode] operator[SEP] operator[SEP] } Keyword[else] { identifier[res] operator[SEP] identifier[sendError] operator[SEP] identifier[statusCode] , identifier[message] operator[SEP] operator[SEP] } }
@SuppressWarnings ({ "rawtypes", "unchecked" }) private final void processQueue () { SoftValue<V> softValue; while ((softValue = (SoftValue) queue.poll()) != null) { internalMap.remove(softValue.key); } }
class class_name[name] begin[{] method[processQueue, return_type[void], modifier[final private], parameter[]] begin[{] local_variable[type[SoftValue], softValue] while[binary_operation[assign[member[.softValue], Cast(expression=MethodInvocation(arguments=[], member=poll, postfix_operators=[], prefix_operators=[], qualifier=queue, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SoftValue, sub_type=None))], !=, literal[null]]] begin[{] call[internalMap.remove, parameter[member[softValue.key]]] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[private] Keyword[final] Keyword[void] identifier[processQueue] operator[SEP] operator[SEP] { identifier[SoftValue] operator[<] identifier[V] operator[>] identifier[softValue] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[softValue] operator[=] operator[SEP] identifier[SoftValue] operator[SEP] identifier[queue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[internalMap] operator[SEP] identifier[remove] operator[SEP] identifier[softValue] operator[SEP] identifier[key] operator[SEP] operator[SEP] } }
public final void entryRuleXMemberFeatureCall() throws RecognitionException { try { // InternalXbase.g:634:1: ( ruleXMemberFeatureCall EOF ) // InternalXbase.g:635:1: ruleXMemberFeatureCall EOF { if ( state.backtracking==0 ) { before(grammarAccess.getXMemberFeatureCallRule()); } pushFollow(FOLLOW_1); ruleXMemberFeatureCall(); state._fsp--; if (state.failed) return ; if ( state.backtracking==0 ) { after(grammarAccess.getXMemberFeatureCallRule()); } match(input,EOF,FOLLOW_2); if (state.failed) return ; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; }
class class_name[name] begin[{] method[entryRuleXMemberFeatureCall, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, 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=[MethodInvocation(arguments=[], member=getXMemberFeatureCallRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=ruleXMemberFeatureCall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, 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=[MethodInvocation(arguments=[], member=getXMemberFeatureCallRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=after, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[None] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[entryRuleXMemberFeatureCall] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXMemberFeatureCallRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[ruleXMemberFeatureCall] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXMemberFeatureCallRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] operator[SEP] }
private void scanClassesDirectory(MavenProjectDirectoryDescriptor projectDescriptor, MavenArtifactDescriptor artifactDescriptor, final String directoryName, Scanner scanner) { File directory = new File(directoryName); if (directory.exists()) { scanArtifact(projectDescriptor, artifactDescriptor, directory, directoryName, scanner); } }
class class_name[name] begin[{] method[scanClassesDirectory, return_type[void], modifier[private], parameter[projectDescriptor, artifactDescriptor, directoryName, scanner]] begin[{] local_variable[type[File], directory] if[call[directory.exists, parameter[]]] begin[{] call[.scanArtifact, parameter[member[.projectDescriptor], member[.artifactDescriptor], member[.directory], member[.directoryName], member[.scanner]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[scanClassesDirectory] operator[SEP] identifier[MavenProjectDirectoryDescriptor] identifier[projectDescriptor] , identifier[MavenArtifactDescriptor] identifier[artifactDescriptor] , Keyword[final] identifier[String] identifier[directoryName] , identifier[Scanner] identifier[scanner] operator[SEP] { identifier[File] identifier[directory] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[directoryName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[directory] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[scanArtifact] operator[SEP] identifier[projectDescriptor] , identifier[artifactDescriptor] , identifier[directory] , identifier[directoryName] , identifier[scanner] operator[SEP] operator[SEP] } }
public static TransactionException invalidAttributeValue(Object object, AttributeType.DataType dataType) { return create(ErrorMessage.INVALID_DATATYPE.getMessage(object, object.getClass().getSimpleName(), dataType.name())); }
class class_name[name] begin[{] method[invalidAttributeValue, return_type[type[TransactionException]], modifier[public static], parameter[object, dataType]] begin[{] return[call[.create, parameter[call[ErrorMessage.INVALID_DATATYPE.getMessage, parameter[member[.object], call[object.getClass, parameter[]], call[dataType.name, parameter[]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[TransactionException] identifier[invalidAttributeValue] operator[SEP] identifier[Object] identifier[object] , identifier[AttributeType] operator[SEP] identifier[DataType] identifier[dataType] operator[SEP] { Keyword[return] identifier[create] operator[SEP] identifier[ErrorMessage] operator[SEP] identifier[INVALID_DATATYPE] operator[SEP] identifier[getMessage] operator[SEP] identifier[object] , identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[dataType] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private int parseDateFormatStyle(Arguments args) { if (args.has(SHORT_STYLE)) { return DateFormat.SHORT; } else if (args.has(MEDIUM_STYLE)) { return DateFormat.MEDIUM; } else if (args.has(LONG_STYLE)) { return DateFormat.LONG; } else if (args.has(FULL_STYLE)) { return DateFormat.FULL; } return DateFormat.DEFAULT; }
class class_name[name] begin[{] method[parseDateFormatStyle, return_type[type[int]], modifier[private], parameter[args]] begin[{] if[call[args.has, parameter[member[.SHORT_STYLE]]]] begin[{] return[member[DateFormat.SHORT]] else begin[{] if[call[args.has, parameter[member[.MEDIUM_STYLE]]]] begin[{] return[member[DateFormat.MEDIUM]] else begin[{] if[call[args.has, parameter[member[.LONG_STYLE]]]] begin[{] return[member[DateFormat.LONG]] else begin[{] if[call[args.has, parameter[member[.FULL_STYLE]]]] begin[{] return[member[DateFormat.FULL]] else begin[{] None end[}] end[}] end[}] end[}] return[member[DateFormat.DEFAULT]] end[}] END[}]
Keyword[private] Keyword[int] identifier[parseDateFormatStyle] operator[SEP] identifier[Arguments] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[has] operator[SEP] identifier[SHORT_STYLE] operator[SEP] operator[SEP] { Keyword[return] identifier[DateFormat] operator[SEP] identifier[SHORT] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[has] operator[SEP] identifier[MEDIUM_STYLE] operator[SEP] operator[SEP] { Keyword[return] identifier[DateFormat] operator[SEP] identifier[MEDIUM] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[has] operator[SEP] identifier[LONG_STYLE] operator[SEP] operator[SEP] { Keyword[return] identifier[DateFormat] operator[SEP] identifier[LONG] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[has] operator[SEP] identifier[FULL_STYLE] operator[SEP] operator[SEP] { Keyword[return] identifier[DateFormat] operator[SEP] identifier[FULL] operator[SEP] } Keyword[return] identifier[DateFormat] operator[SEP] identifier[DEFAULT] operator[SEP] }
public static List<String> listFromCommaSeparatedStringList(List<String> listOfCommaSeparatedValues) { if (listOfCommaSeparatedValues == null) { return null; } List<String> outList = new ArrayList<String>(); for (String commaSeparatedValues : listOfCommaSeparatedValues) { if (commaSeparatedValues != null) { List<String> values = Arrays.asList( commaSeparatedValues.split("\\s*,\\s*") ); outList.addAll(values); } } if (outList.size() == 0) { return null; } return outList; }
class class_name[name] begin[{] method[listFromCommaSeparatedStringList, return_type[type[List]], modifier[public static], parameter[listOfCommaSeparatedValues]] begin[{] if[binary_operation[member[.listOfCommaSeparatedValues], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], outList] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=commaSeparatedValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\s*,\\s*")], member=split, postfix_operators=[], prefix_operators=[], qualifier=commaSeparatedValues, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), name=values)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=outList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=listOfCommaSeparatedValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=commaSeparatedValues)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[binary_operation[call[outList.size, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] return[member[.outList]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[listFromCommaSeparatedStringList] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[listOfCommaSeparatedValues] operator[SEP] { Keyword[if] operator[SEP] identifier[listOfCommaSeparatedValues] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[outList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[commaSeparatedValues] operator[:] identifier[listOfCommaSeparatedValues] operator[SEP] { Keyword[if] operator[SEP] identifier[commaSeparatedValues] operator[!=] Other[null] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[commaSeparatedValues] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[outList] operator[SEP] identifier[addAll] operator[SEP] identifier[values] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[outList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[outList] operator[SEP] }
public static void info(Logger log, String methodName) { if (log.isInfoEnabled()) log.info(buildMethodLogString(methodName)); }
class class_name[name] begin[{] method[info, return_type[void], modifier[public static], parameter[log, methodName]] begin[{] if[call[log.isInfoEnabled, parameter[]]] begin[{] call[log.info, parameter[call[.buildMethodLogString, parameter[member[.methodName]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[info] operator[SEP] identifier[Logger] identifier[log] , identifier[String] identifier[methodName] 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] identifier[buildMethodLogString] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] operator[SEP] }
public static void proxy(Method method, InvocationHandler invocationHandler) { assertInvocationHandlerNotNull(invocationHandler); MockRepository.putMethodProxy(method, invocationHandler); }
class class_name[name] begin[{] method[proxy, return_type[void], modifier[public static], parameter[method, invocationHandler]] begin[{] call[.assertInvocationHandlerNotNull, parameter[member[.invocationHandler]]] call[MockRepository.putMethodProxy, parameter[member[.method], member[.invocationHandler]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[proxy] operator[SEP] identifier[Method] identifier[method] , identifier[InvocationHandler] identifier[invocationHandler] operator[SEP] { identifier[assertInvocationHandlerNotNull] operator[SEP] identifier[invocationHandler] operator[SEP] operator[SEP] identifier[MockRepository] operator[SEP] identifier[putMethodProxy] operator[SEP] identifier[method] , identifier[invocationHandler] operator[SEP] operator[SEP] }
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if( templates==null ) return null; return newXMLFilter(templates); }
class class_name[name] begin[{] method[newXMLFilter, return_type[type[XMLFilter]], modifier[public], parameter[src]] begin[{] local_variable[type[Templates], templates] if[binary_operation[member[.templates], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[.newXMLFilter, parameter[member[.templates]]]] end[}] END[}]
Keyword[public] identifier[XMLFilter] identifier[newXMLFilter] operator[SEP] identifier[Source] identifier[src] operator[SEP] Keyword[throws] identifier[TransformerConfigurationException] { identifier[Templates] identifier[templates] operator[=] identifier[newTemplates] operator[SEP] identifier[src] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[templates] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[newXMLFilter] operator[SEP] identifier[templates] operator[SEP] operator[SEP] }
public static void serialise(Path output, Object json) throws IOException { // First serialise to a temp file: Gson gson = getBuilder().create(); Path temp = Files.createTempFile(json.getClass().getSimpleName(), ".json"); try (Writer writer = Files.newBufferedWriter(temp, StandardCharsets.UTF_8)) { gson.toJson(json, writer); } // Now do an optimised Channel-to-Channel transfer to the output file: long size = Files.size(temp); try (FileChannel tempChannel = FileChannel.open(temp, StandardOpenOption.READ); FileChannel outputChannel = FileChannel.open(output, StandardOpenOption.WRITE, StandardOpenOption.CREATE)) { // NB the lock will be released when the channel is closed: writeLock(outputChannel); outputChannel.truncate(0); tempChannel.transferTo(0, size, outputChannel); outputChannel.truncate(size); } }
class class_name[name] begin[{] method[serialise, return_type[void], modifier[public static], parameter[output, json]] begin[{] local_variable[type[Gson], gson] local_variable[type[Path], temp] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=json, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toJson, postfix_operators=[], prefix_operators=[], qualifier=gson, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=writer, type=ReferenceType(arguments=None, dimensions=[], name=Writer, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, selectors=[])], member=newBufferedWriter, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None))]) local_variable[type[long], size] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=outputChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=truncate, postfix_operators=[], prefix_operators=[], qualifier=outputChannel, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outputChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transferTo, postfix_operators=[], prefix_operators=[], qualifier=tempChannel, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=truncate, postfix_operators=[], prefix_operators=[], qualifier=outputChannel, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=tempChannel, type=ReferenceType(arguments=None, dimensions=[], name=FileChannel, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=READ, postfix_operators=[], prefix_operators=[], qualifier=StandardOpenOption, selectors=[])], member=open, postfix_operators=[], prefix_operators=[], qualifier=FileChannel, selectors=[], type_arguments=None)), TryResource(annotations=[], modifiers=set(), name=outputChannel, type=ReferenceType(arguments=None, dimensions=[], name=FileChannel, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=WRITE, postfix_operators=[], prefix_operators=[], qualifier=StandardOpenOption, selectors=[]), MemberReference(member=CREATE, postfix_operators=[], prefix_operators=[], qualifier=StandardOpenOption, selectors=[])], member=open, postfix_operators=[], prefix_operators=[], qualifier=FileChannel, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[serialise] operator[SEP] identifier[Path] identifier[output] , identifier[Object] identifier[json] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Gson] identifier[gson] operator[=] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[temp] operator[=] identifier[Files] operator[SEP] identifier[createTempFile] operator[SEP] identifier[json] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[Writer] identifier[writer] operator[=] identifier[Files] operator[SEP] identifier[newBufferedWriter] operator[SEP] identifier[temp] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] { identifier[gson] operator[SEP] identifier[toJson] operator[SEP] identifier[json] , identifier[writer] operator[SEP] operator[SEP] } Keyword[long] identifier[size] operator[=] identifier[Files] operator[SEP] identifier[size] operator[SEP] identifier[temp] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[FileChannel] identifier[tempChannel] operator[=] identifier[FileChannel] operator[SEP] identifier[open] operator[SEP] identifier[temp] , identifier[StandardOpenOption] operator[SEP] identifier[READ] operator[SEP] operator[SEP] identifier[FileChannel] identifier[outputChannel] operator[=] identifier[FileChannel] operator[SEP] identifier[open] operator[SEP] identifier[output] , identifier[StandardOpenOption] operator[SEP] identifier[WRITE] , identifier[StandardOpenOption] operator[SEP] identifier[CREATE] operator[SEP] operator[SEP] { identifier[writeLock] operator[SEP] identifier[outputChannel] operator[SEP] operator[SEP] identifier[outputChannel] operator[SEP] identifier[truncate] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[tempChannel] operator[SEP] identifier[transferTo] operator[SEP] Other[0] , identifier[size] , identifier[outputChannel] operator[SEP] operator[SEP] identifier[outputChannel] operator[SEP] identifier[truncate] operator[SEP] identifier[size] operator[SEP] operator[SEP] } }
@Override public String getSql(final String sqlPath) { if (!cache) { return sqlLoader.load(sqlPath); } else { return sqlMap.get(sqlPath.replace(".", "/")); } }
class class_name[name] begin[{] method[getSql, return_type[type[String]], modifier[public], parameter[sqlPath]] begin[{] if[member[.cache]] begin[{] return[call[sqlLoader.load, parameter[member[.sqlPath]]]] else begin[{] return[call[sqlMap.get, parameter[call[sqlPath.replace, parameter[literal["."], literal["/"]]]]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getSql] operator[SEP] Keyword[final] identifier[String] identifier[sqlPath] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[cache] operator[SEP] { Keyword[return] identifier[sqlLoader] operator[SEP] identifier[load] operator[SEP] identifier[sqlPath] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[sqlMap] operator[SEP] identifier[get] operator[SEP] identifier[sqlPath] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } }
@Override public ListConfigurationRevisionsResult listConfigurationRevisions(ListConfigurationRevisionsRequest request) { request = beforeClientExecution(request); return executeListConfigurationRevisions(request); }
class class_name[name] begin[{] method[listConfigurationRevisions, return_type[type[ListConfigurationRevisionsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeListConfigurationRevisions, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ListConfigurationRevisionsResult] identifier[listConfigurationRevisions] operator[SEP] identifier[ListConfigurationRevisionsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListConfigurationRevisions] operator[SEP] identifier[request] operator[SEP] operator[SEP] }