code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void append (CharSequence text, int start, int end){ mInputView.append(text, start, end); }
class class_name[name] begin[{] method[append, return_type[void], modifier[public], parameter[text, start, end]] begin[{] call[mInputView.append, parameter[member[.text], member[.start], member[.end]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[append] operator[SEP] identifier[CharSequence] identifier[text] , Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] { identifier[mInputView] operator[SEP] identifier[append] operator[SEP] identifier[text] , identifier[start] , identifier[end] operator[SEP] operator[SEP] }
public static Webcam getDefault() throws WebcamException { try { return getDefault(Long.MAX_VALUE); } catch (TimeoutException e) { // this should never happen since user would have to wait 300000000 // years for it to occur throw new RuntimeException(e); } }
class class_name[name] begin[{] method[getDefault, return_type[type[Webcam]], modifier[public static], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[])], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=, 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=['TimeoutException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Webcam] identifier[getDefault] operator[SEP] operator[SEP] Keyword[throws] identifier[WebcamException] { Keyword[try] { Keyword[return] identifier[getDefault] operator[SEP] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TimeoutException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
protected String getPrefixedName( Name baseName ) { String prefixedName = prefixedNames.get(baseName); if (prefixedName == null) { prefixedName = baseName.getString(session.namespaces()); prefixedNames.put(baseName, prefixedName); } return prefixedName; }
class class_name[name] begin[{] method[getPrefixedName, return_type[type[String]], modifier[protected], parameter[baseName]] begin[{] local_variable[type[String], prefixedName] if[binary_operation[member[.prefixedName], ==, literal[null]]] begin[{] assign[member[.prefixedName], call[baseName.getString, parameter[call[session.namespaces, parameter[]]]]] call[prefixedNames.put, parameter[member[.baseName], member[.prefixedName]]] else begin[{] None end[}] return[member[.prefixedName]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getPrefixedName] operator[SEP] identifier[Name] identifier[baseName] operator[SEP] { identifier[String] identifier[prefixedName] operator[=] identifier[prefixedNames] operator[SEP] identifier[get] operator[SEP] identifier[baseName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefixedName] operator[==] Other[null] operator[SEP] { identifier[prefixedName] operator[=] identifier[baseName] operator[SEP] identifier[getString] operator[SEP] identifier[session] operator[SEP] identifier[namespaces] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[prefixedNames] operator[SEP] identifier[put] operator[SEP] identifier[baseName] , identifier[prefixedName] operator[SEP] operator[SEP] } Keyword[return] identifier[prefixedName] operator[SEP] }
public boolean contains(int s) { if (null == m_map) return false; for (int i = 0; i < m_firstFree; i++) { int node = m_map[i]; if (node == s) return true; } return false; }
class class_name[name] begin[{] method[contains, return_type[type[boolean]], modifier[public], parameter[s]] begin[{] if[binary_operation[literal[null], ==, member[.m_map]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=m_map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=node)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_firstFree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[contains] operator[SEP] Keyword[int] identifier[s] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[m_map] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[m_firstFree] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[node] operator[=] identifier[m_map] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[==] identifier[s] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Help(help = "Update the Security of a NetworkServiceDescriptor with specific id") public Security updateSecurity( final String idNSD, final String idSecurity, final Security updatedSecurity) throws SDKException { String url = idNSD + "/security" + "/" + idSecurity; return (Security) requestPut(url, updatedSecurity); }
class class_name[name] begin[{] method[updateSecurity, return_type[type[Security]], modifier[public], parameter[idNSD, idSecurity, updatedSecurity]] begin[{] local_variable[type[String], url] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=updatedSecurity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requestPut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Security, sub_type=None))] end[}] END[}]
annotation[@] identifier[Help] operator[SEP] identifier[help] operator[=] literal[String] operator[SEP] Keyword[public] identifier[Security] identifier[updateSecurity] operator[SEP] Keyword[final] identifier[String] identifier[idNSD] , Keyword[final] identifier[String] identifier[idSecurity] , Keyword[final] identifier[Security] identifier[updatedSecurity] operator[SEP] Keyword[throws] identifier[SDKException] { identifier[String] identifier[url] operator[=] identifier[idNSD] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[idSecurity] operator[SEP] Keyword[return] operator[SEP] identifier[Security] operator[SEP] identifier[requestPut] operator[SEP] identifier[url] , identifier[updatedSecurity] operator[SEP] operator[SEP] }
@Inject(method = "loadTextureAtlas", at = @At("RETURN"), locals = LocalCapture.CAPTURE_FAILSOFT) private void onLoadTextureAtlas(IResourceManager resourceManager, CallbackInfo ci, int i, Stitcher stitcher, int j, int k, ProgressManager.ProgressBar bar) { Icon.BLOCK_TEXTURE_WIDTH = stitcher.getCurrentWidth(); Icon.BLOCK_TEXTURE_HEIGHT = stitcher.getCurrentHeight(); }
class class_name[name] begin[{] method[onLoadTextureAtlas, return_type[void], modifier[private], parameter[resourceManager, ci, i, stitcher, j, k, bar]] begin[{] assign[member[Icon.BLOCK_TEXTURE_WIDTH], call[stitcher.getCurrentWidth, parameter[]]] assign[member[Icon.BLOCK_TEXTURE_HEIGHT], call[stitcher.getCurrentHeight, parameter[]]] end[}] END[}]
annotation[@] identifier[Inject] operator[SEP] identifier[method] operator[=] literal[String] , identifier[at] operator[=] annotation[@] identifier[At] operator[SEP] literal[String] operator[SEP] , identifier[locals] operator[=] identifier[LocalCapture] operator[SEP] identifier[CAPTURE_FAILSOFT] operator[SEP] Keyword[private] Keyword[void] identifier[onLoadTextureAtlas] operator[SEP] identifier[IResourceManager] identifier[resourceManager] , identifier[CallbackInfo] identifier[ci] , Keyword[int] identifier[i] , identifier[Stitcher] identifier[stitcher] , Keyword[int] identifier[j] , Keyword[int] identifier[k] , identifier[ProgressManager] operator[SEP] identifier[ProgressBar] identifier[bar] operator[SEP] { identifier[Icon] operator[SEP] identifier[BLOCK_TEXTURE_WIDTH] operator[=] identifier[stitcher] operator[SEP] identifier[getCurrentWidth] operator[SEP] operator[SEP] operator[SEP] identifier[Icon] operator[SEP] identifier[BLOCK_TEXTURE_HEIGHT] operator[=] identifier[stitcher] operator[SEP] identifier[getCurrentHeight] operator[SEP] operator[SEP] operator[SEP] }
public static byte[] addAll(byte[] array1, byte[] array2) { if (array1 == null) { return clone(array2); } else if (array2 == null) { return clone(array1); } byte[] joinedArray = new byte[array1.length + array2.length]; System.arraycopy(array1, 0, joinedArray, 0, array1.length); System.arraycopy(array2, 0, joinedArray, array1.length, array2.length); return joinedArray; }
class class_name[name] begin[{] method[addAll, return_type[type[byte]], modifier[public static], parameter[array1, array2]] begin[{] if[binary_operation[member[.array1], ==, literal[null]]] begin[{] return[call[.clone, parameter[member[.array2]]]] else begin[{] if[binary_operation[member[.array2], ==, literal[null]]] begin[{] return[call[.clone, parameter[member[.array1]]]] else begin[{] None end[}] end[}] local_variable[type[byte], joinedArray] call[System.arraycopy, parameter[member[.array1], literal[0], member[.joinedArray], literal[0], member[array1.length]]] call[System.arraycopy, parameter[member[.array2], literal[0], member[.joinedArray], member[array1.length], member[array2.length]]] return[member[.joinedArray]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[array1] , Keyword[byte] operator[SEP] operator[SEP] identifier[array2] operator[SEP] { Keyword[if] operator[SEP] identifier[array1] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[clone] operator[SEP] identifier[array2] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[array2] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[clone] operator[SEP] identifier[array1] operator[SEP] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[joinedArray] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[array1] operator[SEP] identifier[length] operator[+] identifier[array2] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[array1] , Other[0] , identifier[joinedArray] , Other[0] , identifier[array1] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[array2] , Other[0] , identifier[joinedArray] , identifier[array1] operator[SEP] identifier[length] , identifier[array2] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[joinedArray] operator[SEP] }
public void setCachedConsumerProps(CachedSessionProperties props) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setCachedConsumerProps", props); this.cachedProps = props; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setCachedConsumerProps"); }
class class_name[name] begin[{] method[setCachedConsumerProps, return_type[void], modifier[public], parameter[props]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["setCachedConsumerProps"], member[.props]]] else begin[{] None end[}] assign[THIS[member[None.cachedProps]], member[.props]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["setCachedConsumerProps"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCachedConsumerProps] operator[SEP] identifier[CachedSessionProperties] identifier[props] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[props] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[cachedProps] operator[=] identifier[props] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private EntityManager getOrCreateTransactionScopedEntityManager( final EntityManagerFactory emf, final String scopedPuName, final Map properties, final SynchronizationType synchronizationType) { EntityManager entityManager = TransactionUtil.getTransactionScopedEntityManager(puScopedName, transactionSynchronizationRegistry); if (entityManager == null) { entityManager = createEntityManager(emf, properties, synchronizationType); if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("%s: created entity manager session %s", TransactionUtil.getEntityManagerDetails(entityManager, scopedPuName), TransactionUtil.getTransaction(transactionManager).toString()); } TransactionUtil.registerSynchronization(entityManager, scopedPuName, transactionSynchronizationRegistry, transactionManager); TransactionUtil.putEntityManagerInTransactionRegistry(scopedPuName, entityManager, transactionSynchronizationRegistry); } else { testForMixedSynchronizationTypes(emf, entityManager, puScopedName, synchronizationType, properties); if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("%s: reuse entity manager session already in tx %s", TransactionUtil.getEntityManagerDetails(entityManager, scopedPuName), TransactionUtil.getTransaction(transactionManager).toString()); } } return entityManager; }
class class_name[name] begin[{] method[getOrCreateTransactionScopedEntityManager, return_type[type[EntityManager]], modifier[private], parameter[emf, scopedPuName, properties, synchronizationType]] begin[{] local_variable[type[EntityManager], entityManager] if[binary_operation[member[.entityManager], ==, literal[null]]] begin[{] assign[member[.entityManager], call[.createEntityManager, parameter[member[.emf], member[.properties], member[.synchronizationType]]]] if[call[ROOT_LOGGER.isDebugEnabled, parameter[]]] begin[{] call[ROOT_LOGGER.debugf, parameter[literal["%s: created entity manager session %s"], call[TransactionUtil.getEntityManagerDetails, parameter[member[.entityManager], member[.scopedPuName]]], call[TransactionUtil.getTransaction, parameter[member[.transactionManager]]]]] else begin[{] None end[}] call[TransactionUtil.registerSynchronization, parameter[member[.entityManager], member[.scopedPuName], member[.transactionSynchronizationRegistry], member[.transactionManager]]] call[TransactionUtil.putEntityManagerInTransactionRegistry, parameter[member[.scopedPuName], member[.entityManager], member[.transactionSynchronizationRegistry]]] else begin[{] call[.testForMixedSynchronizationTypes, parameter[member[.emf], member[.entityManager], member[.puScopedName], member[.synchronizationType], member[.properties]]] if[call[ROOT_LOGGER.isDebugEnabled, parameter[]]] begin[{] call[ROOT_LOGGER.debugf, parameter[literal["%s: reuse entity manager session already in tx %s"], call[TransactionUtil.getEntityManagerDetails, parameter[member[.entityManager], member[.scopedPuName]]], call[TransactionUtil.getTransaction, parameter[member[.transactionManager]]]]] else begin[{] None end[}] end[}] return[member[.entityManager]] end[}] END[}]
Keyword[private] identifier[EntityManager] identifier[getOrCreateTransactionScopedEntityManager] operator[SEP] Keyword[final] identifier[EntityManagerFactory] identifier[emf] , Keyword[final] identifier[String] identifier[scopedPuName] , Keyword[final] identifier[Map] identifier[properties] , Keyword[final] identifier[SynchronizationType] identifier[synchronizationType] operator[SEP] { identifier[EntityManager] identifier[entityManager] operator[=] identifier[TransactionUtil] operator[SEP] identifier[getTransactionScopedEntityManager] operator[SEP] identifier[puScopedName] , identifier[transactionSynchronizationRegistry] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityManager] operator[==] Other[null] operator[SEP] { identifier[entityManager] operator[=] identifier[createEntityManager] operator[SEP] identifier[emf] , identifier[properties] , identifier[synchronizationType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[ROOT_LOGGER] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[TransactionUtil] operator[SEP] identifier[getEntityManagerDetails] operator[SEP] identifier[entityManager] , identifier[scopedPuName] operator[SEP] , identifier[TransactionUtil] operator[SEP] identifier[getTransaction] operator[SEP] identifier[transactionManager] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[TransactionUtil] operator[SEP] identifier[registerSynchronization] operator[SEP] identifier[entityManager] , identifier[scopedPuName] , identifier[transactionSynchronizationRegistry] , identifier[transactionManager] operator[SEP] operator[SEP] identifier[TransactionUtil] operator[SEP] identifier[putEntityManagerInTransactionRegistry] operator[SEP] identifier[scopedPuName] , identifier[entityManager] , identifier[transactionSynchronizationRegistry] operator[SEP] operator[SEP] } Keyword[else] { identifier[testForMixedSynchronizationTypes] operator[SEP] identifier[emf] , identifier[entityManager] , identifier[puScopedName] , identifier[synchronizationType] , identifier[properties] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[ROOT_LOGGER] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[TransactionUtil] operator[SEP] identifier[getEntityManagerDetails] operator[SEP] identifier[entityManager] , identifier[scopedPuName] operator[SEP] , identifier[TransactionUtil] operator[SEP] identifier[getTransaction] operator[SEP] identifier[transactionManager] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[entityManager] operator[SEP] }
public static <T> Consumer<T> redirectable(Supplier<Consumer<T>> target) { return value -> target.get().accept(value); }
class class_name[name] begin[{] method[redirectable, return_type[type[Consumer]], modifier[public static], parameter[target]] begin[{] return[LambdaExpression(body=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Consumer] operator[<] identifier[T] operator[>] identifier[redirectable] operator[SEP] identifier[Supplier] operator[<] identifier[Consumer] operator[<] identifier[T] operator[>] operator[>] identifier[target] operator[SEP] { Keyword[return] identifier[value] operator[->] identifier[target] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[accept] operator[SEP] identifier[value] operator[SEP] operator[SEP] }
public ServiceFuture<Void> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback); }
class class_name[name] begin[{] method[moveResourcesAsync, return_type[type[ServiceFuture]], modifier[public], parameter[sourceResourceGroupName, parameters, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.moveResourcesWithServiceResponseAsync, parameter[member[.sourceResourceGroupName], member[.parameters]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[Void] operator[>] identifier[moveResourcesAsync] operator[SEP] identifier[String] identifier[sourceResourceGroupName] , identifier[ResourcesMoveInfo] identifier[parameters] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[Void] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[moveResourcesWithServiceResponseAsync] operator[SEP] identifier[sourceResourceGroupName] , identifier[parameters] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
Context getContext(final String path, List<String> aliases) { VHostMapping host = null; for (final VHostMapping vhost : vHosts) { if (aliases.equals(vhost.getAliases())) { host = vhost; break; } } if (host == null) { return null; } for (final Context context : contexts) { if (context.getPath().equals(path) && context.getVhost() == host) { return context; } } return null; }
class class_name[name] begin[{] method[getContext, return_type[type[Context]], modifier[default], parameter[path, aliases]] begin[{] local_variable[type[VHostMapping], host] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAliases, postfix_operators=[], prefix_operators=[], qualifier=vhost, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=aliases, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=vhost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=vHosts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=vhost)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=VHostMapping, sub_type=None))), label=None) if[binary_operation[member[.host], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getVhost, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), operandr=MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=contexts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=context)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Context, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
identifier[Context] identifier[getContext] operator[SEP] Keyword[final] identifier[String] identifier[path] , identifier[List] operator[<] identifier[String] operator[>] identifier[aliases] operator[SEP] { identifier[VHostMapping] identifier[host] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[VHostMapping] identifier[vhost] operator[:] identifier[vHosts] operator[SEP] { Keyword[if] operator[SEP] identifier[aliases] operator[SEP] identifier[equals] operator[SEP] identifier[vhost] operator[SEP] identifier[getAliases] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[host] operator[=] identifier[vhost] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[host] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[Context] identifier[context] operator[:] identifier[contexts] operator[SEP] { Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[path] operator[SEP] operator[&&] identifier[context] operator[SEP] identifier[getVhost] operator[SEP] operator[SEP] operator[==] identifier[host] operator[SEP] { Keyword[return] identifier[context] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); }
class class_name[name] begin[{] method[getByResourceGroup, return_type[type[WorkspaceInner]], modifier[public], parameter[resourceGroupName, workspaceName]] begin[{] return[call[.getByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.workspaceName]]]] end[}] END[}]
Keyword[public] identifier[WorkspaceInner] identifier[getByResourceGroup] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[workspaceName] operator[SEP] { Keyword[return] identifier[getByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[workspaceName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public PathImpl get(String scheme) { ConcurrentHashMap<String,SchemeRoot> map = getMap(); SchemeRoot root = map.get(scheme); if (root == null) { PathImpl rootPath = createLazyScheme(scheme); if (rootPath != null) { map.putIfAbsent(scheme, new SchemeRoot(rootPath)); root = map.get(scheme); } } PathImpl path = null; if (root != null) { path = root.getRoot(); } if (path != null) { return path; } else { return new NotFoundPath(this, scheme + ":"); } }
class class_name[name] begin[{] method[get, return_type[type[PathImpl]], modifier[public], parameter[scheme]] begin[{] local_variable[type[ConcurrentHashMap], map] local_variable[type[SchemeRoot], root] if[binary_operation[member[.root], ==, literal[null]]] begin[{] local_variable[type[PathImpl], rootPath] if[binary_operation[member[.rootPath], !=, literal[null]]] begin[{] call[map.putIfAbsent, parameter[member[.scheme], ClassCreator(arguments=[MemberReference(member=rootPath, 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=SchemeRoot, sub_type=None))]] assign[member[.root], call[map.get, parameter[member[.scheme]]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[PathImpl], path] if[binary_operation[member[.root], !=, literal[null]]] begin[{] assign[member[.path], call[root.getRoot, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.path], !=, literal[null]]] begin[{] return[member[.path]] else begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), BinaryOperation(operandl=MemberReference(member=scheme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotFoundPath, sub_type=None))] end[}] end[}] END[}]
Keyword[public] identifier[PathImpl] identifier[get] operator[SEP] identifier[String] identifier[scheme] operator[SEP] { identifier[ConcurrentHashMap] operator[<] identifier[String] , identifier[SchemeRoot] operator[>] identifier[map] operator[=] identifier[getMap] operator[SEP] operator[SEP] operator[SEP] identifier[SchemeRoot] identifier[root] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[==] Other[null] operator[SEP] { identifier[PathImpl] identifier[rootPath] operator[=] identifier[createLazyScheme] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rootPath] operator[!=] Other[null] operator[SEP] { identifier[map] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[scheme] , Keyword[new] identifier[SchemeRoot] operator[SEP] identifier[rootPath] operator[SEP] operator[SEP] operator[SEP] identifier[root] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] } } identifier[PathImpl] identifier[path] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[!=] Other[null] operator[SEP] { identifier[path] operator[=] identifier[root] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[path] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[NotFoundPath] operator[SEP] Keyword[this] , identifier[scheme] operator[+] literal[String] operator[SEP] operator[SEP] } }
private static Sc68Binding loadLibrary() { try { Verbose.info("Load library: ", LIBRARY_NAME); final Sc68Binding binding = Native.loadLibrary(LIBRARY_NAME, Sc68Binding.class); Verbose.info("Library ", LIBRARY_NAME, " loaded"); return binding; } catch (final LinkageError exception) { throw new LionEngineException(exception, ERROR_LOAD_LIBRARY + LIBRARY_NAME); } }
class class_name[name] begin[{] method[loadLibrary, return_type[type[Sc68Binding]], modifier[private static], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Load library: "), MemberReference(member=LIBRARY_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=Verbose, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=LIBRARY_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Sc68Binding, sub_type=None))], member=loadLibrary, postfix_operators=[], prefix_operators=[], qualifier=Native, selectors=[], type_arguments=None), name=binding)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Sc68Binding, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Library "), MemberReference(member=LIBRARY_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" loaded")], member=info, postfix_operators=[], prefix_operators=[], qualifier=Verbose, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=binding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=ERROR_LOAD_LIBRARY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LIBRARY_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LionEngineException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['LinkageError']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[Sc68Binding] identifier[loadLibrary] operator[SEP] operator[SEP] { Keyword[try] { identifier[Verbose] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[LIBRARY_NAME] operator[SEP] operator[SEP] Keyword[final] identifier[Sc68Binding] identifier[binding] operator[=] identifier[Native] operator[SEP] identifier[loadLibrary] operator[SEP] identifier[LIBRARY_NAME] , identifier[Sc68Binding] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Verbose] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[LIBRARY_NAME] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[binding] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[LinkageError] identifier[exception] operator[SEP] { Keyword[throw] Keyword[new] identifier[LionEngineException] operator[SEP] identifier[exception] , identifier[ERROR_LOAD_LIBRARY] operator[+] identifier[LIBRARY_NAME] operator[SEP] operator[SEP] } }
static final byte[] resizeBuffer(final byte[] buf, final int newsize) { if (buf.length == newsize) return buf; final byte[] newbuf = new byte[newsize]; System.arraycopy(buf, 0, newbuf, 0, Math.min(buf.length, newbuf.length)); return newbuf; }
class class_name[name] begin[{] method[resizeBuffer, return_type[type[byte]], modifier[final static], parameter[buf, newsize]] begin[{] if[binary_operation[member[buf.length], ==, member[.newsize]]] begin[{] return[member[.buf]] else begin[{] None end[}] local_variable[type[byte], newbuf] call[System.arraycopy, parameter[member[.buf], literal[0], member[.newbuf], literal[0], call[Math.min, parameter[member[buf.length], member[newbuf.length]]]]] return[member[.newbuf]] end[}] END[}]
Keyword[static] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[resizeBuffer] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] , Keyword[final] Keyword[int] identifier[newsize] operator[SEP] { Keyword[if] operator[SEP] identifier[buf] operator[SEP] identifier[length] operator[==] identifier[newsize] operator[SEP] Keyword[return] identifier[buf] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[newbuf] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[newsize] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[buf] , Other[0] , identifier[newbuf] , Other[0] , identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[buf] operator[SEP] identifier[length] , identifier[newbuf] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[newbuf] operator[SEP] }
protected static String encodeTags(Map<String, String> tags) { if (tags == null) { return null; } try { StringBuilder builder = new StringBuilder(); boolean first = true; for (Entry<String, String> entry : tags.entrySet()) { if (!first) { builder.append(','); } builder.append(URLEncoder.encode(entry.getKey(), "UTF-8")); //$NON-NLS-1$ builder.append(':'); builder.append(URLEncoder.encode(entry.getValue(), "UTF-8")); //$NON-NLS-1$ first = false; } return builder.toString(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return ""; //$NON-NLS-1$ } }
class class_name[name] begin[{] method[encodeTags, return_type[type[String]], modifier[static protected], parameter[tags]] begin[{] if[binary_operation[member[.tags], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=first)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=first, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':')], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=tags, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[static] identifier[String] identifier[encodeTags] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[SEP] { Keyword[if] operator[SEP] identifier[tags] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[first] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[tags] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[first] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[first] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] } }
public static void toWriter(String templateFileName, VelocityContext context, Writer writer) { assertInit(); final Template template = Velocity.getTemplate(templateFileName); merge(template, context, writer); }
class class_name[name] begin[{] method[toWriter, return_type[void], modifier[public static], parameter[templateFileName, context, writer]] begin[{] call[.assertInit, parameter[]] local_variable[type[Template], template] call[.merge, parameter[member[.template], member[.context], member[.writer]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[toWriter] operator[SEP] identifier[String] identifier[templateFileName] , identifier[VelocityContext] identifier[context] , identifier[Writer] identifier[writer] operator[SEP] { identifier[assertInit] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Template] identifier[template] operator[=] identifier[Velocity] operator[SEP] identifier[getTemplate] operator[SEP] identifier[templateFileName] operator[SEP] operator[SEP] identifier[merge] operator[SEP] identifier[template] , identifier[context] , identifier[writer] operator[SEP] operator[SEP] }
public void marshall(UnprocessedTraceSegment unprocessedTraceSegment, ProtocolMarshaller protocolMarshaller) { if (unprocessedTraceSegment == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(unprocessedTraceSegment.getId(), ID_BINDING); protocolMarshaller.marshall(unprocessedTraceSegment.getErrorCode(), ERRORCODE_BINDING); protocolMarshaller.marshall(unprocessedTraceSegment.getMessage(), MESSAGE_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[unprocessedTraceSegment, protocolMarshaller]] begin[{] if[binary_operation[member[.unprocessedTraceSegment], ==, 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=getId, postfix_operators=[], prefix_operators=[], qualifier=unprocessedTraceSegment, selectors=[], type_arguments=None), MemberReference(member=ID_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=unprocessedTraceSegment, 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=getMessage, postfix_operators=[], prefix_operators=[], qualifier=unprocessedTraceSegment, selectors=[], type_arguments=None), MemberReference(member=MESSAGE_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[UnprocessedTraceSegment] identifier[unprocessedTraceSegment] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[unprocessedTraceSegment] 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[unprocessedTraceSegment] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[ID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[unprocessedTraceSegment] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] , identifier[ERRORCODE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[unprocessedTraceSegment] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[MESSAGE_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 marshall(RegexMatchTuple regexMatchTuple, ProtocolMarshaller protocolMarshaller) { if (regexMatchTuple == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(regexMatchTuple.getFieldToMatch(), FIELDTOMATCH_BINDING); protocolMarshaller.marshall(regexMatchTuple.getTextTransformation(), TEXTTRANSFORMATION_BINDING); protocolMarshaller.marshall(regexMatchTuple.getRegexPatternSetId(), REGEXPATTERNSETID_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[regexMatchTuple, protocolMarshaller]] begin[{] if[binary_operation[member[.regexMatchTuple], ==, 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=getFieldToMatch, postfix_operators=[], prefix_operators=[], qualifier=regexMatchTuple, selectors=[], type_arguments=None), MemberReference(member=FIELDTOMATCH_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=getTextTransformation, postfix_operators=[], prefix_operators=[], qualifier=regexMatchTuple, selectors=[], type_arguments=None), MemberReference(member=TEXTTRANSFORMATION_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=getRegexPatternSetId, postfix_operators=[], prefix_operators=[], qualifier=regexMatchTuple, selectors=[], type_arguments=None), MemberReference(member=REGEXPATTERNSETID_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[RegexMatchTuple] identifier[regexMatchTuple] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[regexMatchTuple] 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[regexMatchTuple] operator[SEP] identifier[getFieldToMatch] operator[SEP] operator[SEP] , identifier[FIELDTOMATCH_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[regexMatchTuple] operator[SEP] identifier[getTextTransformation] operator[SEP] operator[SEP] , identifier[TEXTTRANSFORMATION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[regexMatchTuple] operator[SEP] identifier[getRegexPatternSetId] operator[SEP] operator[SEP] , identifier[REGEXPATTERNSETID_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 <T> void addValueCallback( final KeyPath keyPath, final T property, final LottieValueCallback<T> callback) { if (compositionLayer == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { addValueCallback(keyPath, property, callback); } }); return; } boolean invalidate; if (keyPath.getResolvedElement() != null) { keyPath.getResolvedElement().addValueCallback(property, callback); invalidate = true; } else { List<KeyPath> elements = resolveKeyPath(keyPath); for (int i = 0; i < elements.size(); i++) { //noinspection ConstantConditions elements.get(i).getResolvedElement().addValueCallback(property, callback); } invalidate = !elements.isEmpty(); } if (invalidate) { invalidateSelf(); if (property == LottieProperty.TIME_REMAP) { // Time remapping values are read in setProgress. In order for the new value // to apply, we have to re-set the progress with the current progress so that the // time remapping can be reapplied. setProgress(getProgress()); } } }
class class_name[name] begin[{] method[addValueCallback, return_type[void], modifier[public], parameter[keyPath, property, callback]] begin[{] if[binary_operation[member[.compositionLayer], ==, literal[null]]] begin[{] call[lazyCompositionTasks.add, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keyPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addValueCallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[FormalParameter(annotations=[], modifiers=set(), name=composition, type=ReferenceType(arguments=None, dimensions=[], name=LottieComposition, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LazyCompositionTask, sub_type=None))]] return[None] else begin[{] None end[}] local_variable[type[boolean], invalidate] if[binary_operation[call[keyPath.getResolvedElement, parameter[]], !=, literal[null]]] begin[{] call[keyPath.getResolvedElement, parameter[]] assign[member[.invalidate], literal[true]] else begin[{] local_variable[type[List], elements] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[MethodInvocation(arguments=[], member=getResolvedElement, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addValueCallback, 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=size, postfix_operators=[], prefix_operators=[], qualifier=elements, 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) assign[member[.invalidate], call[elements.isEmpty, parameter[]]] end[}] if[member[.invalidate]] begin[{] call[.invalidateSelf, parameter[]] if[binary_operation[member[.property], ==, member[LottieProperty.TIME_REMAP]]] begin[{] call[.setProgress, parameter[call[.getProgress, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[addValueCallback] operator[SEP] Keyword[final] identifier[KeyPath] identifier[keyPath] , Keyword[final] identifier[T] identifier[property] , Keyword[final] identifier[LottieValueCallback] operator[<] identifier[T] operator[>] identifier[callback] operator[SEP] { Keyword[if] operator[SEP] identifier[compositionLayer] operator[==] Other[null] operator[SEP] { identifier[lazyCompositionTasks] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[LazyCompositionTask] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] identifier[LottieComposition] identifier[composition] operator[SEP] { identifier[addValueCallback] operator[SEP] identifier[keyPath] , identifier[property] , identifier[callback] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[boolean] identifier[invalidate] operator[SEP] Keyword[if] operator[SEP] identifier[keyPath] operator[SEP] identifier[getResolvedElement] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[keyPath] operator[SEP] identifier[getResolvedElement] operator[SEP] operator[SEP] operator[SEP] identifier[addValueCallback] operator[SEP] identifier[property] , identifier[callback] operator[SEP] operator[SEP] identifier[invalidate] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[List] operator[<] identifier[KeyPath] operator[>] identifier[elements] operator[=] identifier[resolveKeyPath] operator[SEP] identifier[keyPath] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[elements] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[elements] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getResolvedElement] operator[SEP] operator[SEP] operator[SEP] identifier[addValueCallback] operator[SEP] identifier[property] , identifier[callback] operator[SEP] operator[SEP] } identifier[invalidate] operator[=] operator[!] identifier[elements] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[invalidate] operator[SEP] { identifier[invalidateSelf] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[==] identifier[LottieProperty] operator[SEP] identifier[TIME_REMAP] operator[SEP] { identifier[setProgress] operator[SEP] identifier[getProgress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
private String loadPicture(final int rowIndex, final int colIndex) { FacesCell facesCell = parent.getCellHelper() .getFacesCellWithRowColFromCurrentPage(rowIndex, colIndex); if (facesCell != null && facesCell.isContainPic()) { FacesContext context = FacesContext.getCurrentInstance(); String pictureId = facesCell.getPictureId(); String pictureViewId = Integer.toHexString( System.identityHashCode(parent.getWb())) + pictureId; Map<String, Object> sessionMap = context.getExternalContext() .getSessionMap(); if (sessionMap.get(pictureViewId) == null) { sessionMap.put(pictureViewId, parent.getPicturesMap() .get(pictureId).getPictureData()); } return pictureViewId; } else { return null; } }
class class_name[name] begin[{] method[loadPicture, return_type[type[String]], modifier[private], parameter[rowIndex, colIndex]] begin[{] local_variable[type[FacesCell], facesCell] if[binary_operation[binary_operation[member[.facesCell], !=, literal[null]], &&, call[facesCell.isContainPic, parameter[]]]] begin[{] local_variable[type[FacesContext], context] local_variable[type[String], pictureId] local_variable[type[String], pictureViewId] local_variable[type[Map], sessionMap] if[binary_operation[call[sessionMap.get, parameter[member[.pictureViewId]]], ==, literal[null]]] begin[{] call[sessionMap.put, parameter[member[.pictureViewId], call[parent.getPicturesMap, parameter[]]]] else begin[{] None end[}] return[member[.pictureViewId]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[private] identifier[String] identifier[loadPicture] operator[SEP] Keyword[final] Keyword[int] identifier[rowIndex] , Keyword[final] Keyword[int] identifier[colIndex] operator[SEP] { identifier[FacesCell] identifier[facesCell] operator[=] identifier[parent] operator[SEP] identifier[getCellHelper] operator[SEP] operator[SEP] operator[SEP] identifier[getFacesCellWithRowColFromCurrentPage] operator[SEP] identifier[rowIndex] , identifier[colIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[facesCell] operator[!=] Other[null] operator[&&] identifier[facesCell] operator[SEP] identifier[isContainPic] operator[SEP] operator[SEP] operator[SEP] { identifier[FacesContext] identifier[context] operator[=] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pictureId] operator[=] identifier[facesCell] operator[SEP] identifier[getPictureId] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pictureViewId] operator[=] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[System] operator[SEP] identifier[identityHashCode] operator[SEP] identifier[parent] operator[SEP] identifier[getWb] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[pictureId] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[sessionMap] operator[=] identifier[context] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionMap] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sessionMap] operator[SEP] identifier[get] operator[SEP] identifier[pictureViewId] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[sessionMap] operator[SEP] identifier[put] operator[SEP] identifier[pictureViewId] , identifier[parent] operator[SEP] identifier[getPicturesMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[pictureId] operator[SEP] operator[SEP] identifier[getPictureData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[pictureViewId] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public boolean isChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isChanged"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isChanged", changed); return changed; }
class class_name[name] begin[{] method[isChanged, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["isChanged"]]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["isChanged"], member[.changed]]] else begin[{] None end[}] return[member[.changed]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isChanged] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[changed] operator[SEP] operator[SEP] Keyword[return] identifier[changed] operator[SEP] }
public static InetAddressResolver listenFor(String host, InetAddressListener listener) { synchronized (cResolvers) { InetAddressResolver resolver = (InetAddressResolver)cResolvers.get(host); if (resolver == null) { resolver = new InetAddressResolver(host); cResolvers.put(host, resolver); } resolver.addListener(listener); return resolver; } }
class class_name[name] begin[{] method[listenFor, return_type[type[InetAddressResolver]], modifier[public static], parameter[host, listener]] begin[{] SYNCHRONIZED[member[.cResolvers]] BEGIN[{] local_variable[type[InetAddressResolver], resolver] if[binary_operation[member[.resolver], ==, literal[null]]] begin[{] assign[member[.resolver], ClassCreator(arguments=[MemberReference(member=host, 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=InetAddressResolver, sub_type=None))] call[cResolvers.put, parameter[member[.host], member[.resolver]]] else begin[{] None end[}] call[resolver.addListener, parameter[member[.listener]]] return[member[.resolver]] END[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[InetAddressResolver] identifier[listenFor] operator[SEP] identifier[String] identifier[host] , identifier[InetAddressListener] identifier[listener] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[cResolvers] operator[SEP] { identifier[InetAddressResolver] identifier[resolver] operator[=] operator[SEP] identifier[InetAddressResolver] operator[SEP] identifier[cResolvers] operator[SEP] identifier[get] operator[SEP] identifier[host] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolver] operator[==] Other[null] operator[SEP] { identifier[resolver] operator[=] Keyword[new] identifier[InetAddressResolver] operator[SEP] identifier[host] operator[SEP] operator[SEP] identifier[cResolvers] operator[SEP] identifier[put] operator[SEP] identifier[host] , identifier[resolver] operator[SEP] operator[SEP] } identifier[resolver] operator[SEP] identifier[addListener] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[return] identifier[resolver] operator[SEP] } }
@Override public void cacheResult(CPRuleUserSegmentRel cpRuleUserSegmentRel) { entityCache.putResult(CPRuleUserSegmentRelModelImpl.ENTITY_CACHE_ENABLED, CPRuleUserSegmentRelImpl.class, cpRuleUserSegmentRel.getPrimaryKey(), cpRuleUserSegmentRel); cpRuleUserSegmentRel.resetOriginalValues(); }
class class_name[name] begin[{] method[cacheResult, return_type[void], modifier[public], parameter[cpRuleUserSegmentRel]] begin[{] call[entityCache.putResult, parameter[member[CPRuleUserSegmentRelModelImpl.ENTITY_CACHE_ENABLED], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CPRuleUserSegmentRelImpl, sub_type=None)), call[cpRuleUserSegmentRel.getPrimaryKey, parameter[]], member[.cpRuleUserSegmentRel]]] call[cpRuleUserSegmentRel.resetOriginalValues, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[cacheResult] operator[SEP] identifier[CPRuleUserSegmentRel] identifier[cpRuleUserSegmentRel] operator[SEP] { identifier[entityCache] operator[SEP] identifier[putResult] operator[SEP] identifier[CPRuleUserSegmentRelModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CPRuleUserSegmentRelImpl] operator[SEP] Keyword[class] , identifier[cpRuleUserSegmentRel] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] , identifier[cpRuleUserSegmentRel] operator[SEP] operator[SEP] identifier[cpRuleUserSegmentRel] operator[SEP] identifier[resetOriginalValues] operator[SEP] operator[SEP] operator[SEP] }
@Override protected void putVariables(Map<String, String> variables) { variables.put(ScopeFormat.SCOPE_JOB_ID, jobId.toString()); variables.put(ScopeFormat.SCOPE_JOB_NAME, jobName); }
class class_name[name] begin[{] method[putVariables, return_type[void], modifier[protected], parameter[variables]] begin[{] call[variables.put, parameter[member[ScopeFormat.SCOPE_JOB_ID], call[jobId.toString, parameter[]]]] call[variables.put, parameter[member[ScopeFormat.SCOPE_JOB_NAME], member[.jobName]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[putVariables] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[variables] operator[SEP] { identifier[variables] operator[SEP] identifier[put] operator[SEP] identifier[ScopeFormat] operator[SEP] identifier[SCOPE_JOB_ID] , identifier[jobId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[variables] operator[SEP] identifier[put] operator[SEP] identifier[ScopeFormat] operator[SEP] identifier[SCOPE_JOB_NAME] , identifier[jobName] operator[SEP] operator[SEP] }
@Override public EquPart morph() throws Exception { if (getValue().length() == 1 && getValue().charAt(0) == '-') { final EquPart part = Equ.getInstance().operator(this); if (part != null) return part; } return this; }
class class_name[name] begin[{] method[morph, return_type[type[EquPart]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[call[.getValue, parameter[]], ==, literal[1]], &&, binary_operation[call[.getValue, parameter[]], ==, literal['-']]]] begin[{] local_variable[type[EquPart], part] if[binary_operation[member[.part], !=, literal[null]]] begin[{] return[member[.part]] else begin[{] None end[}] else begin[{] None end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EquPart] identifier[morph] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[final] identifier[EquPart] identifier[part] operator[=] identifier[Equ] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[operator] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[part] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[part] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
List<IntermediateResultPartition> finishAllBlockingPartitions() { List<IntermediateResultPartition> finishedBlockingPartitions = null; for (IntermediateResultPartition partition : resultPartitions.values()) { if (partition.getResultType().isBlocking() && partition.markFinished()) { if (finishedBlockingPartitions == null) { finishedBlockingPartitions = new LinkedList<IntermediateResultPartition>(); } finishedBlockingPartitions.add(partition); } } if (finishedBlockingPartitions == null) { return Collections.emptyList(); } else { return finishedBlockingPartitions; } }
class class_name[name] begin[{] method[finishAllBlockingPartitions, return_type[type[List]], modifier[default], parameter[]] begin[{] local_variable[type[List], finishedBlockingPartitions] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResultType, postfix_operators=[], prefix_operators=[], qualifier=partition, selectors=[MethodInvocation(arguments=[], member=isBlocking, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=markFinished, postfix_operators=[], prefix_operators=[], qualifier=partition, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=finishedBlockingPartitions, 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=finishedBlockingPartitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IntermediateResultPartition, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=partition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=finishedBlockingPartitions, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=resultPartitions, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=partition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntermediateResultPartition, sub_type=None))), label=None) if[binary_operation[member[.finishedBlockingPartitions], ==, literal[null]]] begin[{] return[call[Collections.emptyList, parameter[]]] else begin[{] return[member[.finishedBlockingPartitions]] end[}] end[}] END[}]
identifier[List] operator[<] identifier[IntermediateResultPartition] operator[>] identifier[finishAllBlockingPartitions] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[IntermediateResultPartition] operator[>] identifier[finishedBlockingPartitions] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[IntermediateResultPartition] identifier[partition] operator[:] identifier[resultPartitions] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[partition] operator[SEP] identifier[getResultType] operator[SEP] operator[SEP] operator[SEP] identifier[isBlocking] operator[SEP] operator[SEP] operator[&&] identifier[partition] operator[SEP] identifier[markFinished] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[finishedBlockingPartitions] operator[==] Other[null] operator[SEP] { identifier[finishedBlockingPartitions] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[IntermediateResultPartition] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[finishedBlockingPartitions] operator[SEP] identifier[add] operator[SEP] identifier[partition] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[finishedBlockingPartitions] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[finishedBlockingPartitions] operator[SEP] } }
protected Option<TextBundle> loadJavaBundle(String bundleName, Locale locale) { Properties properties = new Properties(); String resource = toJavaResourceName(bundleName, locale); try { InputStream is = ClassLoaders.getResourceAsStream(resource, getClass()); if (null == is) return Option.none(); properties.load(is); is.close(); } catch (IOException e) { return Option.none(); } finally { } return Option.<TextBundle> from(new DefaultTextBundle(locale, resource, properties)); }
class class_name[name] begin[{] method[loadJavaBundle, return_type[type[Option]], modifier[protected], parameter[bundleName, locale]] begin[{] local_variable[type[Properties], properties] local_variable[type[String], resource] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getResourceAsStream, postfix_operators=[], prefix_operators=[], qualifier=ClassLoaders, selectors=[], type_arguments=None), name=is)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=none, postfix_operators=[], prefix_operators=[], qualifier=Option, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=none, postfix_operators=[], prefix_operators=[], qualifier=Option, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[], label=None, resources=None) return[call[.Option, parameter[ClassCreator(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, 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=DefaultTextBundle, sub_type=None))]]] end[}] END[}]
Keyword[protected] identifier[Option] operator[<] identifier[TextBundle] operator[>] identifier[loadJavaBundle] operator[SEP] identifier[String] identifier[bundleName] , identifier[Locale] identifier[locale] operator[SEP] { identifier[Properties] identifier[properties] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[resource] operator[=] identifier[toJavaResourceName] operator[SEP] identifier[bundleName] , identifier[locale] operator[SEP] operator[SEP] Keyword[try] { identifier[InputStream] identifier[is] operator[=] identifier[ClassLoaders] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[resource] , identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[is] operator[SEP] Keyword[return] identifier[Option] operator[SEP] identifier[none] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[load] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[return] identifier[Option] operator[SEP] identifier[none] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] identifier[Option] operator[SEP] operator[<] identifier[TextBundle] operator[>] identifier[from] operator[SEP] Keyword[new] identifier[DefaultTextBundle] operator[SEP] identifier[locale] , identifier[resource] , identifier[properties] operator[SEP] operator[SEP] operator[SEP] }
@Override public void applicationStopping(String appName) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "MEF.applicationStopping for application " + appName); } synchronized (ivStateLock) { if (ivState == ACTIVE_STATE) { // No thread is ever waiting for a notification while // in the active state, so simply change state to // indicate deactivate is pending. ivState = DEACTIVATE_PENDING_STATE; } else if (ivState == ACTIVATING_STATE) { // Change state to indicate deactivate is pending // and notify any thread that is waiting for the activate // to complete. ivState = DEACTIVATE_PENDING_STATE; ivStateLock.notifyAll(); } else if (ivState == DEACTIVATE_PENDING_STATE) { // activateendpoint threw an exception and changed // state to deactivate pending. So we need to notify // threads that are waiting for the activate // to complete (e.g. threads blocked by createEndpoint // during the activation of an endpoint). ivStateLock.notifyAll(); } else if (ivState == INACTIVE_STATE) { // This is possible, but not likely. For example, we could create this // MEF object and initialized it to INACTIVE_STATE. An exception occurs // before we make it to the activateEndpoint method for this MEF. If // that happens, then it is possible to get to this method while in // the inactive state. So simply trace fact that this MEF was called // in inactive state and nothing was actually done. if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "MEF.applicationStopping for application " + appName + " was called for an inactive endpoint."); } } else { // The only other state is DEACTIVATING_STATE. This method should NEVER // be called while in the deactivating state. Runtime framework should call // this method before it ever attempts to stop the modules of an application. // Thus, we should not enter deactivating state until after this method is called. // Create FFDC log file for this problem and trace occurrence of this event. // No reason to throw the exception since we created it just for the purpose // of doing the FFDC. String msg = "Internal programming error - applicationStopping called for application \"" + appName + "\" while in deactivating state. This should NEVER occur."; IllegalStateException ex = new IllegalStateException(msg); FFDCFilter.processException(ex, CLASS_NAME + ".applicationStopping", "1208", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, msg); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "MEF.applicationStopping for application " + appName); } }
class class_name[name] begin[{] method[applicationStopping, return_type[void], modifier[public], parameter[appName]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], binary_operation[literal["MEF.applicationStopping for application "], +, member[.appName]]]] else begin[{] None end[}] SYNCHRONIZED[member[.ivStateLock]] BEGIN[{] if[binary_operation[member[.ivState], ==, member[.ACTIVE_STATE]]] begin[{] assign[member[.ivState], member[.DEACTIVATE_PENDING_STATE]] else begin[{] if[binary_operation[member[.ivState], ==, member[.ACTIVATING_STATE]]] begin[{] assign[member[.ivState], member[.DEACTIVATE_PENDING_STATE]] call[ivStateLock.notifyAll, parameter[]] else begin[{] if[binary_operation[member[.ivState], ==, member[.DEACTIVATE_PENDING_STATE]]] begin[{] call[ivStateLock.notifyAll, parameter[]] else begin[{] if[binary_operation[member[.ivState], ==, member[.INACTIVE_STATE]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{] call[Tr.event, parameter[member[.tc], binary_operation[binary_operation[literal["MEF.applicationStopping for application "], +, member[.appName]], +, literal[" was called for an inactive endpoint."]]]] else begin[{] None end[}] else begin[{] local_variable[type[String], msg] local_variable[type[IllegalStateException], ex] call[FFDCFilter.processException, parameter[member[.ex], binary_operation[member[.CLASS_NAME], +, literal[".applicationStopping"]], literal["1208"], THIS[]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{] call[Tr.event, parameter[member[.tc], member[.msg]]] else begin[{] None end[}] end[}] end[}] end[}] end[}] END[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], binary_operation[literal["MEF.applicationStopping for application "], +, member[.appName]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[applicationStopping] operator[SEP] identifier[String] identifier[appName] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[appName] operator[SEP] operator[SEP] } Keyword[synchronized] operator[SEP] identifier[ivStateLock] operator[SEP] { Keyword[if] operator[SEP] identifier[ivState] operator[==] identifier[ACTIVE_STATE] operator[SEP] { identifier[ivState] operator[=] identifier[DEACTIVATE_PENDING_STATE] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ivState] operator[==] identifier[ACTIVATING_STATE] operator[SEP] { identifier[ivState] operator[=] identifier[DEACTIVATE_PENDING_STATE] operator[SEP] identifier[ivStateLock] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ivState] operator[==] identifier[DEACTIVATE_PENDING_STATE] operator[SEP] { identifier[ivStateLock] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ivState] operator[==] identifier[INACTIVE_STATE] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[appName] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[appName] operator[+] literal[String] operator[SEP] identifier[IllegalStateException] identifier[ex] operator[=] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ex] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , identifier[msg] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[appName] operator[SEP] operator[SEP] } }
@Override public LoadBalancerNodeFilter and(LoadBalancerNodeFilter otherFilter) { if (evaluation instanceof SingleFilterEvaluation && otherFilter.evaluation instanceof SingleFilterEvaluation) { return new LoadBalancerNodeFilter( getLoadBalancerPoolFilter().and(otherFilter.getLoadBalancerPoolFilter()), getPredicate().and(otherFilter.getPredicate()) ); } else { evaluation = new AndEvaluation<>(evaluation, otherFilter, LoadBalancerNodeMetadata::getIpAddress); return this; } }
class class_name[name] begin[{] method[and, return_type[type[LoadBalancerNodeFilter]], modifier[public], parameter[otherFilter]] begin[{] if[binary_operation[binary_operation[member[.evaluation], instanceof, type[SingleFilterEvaluation]], &&, binary_operation[member[otherFilter.evaluation], instanceof, type[SingleFilterEvaluation]]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getLoadBalancerPoolFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLoadBalancerPoolFilter, postfix_operators=[], prefix_operators=[], qualifier=otherFilter, selectors=[], type_arguments=None)], member=and, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getPredicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPredicate, postfix_operators=[], prefix_operators=[], qualifier=otherFilter, selectors=[], type_arguments=None)], member=and, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LoadBalancerNodeFilter, sub_type=None))] else begin[{] assign[member[.evaluation], ClassCreator(arguments=[MemberReference(member=evaluation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=otherFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodReference(expression=MemberReference(member=LoadBalancerNodeMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getIpAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=AndEvaluation, sub_type=None))] return[THIS[]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[LoadBalancerNodeFilter] identifier[and] operator[SEP] identifier[LoadBalancerNodeFilter] identifier[otherFilter] operator[SEP] { Keyword[if] operator[SEP] identifier[evaluation] Keyword[instanceof] identifier[SingleFilterEvaluation] operator[&&] identifier[otherFilter] operator[SEP] identifier[evaluation] Keyword[instanceof] identifier[SingleFilterEvaluation] operator[SEP] { Keyword[return] Keyword[new] identifier[LoadBalancerNodeFilter] operator[SEP] identifier[getLoadBalancerPoolFilter] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[otherFilter] operator[SEP] identifier[getLoadBalancerPoolFilter] operator[SEP] operator[SEP] operator[SEP] , identifier[getPredicate] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[otherFilter] operator[SEP] identifier[getPredicate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[evaluation] operator[=] Keyword[new] identifier[AndEvaluation] operator[<] operator[>] operator[SEP] identifier[evaluation] , identifier[otherFilter] , identifier[LoadBalancerNodeMetadata] operator[::] identifier[getIpAddress] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] } }
public PatternMatcher execute() throws DataflowAnalysisException { workList.addLast(cfg.getEntry()); while (!workList.isEmpty()) { BasicBlock basicBlock = workList.removeLast(); visitedBlockMap.put(basicBlock, basicBlock); // Scan instructions of basic block for possible matches BasicBlock.InstructionIterator i = basicBlock.instructionIterator(); while (i.hasNext()) { attemptMatch(basicBlock, i.duplicate()); i.next(); } // Add successors of the basic block (which haven't been visited // already) Iterator<BasicBlock> succIterator = cfg.successorIterator(basicBlock); while (succIterator.hasNext()) { BasicBlock succ = succIterator.next(); if (visitedBlockMap.get(succ) == null) { workList.addLast(succ); } } } return this; }
class class_name[name] begin[{] method[execute, return_type[type[PatternMatcher]], modifier[public], parameter[]] begin[{] call[workList.addLast, parameter[call[cfg.getEntry, parameter[]]]] while[call[workList.isEmpty, parameter[]]] begin[{] local_variable[type[BasicBlock], basicBlock] call[visitedBlockMap.put, parameter[member[.basicBlock], member[.basicBlock]]] local_variable[type[BasicBlock], i] while[call[i.hasNext, parameter[]]] begin[{] call[.attemptMatch, parameter[member[.basicBlock], call[i.duplicate, parameter[]]]] call[i.next, parameter[]] end[}] local_variable[type[Iterator], succIterator] while[call[succIterator.hasNext, parameter[]]] begin[{] local_variable[type[BasicBlock], succ] if[binary_operation[call[visitedBlockMap.get, parameter[member[.succ]]], ==, literal[null]]] begin[{] call[workList.addLast, parameter[member[.succ]]] else begin[{] None end[}] end[}] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[PatternMatcher] identifier[execute] operator[SEP] operator[SEP] Keyword[throws] identifier[DataflowAnalysisException] { identifier[workList] operator[SEP] identifier[addLast] operator[SEP] identifier[cfg] operator[SEP] identifier[getEntry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[workList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[BasicBlock] identifier[basicBlock] operator[=] identifier[workList] operator[SEP] identifier[removeLast] operator[SEP] operator[SEP] operator[SEP] identifier[visitedBlockMap] operator[SEP] identifier[put] operator[SEP] identifier[basicBlock] , identifier[basicBlock] operator[SEP] operator[SEP] identifier[BasicBlock] operator[SEP] identifier[InstructionIterator] identifier[i] operator[=] identifier[basicBlock] operator[SEP] identifier[instructionIterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[attemptMatch] operator[SEP] identifier[basicBlock] , identifier[i] operator[SEP] identifier[duplicate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } identifier[Iterator] operator[<] identifier[BasicBlock] operator[>] identifier[succIterator] operator[=] identifier[cfg] operator[SEP] identifier[successorIterator] operator[SEP] identifier[basicBlock] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[succIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[BasicBlock] identifier[succ] operator[=] identifier[succIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[visitedBlockMap] operator[SEP] identifier[get] operator[SEP] identifier[succ] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[workList] operator[SEP] identifier[addLast] operator[SEP] identifier[succ] operator[SEP] operator[SEP] } } } Keyword[return] Keyword[this] operator[SEP] }
public static boolean isLibertyRepository(RestRepositoryConnection lie, Properties repoProperties) throws InstallException { if (isWlpRepoEnabled(repoProperties)) { return lie.getRepositoryLocation().startsWith(InstallConstants.REPOSITORY_LIBERTY_URL); } return false; }
class class_name[name] begin[{] method[isLibertyRepository, return_type[type[boolean]], modifier[public static], parameter[lie, repoProperties]] begin[{] if[call[.isWlpRepoEnabled, parameter[member[.repoProperties]]]] begin[{] return[call[lie.getRepositoryLocation, parameter[]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isLibertyRepository] operator[SEP] identifier[RestRepositoryConnection] identifier[lie] , identifier[Properties] identifier[repoProperties] operator[SEP] Keyword[throws] identifier[InstallException] { Keyword[if] operator[SEP] identifier[isWlpRepoEnabled] operator[SEP] identifier[repoProperties] operator[SEP] operator[SEP] { Keyword[return] identifier[lie] operator[SEP] identifier[getRepositoryLocation] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[InstallConstants] operator[SEP] identifier[REPOSITORY_LIBERTY_URL] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public Issue issue(String name, Project project, Map<String, Object> attributes) { Issue issue = new Issue(instance); issue.setName(name); issue.setProject(project); addAttributes(issue, attributes); issue.save(); return issue; }
class class_name[name] begin[{] method[issue, return_type[type[Issue]], modifier[public], parameter[name, project, attributes]] begin[{] local_variable[type[Issue], issue] call[issue.setName, parameter[member[.name]]] call[issue.setProject, parameter[member[.project]]] call[.addAttributes, parameter[member[.issue], member[.attributes]]] call[issue.save, parameter[]] return[member[.issue]] end[}] END[}]
Keyword[public] identifier[Issue] identifier[issue] operator[SEP] identifier[String] identifier[name] , identifier[Project] identifier[project] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[attributes] operator[SEP] { identifier[Issue] identifier[issue] operator[=] Keyword[new] identifier[Issue] operator[SEP] identifier[instance] operator[SEP] operator[SEP] identifier[issue] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[issue] operator[SEP] identifier[setProject] operator[SEP] identifier[project] operator[SEP] operator[SEP] identifier[addAttributes] operator[SEP] identifier[issue] , identifier[attributes] operator[SEP] operator[SEP] identifier[issue] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[issue] operator[SEP] }
@Override public void readFlatRowsAsync(Query request, StreamObserver<FlatRow> observer) { delegate.readFlatRows(request.toProto(requestContext), observer); }
class class_name[name] begin[{] method[readFlatRowsAsync, return_type[void], modifier[public], parameter[request, observer]] begin[{] call[delegate.readFlatRows, parameter[call[request.toProto, parameter[member[.requestContext]]], member[.observer]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[readFlatRowsAsync] operator[SEP] identifier[Query] identifier[request] , identifier[StreamObserver] operator[<] identifier[FlatRow] operator[>] identifier[observer] operator[SEP] { identifier[delegate] operator[SEP] identifier[readFlatRows] operator[SEP] identifier[request] operator[SEP] identifier[toProto] operator[SEP] identifier[requestContext] operator[SEP] , identifier[observer] operator[SEP] operator[SEP] }
public LoadBalancerTlsCertificateRenewalSummary withDomainValidationOptions(LoadBalancerTlsCertificateDomainValidationOption... domainValidationOptions) { if (this.domainValidationOptions == null) { setDomainValidationOptions(new java.util.ArrayList<LoadBalancerTlsCertificateDomainValidationOption>(domainValidationOptions.length)); } for (LoadBalancerTlsCertificateDomainValidationOption ele : domainValidationOptions) { this.domainValidationOptions.add(ele); } return this; }
class class_name[name] begin[{] method[withDomainValidationOptions, return_type[type[LoadBalancerTlsCertificateRenewalSummary]], modifier[public], parameter[domainValidationOptions]] begin[{] if[binary_operation[THIS[member[None.domainValidationOptions]], ==, literal[null]]] begin[{] call[.setDomainValidationOptions, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=domainValidationOptions, 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=LoadBalancerTlsCertificateDomainValidationOption, 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=domainValidationOptions, 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=domainValidationOptions, 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=LoadBalancerTlsCertificateDomainValidationOption, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[LoadBalancerTlsCertificateRenewalSummary] identifier[withDomainValidationOptions] operator[SEP] identifier[LoadBalancerTlsCertificateDomainValidationOption] operator[...] identifier[domainValidationOptions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[domainValidationOptions] operator[==] Other[null] operator[SEP] { identifier[setDomainValidationOptions] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[LoadBalancerTlsCertificateDomainValidationOption] operator[>] operator[SEP] identifier[domainValidationOptions] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[LoadBalancerTlsCertificateDomainValidationOption] identifier[ele] operator[:] identifier[domainValidationOptions] operator[SEP] { Keyword[this] operator[SEP] identifier[domainValidationOptions] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public List<Config> loadPullFilesRecursively(Path path, Config sysProps, boolean loadGlobalProperties) { return Lists.transform(this.fetchJobFilesRecursively(path), new Function<Path, Config>() { @Nullable @Override public Config apply(@Nullable Path jobFile) { if (jobFile == null) { return null; } try { return PullFileLoader.this.loadPullFile(jobFile, sysProps, loadGlobalProperties); } catch (IOException e) { log.error("Cannot load job from {} due to {}", jobFile, ExceptionUtils.getFullStackTrace(e)); return null; } } }); }
class class_name[name] begin[{] method[loadPullFilesRecursively, return_type[type[List]], modifier[public], parameter[path, sysProps, loadGlobalProperties]] begin[{] return[call[Lists.transform, parameter[THIS[call[None.fetchJobFilesRecursively, parameter[member[.path]]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Nullable), Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jobFile, 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=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), TryStatement(block=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=PullFileLoader, selectors=[MethodInvocation(arguments=[MemberReference(member=jobFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sysProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=loadGlobalProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadPullFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot load job from {} due to {}"), MemberReference(member=jobFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFullStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None)], 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=['IOException']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[Annotation(element=None, name=Nullable)], modifiers=set(), name=jobFile, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Config, 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=Path, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Config, sub_type=None))], dimensions=None, name=Function, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Config] operator[>] identifier[loadPullFilesRecursively] operator[SEP] identifier[Path] identifier[path] , identifier[Config] identifier[sysProps] , Keyword[boolean] identifier[loadGlobalProperties] operator[SEP] { Keyword[return] identifier[Lists] operator[SEP] identifier[transform] operator[SEP] Keyword[this] operator[SEP] identifier[fetchJobFilesRecursively] operator[SEP] identifier[path] operator[SEP] , Keyword[new] identifier[Function] operator[<] identifier[Path] , identifier[Config] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Nullable] annotation[@] identifier[Override] Keyword[public] identifier[Config] identifier[apply] operator[SEP] annotation[@] identifier[Nullable] identifier[Path] identifier[jobFile] operator[SEP] { Keyword[if] operator[SEP] identifier[jobFile] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { Keyword[return] identifier[PullFileLoader] operator[SEP] Keyword[this] operator[SEP] identifier[loadPullFile] operator[SEP] identifier[jobFile] , identifier[sysProps] , identifier[loadGlobalProperties] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[jobFile] , identifier[ExceptionUtils] operator[SEP] identifier[getFullStackTrace] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } } operator[SEP] operator[SEP] }
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/id/{userId}") @Description("Returns the user having the given ID.") public PrincipalUserDto getUserById(@Context HttpServletRequest req, @PathParam("userId") final BigInteger userId) { if (userId == null || userId.compareTo(BigInteger.ZERO) < 1) { throw new WebApplicationException("User Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST); } PrincipalUser remoteUser = validateAndGetOwner(req, null); PrincipalUser user = _uService.findUserByPrimaryKey(userId); if (user != null) { super.validateResourceAuthorization(req, user, remoteUser); return PrincipalUserDto.transformToDto(user); } throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND); }
class class_name[name] begin[{] method[getUserById, return_type[type[PrincipalUserDto]], modifier[public], parameter[req, userId]] begin[{] if[binary_operation[binary_operation[member[.userId], ==, literal[null]], ||, binary_operation[call[userId.compareTo, parameter[member[BigInteger.ZERO]]], <, literal[1]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User Id cannot be null and must be a positive non-zero number."), MemberReference(member=BAD_REQUEST, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WebApplicationException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[PrincipalUser], remoteUser] local_variable[type[PrincipalUser], user] if[binary_operation[member[.user], !=, literal[null]]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=remoteUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateResourceAuthorization, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) return[call[PrincipalUserDto.transformToDto, parameter[member[.user]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getReasonPhrase, postfix_operators=[], prefix_operators=[], qualifier=Response.Status.NOT_FOUND, selectors=[], type_arguments=None), MemberReference(member=NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=Response.Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WebApplicationException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[GET] annotation[@] identifier[Produces] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Description] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[PrincipalUserDto] identifier[getUserById] operator[SEP] annotation[@] identifier[Context] identifier[HttpServletRequest] identifier[req] , annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[BigInteger] identifier[userId] operator[SEP] { Keyword[if] operator[SEP] identifier[userId] operator[==] Other[null] operator[||] identifier[userId] operator[SEP] identifier[compareTo] operator[SEP] identifier[BigInteger] operator[SEP] identifier[ZERO] operator[SEP] operator[<] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[WebApplicationException] operator[SEP] literal[String] , identifier[Status] operator[SEP] identifier[BAD_REQUEST] operator[SEP] operator[SEP] } identifier[PrincipalUser] identifier[remoteUser] operator[=] identifier[validateAndGetOwner] operator[SEP] identifier[req] , Other[null] operator[SEP] operator[SEP] identifier[PrincipalUser] identifier[user] operator[=] identifier[_uService] operator[SEP] identifier[findUserByPrimaryKey] operator[SEP] identifier[userId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[SEP] { Keyword[super] operator[SEP] identifier[validateResourceAuthorization] operator[SEP] identifier[req] , identifier[user] , identifier[remoteUser] operator[SEP] operator[SEP] Keyword[return] identifier[PrincipalUserDto] operator[SEP] identifier[transformToDto] operator[SEP] identifier[user] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[WebApplicationException] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[NOT_FOUND] operator[SEP] identifier[getReasonPhrase] operator[SEP] operator[SEP] , identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[NOT_FOUND] operator[SEP] operator[SEP] }
public ServiceFuture<SyncMemberInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters, final ServiceCallback<SyncMemberInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters), serviceCallback); }
class class_name[name] begin[{] method[createOrUpdateAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.createOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.databaseName], member[.syncGroupName], member[.syncMemberName], member[.parameters]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[SyncMemberInner] operator[>] identifier[createOrUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[databaseName] , identifier[String] identifier[syncGroupName] , identifier[String] identifier[syncMemberName] , identifier[SyncMemberInner] identifier[parameters] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[SyncMemberInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[createOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[databaseName] , identifier[syncGroupName] , identifier[syncMemberName] , identifier[parameters] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
private void storeBundle(String bundleId, JoinableResourceBundleContent store) { stopProcessIfNeeded(); if (bundleMustBeProcessedInLive(store.getContent().toString())) { liveProcessBundles.add(bundleId); } resourceBundleHandler.storeBundle(bundleId, store); }
class class_name[name] begin[{] method[storeBundle, return_type[void], modifier[private], parameter[bundleId, store]] begin[{] call[.stopProcessIfNeeded, parameter[]] if[call[.bundleMustBeProcessedInLive, parameter[call[store.getContent, parameter[]]]]] begin[{] call[liveProcessBundles.add, parameter[member[.bundleId]]] else begin[{] None end[}] call[resourceBundleHandler.storeBundle, parameter[member[.bundleId], member[.store]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[storeBundle] operator[SEP] identifier[String] identifier[bundleId] , identifier[JoinableResourceBundleContent] identifier[store] operator[SEP] { identifier[stopProcessIfNeeded] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bundleMustBeProcessedInLive] operator[SEP] identifier[store] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[liveProcessBundles] operator[SEP] identifier[add] operator[SEP] identifier[bundleId] operator[SEP] operator[SEP] } identifier[resourceBundleHandler] operator[SEP] identifier[storeBundle] operator[SEP] identifier[bundleId] , identifier[store] operator[SEP] operator[SEP] }
public final void entryRuleParenthesizedAssignableElement() throws RecognitionException { try { // InternalXtext.g:946:1: ( ruleParenthesizedAssignableElement EOF ) // InternalXtext.g:947:1: ruleParenthesizedAssignableElement EOF { before(grammarAccess.getParenthesizedAssignableElementRule()); pushFollow(FollowSets000.FOLLOW_1); ruleParenthesizedAssignableElement(); state._fsp--; after(grammarAccess.getParenthesizedAssignableElementRule()); match(input,EOF,FollowSets000.FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; }
class class_name[name] begin[{] method[entryRuleParenthesizedAssignableElement, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParenthesizedAssignableElementRule, 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=FollowSets000, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=ruleParenthesizedAssignableElement, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParenthesizedAssignableElementRule, 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=FollowSets000, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=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[entryRuleParenthesizedAssignableElement] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { { identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getParenthesizedAssignableElementRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FollowSets000] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[ruleParenthesizedAssignableElement] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getParenthesizedAssignableElementRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FollowSets000] operator[SEP] identifier[FOLLOW_2] operator[SEP] 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] }
@Override public Object unMarshall(Response<PutResponse> response, Object entity) { return unMarshall(response, entity.getClass()); }
class class_name[name] begin[{] method[unMarshall, return_type[type[Object]], modifier[public], parameter[response, entity]] begin[{] return[call[.unMarshall, parameter[member[.response], call[entity.getClass, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[unMarshall] operator[SEP] identifier[Response] operator[<] identifier[PutResponse] operator[>] identifier[response] , identifier[Object] identifier[entity] operator[SEP] { Keyword[return] identifier[unMarshall] operator[SEP] identifier[response] , identifier[entity] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void write(String s, int off, int len) throws IOException { synchronized (lock) { ensureOpen(); int b = off, t = off + len; while (b < t) { int d = min(nChars - nextChar, t - b); s.getChars(b, b + d, cb, nextChar); b += d; nextChar += d; if (nextChar >= nChars) flushBuffer(); } } }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[s, off, len]] begin[{] SYNCHRONIZED[member[.lock]] BEGIN[{] call[.ensureOpen, parameter[]] local_variable[type[int], b] while[binary_operation[member[.b], <, member[.t]]] begin[{] local_variable[type[int], d] call[s.getChars, parameter[member[.b], binary_operation[member[.b], +, member[.d]], member[.cb], member[.nextChar]]] assign[member[.b], member[.d]] assign[member[.nextChar], member[.d]] if[binary_operation[member[.nextChar], >=, member[.nChars]]] begin[{] call[.flushBuffer, parameter[]] else begin[{] None end[}] end[}] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[String] identifier[s] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { identifier[ensureOpen] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[b] operator[=] identifier[off] , identifier[t] operator[=] identifier[off] operator[+] identifier[len] operator[SEP] Keyword[while] operator[SEP] identifier[b] operator[<] identifier[t] operator[SEP] { Keyword[int] identifier[d] operator[=] identifier[min] operator[SEP] identifier[nChars] operator[-] identifier[nextChar] , identifier[t] operator[-] identifier[b] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[getChars] operator[SEP] identifier[b] , identifier[b] operator[+] identifier[d] , identifier[cb] , identifier[nextChar] operator[SEP] operator[SEP] identifier[b] operator[+=] identifier[d] operator[SEP] identifier[nextChar] operator[+=] identifier[d] operator[SEP] Keyword[if] operator[SEP] identifier[nextChar] operator[>=] identifier[nChars] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP] } } }
public boolean removeObserver(BusObserver<M> observer) { logger.trace("removing observer {}", observer.getClass().getSimpleName()); return observers.remove(observer); }
class class_name[name] begin[{] method[removeObserver, return_type[type[boolean]], modifier[public], parameter[observer]] begin[{] call[logger.trace, parameter[literal["removing observer {}"], call[observer.getClass, parameter[]]]] return[call[observers.remove, parameter[member[.observer]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[removeObserver] operator[SEP] identifier[BusObserver] operator[<] identifier[M] operator[>] identifier[observer] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[observer] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[observers] operator[SEP] identifier[remove] operator[SEP] identifier[observer] operator[SEP] operator[SEP] }
public boolean isOnline() { Boolean online = getOptionValue(OnlineModeOption.NAME); return online == null ? DEFAULT_ONLINE : online; }
class class_name[name] begin[{] method[isOnline, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[Boolean], online] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=online, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=online, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=DEFAULT_ONLINE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isOnline] operator[SEP] operator[SEP] { identifier[Boolean] identifier[online] operator[=] identifier[getOptionValue] operator[SEP] identifier[OnlineModeOption] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] Keyword[return] identifier[online] operator[==] Other[null] operator[?] identifier[DEFAULT_ONLINE] operator[:] identifier[online] operator[SEP] }
public void appendAllParametersDetails(StringBuilder out, int indentCount, String indent, List<ParameterDescription> sortedParameters) { if (sortedParameters.size() > 0) { out.append(indent).append(" Options:\n"); } for (ParameterDescription pd : sortedParameters) { WrappedParameter parameter = pd.getParameter(); String description = pd.getDescription(); boolean hasDescription = !description.isEmpty(); // First line, command name out.append(indent) .append(" ") .append(parameter.required() ? "* " : " ") .append(pd.getNames()) .append("\n"); if (hasDescription) { wrapDescription(out, indentCount, s(indentCount) + description); } Object def = pd.getDefault(); if (pd.isDynamicParameter()) { String syntax = "Syntax: " + parameter.names()[0] + "key" + parameter.getAssignment() + "value"; if (hasDescription) { out.append(newLineAndIndent(indentCount)); } else { out.append(s(indentCount)); } out.append(syntax); } if (def != null && !pd.isHelp()) { String displayedDef = Strings.isStringEmpty(def.toString()) ? "<empty string>" : def.toString(); String defaultText = "Default: " + (parameter.password() ? "********" : displayedDef); if (hasDescription) { out.append(newLineAndIndent(indentCount)); } else { out.append(s(indentCount)); } out.append(defaultText); } Class<?> type = pd.getParameterized().getType(); if (type.isEnum()) { String valueList = EnumSet.allOf((Class<? extends Enum>) type).toString(); String possibleValues = "Possible Values: " + valueList; // Prevent duplicate values list, since it is set as 'Options: [values]' if the description // of an enum field is empty in ParameterDescription#init(..) if (!description.contains("Options: " + valueList)) { if (hasDescription) { out.append(newLineAndIndent(indentCount)); } else { out.append(s(indentCount)); } out.append(possibleValues); } } out.append("\n"); } }
class class_name[name] begin[{] method[appendAllParametersDetails, return_type[void], modifier[public], parameter[out, indentCount, indent, sortedParameters]] begin[{] if[binary_operation[call[sortedParameters.size, parameter[]], >, literal[0]]] begin[{] call[out.append, parameter[member[.indent]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameter, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), name=parameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WrappedParameter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), name=description)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=description, selectors=[], type_arguments=None), name=hasDescription)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[], member=required, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="* "))], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNames, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=hasDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=wrapDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), name=def)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDynamicParameter, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Syntax: "), operandr=MethodInvocation(arguments=[], member=names, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="key"), operator=+), operandr=MethodInvocation(arguments=[], member=getAssignment, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value"), operator=+), name=syntax)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MemberReference(member=hasDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newLineAndIndent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=syntax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isHelp, postfix_operators=[], prefix_operators=['!'], qualifier=pd, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None)], member=isStringEmpty, postfix_operators=[], prefix_operators=[], qualifier=Strings, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<empty string>")), name=displayedDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Default: "), operandr=TernaryExpression(condition=MethodInvocation(arguments=[], member=password, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), if_false=MemberReference(member=displayedDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="********")), operator=+), name=defaultText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MemberReference(member=hasDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newLineAndIndent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=defaultText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterized, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[MethodInvocation(arguments=[], member=getType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEnum, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Enum, sub_type=None))], dimensions=[], name=Class, sub_type=None))], member=allOf, postfix_operators=[], prefix_operators=[], qualifier=EnumSet, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=valueList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Possible Values: "), operandr=MemberReference(member=valueList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=possibleValues)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Options: "), operandr=MemberReference(member=valueList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=description, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=hasDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newLineAndIndent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=possibleValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sortedParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParameterDescription, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[appendAllParametersDetails] operator[SEP] identifier[StringBuilder] identifier[out] , Keyword[int] identifier[indentCount] , identifier[String] identifier[indent] , identifier[List] operator[<] identifier[ParameterDescription] operator[>] identifier[sortedParameters] operator[SEP] { Keyword[if] operator[SEP] identifier[sortedParameters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[indent] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ParameterDescription] identifier[pd] operator[:] identifier[sortedParameters] operator[SEP] { identifier[WrappedParameter] identifier[parameter] operator[=] identifier[pd] operator[SEP] identifier[getParameter] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[description] operator[=] identifier[pd] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasDescription] operator[=] operator[!] identifier[description] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[indent] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[parameter] operator[SEP] identifier[required] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[pd] operator[SEP] identifier[getNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasDescription] operator[SEP] { identifier[wrapDescription] operator[SEP] identifier[out] , identifier[indentCount] , identifier[s] operator[SEP] identifier[indentCount] operator[SEP] operator[+] identifier[description] operator[SEP] operator[SEP] } identifier[Object] identifier[def] operator[=] identifier[pd] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pd] operator[SEP] identifier[isDynamicParameter] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[syntax] operator[=] literal[String] operator[+] identifier[parameter] operator[SEP] identifier[names] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[+] identifier[parameter] operator[SEP] identifier[getAssignment] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[hasDescription] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[newLineAndIndent] operator[SEP] identifier[indentCount] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] identifier[indentCount] operator[SEP] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[syntax] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[def] operator[!=] Other[null] operator[&&] operator[!] identifier[pd] operator[SEP] identifier[isHelp] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[displayedDef] operator[=] identifier[Strings] operator[SEP] identifier[isStringEmpty] operator[SEP] identifier[def] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] identifier[def] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[defaultText] operator[=] literal[String] operator[+] operator[SEP] identifier[parameter] operator[SEP] identifier[password] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] identifier[displayedDef] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasDescription] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[newLineAndIndent] operator[SEP] identifier[indentCount] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] identifier[indentCount] operator[SEP] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[defaultText] operator[SEP] operator[SEP] } identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[pd] operator[SEP] identifier[getParameterized] operator[SEP] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[valueList] operator[=] identifier[EnumSet] operator[SEP] identifier[allOf] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Enum] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[possibleValues] operator[=] literal[String] operator[+] identifier[valueList] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[description] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[+] identifier[valueList] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[hasDescription] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[newLineAndIndent] operator[SEP] identifier[indentCount] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] identifier[indentCount] operator[SEP] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[possibleValues] operator[SEP] operator[SEP] } } identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public static String delFirst(String regex, CharSequence content) { if (StrUtil.hasBlank(regex, content)) { return StrUtil.str(content); } // Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL); return delFirst(pattern, content); }
class class_name[name] begin[{] method[delFirst, return_type[type[String]], modifier[public static], parameter[regex, content]] begin[{] if[call[StrUtil.hasBlank, parameter[member[.regex], member[.content]]]] begin[{] return[call[StrUtil.str, parameter[member[.content]]]] else begin[{] None end[}] local_variable[type[Pattern], pattern] return[call[.delFirst, parameter[member[.pattern], member[.content]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[delFirst] operator[SEP] identifier[String] identifier[regex] , identifier[CharSequence] identifier[content] operator[SEP] { Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[hasBlank] operator[SEP] identifier[regex] , identifier[content] operator[SEP] operator[SEP] { Keyword[return] identifier[StrUtil] operator[SEP] identifier[str] operator[SEP] identifier[content] operator[SEP] operator[SEP] } Keyword[final] identifier[Pattern] identifier[pattern] operator[=] identifier[PatternPool] operator[SEP] identifier[get] operator[SEP] identifier[regex] , identifier[Pattern] operator[SEP] identifier[DOTALL] operator[SEP] operator[SEP] Keyword[return] identifier[delFirst] operator[SEP] identifier[pattern] , identifier[content] operator[SEP] operator[SEP] }
@Override public void activate(RuleBlock ruleBlock) { if (FuzzyLite.isDebugging()) { FuzzyLite.logger().log(Level.FINE, "Activation: {0} {1}", new String[]{getClass().getName(), parameters()}); } TNorm conjunction = ruleBlock.getConjunction(); SNorm disjunction = ruleBlock.getDisjunction(); TNorm implication = ruleBlock.getImplication(); PriorityQueue<Rule> rulesToActivate = new PriorityQueue<Rule>( numberOfRules, new Ascending()); for (Rule rule : ruleBlock.getRules()) { rule.deactivate(); if (rule.isLoaded()) { double activationDegree = rule.activateWith(conjunction, disjunction); if (Op.isGt(activationDegree, 0.0)) { rulesToActivate.offer(rule); } } } int activated = 0; while (!rulesToActivate.isEmpty() && activated++ < numberOfRules) { rulesToActivate.poll().trigger(implication); } }
class class_name[name] begin[{] method[activate, return_type[void], modifier[public], parameter[ruleBlock]] begin[{] if[call[FuzzyLite.isDebugging, parameter[]]] begin[{] call[FuzzyLite.logger, parameter[]] else begin[{] None end[}] local_variable[type[TNorm], conjunction] local_variable[type[SNorm], disjunction] local_variable[type[TNorm], implication] local_variable[type[PriorityQueue], rulesToActivate] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=deactivate, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isLoaded, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=conjunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=disjunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=activateWith, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), name=activationDegree)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=activationDegree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0)], member=isGt, postfix_operators=[], prefix_operators=[], qualifier=Op, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=offer, postfix_operators=[], prefix_operators=[], qualifier=rulesToActivate, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRules, postfix_operators=[], prefix_operators=[], qualifier=ruleBlock, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Rule, sub_type=None))), label=None) local_variable[type[int], activated] while[binary_operation[call[rulesToActivate.isEmpty, parameter[]], &&, binary_operation[member[.activated], <, member[.numberOfRules]]]] begin[{] call[rulesToActivate.poll, parameter[]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[activate] operator[SEP] identifier[RuleBlock] identifier[ruleBlock] operator[SEP] { Keyword[if] operator[SEP] identifier[FuzzyLite] operator[SEP] identifier[isDebugging] operator[SEP] operator[SEP] operator[SEP] { identifier[FuzzyLite] operator[SEP] identifier[logger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[parameters] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } identifier[TNorm] identifier[conjunction] operator[=] identifier[ruleBlock] operator[SEP] identifier[getConjunction] operator[SEP] operator[SEP] operator[SEP] identifier[SNorm] identifier[disjunction] operator[=] identifier[ruleBlock] operator[SEP] identifier[getDisjunction] operator[SEP] operator[SEP] operator[SEP] identifier[TNorm] identifier[implication] operator[=] identifier[ruleBlock] operator[SEP] identifier[getImplication] operator[SEP] operator[SEP] operator[SEP] identifier[PriorityQueue] operator[<] identifier[Rule] operator[>] identifier[rulesToActivate] operator[=] Keyword[new] identifier[PriorityQueue] operator[<] identifier[Rule] operator[>] operator[SEP] identifier[numberOfRules] , Keyword[new] identifier[Ascending] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Rule] identifier[rule] operator[:] identifier[ruleBlock] operator[SEP] identifier[getRules] operator[SEP] operator[SEP] operator[SEP] { identifier[rule] operator[SEP] identifier[deactivate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[isLoaded] operator[SEP] operator[SEP] operator[SEP] { Keyword[double] identifier[activationDegree] operator[=] identifier[rule] operator[SEP] identifier[activateWith] operator[SEP] identifier[conjunction] , identifier[disjunction] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Op] operator[SEP] identifier[isGt] operator[SEP] identifier[activationDegree] , literal[Float] operator[SEP] operator[SEP] { identifier[rulesToActivate] operator[SEP] identifier[offer] operator[SEP] identifier[rule] operator[SEP] operator[SEP] } } } Keyword[int] identifier[activated] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[rulesToActivate] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[activated] operator[++] operator[<] identifier[numberOfRules] operator[SEP] { identifier[rulesToActivate] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[trigger] operator[SEP] identifier[implication] operator[SEP] operator[SEP] } }
@Override public ModbusMessage createMessage(int functionCode) { ModbusMessage msg; switch (ModbusFunctionCode.get(functionCode)) { case READ_COILS: msg = new ReadCoilsRequest(); break; case READ_DISCRETE_INPUTS: msg = new ReadDiscreteInputsRequest(); break; case READ_HOLDING_REGISTERS: msg = new ReadHoldingRegistersRequest(); break; case READ_INPUT_REGISTERS: msg = new ReadInputRegistersRequest(); break; case WRITE_SINGLE_COIL: msg = new WriteSingleCoilRequest(); break; case WRITE_SINGLE_REGISTER: msg = new WriteSingleRegisterRequest(); break; case WRITE_MULTIPLE_COILS: msg = new WriteMultipleCoilsRequest(); break; case WRITE_MULTIPLE_REGISTERS: msg = new WriteMultipleRegistersRequest(); break; case MASK_WRITE_REGISTER: msg = new MaskWriteRegisterRequest(); break; case READ_WRITE_MULTIPLE_REGISTERS: msg = new ReadWriteMultipleRegistersRequest(); break; case READ_FIFO_QUEUE: msg = new ReadFifoQueueRequest(); break; case READ_FILE_RECORD: msg = new ReadFileRecordRequest(); break; case WRITE_FILE_RECORD: msg = new WriteFileRecordRequest(); break; case READ_EXCEPTION_STATUS: msg = new ReadExceptionStatusRequest(); break; case REPORT_SLAVE_ID: msg = new ReportSlaveIdRequest(); break; case GET_COMM_EVENT_COUNTER: msg = new GetCommEventCounterRequest(); break; case GET_COMM_EVENT_LOG: msg = new GetCommEventLogRequest(); break; case DIAGNOSTICS: msg = new DiagnosticsRequest(); break; case ENCAPSULATED_INTERFACE_TRANSPORT: msg = new EncapsulatedInterfaceTransportRequest(); break; default: msg = new IllegalFunctionRequest(functionCode); } return msg; }
class class_name[name] begin[{] method[createMessage, return_type[type[ModbusMessage]], modifier[public], parameter[functionCode]] begin[{] local_variable[type[ModbusMessage], msg] SwitchStatement(cases=[SwitchStatementCase(case=['READ_COILS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadCoilsRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['READ_DISCRETE_INPUTS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadDiscreteInputsRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['READ_HOLDING_REGISTERS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadHoldingRegistersRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['READ_INPUT_REGISTERS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadInputRegistersRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['WRITE_SINGLE_COIL'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WriteSingleCoilRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['WRITE_SINGLE_REGISTER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WriteSingleRegisterRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['WRITE_MULTIPLE_COILS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WriteMultipleCoilsRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['WRITE_MULTIPLE_REGISTERS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WriteMultipleRegistersRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['MASK_WRITE_REGISTER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MaskWriteRegisterRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['READ_WRITE_MULTIPLE_REGISTERS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadWriteMultipleRegistersRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['READ_FIFO_QUEUE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadFifoQueueRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['READ_FILE_RECORD'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadFileRecordRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['WRITE_FILE_RECORD'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WriteFileRecordRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['READ_EXCEPTION_STATUS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadExceptionStatusRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['REPORT_SLAVE_ID'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReportSlaveIdRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['GET_COMM_EVENT_COUNTER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetCommEventCounterRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['GET_COMM_EVENT_LOG'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetCommEventLogRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['DIAGNOSTICS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DiagnosticsRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ENCAPSULATED_INTERFACE_TRANSPORT'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EncapsulatedInterfaceTransportRequest, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=functionCode, 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=IllegalFunctionRequest, sub_type=None))), label=None)])], expression=MethodInvocation(arguments=[MemberReference(member=functionCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ModbusFunctionCode, selectors=[], type_arguments=None), label=None) return[member[.msg]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ModbusMessage] identifier[createMessage] operator[SEP] Keyword[int] identifier[functionCode] operator[SEP] { identifier[ModbusMessage] identifier[msg] operator[SEP] Keyword[switch] operator[SEP] identifier[ModbusFunctionCode] operator[SEP] identifier[get] operator[SEP] identifier[functionCode] operator[SEP] operator[SEP] { Keyword[case] identifier[READ_COILS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadCoilsRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[READ_DISCRETE_INPUTS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadDiscreteInputsRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[READ_HOLDING_REGISTERS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadHoldingRegistersRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[READ_INPUT_REGISTERS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadInputRegistersRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WRITE_SINGLE_COIL] operator[:] identifier[msg] operator[=] Keyword[new] identifier[WriteSingleCoilRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WRITE_SINGLE_REGISTER] operator[:] identifier[msg] operator[=] Keyword[new] identifier[WriteSingleRegisterRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WRITE_MULTIPLE_COILS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[WriteMultipleCoilsRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WRITE_MULTIPLE_REGISTERS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[WriteMultipleRegistersRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[MASK_WRITE_REGISTER] operator[:] identifier[msg] operator[=] Keyword[new] identifier[MaskWriteRegisterRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[READ_WRITE_MULTIPLE_REGISTERS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadWriteMultipleRegistersRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[READ_FIFO_QUEUE] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadFifoQueueRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[READ_FILE_RECORD] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadFileRecordRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WRITE_FILE_RECORD] operator[:] identifier[msg] operator[=] Keyword[new] identifier[WriteFileRecordRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[READ_EXCEPTION_STATUS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReadExceptionStatusRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[REPORT_SLAVE_ID] operator[:] identifier[msg] operator[=] Keyword[new] identifier[ReportSlaveIdRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[GET_COMM_EVENT_COUNTER] operator[:] identifier[msg] operator[=] Keyword[new] identifier[GetCommEventCounterRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[GET_COMM_EVENT_LOG] operator[:] identifier[msg] operator[=] Keyword[new] identifier[GetCommEventLogRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[DIAGNOSTICS] operator[:] identifier[msg] operator[=] Keyword[new] identifier[DiagnosticsRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ENCAPSULATED_INTERFACE_TRANSPORT] operator[:] identifier[msg] operator[=] Keyword[new] identifier[EncapsulatedInterfaceTransportRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[msg] operator[=] Keyword[new] identifier[IllegalFunctionRequest] operator[SEP] identifier[functionCode] operator[SEP] operator[SEP] } Keyword[return] identifier[msg] operator[SEP] }
public void finalizeReporter(int testStatus) { // reopen the file try (FileWriter fw = new FileWriter(file, true); BufferedWriter out = new BufferedWriter(fw)) { out.write(" </table>\n"); out.write(" </body>\n"); out.write("</html>\n"); } catch (IOException e) { log.error(e); } // Record the metrics if ((fails + passes + checks) != stepNum) { log.error("There was some error recording your test steps. Step results don't equal steps performed"); } replaceInFile("STEPSPERFORMED", Integer.toString(fails + passes + checks)); replaceInFile("STEPSPASSED", Integer.toString(passes)); replaceInFile("STEPSFAILED", Integer.toString(fails)); if (fails == 0 && checks == 0 && testStatus == 0) { replaceInFile(PASSORFAIL, "<font size='+2' class='pass'><b>PASS</b></font>"); } else if (fails == 0) { replaceInFile(PASSORFAIL, "<font size='+2' class='check'><b>CHECK</b" + "></font>"); } else { replaceInFile(PASSORFAIL, "<font size='+2' class='fail'><b>FAIL</b></font>"); } addTimeToReport(); if (Property.packageResults()) { packageTestResults(); } if (Property.generatePDF()) { generatePdf(); } }
class class_name[name] begin[{] method[finalizeReporter, return_type[void], modifier[public], parameter[testStatus]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" </table>\n")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" </body>\n")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="</html>\n")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fw, type=ReferenceType(arguments=None, dimensions=[], name=FileWriter, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileWriter, sub_type=None))), TryResource(annotations=[], modifiers=set(), name=out, type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=fw, 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=BufferedWriter, sub_type=None)))]) if[binary_operation[binary_operation[binary_operation[member[.fails], +, member[.passes]], +, member[.checks]], !=, member[.stepNum]]] begin[{] call[log.error, parameter[literal["There was some error recording your test steps. Step results don't equal steps performed"]]] else begin[{] None end[}] call[.replaceInFile, parameter[literal["STEPSPERFORMED"], call[Integer.toString, parameter[binary_operation[binary_operation[member[.fails], +, member[.passes]], +, member[.checks]]]]]] call[.replaceInFile, parameter[literal["STEPSPASSED"], call[Integer.toString, parameter[member[.passes]]]]] call[.replaceInFile, parameter[literal["STEPSFAILED"], call[Integer.toString, parameter[member[.fails]]]]] if[binary_operation[binary_operation[binary_operation[member[.fails], ==, literal[0]], &&, binary_operation[member[.checks], ==, literal[0]]], &&, binary_operation[member[.testStatus], ==, literal[0]]]] begin[{] call[.replaceInFile, parameter[member[.PASSORFAIL], literal["<font size='+2' class='pass'><b>PASS</b></font>"]]] else begin[{] if[binary_operation[member[.fails], ==, literal[0]]] begin[{] call[.replaceInFile, parameter[member[.PASSORFAIL], binary_operation[literal["<font size='+2' class='check'><b>CHECK</b"], +, literal["></font>"]]]] else begin[{] call[.replaceInFile, parameter[member[.PASSORFAIL], literal["<font size='+2' class='fail'><b>FAIL</b></font>"]]] end[}] end[}] call[.addTimeToReport, parameter[]] if[call[Property.packageResults, parameter[]]] begin[{] call[.packageTestResults, parameter[]] else begin[{] None end[}] if[call[Property.generatePDF, parameter[]]] begin[{] call[.generatePdf, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[finalizeReporter] operator[SEP] Keyword[int] identifier[testStatus] operator[SEP] { Keyword[try] operator[SEP] identifier[FileWriter] identifier[fw] operator[=] Keyword[new] identifier[FileWriter] operator[SEP] identifier[file] , literal[boolean] operator[SEP] operator[SEP] identifier[BufferedWriter] identifier[out] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] identifier[fw] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[fails] operator[+] identifier[passes] operator[+] identifier[checks] operator[SEP] operator[!=] identifier[stepNum] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[replaceInFile] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[fails] operator[+] identifier[passes] operator[+] identifier[checks] operator[SEP] operator[SEP] operator[SEP] identifier[replaceInFile] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[passes] operator[SEP] operator[SEP] operator[SEP] identifier[replaceInFile] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[fails] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fails] operator[==] Other[0] operator[&&] identifier[checks] operator[==] Other[0] operator[&&] identifier[testStatus] operator[==] Other[0] operator[SEP] { identifier[replaceInFile] operator[SEP] identifier[PASSORFAIL] , literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fails] operator[==] Other[0] operator[SEP] { identifier[replaceInFile] operator[SEP] identifier[PASSORFAIL] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[replaceInFile] operator[SEP] identifier[PASSORFAIL] , literal[String] operator[SEP] operator[SEP] } identifier[addTimeToReport] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Property] operator[SEP] identifier[packageResults] operator[SEP] operator[SEP] operator[SEP] { identifier[packageTestResults] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Property] operator[SEP] identifier[generatePDF] operator[SEP] operator[SEP] operator[SEP] { identifier[generatePdf] operator[SEP] operator[SEP] operator[SEP] } }
public void checkSemantics(boolean all) throws BadSemanticsException { super.checkSemantics(all); Util.uniqueNames(varTemplate, getEncodedName(), getTypeName()); if (all) { for (Enumeration e = varTemplate.elements(); e.hasMoreElements();) { BaseType bt = (BaseType) e.nextElement(); bt.checkSemantics(true); } } }
class class_name[name] begin[{] method[checkSemantics, return_type[void], modifier[public], parameter[all]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=all, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkSemantics, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[Util.uniqueNames, parameter[member[.varTemplate], call[.getEncodedName, parameter[]], call[.getTypeName, parameter[]]]] if[member[.all]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BaseType, sub_type=None)), name=bt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BaseType, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=checkSemantics, postfix_operators=[], prefix_operators=[], qualifier=bt, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=elements, postfix_operators=[], prefix_operators=[], qualifier=varTemplate, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), update=None), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[checkSemantics] operator[SEP] Keyword[boolean] identifier[all] operator[SEP] Keyword[throws] identifier[BadSemanticsException] { Keyword[super] operator[SEP] identifier[checkSemantics] operator[SEP] identifier[all] operator[SEP] operator[SEP] identifier[Util] operator[SEP] identifier[uniqueNames] operator[SEP] identifier[varTemplate] , identifier[getEncodedName] operator[SEP] operator[SEP] , identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[all] operator[SEP] { Keyword[for] operator[SEP] identifier[Enumeration] identifier[e] operator[=] identifier[varTemplate] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[BaseType] identifier[bt] operator[=] operator[SEP] identifier[BaseType] operator[SEP] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[bt] operator[SEP] identifier[checkSemantics] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } }
@Override public <V extends FileAttributeView> V getFileAttributeView(final Path path, final Class<V> type, final LinkOption... options) { if (path == null) { throw new IllegalArgumentException("path must be specified"); } if (type == null) { throw new IllegalArgumentException("type must be specified"); } if (!type.isAssignableFrom(ShrinkWrapFileAttributeView.class)) { // Nope, we don't support this view return null; } if (!(path instanceof ShrinkWrapPath)) { throw new IllegalArgumentException("Only " + ShrinkWrapPath.class.getSimpleName() + " is supported"); } return type.cast(new ShrinkWrapFileAttributeView(new ShrinkWrapFileAttributes((ShrinkWrapPath) path, getArchive(path)))); }
class class_name[name] begin[{] method[getFileAttributeView, return_type[type[V]], modifier[public], parameter[path, type, options]] begin[{] if[binary_operation[member[.path], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="path must be specified")], 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[.type], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type must be specified")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[call[type.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShrinkWrapFileAttributeView, sub_type=None))]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.path], instanceof, type[ShrinkWrapPath]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ShrinkWrapPath, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is supported"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[type.cast, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Cast(expression=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ShrinkWrapPath, sub_type=None)), MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getArchive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShrinkWrapFileAttributes, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShrinkWrapFileAttributeView, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[V] Keyword[extends] identifier[FileAttributeView] operator[>] identifier[V] identifier[getFileAttributeView] operator[SEP] Keyword[final] identifier[Path] identifier[path] , Keyword[final] identifier[Class] operator[<] identifier[V] operator[>] identifier[type] , Keyword[final] identifier[LinkOption] operator[...] identifier[options] operator[SEP] { Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[type] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[ShrinkWrapFileAttributeView] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[path] Keyword[instanceof] identifier[ShrinkWrapPath] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[ShrinkWrapPath] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[type] operator[SEP] identifier[cast] operator[SEP] Keyword[new] identifier[ShrinkWrapFileAttributeView] operator[SEP] Keyword[new] identifier[ShrinkWrapFileAttributes] operator[SEP] operator[SEP] identifier[ShrinkWrapPath] operator[SEP] identifier[path] , identifier[getArchive] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(S3Object s3Object, ProtocolMarshaller protocolMarshaller) { if (s3Object == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(s3Object.getBucket(), BUCKET_BINDING); protocolMarshaller.marshall(s3Object.getName(), NAME_BINDING); protocolMarshaller.marshall(s3Object.getVersion(), VERSION_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[s3Object, protocolMarshaller]] begin[{] if[binary_operation[member[.s3Object], ==, 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=getBucket, postfix_operators=[], prefix_operators=[], qualifier=s3Object, selectors=[], type_arguments=None), MemberReference(member=BUCKET_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=getName, postfix_operators=[], prefix_operators=[], qualifier=s3Object, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVersion, postfix_operators=[], prefix_operators=[], qualifier=s3Object, selectors=[], type_arguments=None), MemberReference(member=VERSION_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[S3Object] identifier[s3Object] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[s3Object] 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[s3Object] operator[SEP] identifier[getBucket] operator[SEP] operator[SEP] , identifier[BUCKET_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[s3Object] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[s3Object] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] , identifier[VERSION_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 Set<Action.ActionEffect> getActionEffects() { switch(getImpact()) { case CLASSLOADING: case WRITE: return WRITES; case READ_ONLY: return READS; default: throw new IllegalStateException(); } }
class class_name[name] begin[{] method[getActionEffects, return_type[type[Set]], modifier[public], parameter[]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['CLASSLOADING', 'WRITE'], statements=[ReturnStatement(expression=MemberReference(member=WRITES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['READ_ONLY'], statements=[ReturnStatement(expression=MemberReference(member=READS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getImpact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[Action] operator[SEP] identifier[ActionEffect] operator[>] identifier[getActionEffects] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[getImpact] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[CLASSLOADING] operator[:] Keyword[case] identifier[WRITE] operator[:] Keyword[return] identifier[WRITES] operator[SEP] Keyword[case] identifier[READ_ONLY] operator[:] Keyword[return] identifier[READS] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] } }
@Override public ScopedMessageHandler errors() { if (errorsHandler == null) { synchronized (this) { if (errorsHandler == null) { errorsHandler = createScopedMessageHandler(getErrorMessagesKey()); } } } return errorsHandler; }
class class_name[name] begin[{] method[errors, return_type[type[ScopedMessageHandler]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.errorsHandler], ==, literal[null]]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] if[binary_operation[member[.errorsHandler], ==, literal[null]]] begin[{] assign[member[.errorsHandler], call[.createScopedMessageHandler, parameter[call[.getErrorMessagesKey, parameter[]]]]] else begin[{] None end[}] END[}] else begin[{] None end[}] return[member[.errorsHandler]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ScopedMessageHandler] identifier[errors] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[errorsHandler] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[if] operator[SEP] identifier[errorsHandler] operator[==] Other[null] operator[SEP] { identifier[errorsHandler] operator[=] identifier[createScopedMessageHandler] operator[SEP] identifier[getErrorMessagesKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[errorsHandler] operator[SEP] }
@Override protected void generateClass() { classFile.addField(AccessFlag.PRIVATE, INVOCATION_HANDLER_FIELD, InvocationHandler.class); classFile.addField(AccessFlag.PRIVATE, CONSTRUCTED_GUARD, "Z"); if (serializableProxyClass != null) { createWriteReplace(); } MethodBodyCreator creator = getDefaultMethodOverride(); overrideAllMethods(creator); for (Class<?> iface : additionalInterfaces) { addInterface(creator, iface); } overrideToString(creator); overrideEquals(creator); overrideHashcode(creator); createConstructorDelegates(new ProxyConstructorBodyCreator()); finalizeStaticConstructor(); for (Annotation annotation : this.getSuperClass().getDeclaredAnnotations()) { classFile.getRuntimeVisibleAnnotationsAttribute().addAnnotation(annotation); } }
class class_name[name] begin[{] method[generateClass, return_type[void], modifier[protected], parameter[]] begin[{] call[classFile.addField, parameter[member[AccessFlag.PRIVATE], member[.INVOCATION_HANDLER_FIELD], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvocationHandler, sub_type=None))]] call[classFile.addField, parameter[member[AccessFlag.PRIVATE], member[.CONSTRUCTED_GUARD], literal["Z"]]] if[binary_operation[member[.serializableProxyClass], !=, literal[null]]] begin[{] call[.createWriteReplace, parameter[]] else begin[{] None end[}] local_variable[type[MethodBodyCreator], creator] call[.overrideAllMethods, parameter[member[.creator]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=creator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=additionalInterfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=iface)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) call[.overrideToString, parameter[member[.creator]]] call[.overrideEquals, parameter[member[.creator]]] call[.overrideHashcode, parameter[member[.creator]]] call[.createConstructorDelegates, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProxyConstructorBodyCreator, sub_type=None))]] call[.finalizeStaticConstructor, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRuntimeVisibleAnnotationsAttribute, postfix_operators=[], prefix_operators=[], qualifier=classFile, selectors=[MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAnnotation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getSuperClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getDeclaredAnnotations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[generateClass] operator[SEP] operator[SEP] { identifier[classFile] operator[SEP] identifier[addField] operator[SEP] identifier[AccessFlag] operator[SEP] identifier[PRIVATE] , identifier[INVOCATION_HANDLER_FIELD] , identifier[InvocationHandler] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[classFile] operator[SEP] identifier[addField] operator[SEP] identifier[AccessFlag] operator[SEP] identifier[PRIVATE] , identifier[CONSTRUCTED_GUARD] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serializableProxyClass] operator[!=] Other[null] operator[SEP] { identifier[createWriteReplace] operator[SEP] operator[SEP] operator[SEP] } identifier[MethodBodyCreator] identifier[creator] operator[=] identifier[getDefaultMethodOverride] operator[SEP] operator[SEP] operator[SEP] identifier[overrideAllMethods] operator[SEP] identifier[creator] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[iface] operator[:] identifier[additionalInterfaces] operator[SEP] { identifier[addInterface] operator[SEP] identifier[creator] , identifier[iface] operator[SEP] operator[SEP] } identifier[overrideToString] operator[SEP] identifier[creator] operator[SEP] operator[SEP] identifier[overrideEquals] operator[SEP] identifier[creator] operator[SEP] operator[SEP] identifier[overrideHashcode] operator[SEP] identifier[creator] operator[SEP] operator[SEP] identifier[createConstructorDelegates] operator[SEP] Keyword[new] identifier[ProxyConstructorBodyCreator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[finalizeStaticConstructor] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Annotation] identifier[annotation] operator[:] Keyword[this] operator[SEP] identifier[getSuperClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredAnnotations] operator[SEP] operator[SEP] operator[SEP] { identifier[classFile] operator[SEP] identifier[getRuntimeVisibleAnnotationsAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[addAnnotation] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] } }
public SM2 init(PrivateKey privateKey, PublicKey publicKey) { return this.init(ALGORITHM_SM2, privateKey, publicKey); }
class class_name[name] begin[{] method[init, return_type[type[SM2]], modifier[public], parameter[privateKey, publicKey]] begin[{] return[THIS[call[None.init, parameter[member[.ALGORITHM_SM2], member[.privateKey], member[.publicKey]]]]] end[}] END[}]
Keyword[public] identifier[SM2] identifier[init] operator[SEP] identifier[PrivateKey] identifier[privateKey] , identifier[PublicKey] identifier[publicKey] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[init] operator[SEP] identifier[ALGORITHM_SM2] , identifier[privateKey] , identifier[publicKey] operator[SEP] operator[SEP] }
public void setUserMFASettingList(java.util.Collection<String> userMFASettingList) { if (userMFASettingList == null) { this.userMFASettingList = null; return; } this.userMFASettingList = new java.util.ArrayList<String>(userMFASettingList); }
class class_name[name] begin[{] method[setUserMFASettingList, return_type[void], modifier[public], parameter[userMFASettingList]] begin[{] if[binary_operation[member[.userMFASettingList], ==, literal[null]]] begin[{] assign[THIS[member[None.userMFASettingList]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.userMFASettingList]], ClassCreator(arguments=[MemberReference(member=userMFASettingList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setUserMFASettingList] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[userMFASettingList] operator[SEP] { Keyword[if] operator[SEP] identifier[userMFASettingList] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[userMFASettingList] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[userMFASettingList] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[userMFASettingList] operator[SEP] operator[SEP] }
public boolean hasDeploymentSubModel(final String subsystemName, final PathAddress address) { final Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE); final PathElement subsystem = PathElement.pathElement(SUBSYSTEM, subsystemName); boolean found = false; if (root.hasChild(subsystem)) { if (address == PathAddress.EMPTY_ADDRESS) { return true; } Resource parent = root.getChild(subsystem); for (PathElement child : address) { if (parent.hasChild(child)) { found = true; parent = parent.getChild(child); } else { found = false; break; } } } return found; }
class class_name[name] begin[{] method[hasDeploymentSubModel, return_type[type[boolean]], modifier[public], parameter[subsystemName, address]] begin[{] local_variable[type[Resource], root] local_variable[type[PathElement], subsystem] local_variable[type[boolean], found] if[call[root.hasChild, parameter[member[.subsystem]]]] begin[{] if[binary_operation[member[.address], ==, member[PathAddress.EMPTY_ADDRESS]]] begin[{] return[literal[true]] else begin[{] None end[}] local_variable[type[Resource], parent] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasChild, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PathElement, sub_type=None))), label=None) else begin[{] None end[}] return[member[.found]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[hasDeploymentSubModel] operator[SEP] Keyword[final] identifier[String] identifier[subsystemName] , Keyword[final] identifier[PathAddress] identifier[address] operator[SEP] { Keyword[final] identifier[Resource] identifier[root] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[DEPLOYMENT_RESOURCE] operator[SEP] operator[SEP] Keyword[final] identifier[PathElement] identifier[subsystem] operator[=] identifier[PathElement] operator[SEP] identifier[pathElement] operator[SEP] identifier[SUBSYSTEM] , identifier[subsystemName] operator[SEP] operator[SEP] Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[SEP] identifier[hasChild] operator[SEP] identifier[subsystem] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[address] operator[==] identifier[PathAddress] operator[SEP] identifier[EMPTY_ADDRESS] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[Resource] identifier[parent] operator[=] identifier[root] operator[SEP] identifier[getChild] operator[SEP] identifier[subsystem] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PathElement] identifier[child] operator[:] identifier[address] operator[SEP] { Keyword[if] operator[SEP] identifier[parent] operator[SEP] identifier[hasChild] operator[SEP] identifier[child] operator[SEP] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] identifier[parent] operator[=] identifier[parent] operator[SEP] identifier[getChild] operator[SEP] identifier[child] operator[SEP] operator[SEP] } Keyword[else] { identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[return] identifier[found] operator[SEP] }
public M get() { // may be we should rename this method. the contract would be less // confusing with a different name. if (message == null && messageBytes != null) { checkConverter(); try { return converter.fromBytes(messageBytes); } catch (DecodeException e) { throw new IllegalStateException("Converter failed to deserialize", e); } } return message; }
class class_name[name] begin[{] method[get, return_type[type[M]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[.message], ==, literal[null]], &&, binary_operation[member[.messageBytes], !=, literal[null]]]] begin[{] call[.checkConverter, parameter[]] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=messageBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromBytes, postfix_operators=[], prefix_operators=[], qualifier=converter, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Converter failed to deserialize"), 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=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DecodeException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.message]] end[}] END[}]
Keyword[public] identifier[M] identifier[get] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[&&] identifier[messageBytes] operator[!=] Other[null] operator[SEP] { identifier[checkConverter] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[converter] operator[SEP] identifier[fromBytes] operator[SEP] identifier[messageBytes] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DecodeException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[message] operator[SEP] }
protected void validate(String operationType) throws Exception { super.validate(operationType); MPSInt nodeid_validator = new MPSInt(); nodeid_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 0); nodeid_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 31); nodeid_validator.validate(operationType, nodeid, "\"nodeid\""); MPSInt clusterid_validator = new MPSInt(); clusterid_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 1); clusterid_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 16); clusterid_validator.validate(operationType, clusterid, "\"clusterid\""); MPSIPAddress clnodeip_validator = new MPSIPAddress(); clnodeip_validator.validate(operationType, clnodeip, "\"clnodeip\""); MPSIPAddress clip_validator = new MPSIPAddress(); clip_validator.validate(operationType, clip, "\"clip\""); MPSString password_validator = new MPSString(); password_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128); password_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1); password_validator.validate(operationType, password, "\"password\""); MPSString clmasterstate_validator = new MPSString(); clmasterstate_validator.validate(operationType, clmasterstate, "\"clmasterstate\""); MPSDouble cltothbtx_validator = new MPSDouble(); cltothbtx_validator.validate(operationType, cltothbtx, "\"cltothbtx\""); MPSDouble cltothbrx_validator = new MPSDouble(); cltothbrx_validator.validate(operationType, cltothbrx, "\"cltothbrx\""); MPSDouble nnmcurconn_validator = new MPSDouble(); nnmcurconn_validator.validate(operationType, nnmcurconn, "\"nnmcurconn\""); MPSDouble nnmtotconntx_validator = new MPSDouble(); nnmtotconntx_validator.validate(operationType, nnmtotconntx, "\"nnmtotconntx\""); MPSDouble nnmtotconnrx_validator = new MPSDouble(); nnmtotconnrx_validator.validate(operationType, nnmtotconnrx, "\"nnmtotconnrx\""); MPSDouble nnmerrmsend_validator = new MPSDouble(); nnmerrmsend_validator.validate(operationType, nnmerrmsend, "\"nnmerrmsend\""); MPSDouble clptptx_validator = new MPSDouble(); clptptx_validator.validate(operationType, clptptx, "\"clptptx\""); MPSDouble clptprx_validator = new MPSDouble(); clptprx_validator.validate(operationType, clptprx, "\"clptprx\""); MPSString clptpstate_validator = new MPSString(); clptpstate_validator.validate(operationType, clptpstate, "\"clptpstate\""); MPSString clnodehealth_validator = new MPSString(); clnodehealth_validator.validate(operationType, clnodehealth, "\"clnodehealth\""); MPSString clnodeeffectivehealth_validator = new MPSString(); clnodeeffectivehealth_validator.validate(operationType, clnodeeffectivehealth, "\"clnodeeffectivehealth\""); MPSString clsyncstate_validator = new MPSString(); clsyncstate_validator.validate(operationType, clsyncstate, "\"clsyncstate\""); MPSBoolean iscco_validator = new MPSBoolean(); iscco_validator.validate(operationType, iscco, "\"iscco\""); MPSString islocalsdx_validator = new MPSString(); islocalsdx_validator.validate(operationType, islocalsdx, "\"islocalsdx\""); MPSString act_id_validator = new MPSString(); act_id_validator.validate(operationType, act_id, "\"act_id\""); }
class class_name[name] begin[{] method[validate, return_type[void], modifier[protected], parameter[operationType]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=operationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validate, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) local_variable[type[MPSInt], nodeid_validator] call[nodeid_validator.setConstraintMinValue, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[0]]] call[nodeid_validator.setConstraintMaxValue, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[31]]] call[nodeid_validator.validate, parameter[member[.operationType], member[.nodeid], literal["\"nodeid\""]]] local_variable[type[MPSInt], clusterid_validator] call[clusterid_validator.setConstraintMinValue, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[1]]] call[clusterid_validator.setConstraintMaxValue, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[16]]] call[clusterid_validator.validate, parameter[member[.operationType], member[.clusterid], literal["\"clusterid\""]]] local_variable[type[MPSIPAddress], clnodeip_validator] call[clnodeip_validator.validate, parameter[member[.operationType], member[.clnodeip], literal["\"clnodeip\""]]] local_variable[type[MPSIPAddress], clip_validator] call[clip_validator.validate, parameter[member[.operationType], member[.clip], literal["\"clip\""]]] local_variable[type[MPSString], password_validator] call[password_validator.setConstraintMaxStrLen, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[128]]] call[password_validator.setConstraintMinStrLen, parameter[member[MPSConstants.GENERIC_CONSTRAINT], literal[1]]] call[password_validator.validate, parameter[member[.operationType], member[.password], literal["\"password\""]]] local_variable[type[MPSString], clmasterstate_validator] call[clmasterstate_validator.validate, parameter[member[.operationType], member[.clmasterstate], literal["\"clmasterstate\""]]] local_variable[type[MPSDouble], cltothbtx_validator] call[cltothbtx_validator.validate, parameter[member[.operationType], member[.cltothbtx], literal["\"cltothbtx\""]]] local_variable[type[MPSDouble], cltothbrx_validator] call[cltothbrx_validator.validate, parameter[member[.operationType], member[.cltothbrx], literal["\"cltothbrx\""]]] local_variable[type[MPSDouble], nnmcurconn_validator] call[nnmcurconn_validator.validate, parameter[member[.operationType], member[.nnmcurconn], literal["\"nnmcurconn\""]]] local_variable[type[MPSDouble], nnmtotconntx_validator] call[nnmtotconntx_validator.validate, parameter[member[.operationType], member[.nnmtotconntx], literal["\"nnmtotconntx\""]]] local_variable[type[MPSDouble], nnmtotconnrx_validator] call[nnmtotconnrx_validator.validate, parameter[member[.operationType], member[.nnmtotconnrx], literal["\"nnmtotconnrx\""]]] local_variable[type[MPSDouble], nnmerrmsend_validator] call[nnmerrmsend_validator.validate, parameter[member[.operationType], member[.nnmerrmsend], literal["\"nnmerrmsend\""]]] local_variable[type[MPSDouble], clptptx_validator] call[clptptx_validator.validate, parameter[member[.operationType], member[.clptptx], literal["\"clptptx\""]]] local_variable[type[MPSDouble], clptprx_validator] call[clptprx_validator.validate, parameter[member[.operationType], member[.clptprx], literal["\"clptprx\""]]] local_variable[type[MPSString], clptpstate_validator] call[clptpstate_validator.validate, parameter[member[.operationType], member[.clptpstate], literal["\"clptpstate\""]]] local_variable[type[MPSString], clnodehealth_validator] call[clnodehealth_validator.validate, parameter[member[.operationType], member[.clnodehealth], literal["\"clnodehealth\""]]] local_variable[type[MPSString], clnodeeffectivehealth_validator] call[clnodeeffectivehealth_validator.validate, parameter[member[.operationType], member[.clnodeeffectivehealth], literal["\"clnodeeffectivehealth\""]]] local_variable[type[MPSString], clsyncstate_validator] call[clsyncstate_validator.validate, parameter[member[.operationType], member[.clsyncstate], literal["\"clsyncstate\""]]] local_variable[type[MPSBoolean], iscco_validator] call[iscco_validator.validate, parameter[member[.operationType], member[.iscco], literal["\"iscco\""]]] local_variable[type[MPSString], islocalsdx_validator] call[islocalsdx_validator.validate, parameter[member[.operationType], member[.islocalsdx], literal["\"islocalsdx\""]]] local_variable[type[MPSString], act_id_validator] call[act_id_validator.validate, parameter[member[.operationType], member[.act_id], literal["\"act_id\""]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[validate] operator[SEP] identifier[String] identifier[operationType] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[super] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] operator[SEP] operator[SEP] identifier[MPSInt] identifier[nodeid_validator] operator[=] Keyword[new] identifier[MPSInt] operator[SEP] operator[SEP] operator[SEP] identifier[nodeid_validator] operator[SEP] identifier[setConstraintMinValue] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[0] operator[SEP] operator[SEP] identifier[nodeid_validator] operator[SEP] identifier[setConstraintMaxValue] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[31] operator[SEP] operator[SEP] identifier[nodeid_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[nodeid] , literal[String] operator[SEP] operator[SEP] identifier[MPSInt] identifier[clusterid_validator] operator[=] Keyword[new] identifier[MPSInt] operator[SEP] operator[SEP] operator[SEP] identifier[clusterid_validator] operator[SEP] identifier[setConstraintMinValue] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[1] operator[SEP] operator[SEP] identifier[clusterid_validator] operator[SEP] identifier[setConstraintMaxValue] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[16] operator[SEP] operator[SEP] identifier[clusterid_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clusterid] , literal[String] operator[SEP] operator[SEP] identifier[MPSIPAddress] identifier[clnodeip_validator] operator[=] Keyword[new] identifier[MPSIPAddress] operator[SEP] operator[SEP] operator[SEP] identifier[clnodeip_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clnodeip] , literal[String] operator[SEP] operator[SEP] identifier[MPSIPAddress] identifier[clip_validator] operator[=] Keyword[new] identifier[MPSIPAddress] operator[SEP] operator[SEP] operator[SEP] identifier[clip_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clip] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[password_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[password_validator] operator[SEP] identifier[setConstraintMaxStrLen] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[128] operator[SEP] operator[SEP] identifier[password_validator] operator[SEP] identifier[setConstraintMinStrLen] operator[SEP] identifier[MPSConstants] operator[SEP] identifier[GENERIC_CONSTRAINT] , Other[1] operator[SEP] operator[SEP] identifier[password_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[password] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[clmasterstate_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[clmasterstate_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clmasterstate] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[cltothbtx_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[cltothbtx_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[cltothbtx] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[cltothbrx_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[cltothbrx_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[cltothbrx] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[nnmcurconn_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[nnmcurconn_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[nnmcurconn] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[nnmtotconntx_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[nnmtotconntx_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[nnmtotconntx] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[nnmtotconnrx_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[nnmtotconnrx_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[nnmtotconnrx] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[nnmerrmsend_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[nnmerrmsend_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[nnmerrmsend] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[clptptx_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[clptptx_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clptptx] , literal[String] operator[SEP] operator[SEP] identifier[MPSDouble] identifier[clptprx_validator] operator[=] Keyword[new] identifier[MPSDouble] operator[SEP] operator[SEP] operator[SEP] identifier[clptprx_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clptprx] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[clptpstate_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[clptpstate_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clptpstate] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[clnodehealth_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[clnodehealth_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clnodehealth] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[clnodeeffectivehealth_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[clnodeeffectivehealth_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clnodeeffectivehealth] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[clsyncstate_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[clsyncstate_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[clsyncstate] , literal[String] operator[SEP] operator[SEP] identifier[MPSBoolean] identifier[iscco_validator] operator[=] Keyword[new] identifier[MPSBoolean] operator[SEP] operator[SEP] operator[SEP] identifier[iscco_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[iscco] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[islocalsdx_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[islocalsdx_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[islocalsdx] , literal[String] operator[SEP] operator[SEP] identifier[MPSString] identifier[act_id_validator] operator[=] Keyword[new] identifier[MPSString] operator[SEP] operator[SEP] operator[SEP] identifier[act_id_validator] operator[SEP] identifier[validate] operator[SEP] identifier[operationType] , identifier[act_id] , literal[String] operator[SEP] operator[SEP] }
protected void declareNamespaceInContext(int elementNodeIndex,int namespaceNodeIndex) { SuballocatedIntVector nsList=null; if(m_namespaceDeclSets==null) { // First m_namespaceDeclSetElements=new SuballocatedIntVector(32); m_namespaceDeclSetElements.addElement(elementNodeIndex); m_namespaceDeclSets=new Vector(); nsList=new SuballocatedIntVector(32); m_namespaceDeclSets.addElement(nsList); } else { // Most recent. May be -1 (none) if DTM was pruned. // %OPT% Is there a lastElement() method? Should there be? int last=m_namespaceDeclSetElements.size()-1; if(last>=0 && elementNodeIndex==m_namespaceDeclSetElements.elementAt(last)) { nsList=(SuballocatedIntVector)m_namespaceDeclSets.elementAt(last); } } if(nsList==null) { m_namespaceDeclSetElements.addElement(elementNodeIndex); SuballocatedIntVector inherited = findNamespaceContext(_parent(elementNodeIndex)); if (inherited!=null) { // %OPT% Count-down might be faster, but debuggability may // be better this way, and if we ever decide we want to // keep this ordered by expanded-type... int isize=inherited.size(); // Base the size of a new namespace list on the // size of the inherited list - but within reason! nsList=new SuballocatedIntVector(Math.max(Math.min(isize+16,2048), 32)); for(int i=0;i<isize;++i) { nsList.addElement(inherited.elementAt(i)); } } else { nsList=new SuballocatedIntVector(32); } m_namespaceDeclSets.addElement(nsList); } // Handle overwriting inherited. // %OPT% Keep sorted? (By expanded-name rather than by doc order...) // Downside: Would require insertElementAt if not found, // which has recopying costs. But these are generally short lists... int newEType=_exptype(namespaceNodeIndex); for(int i=nsList.size()-1;i>=0;--i) { if(newEType==getExpandedTypeID(nsList.elementAt(i))) { nsList.setElementAt(makeNodeHandle(namespaceNodeIndex),i); return; } } nsList.addElement(makeNodeHandle(namespaceNodeIndex)); }
class class_name[name] begin[{] method[declareNamespaceInContext, return_type[void], modifier[protected], parameter[elementNodeIndex, namespaceNodeIndex]] begin[{] local_variable[type[SuballocatedIntVector], nsList] if[binary_operation[member[.m_namespaceDeclSets], ==, literal[null]]] begin[{] assign[member[.m_namespaceDeclSetElements], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SuballocatedIntVector, sub_type=None))] call[m_namespaceDeclSetElements.addElement, parameter[member[.elementNodeIndex]]] assign[member[.m_namespaceDeclSets], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Vector, sub_type=None))] assign[member[.nsList], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SuballocatedIntVector, sub_type=None))] call[m_namespaceDeclSets.addElement, parameter[member[.nsList]]] else begin[{] local_variable[type[int], last] if[binary_operation[binary_operation[member[.last], >=, literal[0]], &&, binary_operation[member[.elementNodeIndex], ==, call[m_namespaceDeclSetElements.elementAt, parameter[member[.last]]]]]] begin[{] assign[member[.nsList], Cast(expression=MethodInvocation(arguments=[MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=m_namespaceDeclSets, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SuballocatedIntVector, sub_type=None))] else begin[{] None end[}] end[}] if[binary_operation[member[.nsList], ==, literal[null]]] begin[{] call[m_namespaceDeclSetElements.addElement, parameter[member[.elementNodeIndex]]] local_variable[type[SuballocatedIntVector], inherited] if[binary_operation[member[.inherited], !=, literal[null]]] begin[{] local_variable[type[int], isize] assign[member[.nsList], ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=isize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2048)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SuballocatedIntVector, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=inherited, selectors=[], type_arguments=None)], member=addElement, postfix_operators=[], prefix_operators=[], qualifier=nsList, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=isize, 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) else begin[{] assign[member[.nsList], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SuballocatedIntVector, sub_type=None))] end[}] call[m_namespaceDeclSets.addElement, parameter[member[.nsList]]] else begin[{] None end[}] local_variable[type[int], newEType] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newEType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=nsList, selectors=[], type_arguments=None)], member=getExpandedTypeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=namespaceNodeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeNodeHandle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setElementAt, postfix_operators=[], prefix_operators=[], qualifier=nsList, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=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=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=nsList, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[])]), label=None) call[nsList.addElement, parameter[call[.makeNodeHandle, parameter[member[.namespaceNodeIndex]]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[declareNamespaceInContext] operator[SEP] Keyword[int] identifier[elementNodeIndex] , Keyword[int] identifier[namespaceNodeIndex] operator[SEP] { identifier[SuballocatedIntVector] identifier[nsList] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[m_namespaceDeclSets] operator[==] Other[null] operator[SEP] { identifier[m_namespaceDeclSetElements] operator[=] Keyword[new] identifier[SuballocatedIntVector] operator[SEP] Other[32] operator[SEP] operator[SEP] identifier[m_namespaceDeclSetElements] operator[SEP] identifier[addElement] operator[SEP] identifier[elementNodeIndex] operator[SEP] operator[SEP] identifier[m_namespaceDeclSets] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] identifier[nsList] operator[=] Keyword[new] identifier[SuballocatedIntVector] operator[SEP] Other[32] operator[SEP] operator[SEP] identifier[m_namespaceDeclSets] operator[SEP] identifier[addElement] operator[SEP] identifier[nsList] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[last] operator[=] identifier[m_namespaceDeclSetElements] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[last] operator[>=] Other[0] operator[&&] identifier[elementNodeIndex] operator[==] identifier[m_namespaceDeclSetElements] operator[SEP] identifier[elementAt] operator[SEP] identifier[last] operator[SEP] operator[SEP] { identifier[nsList] operator[=] operator[SEP] identifier[SuballocatedIntVector] operator[SEP] identifier[m_namespaceDeclSets] operator[SEP] identifier[elementAt] operator[SEP] identifier[last] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[nsList] operator[==] Other[null] operator[SEP] { identifier[m_namespaceDeclSetElements] operator[SEP] identifier[addElement] operator[SEP] identifier[elementNodeIndex] operator[SEP] operator[SEP] identifier[SuballocatedIntVector] identifier[inherited] operator[=] identifier[findNamespaceContext] operator[SEP] identifier[_parent] operator[SEP] identifier[elementNodeIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inherited] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[isize] operator[=] identifier[inherited] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[nsList] operator[=] Keyword[new] identifier[SuballocatedIntVector] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[isize] operator[+] Other[16] , Other[2048] operator[SEP] , Other[32] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[isize] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[nsList] operator[SEP] identifier[addElement] operator[SEP] identifier[inherited] operator[SEP] identifier[elementAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[nsList] operator[=] Keyword[new] identifier[SuballocatedIntVector] operator[SEP] Other[32] operator[SEP] operator[SEP] } identifier[m_namespaceDeclSets] operator[SEP] identifier[addElement] operator[SEP] identifier[nsList] operator[SEP] operator[SEP] } Keyword[int] identifier[newEType] operator[=] identifier[_exptype] operator[SEP] identifier[namespaceNodeIndex] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[nsList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] operator[--] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[newEType] operator[==] identifier[getExpandedTypeID] operator[SEP] identifier[nsList] operator[SEP] identifier[elementAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[nsList] operator[SEP] identifier[setElementAt] operator[SEP] identifier[makeNodeHandle] operator[SEP] identifier[namespaceNodeIndex] operator[SEP] , identifier[i] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } identifier[nsList] operator[SEP] identifier[addElement] operator[SEP] identifier[makeNodeHandle] operator[SEP] identifier[namespaceNodeIndex] operator[SEP] operator[SEP] operator[SEP] }
public static void writeGzipObjectToStream(final Object o, OutputStream out) { out = new BufferedOutputStream(out); try { out = new GZIPOutputStream(out, true); final ObjectOutputStream oos = new ObjectOutputStream(out); oos.writeObject(o); oos.flush(); } catch (final IOException e) { e.printStackTrace(); } }
class class_name[name] begin[{] method[writeGzipObjectToStream, return_type[void], modifier[public static], parameter[o, out]] begin[{] assign[member[.out], ClassCreator(arguments=[MemberReference(member=out, 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=BufferedOutputStream, sub_type=None))] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GZIPOutputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None)), name=oos)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ObjectOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeGzipObjectToStream] operator[SEP] Keyword[final] identifier[Object] identifier[o] , identifier[OutputStream] identifier[out] operator[SEP] { identifier[out] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[try] { identifier[out] operator[=] Keyword[new] identifier[GZIPOutputStream] operator[SEP] identifier[out] , literal[boolean] operator[SEP] operator[SEP] Keyword[final] identifier[ObjectOutputStream] identifier[oos] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] identifier[out] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[writeObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
public R getMatch() { for (Pattern<T, R> pattern : patterns) { if (pattern.matches(value)) { return pattern.apply(value); } } throw new MatchException("No match found for " + value); }
class class_name[name] begin[{] method[getMatch, return_type[type[R]], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=patterns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pattern)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=[], name=Pattern, sub_type=None))), label=None) ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No match found for "), operandr=MemberReference(member=value, 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=MatchException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] identifier[R] identifier[getMatch] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Pattern] operator[<] identifier[T] , identifier[R] operator[>] identifier[pattern] operator[:] identifier[patterns] operator[SEP] { Keyword[if] operator[SEP] identifier[pattern] operator[SEP] identifier[matches] operator[SEP] identifier[value] operator[SEP] operator[SEP] { Keyword[return] identifier[pattern] operator[SEP] identifier[apply] operator[SEP] identifier[value] operator[SEP] operator[SEP] } } Keyword[throw] Keyword[new] identifier[MatchException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP] }
private Stmt.Fail parseFailStatement(EnclosingScope scope) { int start = index; // Match the fail keyword match(Fail); int end = index; matchEndLine(); // Done. return annotateSourceLocation(new Stmt.Fail(),start,end-1); }
class class_name[name] begin[{] method[parseFailStatement, return_type[type[Stmt]], modifier[private], parameter[scope]] begin[{] local_variable[type[int], start] call[.match, parameter[member[.Fail]]] local_variable[type[int], end] call[.matchEndLine, parameter[]] return[call[.annotateSourceLocation, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Stmt, sub_type=ReferenceType(arguments=None, dimensions=None, name=Fail, sub_type=None))), member[.start], binary_operation[member[.end], -, literal[1]]]]] end[}] END[}]
Keyword[private] identifier[Stmt] operator[SEP] identifier[Fail] identifier[parseFailStatement] operator[SEP] identifier[EnclosingScope] identifier[scope] operator[SEP] { Keyword[int] identifier[start] operator[=] identifier[index] operator[SEP] identifier[match] operator[SEP] identifier[Fail] operator[SEP] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[index] operator[SEP] identifier[matchEndLine] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[annotateSourceLocation] operator[SEP] Keyword[new] identifier[Stmt] operator[SEP] identifier[Fail] operator[SEP] operator[SEP] , identifier[start] , identifier[end] operator[-] Other[1] operator[SEP] operator[SEP] }
@Override public InputHandler getInputHandler(ProtocolType type, SIBUuid8 sourceMEUuid, JsMessage msg) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getInputHandler", new Object[] { type, sourceMEUuid, msg }); InputHandler msgHandler = null; if (type == ProtocolType.UNICASTINPUT) { msgHandler = getInputHandler(); } else if (type == ProtocolType.PUBSUBINPUT) { msgHandler = getInputHandler(); } else if (type == ProtocolType.ANYCASTINPUT) { // For durable, AIHs are referenced by pseudo destination ID so check for that first SIBUuid12 destID = msg.getGuaranteedTargetDestinationDefinitionUUID(); SIBUuid12 gatheringTargetDestUuid = msg.getGuaranteedGatheringTargetUUID(); msgHandler = _protoRealization. getRemoteSupport(). getAnycastInputHandlerByPseudoDestId(destID); // Otherwise, use the uuid of the sourceCellule ME to find the RCD to deliver the message. We assume that this // uuid corresponds to that used to choose the RCD initially, and that was used by the associated // AIH as the uuid of the DME to which it sent the request for the message. if (msgHandler == null) msgHandler = getAnycastInputHandler(sourceMEUuid, gatheringTargetDestUuid, true); } //else //{ //unsupported protocol type //return null //} if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getInputHandler", msgHandler); return msgHandler; }
class class_name[name] begin[{] method[getInputHandler, return_type[type[InputHandler]], modifier[public], parameter[type, sourceMEUuid, msg]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["getInputHandler"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sourceMEUuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[InputHandler], msgHandler] if[binary_operation[member[.type], ==, member[ProtocolType.UNICASTINPUT]]] begin[{] assign[member[.msgHandler], call[.getInputHandler, parameter[]]] else begin[{] if[binary_operation[member[.type], ==, member[ProtocolType.PUBSUBINPUT]]] begin[{] assign[member[.msgHandler], call[.getInputHandler, parameter[]]] else begin[{] if[binary_operation[member[.type], ==, member[ProtocolType.ANYCASTINPUT]]] begin[{] local_variable[type[SIBUuid12], destID] local_variable[type[SIBUuid12], gatheringTargetDestUuid] assign[member[.msgHandler], call[_protoRealization.getRemoteSupport, parameter[]]] if[binary_operation[member[.msgHandler], ==, literal[null]]] begin[{] assign[member[.msgHandler], call[.getAnycastInputHandler, parameter[member[.sourceMEUuid], member[.gatheringTargetDestUuid], literal[true]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["getInputHandler"], member[.msgHandler]]] else begin[{] None end[}] return[member[.msgHandler]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[InputHandler] identifier[getInputHandler] operator[SEP] identifier[ProtocolType] identifier[type] , identifier[SIBUuid8] identifier[sourceMEUuid] , identifier[JsMessage] identifier[msg] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[type] , identifier[sourceMEUuid] , identifier[msg] } operator[SEP] operator[SEP] identifier[InputHandler] identifier[msgHandler] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ProtocolType] operator[SEP] identifier[UNICASTINPUT] operator[SEP] { identifier[msgHandler] operator[=] identifier[getInputHandler] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ProtocolType] operator[SEP] identifier[PUBSUBINPUT] operator[SEP] { identifier[msgHandler] operator[=] identifier[getInputHandler] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ProtocolType] operator[SEP] identifier[ANYCASTINPUT] operator[SEP] { identifier[SIBUuid12] identifier[destID] operator[=] identifier[msg] operator[SEP] identifier[getGuaranteedTargetDestinationDefinitionUUID] operator[SEP] operator[SEP] operator[SEP] identifier[SIBUuid12] identifier[gatheringTargetDestUuid] operator[=] identifier[msg] operator[SEP] identifier[getGuaranteedGatheringTargetUUID] operator[SEP] operator[SEP] operator[SEP] identifier[msgHandler] operator[=] identifier[_protoRealization] operator[SEP] identifier[getRemoteSupport] operator[SEP] operator[SEP] operator[SEP] identifier[getAnycastInputHandlerByPseudoDestId] operator[SEP] identifier[destID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msgHandler] operator[==] Other[null] operator[SEP] identifier[msgHandler] operator[=] identifier[getAnycastInputHandler] operator[SEP] identifier[sourceMEUuid] , identifier[gatheringTargetDestUuid] , literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[msgHandler] operator[SEP] operator[SEP] Keyword[return] identifier[msgHandler] operator[SEP] }
public void setAddRouteTableIds(java.util.Collection<String> addRouteTableIds) { if (addRouteTableIds == null) { this.addRouteTableIds = null; return; } this.addRouteTableIds = new com.amazonaws.internal.SdkInternalList<String>(addRouteTableIds); }
class class_name[name] begin[{] method[setAddRouteTableIds, return_type[void], modifier[public], parameter[addRouteTableIds]] begin[{] if[binary_operation[member[.addRouteTableIds], ==, literal[null]]] begin[{] assign[THIS[member[None.addRouteTableIds]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.addRouteTableIds]], ClassCreator(arguments=[MemberReference(member=addRouteTableIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAddRouteTableIds] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[addRouteTableIds] operator[SEP] { Keyword[if] operator[SEP] identifier[addRouteTableIds] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[addRouteTableIds] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[addRouteTableIds] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[addRouteTableIds] operator[SEP] operator[SEP] }
protected List<ServletDefinition> initServlets( List<ServletDefinition> servletDefinitions) throws Exception { // Sort the list taking in account the load-on-startup attribute Collections.sort(servletDefinitions); // Sets the Jawr context at "bundle processing at build time" ThreadLocalJawrContext.setBundleProcessingAtBuildTime(true); List<ServletDefinition> jawrServletDefinitions = new ArrayList<ServletDefinition>(); for (Iterator<ServletDefinition> iterator = servletDefinitions .iterator(); iterator.hasNext();) { ServletDefinition servletDefinition = (ServletDefinition) iterator .next(); servletDefinition.initServlet(); if (servletDefinition.isJawrServletDefinition()) { jawrServletDefinitions.add(servletDefinition); } } return jawrServletDefinitions; }
class class_name[name] begin[{] method[initServlets, return_type[type[List]], modifier[protected], parameter[servletDefinitions]] begin[{] call[Collections.sort, parameter[member[.servletDefinitions]]] call[ThreadLocalJawrContext.setBundleProcessingAtBuildTime, parameter[literal[true]]] local_variable[type[List], jawrServletDefinitions] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ServletDefinition, sub_type=None)), name=servletDefinition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServletDefinition, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=initServlet, postfix_operators=[], prefix_operators=[], qualifier=servletDefinition, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isJawrServletDefinition, postfix_operators=[], prefix_operators=[], qualifier=servletDefinition, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=servletDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=jawrServletDefinitions, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=servletDefinitions, selectors=[], type_arguments=None), name=iterator)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServletDefinition, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) return[member[.jawrServletDefinitions]] end[}] END[}]
Keyword[protected] identifier[List] operator[<] identifier[ServletDefinition] operator[>] identifier[initServlets] operator[SEP] identifier[List] operator[<] identifier[ServletDefinition] operator[>] identifier[servletDefinitions] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[servletDefinitions] operator[SEP] operator[SEP] identifier[ThreadLocalJawrContext] operator[SEP] identifier[setBundleProcessingAtBuildTime] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ServletDefinition] operator[>] identifier[jawrServletDefinitions] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ServletDefinition] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[ServletDefinition] operator[>] identifier[iterator] operator[=] identifier[servletDefinitions] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[ServletDefinition] identifier[servletDefinition] operator[=] operator[SEP] identifier[ServletDefinition] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[servletDefinition] operator[SEP] identifier[initServlet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[servletDefinition] operator[SEP] identifier[isJawrServletDefinition] operator[SEP] operator[SEP] operator[SEP] { identifier[jawrServletDefinitions] operator[SEP] identifier[add] operator[SEP] identifier[servletDefinition] operator[SEP] operator[SEP] } } Keyword[return] identifier[jawrServletDefinitions] operator[SEP] }
public void setParameterDefinitions(java.util.Collection<ParameterDefinition> parameterDefinitions) { if (parameterDefinitions == null) { this.parameterDefinitions = null; return; } this.parameterDefinitions = new java.util.ArrayList<ParameterDefinition>(parameterDefinitions); }
class class_name[name] begin[{] method[setParameterDefinitions, return_type[void], modifier[public], parameter[parameterDefinitions]] begin[{] if[binary_operation[member[.parameterDefinitions], ==, literal[null]]] begin[{] assign[THIS[member[None.parameterDefinitions]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.parameterDefinitions]], ClassCreator(arguments=[MemberReference(member=parameterDefinitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ParameterDefinition, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setParameterDefinitions] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ParameterDefinition] operator[>] identifier[parameterDefinitions] operator[SEP] { Keyword[if] operator[SEP] identifier[parameterDefinitions] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[parameterDefinitions] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[parameterDefinitions] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ParameterDefinition] operator[>] operator[SEP] identifier[parameterDefinitions] operator[SEP] operator[SEP] }
public <S, T> Converter<S, T> findConverter(ConverterKey<S,T> key) { // We check once before attempting introspection so we avoid that if possible @SuppressWarnings("unchecked") Converter<S,T> converter = (Converter<S, T>) registeredConverters.get(key); if (converter != null) { return converter; } // Now try introspecting the relevant class registerAnnotatedClasses(key.getInputClass(), key.getOutputClass()); @SuppressWarnings("unchecked") Converter<S,T> myConverter = (Converter<S, T>) registeredConverters.get(key); return myConverter; }
class class_name[name] begin[{] method[findConverter, return_type[type[Converter]], modifier[public], parameter[key]] begin[{] local_variable[type[Converter], converter] if[binary_operation[member[.converter], !=, literal[null]]] begin[{] return[member[.converter]] else begin[{] None end[}] call[.registerAnnotatedClasses, parameter[call[key.getInputClass, parameter[]], call[key.getOutputClass, parameter[]]]] local_variable[type[Converter], myConverter] return[member[.myConverter]] end[}] END[}]
Keyword[public] operator[<] identifier[S] , identifier[T] operator[>] identifier[Converter] operator[<] identifier[S] , identifier[T] operator[>] identifier[findConverter] operator[SEP] identifier[ConverterKey] operator[<] identifier[S] , identifier[T] operator[>] identifier[key] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Converter] operator[<] identifier[S] , identifier[T] operator[>] identifier[converter] operator[=] operator[SEP] identifier[Converter] operator[<] identifier[S] , identifier[T] operator[>] operator[SEP] identifier[registeredConverters] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[converter] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[converter] operator[SEP] } identifier[registerAnnotatedClasses] operator[SEP] identifier[key] operator[SEP] identifier[getInputClass] operator[SEP] operator[SEP] , identifier[key] operator[SEP] identifier[getOutputClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Converter] operator[<] identifier[S] , identifier[T] operator[>] identifier[myConverter] operator[=] operator[SEP] identifier[Converter] operator[<] identifier[S] , identifier[T] operator[>] operator[SEP] identifier[registeredConverters] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] identifier[myConverter] operator[SEP] }
public synchronized ID removeOnline(final USER user) { final ID sessionId = usersOnline.remove(user); if (sessionId != null) { sessionIdToUser.remove(sessionId); } return sessionId; }
class class_name[name] begin[{] method[removeOnline, return_type[type[ID]], modifier[synchronized public], parameter[user]] begin[{] local_variable[type[ID], sessionId] if[binary_operation[member[.sessionId], !=, literal[null]]] begin[{] call[sessionIdToUser.remove, parameter[member[.sessionId]]] else begin[{] None end[}] return[member[.sessionId]] end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[ID] identifier[removeOnline] operator[SEP] Keyword[final] identifier[USER] identifier[user] operator[SEP] { Keyword[final] identifier[ID] identifier[sessionId] operator[=] identifier[usersOnline] operator[SEP] identifier[remove] operator[SEP] identifier[user] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sessionId] operator[!=] Other[null] operator[SEP] { identifier[sessionIdToUser] operator[SEP] identifier[remove] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] } Keyword[return] identifier[sessionId] operator[SEP] }
public static boolean isPrimitive(Class<?> aClass) { if(aClass == null) return false; String className = aClass.getName(); return className.matches("(float|char|short|double|int|long|byte|boolean|(java.lang.(Long|Integer|String|Float|Double|Short|Byte|Boolean)))"); }
class class_name[name] begin[{] method[isPrimitive, return_type[type[boolean]], modifier[public static], parameter[aClass]] begin[{] if[binary_operation[member[.aClass], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[String], className] return[call[className.matches, parameter[literal["(float|char|short|double|int|long|byte|boolean|(java.lang.(Long|Integer|String|Float|Double|Short|Byte|Boolean)))"]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isPrimitive] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[aClass] operator[SEP] { Keyword[if] operator[SEP] identifier[aClass] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[String] identifier[className] operator[=] identifier[aClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[className] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public static CommercePriceEntry[] findByCPInstanceUuid_PrevAndNext( long commercePriceEntryId, String CPInstanceUuid, OrderByComparator<CommercePriceEntry> orderByComparator) throws com.liferay.commerce.price.list.exception.NoSuchPriceEntryException { return getPersistence() .findByCPInstanceUuid_PrevAndNext(commercePriceEntryId, CPInstanceUuid, orderByComparator); }
class class_name[name] begin[{] method[findByCPInstanceUuid_PrevAndNext, return_type[type[CommercePriceEntry]], modifier[public static], parameter[commercePriceEntryId, CPInstanceUuid, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommercePriceEntry] operator[SEP] operator[SEP] identifier[findByCPInstanceUuid_PrevAndNext] operator[SEP] Keyword[long] identifier[commercePriceEntryId] , identifier[String] identifier[CPInstanceUuid] , identifier[OrderByComparator] operator[<] identifier[CommercePriceEntry] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[price] operator[SEP] identifier[list] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchPriceEntryException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByCPInstanceUuid_PrevAndNext] operator[SEP] identifier[commercePriceEntryId] , identifier[CPInstanceUuid] , identifier[orderByComparator] operator[SEP] operator[SEP] }
protected void stopJob(Thread thread, Object job) { if (job instanceof Socket) { try { ((Socket) job).close(); } catch (Exception e) { LogSupport.ignore(log, e); } } super.stopJob(thread, job); }
class class_name[name] begin[{] method[stopJob, return_type[void], modifier[protected], parameter[thread, job]] begin[{] if[binary_operation[member[.job], instanceof, type[Socket]]] begin[{] TryStatement(block=[StatementExpression(expression=Cast(expression=MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Socket, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ignore, postfix_operators=[], prefix_operators=[], qualifier=LogSupport, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=thread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stopJob, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[stopJob] operator[SEP] identifier[Thread] identifier[thread] , identifier[Object] identifier[job] operator[SEP] { Keyword[if] operator[SEP] identifier[job] Keyword[instanceof] identifier[Socket] operator[SEP] { Keyword[try] { operator[SEP] operator[SEP] identifier[Socket] operator[SEP] identifier[job] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LogSupport] operator[SEP] identifier[ignore] operator[SEP] identifier[log] , identifier[e] operator[SEP] operator[SEP] } } Keyword[super] operator[SEP] identifier[stopJob] operator[SEP] identifier[thread] , identifier[job] operator[SEP] operator[SEP] }
public static void setDefaultSSLSocketFactory(SSLSocketFactory sf) { if (sf == null) { throw new IllegalArgumentException( "no default SSLSocketFactory specified"); } SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkSetFactory(); } defaultSSLSocketFactory = sf; }
class class_name[name] begin[{] method[setDefaultSSLSocketFactory, return_type[void], modifier[public static], parameter[sf]] begin[{] if[binary_operation[member[.sf], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no default SSLSocketFactory specified")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[SecurityManager], sm] if[binary_operation[member[.sm], !=, literal[null]]] begin[{] call[sm.checkSetFactory, parameter[]] else begin[{] None end[}] assign[member[.defaultSSLSocketFactory], member[.sf]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setDefaultSSLSocketFactory] operator[SEP] identifier[SSLSocketFactory] identifier[sf] operator[SEP] { Keyword[if] operator[SEP] identifier[sf] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[SecurityManager] identifier[sm] operator[=] identifier[System] operator[SEP] identifier[getSecurityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sm] operator[!=] Other[null] operator[SEP] { identifier[sm] operator[SEP] identifier[checkSetFactory] operator[SEP] operator[SEP] operator[SEP] } identifier[defaultSSLSocketFactory] operator[=] identifier[sf] operator[SEP] }
public AwsSecurityFindingFilters withResourceAwsEc2InstanceKeyName(StringFilter... resourceAwsEc2InstanceKeyName) { if (this.resourceAwsEc2InstanceKeyName == null) { setResourceAwsEc2InstanceKeyName(new java.util.ArrayList<StringFilter>(resourceAwsEc2InstanceKeyName.length)); } for (StringFilter ele : resourceAwsEc2InstanceKeyName) { this.resourceAwsEc2InstanceKeyName.add(ele); } return this; }
class class_name[name] begin[{] method[withResourceAwsEc2InstanceKeyName, return_type[type[AwsSecurityFindingFilters]], modifier[public], parameter[resourceAwsEc2InstanceKeyName]] begin[{] if[binary_operation[THIS[member[None.resourceAwsEc2InstanceKeyName]], ==, literal[null]]] begin[{] call[.setResourceAwsEc2InstanceKeyName, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resourceAwsEc2InstanceKeyName, 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=StringFilter, 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=resourceAwsEc2InstanceKeyName, 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=resourceAwsEc2InstanceKeyName, 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=StringFilter, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[AwsSecurityFindingFilters] identifier[withResourceAwsEc2InstanceKeyName] operator[SEP] identifier[StringFilter] operator[...] identifier[resourceAwsEc2InstanceKeyName] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[resourceAwsEc2InstanceKeyName] operator[==] Other[null] operator[SEP] { identifier[setResourceAwsEc2InstanceKeyName] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[StringFilter] operator[>] operator[SEP] identifier[resourceAwsEc2InstanceKeyName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[StringFilter] identifier[ele] operator[:] identifier[resourceAwsEc2InstanceKeyName] operator[SEP] { Keyword[this] operator[SEP] identifier[resourceAwsEc2InstanceKeyName] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public com.liferay.commerce.shipping.engine.fixed.service.CommerceShippingFixedOptionLocalService getCommerceShippingFixedOptionLocalService() { return commerceShippingFixedOptionLocalService; }
class class_name[name] begin[{] method[getCommerceShippingFixedOptionLocalService, return_type[type[com]], modifier[public], parameter[]] begin[{] return[member[.commerceShippingFixedOptionLocalService]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[shipping] operator[SEP] identifier[engine] operator[SEP] identifier[fixed] operator[SEP] identifier[service] operator[SEP] identifier[CommerceShippingFixedOptionLocalService] identifier[getCommerceShippingFixedOptionLocalService] operator[SEP] operator[SEP] { Keyword[return] identifier[commerceShippingFixedOptionLocalService] operator[SEP] }
public String setAttribute(final String name, final String value) { if(null!=value){ return getAttributes().put(name, value); }else{ getAttributes().remove(name); return value; } }
class class_name[name] begin[{] method[setAttribute, return_type[type[String]], modifier[public], parameter[name, value]] begin[{] if[binary_operation[literal[null], !=, member[.value]]] begin[{] return[call[.getAttributes, parameter[]]] else begin[{] call[.getAttributes, parameter[]] return[member[.value]] end[}] end[}] END[}]
Keyword[public] identifier[String] identifier[setAttribute] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[value] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[value] operator[SEP] { Keyword[return] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] } }
protected void createFrontLogoutActionState(final Flow flow) { val actionState = createActionState(flow, CasWebflowConstants.STATE_ID_FRONT_LOGOUT, createEvaluateAction("frontChannelLogoutAction")); createTransitionForState(actionState, CasWebflowConstants.TRANSITION_ID_FINISH, CasWebflowConstants.STATE_ID_FINISH_LOGOUT); createTransitionForState(actionState, CasWebflowConstants.TRANSITION_ID_PROPAGATE, CasWebflowConstants.STATE_ID_PROPAGATE_LOGOUT_REQUESTS); }
class class_name[name] begin[{] method[createFrontLogoutActionState, return_type[void], modifier[protected], parameter[flow]] begin[{] local_variable[type[val], actionState] call[.createTransitionForState, parameter[member[.actionState], member[CasWebflowConstants.TRANSITION_ID_FINISH], member[CasWebflowConstants.STATE_ID_FINISH_LOGOUT]]] call[.createTransitionForState, parameter[member[.actionState], member[CasWebflowConstants.TRANSITION_ID_PROPAGATE], member[CasWebflowConstants.STATE_ID_PROPAGATE_LOGOUT_REQUESTS]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[createFrontLogoutActionState] operator[SEP] Keyword[final] identifier[Flow] identifier[flow] operator[SEP] { identifier[val] identifier[actionState] operator[=] identifier[createActionState] operator[SEP] identifier[flow] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_FRONT_LOGOUT] , identifier[createEvaluateAction] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[createTransitionForState] operator[SEP] identifier[actionState] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_FINISH] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_FINISH_LOGOUT] operator[SEP] operator[SEP] identifier[createTransitionForState] operator[SEP] identifier[actionState] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_PROPAGATE] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_PROPAGATE_LOGOUT_REQUESTS] operator[SEP] operator[SEP] }
public static Response call(String server, String service, DataObject data, String... params) { return call(server, service, false, data, params); }
class class_name[name] begin[{] method[call, return_type[type[Response]], modifier[public static], parameter[server, service, data, params]] begin[{] return[call[.call, parameter[member[.server], member[.service], literal[false], member[.data], member[.params]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Response] identifier[call] operator[SEP] identifier[String] identifier[server] , identifier[String] identifier[service] , identifier[DataObject] identifier[data] , identifier[String] operator[...] identifier[params] operator[SEP] { Keyword[return] identifier[call] operator[SEP] identifier[server] , identifier[service] , literal[boolean] , identifier[data] , identifier[params] operator[SEP] operator[SEP] }
@Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String api = request.getParameter("api"); if (api == null || api.length() == 0) { response.setContentType("text/html; charset=UTF-8"); getIndex(response.getWriter()); } else { response.setContentType("text/xml; charset=UTF-8"); getWSDL(api.toUpperCase(), request.getRequestURL() .toString(), response.getWriter()); } response.flushBuffer(); }
class class_name[name] begin[{] method[doGet, return_type[void], modifier[public], parameter[request, response]] begin[{] local_variable[type[String], api] if[binary_operation[binary_operation[member[.api], ==, literal[null]], ||, binary_operation[call[api.length, parameter[]], ==, literal[0]]]] begin[{] call[response.setContentType, parameter[literal["text/html; charset=UTF-8"]]] call[.getIndex, parameter[call[response.getWriter, parameter[]]]] else begin[{] call[response.setContentType, parameter[literal["text/xml; charset=UTF-8"]]] call[.getWSDL, parameter[call[api.toUpperCase, parameter[]], call[request.getRequestURL, parameter[]], call[response.getWriter, parameter[]]]] end[}] call[response.flushBuffer, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doGet] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { identifier[String] identifier[api] operator[=] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[api] operator[==] Other[null] operator[||] identifier[api] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[response] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getIndex] operator[SEP] identifier[response] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[response] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getWSDL] operator[SEP] identifier[api] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] , identifier[request] operator[SEP] identifier[getRequestURL] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[response] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[response] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP] }
private void prefetchFromDestination() throws JMSException { // Lazy test, do not synchronize here but on response (see addToPrefetchQueue()) if (closed) return; if (traceEnabled) log.trace("#"+id+" Prefetching more from destination "+destination); // Ask for more PrefetchQuery query = new PrefetchQuery(); query.setSessionId(session.getId()); query.setConsumerId(id); transportEndpoint.nonBlockingRequest(query); }
class class_name[name] begin[{] method[prefetchFromDestination, return_type[void], modifier[private], parameter[]] begin[{] if[member[.closed]] begin[{] return[None] else begin[{] None end[}] if[member[.traceEnabled]] begin[{] call[log.trace, parameter[binary_operation[binary_operation[binary_operation[literal["#"], +, member[.id]], +, literal[" Prefetching more from destination "]], +, member[.destination]]]] else begin[{] None end[}] local_variable[type[PrefetchQuery], query] call[query.setSessionId, parameter[call[session.getId, parameter[]]]] call[query.setConsumerId, parameter[member[.id]]] call[transportEndpoint.nonBlockingRequest, parameter[member[.query]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[prefetchFromDestination] operator[SEP] operator[SEP] Keyword[throws] identifier[JMSException] { Keyword[if] operator[SEP] identifier[closed] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[traceEnabled] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[destination] operator[SEP] operator[SEP] identifier[PrefetchQuery] identifier[query] operator[=] Keyword[new] identifier[PrefetchQuery] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setSessionId] operator[SEP] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setConsumerId] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[transportEndpoint] operator[SEP] identifier[nonBlockingRequest] operator[SEP] identifier[query] operator[SEP] operator[SEP] }
public static double innerProdA(DMatrixD1 x, DMatrixD1 A , DMatrixD1 y ) { int n = A.numRows; int m = A.numCols; if( x.getNumElements() != n ) throw new IllegalArgumentException("Unexpected number of elements in x"); if( y.getNumElements() != m ) throw new IllegalArgumentException("Unexpected number of elements in y"); double result = 0; for( int i = 0; i < m; i++ ) { double total = 0; for( int j = 0; j < n; j++ ) { total += x.get(j)*A.unsafe_get(j,i); } result += total*y.get(i); } return result; }
class class_name[name] begin[{] method[innerProdA, return_type[type[double]], modifier[public static], parameter[x, A, y]] begin[{] local_variable[type[int], n] local_variable[type[int], m] if[binary_operation[call[x.getNumElements, parameter[]], !=, member[.n]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected number of elements in x")], 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[call[y.getNumElements, parameter[]], !=, member[.m]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected number of elements in y")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[double], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=total)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unsafe_get, postfix_operators=[], prefix_operators=[], qualifier=A, selectors=[], type_arguments=None), operator=*)), 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=y, selectors=[], type_arguments=None), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[innerProdA] operator[SEP] identifier[DMatrixD1] identifier[x] , identifier[DMatrixD1] identifier[A] , identifier[DMatrixD1] identifier[y] operator[SEP] { Keyword[int] identifier[n] operator[=] identifier[A] operator[SEP] identifier[numRows] operator[SEP] Keyword[int] identifier[m] operator[=] identifier[A] operator[SEP] identifier[numCols] operator[SEP] Keyword[if] operator[SEP] identifier[x] operator[SEP] identifier[getNumElements] operator[SEP] operator[SEP] operator[!=] identifier[n] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[y] operator[SEP] identifier[getNumElements] operator[SEP] operator[SEP] operator[!=] identifier[m] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[double] identifier[result] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[m] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[total] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[n] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[total] operator[+=] identifier[x] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[*] identifier[A] operator[SEP] identifier[unsafe_get] operator[SEP] identifier[j] , identifier[i] operator[SEP] operator[SEP] } identifier[result] operator[+=] identifier[total] operator[*] identifier[y] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public void setJobNames(java.util.Collection<String> jobNames) { if (jobNames == null) { this.jobNames = null; return; } this.jobNames = new java.util.ArrayList<String>(jobNames); }
class class_name[name] begin[{] method[setJobNames, return_type[void], modifier[public], parameter[jobNames]] begin[{] if[binary_operation[member[.jobNames], ==, literal[null]]] begin[{] assign[THIS[member[None.jobNames]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.jobNames]], ClassCreator(arguments=[MemberReference(member=jobNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setJobNames] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[jobNames] operator[SEP] { Keyword[if] operator[SEP] identifier[jobNames] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[jobNames] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[jobNames] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[jobNames] operator[SEP] operator[SEP] }
public static <T> T[] getAny(Object array, int... indexes) { if(null == array) { return null; } final T[] result = newArray(array.getClass().getComponentType(), indexes.length); for (int i : indexes) { result[i] = get(array, i); } return result; }
class class_name[name] begin[{] method[getAny, return_type[type[T]], modifier[public static], parameter[array, indexes]] begin[{] if[binary_operation[literal[null], ==, member[.array]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[T], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=indexes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[getAny] operator[SEP] identifier[Object] identifier[array] , Keyword[int] operator[...] identifier[indexes] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[array] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[newArray] operator[SEP] identifier[array] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[indexes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[:] identifier[indexes] operator[SEP] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[get] operator[SEP] identifier[array] , identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static SmartBinder from(Class<?> retType, String[] names, Class<?>... types) { return from(Signature.returning(retType).appendArgs(names, types)); }
class class_name[name] begin[{] method[from, return_type[type[SmartBinder]], modifier[public static], parameter[retType, names, types]] begin[{] return[call[.from, parameter[call[Signature.returning, parameter[member[.retType]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SmartBinder] identifier[from] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[retType] , identifier[String] operator[SEP] operator[SEP] identifier[names] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[types] operator[SEP] { Keyword[return] identifier[from] operator[SEP] identifier[Signature] operator[SEP] identifier[returning] operator[SEP] identifier[retType] operator[SEP] operator[SEP] identifier[appendArgs] operator[SEP] identifier[names] , identifier[types] operator[SEP] operator[SEP] operator[SEP] }
private static <L extends Annotation> String defineOrderByStatement(final SQLiteModelMethod method, final JQL result, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) { StringBuilder builder = new StringBuilder(); String orderBy = AnnotationUtility.extractAsString(method.getElement(), annotation, AnnotationAttributeType.ORDER_BY); if (StringUtils.hasText(orderBy)) { result.annotatedOrderBy = true; } final One<String> orderDynamicName = new One<String>(null); forEachParameter(method, new OnMethodParameterListener() { @Override public void onMethodParameter(VariableElement methodParam) { if (methodParam.getAnnotation(BindSqlDynamicOrderBy.class) != null) { orderDynamicName.value0 = methodParam.getSimpleName().toString(); result.paramOrderBy = orderDynamicName.value0; // CONSTRAINT: @BindSqlOrderBy can be used only on String // parameter type AssertKripton.assertTrueOrInvalidTypeForAnnotationMethodParameterException(TypeUtility.isEquals(TypeUtility.typeName(String.class), TypeUtility.typeName(methodParam)), method.getParent().getElement(), method.getElement(), methodParam, BindSqlDynamicOrderBy.class); } } }); if (StringUtils.hasText(orderBy) || StringUtils.hasText(orderDynamicName.value0)) { builder.append(" " + ORDER_BY_KEYWORD); if (StringUtils.hasText(orderBy)) { result.staticOrderBy = true; builder.append(StringUtils.startWithSpace(orderBy)); } StringBuilder dynamicBuffer = new StringBuilder(); if (StringUtils.hasText(orderDynamicName.value0)) { if (StringUtils.hasText(orderBy)) { dynamicBuffer.append(","); builder.append(","); } dynamicBuffer.append(" #{" + JQLDynamicStatementType.DYNAMIC_ORDER_BY + "}"); builder.append(" #{" + JQLDynamicStatementType.DYNAMIC_ORDER_BY + "}"); // define replacement string for WHERE dynamicReplace.put(JQLDynamicStatementType.DYNAMIC_ORDER_BY, dynamicBuffer.toString()); } } return builder.toString(); }
class class_name[name] begin[{] method[defineOrderByStatement, return_type[type[String]], modifier[private static], parameter[method, result, annotation, dynamicReplace]] begin[{] local_variable[type[StringBuilder], builder] local_variable[type[String], orderBy] if[call[StringUtils.hasText, parameter[member[.orderBy]]]] begin[{] assign[member[result.annotatedOrderBy], literal[true]] else begin[{] None end[}] local_variable[type[One], orderDynamicName] call[.forEachParameter, parameter[member[.method], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BindSqlDynamicOrderBy, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=methodParam, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value0, postfix_operators=[], prefix_operators=[], qualifier=orderDynamicName, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=methodParam, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramOrderBy, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MemberReference(member=value0, postfix_operators=[], prefix_operators=[], qualifier=orderDynamicName, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=TypeUtility, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=methodParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=TypeUtility, selectors=[], type_arguments=None)], member=isEquals, postfix_operators=[], prefix_operators=[], qualifier=TypeUtility, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[], member=getElement, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getElement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), MemberReference(member=methodParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BindSqlDynamicOrderBy, sub_type=None))], member=assertTrueOrInvalidTypeForAnnotationMethodParameterException, postfix_operators=[], prefix_operators=[], qualifier=AssertKripton, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=onMethodParameter, parameters=[FormalParameter(annotations=[], modifiers=set(), name=methodParam, type=ReferenceType(arguments=None, dimensions=[], name=VariableElement, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OnMethodParameterListener, sub_type=None))]] if[binary_operation[call[StringUtils.hasText, parameter[member[.orderBy]]], ||, call[StringUtils.hasText, parameter[member[orderDynamicName.value0]]]]] begin[{] call[builder.append, parameter[binary_operation[literal[" "], +, member[.ORDER_BY_KEYWORD]]]] if[call[StringUtils.hasText, parameter[member[.orderBy]]]] begin[{] assign[member[result.staticOrderBy], literal[true]] call[builder.append, parameter[call[StringUtils.startWithSpace, parameter[member[.orderBy]]]]] else begin[{] None end[}] local_variable[type[StringBuilder], dynamicBuffer] if[call[StringUtils.hasText, parameter[member[orderDynamicName.value0]]]] begin[{] if[call[StringUtils.hasText, parameter[member[.orderBy]]]] begin[{] call[dynamicBuffer.append, parameter[literal[","]]] call[builder.append, parameter[literal[","]]] else begin[{] None end[}] call[dynamicBuffer.append, parameter[binary_operation[binary_operation[literal[" #{"], +, member[JQLDynamicStatementType.DYNAMIC_ORDER_BY]], +, literal["}"]]]] call[builder.append, parameter[binary_operation[binary_operation[literal[" #{"], +, member[JQLDynamicStatementType.DYNAMIC_ORDER_BY]], +, literal["}"]]]] call[dynamicReplace.put, parameter[member[JQLDynamicStatementType.DYNAMIC_ORDER_BY], call[dynamicBuffer.toString, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[L] Keyword[extends] identifier[Annotation] operator[>] identifier[String] identifier[defineOrderByStatement] operator[SEP] Keyword[final] identifier[SQLiteModelMethod] identifier[method] , Keyword[final] identifier[JQL] identifier[result] , identifier[Class] operator[<] identifier[L] operator[>] identifier[annotation] , identifier[Map] operator[<] identifier[JQLDynamicStatementType] , identifier[String] operator[>] identifier[dynamicReplace] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[orderBy] operator[=] identifier[AnnotationUtility] operator[SEP] identifier[extractAsString] operator[SEP] identifier[method] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[annotation] , identifier[AnnotationAttributeType] operator[SEP] identifier[ORDER_BY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[orderBy] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedOrderBy] operator[=] literal[boolean] operator[SEP] } Keyword[final] identifier[One] operator[<] identifier[String] operator[>] identifier[orderDynamicName] operator[=] Keyword[new] identifier[One] operator[<] identifier[String] operator[>] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[forEachParameter] operator[SEP] identifier[method] , Keyword[new] identifier[OnMethodParameterListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onMethodParameter] operator[SEP] identifier[VariableElement] identifier[methodParam] operator[SEP] { Keyword[if] operator[SEP] identifier[methodParam] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[BindSqlDynamicOrderBy] operator[SEP] Keyword[class] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[orderDynamicName] operator[SEP] identifier[value0] operator[=] identifier[methodParam] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[paramOrderBy] operator[=] identifier[orderDynamicName] operator[SEP] identifier[value0] operator[SEP] identifier[AssertKripton] operator[SEP] identifier[assertTrueOrInvalidTypeForAnnotationMethodParameterException] operator[SEP] identifier[TypeUtility] operator[SEP] identifier[isEquals] operator[SEP] identifier[TypeUtility] operator[SEP] identifier[typeName] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] , identifier[TypeUtility] operator[SEP] identifier[typeName] operator[SEP] identifier[methodParam] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[methodParam] , identifier[BindSqlDynamicOrderBy] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[orderBy] operator[SEP] operator[||] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[orderDynamicName] operator[SEP] identifier[value0] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[ORDER_BY_KEYWORD] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[orderBy] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[staticOrderBy] operator[=] literal[boolean] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[StringUtils] operator[SEP] identifier[startWithSpace] operator[SEP] identifier[orderBy] operator[SEP] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[dynamicBuffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[orderDynamicName] operator[SEP] identifier[value0] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[orderBy] operator[SEP] operator[SEP] { identifier[dynamicBuffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[dynamicBuffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[JQLDynamicStatementType] operator[SEP] identifier[DYNAMIC_ORDER_BY] operator[+] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[JQLDynamicStatementType] operator[SEP] identifier[DYNAMIC_ORDER_BY] operator[+] literal[String] operator[SEP] operator[SEP] identifier[dynamicReplace] operator[SEP] identifier[put] operator[SEP] identifier[JQLDynamicStatementType] operator[SEP] identifier[DYNAMIC_ORDER_BY] , identifier[dynamicBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public TagCrawler removeHandler(String name) { if (handlers.containsKey(name)) { handlers.remove(name); } return this; }
class class_name[name] begin[{] method[removeHandler, return_type[type[TagCrawler]], modifier[public], parameter[name]] begin[{] if[call[handlers.containsKey, parameter[member[.name]]]] begin[{] call[handlers.remove, parameter[member[.name]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[TagCrawler] identifier[removeHandler] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[handlers] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[handlers] operator[SEP] identifier[remove] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@DoesServiceRequest public Iterable<CloudQueue> listQueues(final String prefix) { return this.listQueues(prefix, QueueListingDetails.NONE, null, null); }
class class_name[name] begin[{] method[listQueues, return_type[type[Iterable]], modifier[public], parameter[prefix]] begin[{] return[THIS[call[None.listQueues, parameter[member[.prefix], member[QueueListingDetails.NONE], literal[null], literal[null]]]]] end[}] END[}]
annotation[@] identifier[DoesServiceRequest] Keyword[public] identifier[Iterable] operator[<] identifier[CloudQueue] operator[>] identifier[listQueues] operator[SEP] Keyword[final] identifier[String] identifier[prefix] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[listQueues] operator[SEP] identifier[prefix] , identifier[QueueListingDetails] operator[SEP] identifier[NONE] , Other[null] , Other[null] operator[SEP] operator[SEP] }
public void addListeners() { this.getRecord(UserInfo.USER_INFO_FILE).getField(UserInfo.USER_NAME).setEnabled(false); this.readCurrentUser(); super.addListeners(); this.getMainRecord().addListener(new UserPasswordHandler(true)); }
class class_name[name] begin[{] method[addListeners, return_type[void], modifier[public], parameter[]] begin[{] THIS[call[None.getRecord, parameter[member[UserInfo.USER_INFO_FILE]]]call[None.getField, parameter[member[UserInfo.USER_NAME]]]call[None.setEnabled, parameter[literal[false]]]] THIS[call[None.readCurrentUser, parameter[]]] SuperMethodInvocation(arguments=[], member=addListeners, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) THIS[call[None.getMainRecord, parameter[]]call[None.addListener, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UserPasswordHandler, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addListeners] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[UserInfo] operator[SEP] identifier[USER_INFO_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[UserInfo] operator[SEP] identifier[USER_NAME] operator[SEP] operator[SEP] identifier[setEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[readCurrentUser] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[addListeners] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[UserPasswordHandler] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] }
public void setText(int index, String value) { set(selectField(TaskFieldLists.CUSTOM_TEXT, index), value); }
class class_name[name] begin[{] method[setText, return_type[void], modifier[public], parameter[index, value]] begin[{] call[.set, parameter[call[.selectField, parameter[member[TaskFieldLists.CUSTOM_TEXT], member[.index]]], member[.value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setText] operator[SEP] Keyword[int] identifier[index] , identifier[String] identifier[value] operator[SEP] { identifier[set] operator[SEP] identifier[selectField] operator[SEP] identifier[TaskFieldLists] operator[SEP] identifier[CUSTOM_TEXT] , identifier[index] operator[SEP] , identifier[value] operator[SEP] operator[SEP] }
public PoolListUsageMetricsHeaders withLastModified(DateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { this.lastModified = new DateTimeRfc1123(lastModified); } return this; }
class class_name[name] begin[{] method[withLastModified, return_type[type[PoolListUsageMetricsHeaders]], modifier[public], parameter[lastModified]] begin[{] if[binary_operation[member[.lastModified], ==, literal[null]]] begin[{] assign[THIS[member[None.lastModified]], literal[null]] else begin[{] assign[THIS[member[None.lastModified]], ClassCreator(arguments=[MemberReference(member=lastModified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRfc1123, sub_type=None))] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[PoolListUsageMetricsHeaders] identifier[withLastModified] operator[SEP] identifier[DateTime] identifier[lastModified] operator[SEP] { Keyword[if] operator[SEP] identifier[lastModified] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[lastModified] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[lastModified] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected TaskManagerSlot findMatchingSlot(ResourceProfile requestResourceProfile) { Iterator<Map.Entry<SlotID, TaskManagerSlot>> iterator = freeSlots.entrySet().iterator(); while (iterator.hasNext()) { TaskManagerSlot taskManagerSlot = iterator.next().getValue(); // sanity check Preconditions.checkState( taskManagerSlot.getState() == TaskManagerSlot.State.FREE, "TaskManagerSlot %s is not in state FREE but %s.", taskManagerSlot.getSlotId(), taskManagerSlot.getState()); if (taskManagerSlot.getResourceProfile().isMatching(requestResourceProfile)) { iterator.remove(); return taskManagerSlot; } } return null; }
class class_name[name] begin[{] method[findMatchingSlot, return_type[type[TaskManagerSlot]], modifier[protected], parameter[requestResourceProfile]] begin[{] local_variable[type[Iterator], iterator] while[call[iterator.hasNext, parameter[]]] begin[{] local_variable[type[TaskManagerSlot], taskManagerSlot] call[Preconditions.checkState, parameter[binary_operation[call[taskManagerSlot.getState, parameter[]], ==, member[TaskManagerSlot.State.FREE]], literal["TaskManagerSlot %s is not in state FREE but %s."], call[taskManagerSlot.getSlotId, parameter[]], call[taskManagerSlot.getState, parameter[]]]] if[call[taskManagerSlot.getResourceProfile, parameter[]]] begin[{] call[iterator.remove, parameter[]] return[member[.taskManagerSlot]] else begin[{] None end[}] end[}] return[literal[null]] end[}] END[}]
Keyword[protected] identifier[TaskManagerSlot] identifier[findMatchingSlot] operator[SEP] identifier[ResourceProfile] identifier[requestResourceProfile] operator[SEP] { identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[SlotID] , identifier[TaskManagerSlot] operator[>] operator[>] identifier[iterator] operator[=] identifier[freeSlots] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[TaskManagerSlot] identifier[taskManagerSlot] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[taskManagerSlot] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[==] identifier[TaskManagerSlot] operator[SEP] identifier[State] operator[SEP] identifier[FREE] , literal[String] , identifier[taskManagerSlot] operator[SEP] identifier[getSlotId] operator[SEP] operator[SEP] , identifier[taskManagerSlot] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[taskManagerSlot] operator[SEP] identifier[getResourceProfile] operator[SEP] operator[SEP] operator[SEP] identifier[isMatching] operator[SEP] identifier[requestResourceProfile] operator[SEP] operator[SEP] { identifier[iterator] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[taskManagerSlot] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static TileGrid getTileGridWGS84(BoundingBox boundingBox, int zoom) { int tilesPerLat = tilesPerWGS84LatSide(zoom); int tilesPerLon = tilesPerWGS84LonSide(zoom); double tileSizeLat = tileSizeLatPerWGS84Side(tilesPerLat); double tileSizeLon = tileSizeLonPerWGS84Side(tilesPerLon); int minX = (int) ((boundingBox.getMinLongitude() + ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) / tileSizeLon); double tempMaxX = (boundingBox.getMaxLongitude() + ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) / tileSizeLon; int maxX = (int) tempMaxX; if (tempMaxX % 1 == 0) { maxX--; } maxX = Math.min(maxX, tilesPerLon - 1); int minY = (int) (((boundingBox.getMaxLatitude() - ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT) * -1) / tileSizeLat); double tempMaxY = ((boundingBox.getMinLatitude() - ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT) * -1) / tileSizeLat; int maxY = (int) tempMaxY; if (tempMaxY % 1 == 0) { maxY--; } maxY = Math.min(maxY, tilesPerLat - 1); TileGrid grid = new TileGrid(minX, minY, maxX, maxY); return grid; }
class class_name[name] begin[{] method[getTileGridWGS84, return_type[type[TileGrid]], modifier[public static], parameter[boundingBox, zoom]] begin[{] local_variable[type[int], tilesPerLat] local_variable[type[int], tilesPerLon] local_variable[type[double], tileSizeLat] local_variable[type[double], tileSizeLon] local_variable[type[int], minX] local_variable[type[double], tempMaxX] local_variable[type[int], maxX] if[binary_operation[binary_operation[member[.tempMaxX], %, literal[1]], ==, literal[0]]] begin[{] member[.maxX] else begin[{] None end[}] assign[member[.maxX], call[Math.min, parameter[member[.maxX], binary_operation[member[.tilesPerLon], -, literal[1]]]]] local_variable[type[int], minY] local_variable[type[double], tempMaxY] local_variable[type[int], maxY] if[binary_operation[binary_operation[member[.tempMaxY], %, literal[1]], ==, literal[0]]] begin[{] member[.maxY] else begin[{] None end[}] assign[member[.maxY], call[Math.min, parameter[member[.maxY], binary_operation[member[.tilesPerLat], -, literal[1]]]]] local_variable[type[TileGrid], grid] return[member[.grid]] end[}] END[}]
Keyword[public] Keyword[static] identifier[TileGrid] identifier[getTileGridWGS84] operator[SEP] identifier[BoundingBox] identifier[boundingBox] , Keyword[int] identifier[zoom] operator[SEP] { Keyword[int] identifier[tilesPerLat] operator[=] identifier[tilesPerWGS84LatSide] operator[SEP] identifier[zoom] operator[SEP] operator[SEP] Keyword[int] identifier[tilesPerLon] operator[=] identifier[tilesPerWGS84LonSide] operator[SEP] identifier[zoom] operator[SEP] operator[SEP] Keyword[double] identifier[tileSizeLat] operator[=] identifier[tileSizeLatPerWGS84Side] operator[SEP] identifier[tilesPerLat] operator[SEP] operator[SEP] Keyword[double] identifier[tileSizeLon] operator[=] identifier[tileSizeLonPerWGS84Side] operator[SEP] identifier[tilesPerLon] operator[SEP] operator[SEP] Keyword[int] identifier[minX] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[boundingBox] operator[SEP] identifier[getMinLongitude] operator[SEP] operator[SEP] operator[+] identifier[ProjectionConstants] operator[SEP] identifier[WGS84_HALF_WORLD_LON_WIDTH] operator[SEP] operator[/] identifier[tileSizeLon] operator[SEP] operator[SEP] Keyword[double] identifier[tempMaxX] operator[=] operator[SEP] identifier[boundingBox] operator[SEP] identifier[getMaxLongitude] operator[SEP] operator[SEP] operator[+] identifier[ProjectionConstants] operator[SEP] identifier[WGS84_HALF_WORLD_LON_WIDTH] operator[SEP] operator[/] identifier[tileSizeLon] operator[SEP] Keyword[int] identifier[maxX] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[tempMaxX] operator[SEP] Keyword[if] operator[SEP] identifier[tempMaxX] operator[%] Other[1] operator[==] Other[0] operator[SEP] { identifier[maxX] operator[--] operator[SEP] } identifier[maxX] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[maxX] , identifier[tilesPerLon] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[minY] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[boundingBox] operator[SEP] identifier[getMaxLatitude] operator[SEP] operator[SEP] operator[-] identifier[ProjectionConstants] operator[SEP] identifier[WGS84_HALF_WORLD_LAT_HEIGHT] operator[SEP] operator[*] operator[-] Other[1] operator[SEP] operator[/] identifier[tileSizeLat] operator[SEP] operator[SEP] Keyword[double] identifier[tempMaxY] operator[=] operator[SEP] operator[SEP] identifier[boundingBox] operator[SEP] identifier[getMinLatitude] operator[SEP] operator[SEP] operator[-] identifier[ProjectionConstants] operator[SEP] identifier[WGS84_HALF_WORLD_LAT_HEIGHT] operator[SEP] operator[*] operator[-] Other[1] operator[SEP] operator[/] identifier[tileSizeLat] operator[SEP] Keyword[int] identifier[maxY] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[tempMaxY] operator[SEP] Keyword[if] operator[SEP] identifier[tempMaxY] operator[%] Other[1] operator[==] Other[0] operator[SEP] { identifier[maxY] operator[--] operator[SEP] } identifier[maxY] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[maxY] , identifier[tilesPerLat] operator[-] Other[1] operator[SEP] operator[SEP] identifier[TileGrid] identifier[grid] operator[=] Keyword[new] identifier[TileGrid] operator[SEP] identifier[minX] , identifier[minY] , identifier[maxX] , identifier[maxY] operator[SEP] operator[SEP] Keyword[return] identifier[grid] operator[SEP] }
@Nullable @OverrideOnDemand protected String getLoginName (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope) { return aRequestScope.params ().getAsString (CLogin.REQUEST_ATTR_USERID); }
class class_name[name] begin[{] method[getLoginName, return_type[type[String]], modifier[protected], parameter[aRequestScope]] begin[{] return[call[aRequestScope.params, parameter[]]] end[}] END[}]
annotation[@] identifier[Nullable] annotation[@] identifier[OverrideOnDemand] Keyword[protected] identifier[String] identifier[getLoginName] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[IRequestWebScopeWithoutResponse] identifier[aRequestScope] operator[SEP] { Keyword[return] identifier[aRequestScope] operator[SEP] identifier[params] operator[SEP] operator[SEP] operator[SEP] identifier[getAsString] operator[SEP] identifier[CLogin] operator[SEP] identifier[REQUEST_ATTR_USERID] operator[SEP] operator[SEP] }
@Override public Path toRealPath(final LinkOption... options) throws IOException { // All links are "real" (no symlinks) and absolute, so just return this (if exists) if (!this.fileSystem.getArchive().contains(this.path)) { throw new FileNotFoundException("Path points to a nonexistant file or directory: " + this.toString()); } return this; }
class class_name[name] begin[{] method[toRealPath, return_type[type[Path]], modifier[public], parameter[options]] begin[{] if[THIS[member[None.fileSystem]call[None.getArchive, parameter[]]call[None.contains, parameter[THIS[member[None.path]]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Path points to a nonexistant file or directory: "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileNotFoundException, sub_type=None)), label=None) else begin[{] None end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Path] identifier[toRealPath] operator[SEP] Keyword[final] identifier[LinkOption] operator[...] identifier[options] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[fileSystem] operator[SEP] identifier[getArchive] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] Keyword[this] operator[SEP] identifier[path] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[FileNotFoundException] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private static Configuration enableClusteringHashGroups(String cacheName, Configuration configuration) { if ( configuration.clustering().hash().groups().enabled() ) { return configuration; } LOG.clusteringHashGroupsMustBeEnabled( cacheName ); ConfigurationBuilder builder = new ConfigurationBuilder().read( configuration ); builder.clustering().hash().groups().enabled(); return builder.build(); }
class class_name[name] begin[{] method[enableClusteringHashGroups, return_type[type[Configuration]], modifier[private static], parameter[cacheName, configuration]] begin[{] if[call[configuration.clustering, parameter[]]] begin[{] return[member[.configuration]] else begin[{] None end[}] call[LOG.clusteringHashGroupsMustBeEnabled, parameter[member[.cacheName]]] local_variable[type[ConfigurationBuilder], builder] call[builder.clustering, parameter[]] return[call[builder.build, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Configuration] identifier[enableClusteringHashGroups] operator[SEP] identifier[String] identifier[cacheName] , identifier[Configuration] identifier[configuration] operator[SEP] { Keyword[if] operator[SEP] identifier[configuration] operator[SEP] identifier[clustering] operator[SEP] operator[SEP] operator[SEP] identifier[hash] operator[SEP] operator[SEP] operator[SEP] identifier[groups] operator[SEP] operator[SEP] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[configuration] operator[SEP] } identifier[LOG] operator[SEP] identifier[clusteringHashGroupsMustBeEnabled] operator[SEP] identifier[cacheName] operator[SEP] operator[SEP] identifier[ConfigurationBuilder] identifier[builder] operator[=] Keyword[new] identifier[ConfigurationBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[read] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[clustering] operator[SEP] operator[SEP] operator[SEP] identifier[hash] operator[SEP] operator[SEP] operator[SEP] identifier[groups] operator[SEP] operator[SEP] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(RemoveFlowOutputRequest removeFlowOutputRequest, ProtocolMarshaller protocolMarshaller) { if (removeFlowOutputRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(removeFlowOutputRequest.getFlowArn(), FLOWARN_BINDING); protocolMarshaller.marshall(removeFlowOutputRequest.getOutputArn(), OUTPUTARN_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[removeFlowOutputRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.removeFlowOutputRequest], ==, 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=getFlowArn, postfix_operators=[], prefix_operators=[], qualifier=removeFlowOutputRequest, selectors=[], type_arguments=None), MemberReference(member=FLOWARN_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=getOutputArn, postfix_operators=[], prefix_operators=[], qualifier=removeFlowOutputRequest, selectors=[], type_arguments=None), MemberReference(member=OUTPUTARN_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[RemoveFlowOutputRequest] identifier[removeFlowOutputRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[removeFlowOutputRequest] 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[removeFlowOutputRequest] operator[SEP] identifier[getFlowArn] operator[SEP] operator[SEP] , identifier[FLOWARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[removeFlowOutputRequest] operator[SEP] identifier[getOutputArn] operator[SEP] operator[SEP] , identifier[OUTPUTARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static <L, R> Either<L, R> right(R r) { return new Right<>(r); }
class class_name[name] begin[{] method[right, return_type[type[Either]], modifier[public static], parameter[r]] begin[{] return[ClassCreator(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Right, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[L] , identifier[R] operator[>] identifier[Either] operator[<] identifier[L] , identifier[R] operator[>] identifier[right] operator[SEP] identifier[R] identifier[r] operator[SEP] { Keyword[return] Keyword[new] identifier[Right] operator[<] operator[>] operator[SEP] identifier[r] operator[SEP] operator[SEP] }
public static String datetime(long millis) { if (sFormat == null) { sFormat = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("UTC"), US); } return sFormat.format(millis); }
class class_name[name] begin[{] method[datetime, return_type[type[String]], modifier[public static], parameter[millis]] begin[{] if[binary_operation[member[.sFormat], ==, literal[null]]] begin[{] assign[member[.sFormat], call[FastDateFormat.getInstance, parameter[literal["yyyy-MM-dd HH:mm:ss"], call[TimeZone.getTimeZone, parameter[literal["UTC"]]], member[.US]]]] else begin[{] None end[}] return[call[sFormat.format, parameter[member[.millis]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[datetime] operator[SEP] Keyword[long] identifier[millis] operator[SEP] { Keyword[if] operator[SEP] identifier[sFormat] operator[==] Other[null] operator[SEP] { identifier[sFormat] operator[=] identifier[FastDateFormat] operator[SEP] identifier[getInstance] operator[SEP] literal[String] , identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[SEP] , identifier[US] operator[SEP] operator[SEP] } Keyword[return] identifier[sFormat] operator[SEP] identifier[format] operator[SEP] identifier[millis] operator[SEP] operator[SEP] }