code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
@Deprecated public String registerDeviceWithId(String deviceId, String deviceName) throws ApiException, IOException { final Device d = new Device.Builder(projectId).id(deviceId).name(deviceName).build(); return registerDevice(d); }
class class_name[name] begin[{] method[registerDeviceWithId, return_type[type[String]], modifier[public], parameter[deviceId, deviceName]] begin[{] local_variable[type[Device], d] return[call[.registerDevice, parameter[member[.d]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] identifier[String] identifier[registerDeviceWithId] operator[SEP] identifier[String] identifier[deviceId] , identifier[String] identifier[deviceName] operator[SEP] Keyword[throws] identifier[ApiException] , identifier[IOException] { Keyword[final] identifier[Device] identifier[d] operator[=] Keyword[new] identifier[Device] operator[SEP] identifier[Builder] operator[SEP] identifier[projectId] operator[SEP] operator[SEP] identifier[id] operator[SEP] identifier[deviceId] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[deviceName] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[registerDevice] operator[SEP] identifier[d] operator[SEP] operator[SEP] }
public void initTimestamp() throws ChronosException, FatalChronosException { maxAssignedTimestamp = chronosServerWatcher.getPersistentTimestamp(); long newPersistentTimestamp = maxAssignedTimestamp + zkAdvanceTimestamp; chronosServerWatcher.setPersistentTimestamp(newPersistentTimestamp); LOG.info("Get persistent timestamp " + maxAssignedTimestamp + " and set " + newPersistentTimestamp + " in ZooKeeper"); }
class class_name[name] begin[{] method[initTimestamp, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.maxAssignedTimestamp], call[chronosServerWatcher.getPersistentTimestamp, parameter[]]] local_variable[type[long], newPersistentTimestamp] call[chronosServerWatcher.setPersistentTimestamp, parameter[member[.newPersistentTimestamp]]] call[LOG.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Get persistent timestamp "], +, member[.maxAssignedTimestamp]], +, literal[" and set "]], +, member[.newPersistentTimestamp]], +, literal[" in ZooKeeper"]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[initTimestamp] operator[SEP] operator[SEP] Keyword[throws] identifier[ChronosException] , identifier[FatalChronosException] { identifier[maxAssignedTimestamp] operator[=] identifier[chronosServerWatcher] operator[SEP] identifier[getPersistentTimestamp] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[newPersistentTimestamp] operator[=] identifier[maxAssignedTimestamp] operator[+] identifier[zkAdvanceTimestamp] operator[SEP] identifier[chronosServerWatcher] operator[SEP] identifier[setPersistentTimestamp] operator[SEP] identifier[newPersistentTimestamp] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[maxAssignedTimestamp] operator[+] literal[String] operator[+] identifier[newPersistentTimestamp] operator[+] literal[String] operator[SEP] operator[SEP] }
public <T> void invokeNodeRequest ( final NodeRequest request, final NodeRequestsListener<T> listener) { // if we're not on the dobjmgr thread, get there if (!_omgr.isDispatchThread()) { _omgr.postRunnable(new Runnable() { public void run () { invokeNodeRequest(request, listener); } }); return; } // serialize the action to make sure we can byte[] requestBytes = flattenRequest(request); // build a set of node names (including the local node) to which to send the request final Set<String> nodes = findApplicableNodes(request); if (nodes.isEmpty()) { listener.requestsProcessed(new NodeRequestsResultImpl<T>()); return; } final Map<String, T> results = Maps.newHashMap(); final Map<String, String> failures = Maps.newHashMap(); final AtomicInteger completedNodes = new AtomicInteger(); for (final String node : nodes) { invokeNodeRequest(node, requestBytes, new InvocationService.ResultListener() { public void requestProcessed (Object result) { // check off this node's successful response @SuppressWarnings("unchecked") T castResult = (T) result; results.put(node, castResult); nodeDone(); } public void requestFailed (String cause) { failures.put(node, cause); nodeDone(); } protected void nodeDone () { if (completedNodes.incrementAndGet() == nodes.size()) { // if all nodes have responded, let caller know listener.requestsProcessed(new NodeRequestsResultImpl<T>(results, failures)); } } }); } }
class class_name[name] begin[{] method[invokeNodeRequest, return_type[void], modifier[public], parameter[request, listener]] begin[{] if[call[_omgr.isDispatchThread, parameter[]]] begin[{] call[_omgr.postRunnable, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeNodeRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]] return[None] else begin[{] None end[}] local_variable[type[byte], requestBytes] local_variable[type[Set], nodes] if[call[nodes.isEmpty, parameter[]]] begin[{] call[listener.requestsProcessed, parameter[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=T, sub_type=None))], dimensions=None, name=NodeRequestsResultImpl, sub_type=None))]] return[None] else begin[{] None end[}] local_variable[type[Map], results] local_variable[type[Map], failures] local_variable[type[AtomicInteger], completedNodes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requestBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), name=castResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=castResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=nodeDone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=requestProcessed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=failures, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=nodeDone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=requestFailed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=cause, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=incrementAndGet, postfix_operators=[], prefix_operators=[], qualifier=completedNodes, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=failures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=NodeRequestsResultImpl, sub_type=None))], member=requestsProcessed, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'protected'}, name=nodeDone, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvocationService, sub_type=ReferenceType(arguments=None, dimensions=None, name=ResultListener, sub_type=None)))], member=invokeNodeRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[invokeNodeRequest] operator[SEP] Keyword[final] identifier[NodeRequest] identifier[request] , Keyword[final] identifier[NodeRequestsListener] operator[<] identifier[T] operator[>] identifier[listener] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[_omgr] operator[SEP] identifier[isDispatchThread] operator[SEP] operator[SEP] operator[SEP] { identifier[_omgr] operator[SEP] identifier[postRunnable] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[invokeNodeRequest] operator[SEP] identifier[request] , identifier[listener] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[requestBytes] operator[=] identifier[flattenRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[nodes] operator[=] identifier[findApplicableNodes] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[listener] operator[SEP] identifier[requestsProcessed] operator[SEP] Keyword[new] identifier[NodeRequestsResultImpl] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[T] operator[>] identifier[results] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[failures] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AtomicInteger] identifier[completedNodes] operator[=] Keyword[new] identifier[AtomicInteger] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[node] operator[:] identifier[nodes] operator[SEP] { identifier[invokeNodeRequest] operator[SEP] identifier[node] , identifier[requestBytes] , Keyword[new] identifier[InvocationService] operator[SEP] identifier[ResultListener] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[requestProcessed] operator[SEP] identifier[Object] identifier[result] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[T] identifier[castResult] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[result] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] identifier[node] , identifier[castResult] operator[SEP] operator[SEP] identifier[nodeDone] operator[SEP] operator[SEP] operator[SEP] } Keyword[public] Keyword[void] identifier[requestFailed] operator[SEP] identifier[String] identifier[cause] operator[SEP] { identifier[failures] operator[SEP] identifier[put] operator[SEP] identifier[node] , identifier[cause] operator[SEP] operator[SEP] identifier[nodeDone] operator[SEP] operator[SEP] operator[SEP] } Keyword[protected] Keyword[void] identifier[nodeDone] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[completedNodes] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[==] identifier[nodes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[listener] operator[SEP] identifier[requestsProcessed] operator[SEP] Keyword[new] identifier[NodeRequestsResultImpl] operator[<] identifier[T] operator[>] operator[SEP] identifier[results] , identifier[failures] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] } }
@Override protected Element getImage(final Element rssRoot) { final Element eChannel = rssRoot.getChild("channel", getRSSNamespace()); if (eChannel != null) { return eChannel.getChild("image", getRSSNamespace()); } else { return null; } }
class class_name[name] begin[{] method[getImage, return_type[type[Element]], modifier[protected], parameter[rssRoot]] begin[{] local_variable[type[Element], eChannel] if[binary_operation[member[.eChannel], !=, literal[null]]] begin[{] return[call[eChannel.getChild, parameter[literal["image"], call[.getRSSNamespace, parameter[]]]]] else begin[{] return[literal[null]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Element] identifier[getImage] operator[SEP] Keyword[final] identifier[Element] identifier[rssRoot] operator[SEP] { Keyword[final] identifier[Element] identifier[eChannel] operator[=] identifier[rssRoot] operator[SEP] identifier[getChild] operator[SEP] literal[String] , identifier[getRSSNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eChannel] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[eChannel] operator[SEP] identifier[getChild] operator[SEP] literal[String] , identifier[getRSSNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
@Nonnull public static BitSet createBitSet (final byte nValue) { final BitSet ret = new BitSet (CGlobal.BITS_PER_BYTE); for (int i = 0; i < CGlobal.BITS_PER_BYTE; ++i) ret.set (i, ((nValue >> i) & 1) == 1); return ret; }
class class_name[name] begin[{] method[createBitSet, return_type[type[BitSet]], modifier[public static], parameter[nValue]] begin[{] local_variable[type[BitSet], ret] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===)], member=set, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BITS_PER_BYTE, postfix_operators=[], prefix_operators=[], qualifier=CGlobal, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[member[.ret]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[BitSet] identifier[createBitSet] operator[SEP] Keyword[final] Keyword[byte] identifier[nValue] operator[SEP] { Keyword[final] identifier[BitSet] identifier[ret] operator[=] Keyword[new] identifier[BitSet] operator[SEP] identifier[CGlobal] operator[SEP] identifier[BITS_PER_BYTE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[CGlobal] operator[SEP] identifier[BITS_PER_BYTE] operator[SEP] operator[++] identifier[i] operator[SEP] identifier[ret] operator[SEP] identifier[set] operator[SEP] identifier[i] , operator[SEP] operator[SEP] identifier[nValue] operator[>] operator[>] identifier[i] operator[SEP] operator[&] Other[1] operator[SEP] operator[==] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
@Override public void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate, final Attribute _attribute, final Object... _values) throws SQLException { checkSQLColumnSize(_attribute, 1); _insertUpdate.column(_attribute.getSqlColNames().get(0), eval(_values)); }
class class_name[name] begin[{] method[prepare, return_type[void], modifier[public], parameter[_insertUpdate, _attribute, _values]] begin[{] call[.checkSQLColumnSize, parameter[member[._attribute], literal[1]]] call[_insertUpdate.column, parameter[call[_attribute.getSqlColNames, parameter[]], call[.eval, parameter[member[._values]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[prepare] operator[SEP] Keyword[final] identifier[AbstractSQLInsertUpdate] operator[<] operator[?] operator[>] identifier[_insertUpdate] , Keyword[final] identifier[Attribute] identifier[_attribute] , Keyword[final] identifier[Object] operator[...] identifier[_values] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[checkSQLColumnSize] operator[SEP] identifier[_attribute] , Other[1] operator[SEP] operator[SEP] identifier[_insertUpdate] operator[SEP] identifier[column] operator[SEP] identifier[_attribute] operator[SEP] identifier[getSqlColNames] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[eval] operator[SEP] identifier[_values] operator[SEP] operator[SEP] operator[SEP] }
public static void fe_copy(int[] h,int[] f) { int f0 = f[0]; int f1 = f[1]; int f2 = f[2]; int f3 = f[3]; int f4 = f[4]; int f5 = f[5]; int f6 = f[6]; int f7 = f[7]; int f8 = f[8]; int f9 = f[9]; h[0] = f0; h[1] = f1; h[2] = f2; h[3] = f3; h[4] = f4; h[5] = f5; h[6] = f6; h[7] = f7; h[8] = f8; h[9] = f9; }
class class_name[name] begin[{] method[fe_copy, return_type[void], modifier[public static], parameter[h, f]] begin[{] local_variable[type[int], f0] local_variable[type[int], f1] local_variable[type[int], f2] local_variable[type[int], f3] local_variable[type[int], f4] local_variable[type[int], f5] local_variable[type[int], f6] local_variable[type[int], f7] local_variable[type[int], f8] local_variable[type[int], f9] assign[member[.h], member[.f0]] assign[member[.h], member[.f1]] assign[member[.h], member[.f2]] assign[member[.h], member[.f3]] assign[member[.h], member[.f4]] assign[member[.h], member[.f5]] assign[member[.h], member[.f6]] assign[member[.h], member[.f7]] assign[member[.h], member[.f8]] assign[member[.h], member[.f9]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[fe_copy] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[h] , Keyword[int] operator[SEP] operator[SEP] identifier[f] operator[SEP] { Keyword[int] identifier[f0] operator[=] identifier[f] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[f1] operator[=] identifier[f] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[f2] operator[=] identifier[f] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[f3] operator[=] identifier[f] operator[SEP] Other[3] operator[SEP] operator[SEP] Keyword[int] identifier[f4] operator[=] identifier[f] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[int] identifier[f5] operator[=] identifier[f] operator[SEP] Other[5] operator[SEP] operator[SEP] Keyword[int] identifier[f6] operator[=] identifier[f] operator[SEP] Other[6] operator[SEP] operator[SEP] Keyword[int] identifier[f7] operator[=] identifier[f] operator[SEP] Other[7] operator[SEP] operator[SEP] Keyword[int] identifier[f8] operator[=] identifier[f] operator[SEP] Other[8] operator[SEP] operator[SEP] Keyword[int] identifier[f9] operator[=] identifier[f] operator[SEP] Other[9] operator[SEP] operator[SEP] identifier[h] operator[SEP] Other[0] operator[SEP] operator[=] identifier[f0] operator[SEP] identifier[h] operator[SEP] Other[1] operator[SEP] operator[=] identifier[f1] operator[SEP] identifier[h] operator[SEP] Other[2] operator[SEP] operator[=] identifier[f2] operator[SEP] identifier[h] operator[SEP] Other[3] operator[SEP] operator[=] identifier[f3] operator[SEP] identifier[h] operator[SEP] Other[4] operator[SEP] operator[=] identifier[f4] operator[SEP] identifier[h] operator[SEP] Other[5] operator[SEP] operator[=] identifier[f5] operator[SEP] identifier[h] operator[SEP] Other[6] operator[SEP] operator[=] identifier[f6] operator[SEP] identifier[h] operator[SEP] Other[7] operator[SEP] operator[=] identifier[f7] operator[SEP] identifier[h] operator[SEP] Other[8] operator[SEP] operator[=] identifier[f8] operator[SEP] identifier[h] operator[SEP] Other[9] operator[SEP] operator[=] identifier[f9] operator[SEP] }
public static CounterValue newCounterValue(CounterConfiguration configuration) { return configuration.type() == CounterType.BOUNDED_STRONG ? newCounterValue(configuration.initialValue(), configuration.lowerBound(), configuration.upperBound()) : newCounterValue(configuration.initialValue()); }
class class_name[name] begin[{] method[newCounterValue, return_type[type[CounterValue]], modifier[public static], parameter[configuration]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), operandr=MemberReference(member=BOUNDED_STRONG, postfix_operators=[], prefix_operators=[], qualifier=CounterType, selectors=[]), operator===), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None)], member=newCounterValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=lowerBound, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=upperBound, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None)], member=newCounterValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[CounterValue] identifier[newCounterValue] operator[SEP] identifier[CounterConfiguration] identifier[configuration] operator[SEP] { Keyword[return] identifier[configuration] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[==] identifier[CounterType] operator[SEP] identifier[BOUNDED_STRONG] operator[?] identifier[newCounterValue] operator[SEP] identifier[configuration] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] , identifier[configuration] operator[SEP] identifier[lowerBound] operator[SEP] operator[SEP] , identifier[configuration] operator[SEP] identifier[upperBound] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[newCounterValue] operator[SEP] identifier[configuration] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void resetNamedTimer(String timerName, int todoFlags, long threadId) { getNamedTimer(timerName, todoFlags, threadId).reset(); }
class class_name[name] begin[{] method[resetNamedTimer, return_type[void], modifier[public static], parameter[timerName, todoFlags, threadId]] begin[{] call[.getNamedTimer, parameter[member[.timerName], member[.todoFlags], member[.threadId]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[resetNamedTimer] operator[SEP] identifier[String] identifier[timerName] , Keyword[int] identifier[todoFlags] , Keyword[long] identifier[threadId] operator[SEP] { identifier[getNamedTimer] operator[SEP] identifier[timerName] , identifier[todoFlags] , identifier[threadId] operator[SEP] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] }
public ListDedicatedIpPoolsResult withDedicatedIpPools(String... dedicatedIpPools) { if (this.dedicatedIpPools == null) { setDedicatedIpPools(new java.util.ArrayList<String>(dedicatedIpPools.length)); } for (String ele : dedicatedIpPools) { this.dedicatedIpPools.add(ele); } return this; }
class class_name[name] begin[{] method[withDedicatedIpPools, return_type[type[ListDedicatedIpPoolsResult]], modifier[public], parameter[dedicatedIpPools]] begin[{] if[binary_operation[THIS[member[None.dedicatedIpPools]], ==, literal[null]]] begin[{] call[.setDedicatedIpPools, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dedicatedIpPools, 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))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dedicatedIpPools, 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=dedicatedIpPools, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ListDedicatedIpPoolsResult] identifier[withDedicatedIpPools] operator[SEP] identifier[String] operator[...] identifier[dedicatedIpPools] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[dedicatedIpPools] operator[==] Other[null] operator[SEP] { identifier[setDedicatedIpPools] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[dedicatedIpPools] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[dedicatedIpPools] operator[SEP] { Keyword[this] operator[SEP] identifier[dedicatedIpPools] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void fieldChanged(Field field) { Record record = this.getMainRecord(); if (field != null) if (record != null) if (field.getRecord() == record) { int iErrorCode= record.handleRecordChange((BaseField)field, DBConstants.FIELD_CHANGED_TYPE, DBConstants.DONT_DISPLAY); // Tell table that I'm getting changed (if not locked) if (iErrorCode != DBConstants.NORMAL_RETURN) this.displayError(iErrorCode); } }
class class_name[name] begin[{] method[fieldChanged, return_type[void], modifier[public], parameter[field]] begin[{] local_variable[type[Record], record] if[binary_operation[member[.field], !=, literal[null]]] begin[{] if[binary_operation[member[.record], !=, literal[null]]] begin[{] if[binary_operation[call[field.getRecord, parameter[]], ==, member[.record]]] begin[{] local_variable[type[int], iErrorCode] if[binary_operation[member[.iErrorCode], !=, member[DBConstants.NORMAL_RETURN]]] begin[{] THIS[call[None.displayError, parameter[member[.iErrorCode]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[fieldChanged] operator[SEP] identifier[Field] identifier[field] operator[SEP] { identifier[Record] identifier[record] operator[=] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[==] identifier[record] operator[SEP] { Keyword[int] identifier[iErrorCode] operator[=] identifier[record] operator[SEP] identifier[handleRecordChange] operator[SEP] operator[SEP] identifier[BaseField] operator[SEP] identifier[field] , identifier[DBConstants] operator[SEP] identifier[FIELD_CHANGED_TYPE] , identifier[DBConstants] operator[SEP] identifier[DONT_DISPLAY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iErrorCode] operator[!=] identifier[DBConstants] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] Keyword[this] operator[SEP] identifier[displayError] operator[SEP] identifier[iErrorCode] operator[SEP] operator[SEP] } }
public static String getSymbol(CurrencyUnit cu) { try { return Waehrung.of(cu).getSymbol(); } catch (IllegalArgumentException ex) { LOG.log(Level.WARNING, "Cannot get symbol for '" + cu + "':", ex); return cu.getCurrencyCode(); } }
class class_name[name] begin[{] method[getSymbol, return_type[type[String]], modifier[public static], parameter[cu]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=cu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Waehrung, selectors=[MethodInvocation(arguments=[], member=getSymbol, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot get symbol for '"), operandr=MemberReference(member=cu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="':"), operator=+), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=getCurrencyCode, postfix_operators=[], prefix_operators=[], qualifier=cu, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getSymbol] operator[SEP] identifier[CurrencyUnit] identifier[cu] operator[SEP] { Keyword[try] { Keyword[return] identifier[Waehrung] operator[SEP] identifier[of] operator[SEP] identifier[cu] operator[SEP] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ex] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[cu] operator[+] literal[String] , identifier[ex] operator[SEP] operator[SEP] Keyword[return] identifier[cu] operator[SEP] identifier[getCurrencyCode] operator[SEP] operator[SEP] operator[SEP] } }
static boolean checkPreLongsFlagsCap(final int preambleLongs, final int flags, final long memCapBytes) { final boolean empty = (flags & EMPTY_FLAG_MASK) > 0; //Preamble flags empty state final int minPre = Family.QUANTILES.getMinPreLongs(); //1 final int maxPre = Family.QUANTILES.getMaxPreLongs(); //2 final boolean valid = ((preambleLongs == minPre) && empty) || ((preambleLongs == maxPre) && !empty); if (!valid) { throw new SketchesArgumentException( "Possible corruption: PreambleLongs inconsistent with empty state: " + preambleLongs); } checkHeapFlags(flags); if (memCapBytes < (preambleLongs << 3)) { throw new SketchesArgumentException( "Possible corruption: Insufficient capacity for preamble: " + memCapBytes); } return empty; }
class class_name[name] begin[{] method[checkPreLongsFlagsCap, return_type[type[boolean]], modifier[static], parameter[preambleLongs, flags, memCapBytes]] begin[{] local_variable[type[boolean], empty] local_variable[type[int], minPre] local_variable[type[int], maxPre] local_variable[type[boolean], valid] if[member[.valid]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Possible corruption: PreambleLongs inconsistent with empty state: "), operandr=MemberReference(member=preambleLongs, 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=SketchesArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[.checkHeapFlags, parameter[member[.flags]]] if[binary_operation[member[.memCapBytes], <, binary_operation[member[.preambleLongs], <<, literal[3]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Possible corruption: Insufficient capacity for preamble: "), operandr=MemberReference(member=memCapBytes, 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=SketchesArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.empty]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[checkPreLongsFlagsCap] operator[SEP] Keyword[final] Keyword[int] identifier[preambleLongs] , Keyword[final] Keyword[int] identifier[flags] , Keyword[final] Keyword[long] identifier[memCapBytes] operator[SEP] { Keyword[final] Keyword[boolean] identifier[empty] operator[=] operator[SEP] identifier[flags] operator[&] identifier[EMPTY_FLAG_MASK] operator[SEP] operator[>] Other[0] operator[SEP] Keyword[final] Keyword[int] identifier[minPre] operator[=] identifier[Family] operator[SEP] identifier[QUANTILES] operator[SEP] identifier[getMinPreLongs] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[maxPre] operator[=] identifier[Family] operator[SEP] identifier[QUANTILES] operator[SEP] identifier[getMaxPreLongs] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[valid] operator[=] operator[SEP] operator[SEP] identifier[preambleLongs] operator[==] identifier[minPre] operator[SEP] operator[&&] identifier[empty] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[preambleLongs] operator[==] identifier[maxPre] operator[SEP] operator[&&] operator[!] identifier[empty] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[valid] operator[SEP] { Keyword[throw] Keyword[new] identifier[SketchesArgumentException] operator[SEP] literal[String] operator[+] identifier[preambleLongs] operator[SEP] operator[SEP] } identifier[checkHeapFlags] operator[SEP] identifier[flags] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[memCapBytes] operator[<] operator[SEP] identifier[preambleLongs] operator[<<] Other[3] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[SketchesArgumentException] operator[SEP] literal[String] operator[+] identifier[memCapBytes] operator[SEP] operator[SEP] } Keyword[return] identifier[empty] operator[SEP] }
public static byte[] encryptWithPublicKey(byte[] publicKeyData, byte[] data) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, IOException { return encryptWithPublicKey(publicKeyData, data, DEFAULT_CIPHER_TRANSFORMATION, DEFAULT_PADDING_SIZE); }
class class_name[name] begin[{] method[encryptWithPublicKey, return_type[type[byte]], modifier[public static], parameter[publicKeyData, data]] begin[{] return[call[.encryptWithPublicKey, parameter[member[.publicKeyData], member[.data], member[.DEFAULT_CIPHER_TRANSFORMATION], member[.DEFAULT_PADDING_SIZE]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[encryptWithPublicKey] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[publicKeyData] , Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[SEP] Keyword[throws] identifier[InvalidKeyException] , identifier[NoSuchAlgorithmException] , identifier[InvalidKeySpecException] , identifier[NoSuchPaddingException] , identifier[IllegalBlockSizeException] , identifier[BadPaddingException] , identifier[IOException] { Keyword[return] identifier[encryptWithPublicKey] operator[SEP] identifier[publicKeyData] , identifier[data] , identifier[DEFAULT_CIPHER_TRANSFORMATION] , identifier[DEFAULT_PADDING_SIZE] operator[SEP] operator[SEP] }
public static void pow(ComplexPolar_F64 a , int N , ComplexPolar_F64 result ) { result.r = Math.pow(a.r,N); result.theta = N*a.theta; }
class class_name[name] begin[{] method[pow, return_type[void], modifier[public static], parameter[a, N, result]] begin[{] assign[member[result.r], call[Math.pow, parameter[member[a.r], member[.N]]]] assign[member[result.theta], binary_operation[member[.N], *, member[a.theta]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[pow] operator[SEP] identifier[ComplexPolar_F64] identifier[a] , Keyword[int] identifier[N] , identifier[ComplexPolar_F64] identifier[result] operator[SEP] { identifier[result] operator[SEP] identifier[r] operator[=] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[a] operator[SEP] identifier[r] , identifier[N] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[theta] operator[=] identifier[N] operator[*] identifier[a] operator[SEP] identifier[theta] operator[SEP] }
public String getJmolScript(Atom[] atoms, int axisID){ final double width=.5;// width of JMol object final String axisColor = "yellow"; //axis color final String screwColor = "orange"; //screw translation color Pair<Atom> endPoints = getAxisEnds(atoms); Atom axisMin = endPoints.getFirst(); Atom axisMax = endPoints.getSecond(); StringWriter result = new StringWriter(); // set arrow heads to a reasonable length result.append("set defaultDrawArrowScale 2.0;"); // draw axis of rotation result.append( String.format("draw ID rot"+axisID+" CYLINDER {%f,%f,%f} {%f,%f,%f} WIDTH %f COLOR %s ;", axisMin.getX(),axisMin.getY(),axisMin.getZ(), axisMax.getX(),axisMax.getY(),axisMax.getZ(), width, axisColor )); // draw screw component boolean positiveScrew = Math.signum(rotationAxis.getX()) == Math.signum(screwTranslation.getX()); if( positiveScrew ) { // screw is in the same direction as the axis result.append( String.format( "draw ID screw"+axisID+" VECTOR {%f,%f,%f} {%f,%f,%f} WIDTH %f COLOR %s ;", axisMax.getX(),axisMax.getY(),axisMax.getZ(), screwTranslation.getX(),screwTranslation.getY(),screwTranslation.getZ(), width, screwColor )); } else { // screw is in the opposite direction as the axis result.append( String.format( "draw ID screw"+axisID+" VECTOR {%f,%f,%f} {%f,%f,%f} WIDTH %f COLOR %s ;", axisMin.getX(),axisMin.getY(),axisMin.getZ(), screwTranslation.getX(),screwTranslation.getY(),screwTranslation.getZ(), width, screwColor )); } // draw angle of rotation if(rotationPos != null) { result.append(System.getProperty("line.separator")); result.append(String.format("draw ID rotArc"+axisID+" ARC {%f,%f,%f} {%f,%f,%f} {0,0,0} {0,%f,%d} SCALE 500 DIAMETER %f COLOR %s;", axisMin.getX(),axisMin.getY(),axisMin.getZ(), axisMax.getX(),axisMax.getY(),axisMax.getZ(), Math.toDegrees(theta), positiveScrew ? 0 : 1 , // draw at the opposite end from the screw arrow width, axisColor )); } return result.toString(); }
class class_name[name] begin[{] method[getJmolScript, return_type[type[String]], modifier[public], parameter[atoms, axisID]] begin[{] local_variable[type[double], width] local_variable[type[String], axisColor] local_variable[type[String], screwColor] local_variable[type[Pair], endPoints] local_variable[type[Atom], axisMin] local_variable[type[Atom], axisMax] local_variable[type[StringWriter], result] call[result.append, parameter[literal["set defaultDrawArrowScale 2.0;"]]] call[result.append, parameter[call[String.format, parameter[binary_operation[binary_operation[literal["draw ID rot"], +, member[.axisID]], +, literal[" CYLINDER {%f,%f,%f} {%f,%f,%f} WIDTH %f COLOR %s ;"]], call[axisMin.getX, parameter[]], call[axisMin.getY, parameter[]], call[axisMin.getZ, parameter[]], call[axisMax.getX, parameter[]], call[axisMax.getY, parameter[]], call[axisMax.getZ, parameter[]], member[.width], member[.axisColor]]]]] local_variable[type[boolean], positiveScrew] if[member[.positiveScrew]] begin[{] call[result.append, parameter[call[String.format, parameter[binary_operation[binary_operation[literal["draw ID screw"], +, member[.axisID]], +, literal[" VECTOR {%f,%f,%f} {%f,%f,%f} WIDTH %f COLOR %s ;"]], call[axisMax.getX, parameter[]], call[axisMax.getY, parameter[]], call[axisMax.getZ, parameter[]], call[screwTranslation.getX, parameter[]], call[screwTranslation.getY, parameter[]], call[screwTranslation.getZ, parameter[]], member[.width], member[.screwColor]]]]] else begin[{] call[result.append, parameter[call[String.format, parameter[binary_operation[binary_operation[literal["draw ID screw"], +, member[.axisID]], +, literal[" VECTOR {%f,%f,%f} {%f,%f,%f} WIDTH %f COLOR %s ;"]], call[axisMin.getX, parameter[]], call[axisMin.getY, parameter[]], call[axisMin.getZ, parameter[]], call[screwTranslation.getX, parameter[]], call[screwTranslation.getY, parameter[]], call[screwTranslation.getZ, parameter[]], member[.width], member[.screwColor]]]]] end[}] if[binary_operation[member[.rotationPos], !=, literal[null]]] begin[{] call[result.append, parameter[call[System.getProperty, parameter[literal["line.separator"]]]]] call[result.append, parameter[call[String.format, parameter[binary_operation[binary_operation[literal["draw ID rotArc"], +, member[.axisID]], +, literal[" ARC {%f,%f,%f} {%f,%f,%f} {0,0,0} {0,%f,%d} SCALE 500 DIAMETER %f COLOR %s;"]], call[axisMin.getX, parameter[]], call[axisMin.getY, parameter[]], call[axisMin.getZ, parameter[]], call[axisMax.getX, parameter[]], call[axisMax.getY, parameter[]], call[axisMax.getZ, parameter[]], call[Math.toDegrees, parameter[member[.theta]]], TernaryExpression(condition=MemberReference(member=positiveScrew, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), member[.width], member[.axisColor]]]]] else begin[{] None end[}] return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getJmolScript] operator[SEP] identifier[Atom] operator[SEP] operator[SEP] identifier[atoms] , Keyword[int] identifier[axisID] operator[SEP] { Keyword[final] Keyword[double] identifier[width] operator[=] literal[Float] operator[SEP] Keyword[final] identifier[String] identifier[axisColor] operator[=] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[screwColor] operator[=] literal[String] operator[SEP] identifier[Pair] operator[<] identifier[Atom] operator[>] identifier[endPoints] operator[=] identifier[getAxisEnds] operator[SEP] identifier[atoms] operator[SEP] operator[SEP] identifier[Atom] identifier[axisMin] operator[=] identifier[endPoints] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] operator[SEP] identifier[Atom] identifier[axisMax] operator[=] identifier[endPoints] operator[SEP] identifier[getSecond] operator[SEP] operator[SEP] operator[SEP] identifier[StringWriter] identifier[result] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] identifier[axisID] operator[+] literal[String] , identifier[axisMin] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[axisMin] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[axisMin] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[width] , identifier[axisColor] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[positiveScrew] operator[=] identifier[Math] operator[SEP] identifier[signum] operator[SEP] identifier[rotationAxis] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] operator[==] identifier[Math] operator[SEP] identifier[signum] operator[SEP] identifier[screwTranslation] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[positiveScrew] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] identifier[axisID] operator[+] literal[String] , identifier[axisMax] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[screwTranslation] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[screwTranslation] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[screwTranslation] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[width] , identifier[screwColor] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] identifier[axisID] operator[+] literal[String] , identifier[axisMin] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[axisMin] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[axisMin] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[screwTranslation] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[screwTranslation] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[screwTranslation] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[width] , identifier[screwColor] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[rotationPos] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] identifier[axisID] operator[+] literal[String] , identifier[axisMin] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[axisMin] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[axisMin] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[axisMax] operator[SEP] identifier[getZ] operator[SEP] operator[SEP] , identifier[Math] operator[SEP] identifier[toDegrees] operator[SEP] identifier[theta] operator[SEP] , identifier[positiveScrew] operator[?] Other[0] operator[:] Other[1] , identifier[width] , identifier[axisColor] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private void readObject (ObjectInputStream s) throws IOException, ClassNotFoundException { // read in number of buckets and allocate the bucket array _buckets = createBuckets(s.readInt()); _loadFactor = s.readFloat(); // read in size (number of mappings) int size = s.readInt(); // read the keys and values for (int i=0; i<size; i++) { int key = s.readInt(); @SuppressWarnings("unchecked") V value = (V)s.readObject(); put(key, value); } }
class class_name[name] begin[{] method[readObject, return_type[void], modifier[private], parameter[s]] begin[{] assign[member[._buckets], call[.createBuckets, parameter[call[s.readInt, parameter[]]]]] assign[member[._loadFactor], call[s.readFloat, parameter[]]] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None)), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[readObject] operator[SEP] identifier[ObjectInputStream] identifier[s] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] { identifier[_buckets] operator[=] identifier[createBuckets] operator[SEP] identifier[s] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[_loadFactor] operator[=] identifier[s] operator[SEP] identifier[readFloat] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[s] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[key] operator[=] identifier[s] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[V] identifier[value] operator[=] operator[SEP] identifier[V] operator[SEP] identifier[s] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public static <T extends Throwable> T convertFromOrSuppressedThrowable(Throwable throwable, Class<T> exceptionClass, boolean checkCause) { if (throwable == null || exceptionClass == null) { return null; } if (exceptionClass.isAssignableFrom(throwable.getClass())) { return (T) throwable; } if (checkCause) { Throwable cause = throwable.getCause(); if (cause != null && exceptionClass.isAssignableFrom(cause.getClass())) { return (T) cause; } } Throwable[] throwables = throwable.getSuppressed(); if (ArrayUtil.isNotEmpty(throwables)) { for (Throwable throwable1 : throwables) { if (exceptionClass.isAssignableFrom(throwable1.getClass())) { return (T) throwable1; } } } return null; }
class class_name[name] begin[{] method[convertFromOrSuppressedThrowable, return_type[type[T]], modifier[public static], parameter[throwable, exceptionClass, checkCause]] begin[{] if[binary_operation[binary_operation[member[.throwable], ==, literal[null]], ||, binary_operation[member[.exceptionClass], ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[exceptionClass.isAssignableFrom, parameter[call[throwable.getClass, parameter[]]]]] begin[{] return[Cast(expression=MemberReference(member=throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] None end[}] if[member[.checkCause]] begin[{] local_variable[type[Throwable], cause] if[binary_operation[binary_operation[member[.cause], !=, literal[null]], &&, call[exceptionClass.isAssignableFrom, parameter[call[cause.getClass, parameter[]]]]]] begin[{] return[Cast(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[Throwable], throwables] if[call[ArrayUtil.isNotEmpty, parameter[member[.throwables]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=throwable1, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=exceptionClass, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=throwable1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=throwables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=throwable1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None))), label=None) else begin[{] None end[}] return[literal[null]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Throwable] operator[>] identifier[T] identifier[convertFromOrSuppressedThrowable] operator[SEP] identifier[Throwable] identifier[throwable] , identifier[Class] operator[<] identifier[T] operator[>] identifier[exceptionClass] , Keyword[boolean] identifier[checkCause] operator[SEP] { Keyword[if] operator[SEP] identifier[throwable] operator[==] Other[null] operator[||] identifier[exceptionClass] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[exceptionClass] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[throwable] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[throwable] operator[SEP] } Keyword[if] operator[SEP] identifier[checkCause] operator[SEP] { identifier[Throwable] identifier[cause] operator[=] identifier[throwable] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] operator[!=] Other[null] operator[&&] identifier[exceptionClass] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[cause] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[cause] operator[SEP] } } identifier[Throwable] operator[SEP] operator[SEP] identifier[throwables] operator[=] identifier[throwable] operator[SEP] identifier[getSuppressed] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ArrayUtil] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[throwables] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Throwable] identifier[throwable1] operator[:] identifier[throwables] operator[SEP] { Keyword[if] operator[SEP] identifier[exceptionClass] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[throwable1] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[throwable1] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public static Element drawFrame(SVGPlot svgp, Projection2D proj, SpatialComparable box) { SVGPath path = new SVGPath(); ArrayList<double[]> edges = getVisibleEdges(proj, box); final int dim = box.getDimensionality(); double[] min = new double[dim]; for(int i = 0; i < dim; i++) { min[i] = box.getMin(i); } double[] rv_min = proj.fastProjectDataToRenderSpace(min); recDrawEdges(path, rv_min[0], rv_min[1], edges, BitsUtil.zero(edges.size())); return path.makeElement(svgp); }
class class_name[name] begin[{] method[drawFrame, return_type[type[Element]], modifier[public static], parameter[svgp, proj, box]] begin[{] local_variable[type[SVGPath], path] local_variable[type[ArrayList], edges] local_variable[type[int], dim] local_variable[type[double], min] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMin, postfix_operators=[], prefix_operators=[], qualifier=box, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[double], rv_min] call[.recDrawEdges, parameter[member[.path], member[.rv_min], member[.rv_min], member[.edges], call[BitsUtil.zero, parameter[call[edges.size, parameter[]]]]]] return[call[path.makeElement, parameter[member[.svgp]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Element] identifier[drawFrame] operator[SEP] identifier[SVGPlot] identifier[svgp] , identifier[Projection2D] identifier[proj] , identifier[SpatialComparable] identifier[box] operator[SEP] { identifier[SVGPath] identifier[path] operator[=] Keyword[new] identifier[SVGPath] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] Keyword[double] operator[SEP] operator[SEP] operator[>] identifier[edges] operator[=] identifier[getVisibleEdges] operator[SEP] identifier[proj] , identifier[box] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[dim] operator[=] identifier[box] operator[SEP] identifier[getDimensionality] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[min] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[dim] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dim] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[min] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[box] operator[SEP] identifier[getMin] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[double] operator[SEP] operator[SEP] identifier[rv_min] operator[=] identifier[proj] operator[SEP] identifier[fastProjectDataToRenderSpace] operator[SEP] identifier[min] operator[SEP] operator[SEP] identifier[recDrawEdges] operator[SEP] identifier[path] , identifier[rv_min] operator[SEP] Other[0] operator[SEP] , identifier[rv_min] operator[SEP] Other[1] operator[SEP] , identifier[edges] , identifier[BitsUtil] operator[SEP] identifier[zero] operator[SEP] identifier[edges] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[path] operator[SEP] identifier[makeElement] operator[SEP] identifier[svgp] operator[SEP] operator[SEP] }
public static String link(Key k, String content, Key cp, String response, Key val) { DeepLearning req = new DeepLearning(); RString rs = new RString("<a href='" + req.href() + ".query?source=%$key" + (cp == null ? "" : "&checkpoint=%$cp") + (response == null ? "" : "&response=%$resp") + (val == null ? "" : "&validation=%$valkey") + "'>%content</a>"); rs.replace("key", k.toString()); rs.replace("content", content); if (cp != null) rs.replace("cp", cp.toString()); if (response != null) rs.replace("resp", response); if (val != null) rs.replace("valkey", val); return rs.toString(); }
class class_name[name] begin[{] method[link, return_type[type[String]], modifier[public static], parameter[k, content, cp, response, val]] begin[{] local_variable[type[DeepLearning], req] local_variable[type[RString], rs] call[rs.replace, parameter[literal["key"], call[k.toString, parameter[]]]] call[rs.replace, parameter[literal["content"], member[.content]]] if[binary_operation[member[.cp], !=, literal[null]]] begin[{] call[rs.replace, parameter[literal["cp"], call[cp.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.response], !=, literal[null]]] begin[{] call[rs.replace, parameter[literal["resp"], member[.response]]] else begin[{] None end[}] if[binary_operation[member[.val], !=, literal[null]]] begin[{] call[rs.replace, parameter[literal["valkey"], member[.val]]] else begin[{] None end[}] return[call[rs.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[link] operator[SEP] identifier[Key] identifier[k] , identifier[String] identifier[content] , identifier[Key] identifier[cp] , identifier[String] identifier[response] , identifier[Key] identifier[val] operator[SEP] { identifier[DeepLearning] identifier[req] operator[=] Keyword[new] identifier[DeepLearning] operator[SEP] operator[SEP] operator[SEP] identifier[RString] identifier[rs] operator[=] Keyword[new] identifier[RString] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[href] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[cp] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] operator[SEP] identifier[response] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] operator[SEP] identifier[val] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[rs] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[k] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rs] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[content] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cp] operator[!=] Other[null] operator[SEP] identifier[rs] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[cp] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[!=] Other[null] operator[SEP] identifier[rs] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[!=] Other[null] operator[SEP] identifier[rs] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[val] operator[SEP] operator[SEP] Keyword[return] identifier[rs] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean eIsSet(int featureID) { switch (featureID) { case BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT: return CURRENCY_UNIT_EDEFAULT == null ? currencyUnit != null : !CURRENCY_UNIT_EDEFAULT.equals(currencyUnit); case BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT: return isSetTimeUnit(); case BpsimPackage.NUMERIC_PARAMETER_TYPE__VALUE: return isSetValue(); } return super.eIsSet(featureID); }
class class_name[name] begin[{] method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage, selectors=[])], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=CURRENCY_UNIT_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=currencyUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=CURRENCY_UNIT_EDEFAULT, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=currencyUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)), label=None)]), SwitchStatementCase(case=[MemberReference(member=NUMERIC_PARAMETER_TYPE__TIME_UNIT, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetTimeUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=NUMERIC_PARAMETER_TYPE__VALUE, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[BpsimPackage] operator[SEP] identifier[NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT] operator[:] Keyword[return] identifier[CURRENCY_UNIT_EDEFAULT] operator[==] Other[null] operator[?] identifier[currencyUnit] operator[!=] Other[null] operator[:] operator[!] identifier[CURRENCY_UNIT_EDEFAULT] operator[SEP] identifier[equals] operator[SEP] identifier[currencyUnit] operator[SEP] operator[SEP] Keyword[case] identifier[BpsimPackage] operator[SEP] identifier[NUMERIC_PARAMETER_TYPE__TIME_UNIT] operator[:] Keyword[return] identifier[isSetTimeUnit] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[BpsimPackage] operator[SEP] identifier[NUMERIC_PARAMETER_TYPE__VALUE] operator[:] Keyword[return] identifier[isSetValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
@BetaApi public final Operation disableXpnHostProject(String project) { DisableXpnHostProjectHttpRequest request = DisableXpnHostProjectHttpRequest.newBuilder().setProject(project).build(); return disableXpnHostProject(request); }
class class_name[name] begin[{] method[disableXpnHostProject, return_type[type[Operation]], modifier[final public], parameter[project]] begin[{] local_variable[type[DisableXpnHostProjectHttpRequest], request] return[call[.disableXpnHostProject, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[disableXpnHostProject] operator[SEP] identifier[String] identifier[project] operator[SEP] { identifier[DisableXpnHostProjectHttpRequest] identifier[request] operator[=] identifier[DisableXpnHostProjectHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setProject] operator[SEP] identifier[project] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[disableXpnHostProject] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override protected void loadJar(final Configuration hadoopConfiguration, final File file, final Object... params) { final JavaSparkContext sparkContext = (JavaSparkContext) params[0]; sparkContext.addJar(file.getAbsolutePath()); }
class class_name[name] begin[{] method[loadJar, return_type[void], modifier[protected], parameter[hadoopConfiguration, file, params]] begin[{] local_variable[type[JavaSparkContext], sparkContext] call[sparkContext.addJar, parameter[call[file.getAbsolutePath, parameter[]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[loadJar] operator[SEP] Keyword[final] identifier[Configuration] identifier[hadoopConfiguration] , Keyword[final] identifier[File] identifier[file] , Keyword[final] identifier[Object] operator[...] identifier[params] operator[SEP] { Keyword[final] identifier[JavaSparkContext] identifier[sparkContext] operator[=] operator[SEP] identifier[JavaSparkContext] operator[SEP] identifier[params] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[sparkContext] operator[SEP] identifier[addJar] operator[SEP] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") @Override public EList<IfcCartesianPoint> getPoints() { return (EList<IfcCartesianPoint>) eGet(Ifc4Package.Literals.IFC_POLYLINE__POINTS, true); }
class class_name[name] begin[{] method[getPoints, return_type[type[EList]], modifier[public], parameter[]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_POLYLINE__POINTS, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcCartesianPoint, sub_type=None))], dimensions=[], name=EList, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[IfcCartesianPoint] operator[>] identifier[getPoints] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcCartesianPoint] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_POLYLINE__POINTS] , literal[boolean] operator[SEP] operator[SEP] }
private SearchFilter getSearchFilter(HttpServletRequest httpServletRequest) { SearchFilter ret = new SearchFilter(); Set<String> keySet = httpServletRequest.getParameterMap().keySet(); for (String key : keySet) { ret.setParam(String.valueOf(key), String.valueOf(httpServletRequest.getParameter(key))); } return ret; }
class class_name[name] begin[{] method[getSearchFilter, return_type[type[SearchFilter]], modifier[private], parameter[httpServletRequest]] begin[{] local_variable[type[SearchFilter], ret] local_variable[type[Set], keySet] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameter, postfix_operators=[], prefix_operators=[], qualifier=httpServletRequest, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=setParam, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=keySet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
Keyword[private] identifier[SearchFilter] identifier[getSearchFilter] operator[SEP] identifier[HttpServletRequest] identifier[httpServletRequest] operator[SEP] { identifier[SearchFilter] identifier[ret] operator[=] Keyword[new] identifier[SearchFilter] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[keySet] operator[=] identifier[httpServletRequest] operator[SEP] identifier[getParameterMap] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[keySet] operator[SEP] { identifier[ret] operator[SEP] identifier[setParam] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[key] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[httpServletRequest] operator[SEP] identifier[getParameter] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public static sslcipher_individualcipher_binding[] get_filtered(nitro_service service, String ciphergroupname, filtervalue[] filter) throws Exception{ sslcipher_individualcipher_binding obj = new sslcipher_individualcipher_binding(); obj.set_ciphergroupname(ciphergroupname); options option = new options(); option.set_filter(filter); sslcipher_individualcipher_binding[] response = (sslcipher_individualcipher_binding[]) obj.getfiltered(service, option); return response; }
class class_name[name] begin[{] method[get_filtered, return_type[type[sslcipher_individualcipher_binding]], modifier[public static], parameter[service, ciphergroupname, filter]] begin[{] local_variable[type[sslcipher_individualcipher_binding], obj] call[obj.set_ciphergroupname, parameter[member[.ciphergroupname]]] local_variable[type[options], option] call[option.set_filter, parameter[member[.filter]]] local_variable[type[sslcipher_individualcipher_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[sslcipher_individualcipher_binding] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[ciphergroupname] , identifier[filtervalue] operator[SEP] operator[SEP] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] { identifier[sslcipher_individualcipher_binding] identifier[obj] operator[=] Keyword[new] identifier[sslcipher_individualcipher_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_ciphergroupname] operator[SEP] identifier[ciphergroupname] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[sslcipher_individualcipher_binding] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[sslcipher_individualcipher_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
@Override public void processMessage() { if (clipboard.isTracking(this.originatorId, this.getTaskId())) { clipboard.pin(this); if (clipboard.isReady(this.originatorId, taskId)) { VoidAggregation aggregation = clipboard.unpin(this.originatorId, taskId); // FIXME: probably there's better solution, then "screw-and-forget" one if (aggregation == null) return; VectorCompleteMessage msg = new VectorCompleteMessage(taskId, aggregation.getAccumulatedResult()); msg.setOriginatorId(aggregation.getOriginatorId()); transport.sendMessage(msg); } } }
class class_name[name] begin[{] method[processMessage, return_type[void], modifier[public], parameter[]] begin[{] if[call[clipboard.isTracking, parameter[THIS[member[None.originatorId]], THIS[call[None.getTaskId, parameter[]]]]]] begin[{] call[clipboard.pin, parameter[THIS[]]] if[call[clipboard.isReady, parameter[THIS[member[None.originatorId]], member[.taskId]]]] begin[{] local_variable[type[VoidAggregation], aggregation] if[binary_operation[member[.aggregation], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[VectorCompleteMessage], msg] call[msg.setOriginatorId, parameter[call[aggregation.getOriginatorId, parameter[]]]] call[transport.sendMessage, parameter[member[.msg]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[processMessage] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[clipboard] operator[SEP] identifier[isTracking] operator[SEP] Keyword[this] operator[SEP] identifier[originatorId] , Keyword[this] operator[SEP] identifier[getTaskId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[clipboard] operator[SEP] identifier[pin] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clipboard] operator[SEP] identifier[isReady] operator[SEP] Keyword[this] operator[SEP] identifier[originatorId] , identifier[taskId] operator[SEP] operator[SEP] { identifier[VoidAggregation] identifier[aggregation] operator[=] identifier[clipboard] operator[SEP] identifier[unpin] operator[SEP] Keyword[this] operator[SEP] identifier[originatorId] , identifier[taskId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aggregation] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[VectorCompleteMessage] identifier[msg] operator[=] Keyword[new] identifier[VectorCompleteMessage] operator[SEP] identifier[taskId] , identifier[aggregation] operator[SEP] identifier[getAccumulatedResult] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[setOriginatorId] operator[SEP] identifier[aggregation] operator[SEP] identifier[getOriginatorId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[transport] operator[SEP] identifier[sendMessage] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } } }
static <T> boolean tryAsCompletable(Object source, Function<? super T, ? extends CompletableSource> mapper, CompletableObserver observer) { if (source instanceof Callable) { @SuppressWarnings("unchecked") Callable<T> call = (Callable<T>) source; CompletableSource cs = null; try { T item = call.call(); if (item != null) { cs = ObjectHelper.requireNonNull(mapper.apply(item), "The mapper returned a null CompletableSource"); } } catch (Throwable ex) { Exceptions.throwIfFatal(ex); EmptyDisposable.error(ex, observer); return true; } if (cs == null) { EmptyDisposable.complete(observer); } else { cs.subscribe(observer); } return true; } return false; }
class class_name[name] begin[{] method[tryAsCompletable, return_type[type[boolean]], modifier[static], parameter[source, mapper, observer]] begin[{] if[binary_operation[member[.source], instanceof, type[Callable]]] begin[{] local_variable[type[Callable], call] local_variable[type[CompletableSource], cs] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=call, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=item, 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=cs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The mapper returned a null CompletableSource")], member=requireNonNull, postfix_operators=[], prefix_operators=[], qualifier=ObjectHelper, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=throwIfFatal, postfix_operators=[], prefix_operators=[], qualifier=Exceptions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=observer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=EmptyDisposable, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.cs], ==, literal[null]]] begin[{] call[EmptyDisposable.complete, parameter[member[.observer]]] else begin[{] call[cs.subscribe, parameter[member[.observer]]] end[}] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[static] operator[<] identifier[T] operator[>] Keyword[boolean] identifier[tryAsCompletable] operator[SEP] identifier[Object] identifier[source] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[CompletableSource] operator[>] identifier[mapper] , identifier[CompletableObserver] identifier[observer] operator[SEP] { Keyword[if] operator[SEP] identifier[source] Keyword[instanceof] identifier[Callable] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Callable] operator[<] identifier[T] operator[>] identifier[call] operator[=] operator[SEP] identifier[Callable] operator[<] identifier[T] operator[>] operator[SEP] identifier[source] operator[SEP] identifier[CompletableSource] identifier[cs] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[T] identifier[item] operator[=] identifier[call] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[!=] Other[null] operator[SEP] { identifier[cs] operator[=] identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[mapper] operator[SEP] identifier[apply] operator[SEP] identifier[item] operator[SEP] , literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] { identifier[Exceptions] operator[SEP] identifier[throwIfFatal] operator[SEP] identifier[ex] operator[SEP] operator[SEP] identifier[EmptyDisposable] operator[SEP] identifier[error] operator[SEP] identifier[ex] , identifier[observer] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[cs] operator[==] Other[null] operator[SEP] { identifier[EmptyDisposable] operator[SEP] identifier[complete] operator[SEP] identifier[observer] operator[SEP] operator[SEP] } Keyword[else] { identifier[cs] operator[SEP] identifier[subscribe] operator[SEP] identifier[observer] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private int getSentenceBreak(String s, DocTree dt) { BreakIterator breakIterator = trees.getBreakIterator(); if (breakIterator == null) { return defaultSentenceBreak(s); } breakIterator.setText(s); final int sbrk = breakIterator.next(); // This is the last doctree, found the droid we are looking for if (dt == null) { return sbrk; } // If the break is well within the span of the string ie. not // at EOL, then we have a clear break. if (sbrk < s.length() - 1) { return sbrk; } if (isTextTree(dt)) { // Two adjacent text trees, a corner case, perhaps // produced by a tool synthesizing a doctree. In // this case, does the break lie within the first span, // then we have the droid, otherwise allow the callers // logic to handle the break in the adjacent doctree. TextTree ttnext = (TextTree) dt; String combined = s + ttnext.getBody(); breakIterator.setText(combined); int sbrk2 = breakIterator.next(); if (sbrk < sbrk2) { return sbrk; } } // Is the adjacent tree a sentence breaker ? if (isSentenceBreak(dt, false)) { return sbrk; } // At this point the adjacent tree is either a javadoc tag ({@..), // html tag (<..) or an entity (&..). Perform a litmus test, by // concatenating a sentence, to validate the break earlier identified. String combined = s + "Dummy Sentence."; breakIterator.setText(combined); int sbrk2 = breakIterator.next(); if (sbrk2 <= sbrk) { return sbrk2; } return -1; // indeterminate at this time }
class class_name[name] begin[{] method[getSentenceBreak, return_type[type[int]], modifier[private], parameter[s, dt]] begin[{] local_variable[type[BreakIterator], breakIterator] if[binary_operation[member[.breakIterator], ==, literal[null]]] begin[{] return[call[.defaultSentenceBreak, parameter[member[.s]]]] else begin[{] None end[}] call[breakIterator.setText, parameter[member[.s]]] local_variable[type[int], sbrk] if[binary_operation[member[.dt], ==, literal[null]]] begin[{] return[member[.sbrk]] else begin[{] None end[}] if[binary_operation[member[.sbrk], <, binary_operation[call[s.length, parameter[]], -, literal[1]]]] begin[{] return[member[.sbrk]] else begin[{] None end[}] if[call[.isTextTree, parameter[member[.dt]]]] begin[{] local_variable[type[TextTree], ttnext] local_variable[type[String], combined] call[breakIterator.setText, parameter[member[.combined]]] local_variable[type[int], sbrk2] if[binary_operation[member[.sbrk], <, member[.sbrk2]]] begin[{] return[member[.sbrk]] else begin[{] None end[}] else begin[{] None end[}] if[call[.isSentenceBreak, parameter[member[.dt], literal[false]]]] begin[{] return[member[.sbrk]] else begin[{] None end[}] local_variable[type[String], combined] call[breakIterator.setText, parameter[member[.combined]]] local_variable[type[int], sbrk2] if[binary_operation[member[.sbrk2], <=, member[.sbrk]]] begin[{] return[member[.sbrk2]] else begin[{] None end[}] return[literal[1]] end[}] END[}]
Keyword[private] Keyword[int] identifier[getSentenceBreak] operator[SEP] identifier[String] identifier[s] , identifier[DocTree] identifier[dt] operator[SEP] { identifier[BreakIterator] identifier[breakIterator] operator[=] identifier[trees] operator[SEP] identifier[getBreakIterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[breakIterator] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[defaultSentenceBreak] operator[SEP] identifier[s] operator[SEP] operator[SEP] } identifier[breakIterator] operator[SEP] identifier[setText] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[sbrk] operator[=] identifier[breakIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dt] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[sbrk] operator[SEP] } Keyword[if] operator[SEP] identifier[sbrk] operator[<] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] { Keyword[return] identifier[sbrk] operator[SEP] } Keyword[if] operator[SEP] identifier[isTextTree] operator[SEP] identifier[dt] operator[SEP] operator[SEP] { identifier[TextTree] identifier[ttnext] operator[=] operator[SEP] identifier[TextTree] operator[SEP] identifier[dt] operator[SEP] identifier[String] identifier[combined] operator[=] identifier[s] operator[+] identifier[ttnext] operator[SEP] identifier[getBody] operator[SEP] operator[SEP] operator[SEP] identifier[breakIterator] operator[SEP] identifier[setText] operator[SEP] identifier[combined] operator[SEP] operator[SEP] Keyword[int] identifier[sbrk2] operator[=] identifier[breakIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sbrk] operator[<] identifier[sbrk2] operator[SEP] { Keyword[return] identifier[sbrk] operator[SEP] } } Keyword[if] operator[SEP] identifier[isSentenceBreak] operator[SEP] identifier[dt] , literal[boolean] operator[SEP] operator[SEP] { Keyword[return] identifier[sbrk] operator[SEP] } identifier[String] identifier[combined] operator[=] identifier[s] operator[+] literal[String] operator[SEP] identifier[breakIterator] operator[SEP] identifier[setText] operator[SEP] identifier[combined] operator[SEP] operator[SEP] Keyword[int] identifier[sbrk2] operator[=] identifier[breakIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sbrk2] operator[<=] identifier[sbrk] operator[SEP] { Keyword[return] identifier[sbrk2] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
public String execute(List<String> parameterList, TestContext context) { if (parameterList == null || parameterList.size() < 8) { throw new InvalidFunctionUsageException("Function parameters not set correctly - need parameters: username,password,realm,noncekey,method,uri,opaque,algorithm"); } StringBuilder authorizationHeader = new StringBuilder(); String username = parameterList.get(0); String password = parameterList.get(1); String realm = parameterList.get(2); String noncekey = parameterList.get(3); String method = parameterList.get(4); String uri = parameterList.get(5); String opaque = parameterList.get(6); String algorithm = parameterList.get(7); String digest1 = username + ":" + realm + ":" + password; String digest2 = method + ":" + uri; Long expirationTime = System.currentTimeMillis() + nonceValidity; String nonce = Base64.encodeBase64String((expirationTime + ":" + getDigestHex(algorithm, expirationTime + ":" + noncekey)).getBytes()); authorizationHeader.append("Digest username="); authorizationHeader.append(username); authorizationHeader.append(",realm="); authorizationHeader.append(realm); authorizationHeader.append(",nonce="); authorizationHeader.append(nonce); authorizationHeader.append(",uri="); authorizationHeader.append(uri); authorizationHeader.append(",response="); authorizationHeader.append(getDigestHex(algorithm, getDigestHex(algorithm, digest1) + ":" + nonce + ":" + getDigestHex(algorithm, digest2))); authorizationHeader.append(",opaque="); authorizationHeader.append(getDigestHex(algorithm, opaque)); authorizationHeader.append(",algorithm="); authorizationHeader.append(algorithm); return authorizationHeader.toString(); }
class class_name[name] begin[{] method[execute, return_type[type[String]], modifier[public], parameter[parameterList, context]] begin[{] if[binary_operation[binary_operation[member[.parameterList], ==, literal[null]], ||, binary_operation[call[parameterList.size, parameter[]], <, literal[8]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Function parameters not set correctly - need parameters: username,password,realm,noncekey,method,uri,opaque,algorithm")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidFunctionUsageException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[StringBuilder], authorizationHeader] local_variable[type[String], username] local_variable[type[String], password] local_variable[type[String], realm] local_variable[type[String], noncekey] local_variable[type[String], method] local_variable[type[String], uri] local_variable[type[String], opaque] local_variable[type[String], algorithm] local_variable[type[String], digest1] local_variable[type[String], digest2] local_variable[type[Long], expirationTime] local_variable[type[String], nonce] call[authorizationHeader.append, parameter[literal["Digest username="]]] call[authorizationHeader.append, parameter[member[.username]]] call[authorizationHeader.append, parameter[literal[",realm="]]] call[authorizationHeader.append, parameter[member[.realm]]] call[authorizationHeader.append, parameter[literal[",nonce="]]] call[authorizationHeader.append, parameter[member[.nonce]]] call[authorizationHeader.append, parameter[literal[",uri="]]] call[authorizationHeader.append, parameter[member[.uri]]] call[authorizationHeader.append, parameter[literal[",response="]]] call[authorizationHeader.append, parameter[call[.getDigestHex, parameter[member[.algorithm], binary_operation[binary_operation[binary_operation[binary_operation[call[.getDigestHex, parameter[member[.algorithm], member[.digest1]]], +, literal[":"]], +, member[.nonce]], +, literal[":"]], +, call[.getDigestHex, parameter[member[.algorithm], member[.digest2]]]]]]]] call[authorizationHeader.append, parameter[literal[",opaque="]]] call[authorizationHeader.append, parameter[call[.getDigestHex, parameter[member[.algorithm], member[.opaque]]]]] call[authorizationHeader.append, parameter[literal[",algorithm="]]] call[authorizationHeader.append, parameter[member[.algorithm]]] return[call[authorizationHeader.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[execute] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[parameterList] , identifier[TestContext] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[parameterList] operator[==] Other[null] operator[||] identifier[parameterList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[8] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidFunctionUsageException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[authorizationHeader] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[username] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[password] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[realm] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[String] identifier[noncekey] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[String] identifier[method] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[String] identifier[uri] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[5] operator[SEP] operator[SEP] identifier[String] identifier[opaque] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[6] operator[SEP] operator[SEP] identifier[String] identifier[algorithm] operator[=] identifier[parameterList] operator[SEP] identifier[get] operator[SEP] Other[7] operator[SEP] operator[SEP] identifier[String] identifier[digest1] operator[=] identifier[username] operator[+] literal[String] operator[+] identifier[realm] operator[+] literal[String] operator[+] identifier[password] operator[SEP] identifier[String] identifier[digest2] operator[=] identifier[method] operator[+] literal[String] operator[+] identifier[uri] operator[SEP] identifier[Long] identifier[expirationTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] identifier[nonceValidity] operator[SEP] identifier[String] identifier[nonce] operator[=] identifier[Base64] operator[SEP] identifier[encodeBase64String] operator[SEP] operator[SEP] identifier[expirationTime] operator[+] literal[String] operator[+] identifier[getDigestHex] operator[SEP] identifier[algorithm] , identifier[expirationTime] operator[+] literal[String] operator[+] identifier[noncekey] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] identifier[username] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] identifier[realm] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] identifier[nonce] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] identifier[getDigestHex] operator[SEP] identifier[algorithm] , identifier[getDigestHex] operator[SEP] identifier[algorithm] , identifier[digest1] operator[SEP] operator[+] literal[String] operator[+] identifier[nonce] operator[+] literal[String] operator[+] identifier[getDigestHex] operator[SEP] identifier[algorithm] , identifier[digest2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] identifier[getDigestHex] operator[SEP] identifier[algorithm] , identifier[opaque] operator[SEP] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authorizationHeader] operator[SEP] identifier[append] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] identifier[authorizationHeader] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static <K, V> ImmutableListMultimap<K, V> copyOf( Multimap<? extends K, ? extends V> multimap) { if (multimap.isEmpty()) { return of(); } // TODO(user): copy ImmutableSetMultimap by using asList() on the sets if (multimap instanceof ImmutableListMultimap) { @SuppressWarnings("unchecked") // safe since multimap is not writable ImmutableListMultimap<K, V> kvMultimap = (ImmutableListMultimap<K, V>) multimap; if (!kvMultimap.isPartialView()) { return kvMultimap; } } ImmutableMap.Builder<K, ImmutableList<V>> builder = new ImmutableMap.Builder<K, ImmutableList<V>>(multimap.asMap().size()); int size = 0; for (Entry<? extends K, ? extends Collection<? extends V>> entry : multimap.asMap().entrySet()) { ImmutableList<V> list = ImmutableList.copyOf(entry.getValue()); if (!list.isEmpty()) { builder.put(entry.getKey(), list); size += list.size(); } } return new ImmutableListMultimap<K, V>(builder.build(), size); }
class class_name[name] begin[{] method[copyOf, return_type[type[ImmutableListMultimap]], modifier[public static], parameter[multimap]] begin[{] if[call[multimap.isEmpty, parameter[]]] begin[{] return[call[.of, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.multimap], instanceof, type[ImmutableListMultimap]]] begin[{] local_variable[type[ImmutableListMultimap], kvMultimap] if[call[kvMultimap.isPartialView, parameter[]]] begin[{] return[member[.kvMultimap]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[ImmutableMap], builder] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=copyOf, postfix_operators=[], prefix_operators=[], qualifier=ImmutableList, selectors=[], type_arguments=None), name=list)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=ImmutableList, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=list, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=asMap, postfix_operators=[], prefix_operators=[], qualifier=multimap, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=extends, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Collection, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=ImmutableListMultimap, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[ImmutableListMultimap] operator[<] identifier[K] , identifier[V] operator[>] identifier[copyOf] operator[SEP] identifier[Multimap] operator[<] operator[?] Keyword[extends] identifier[K] , operator[?] Keyword[extends] identifier[V] operator[>] identifier[multimap] operator[SEP] { Keyword[if] operator[SEP] identifier[multimap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[of] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[multimap] Keyword[instanceof] identifier[ImmutableListMultimap] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[ImmutableListMultimap] operator[<] identifier[K] , identifier[V] operator[>] identifier[kvMultimap] operator[=] operator[SEP] identifier[ImmutableListMultimap] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[multimap] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[kvMultimap] operator[SEP] identifier[isPartialView] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[kvMultimap] operator[SEP] } } identifier[ImmutableMap] operator[SEP] identifier[Builder] operator[<] identifier[K] , identifier[ImmutableList] operator[<] identifier[V] operator[>] operator[>] identifier[builder] operator[=] Keyword[new] identifier[ImmutableMap] operator[SEP] identifier[Builder] operator[<] identifier[K] , identifier[ImmutableList] operator[<] identifier[V] operator[>] operator[>] operator[SEP] identifier[multimap] operator[SEP] identifier[asMap] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] operator[?] Keyword[extends] identifier[K] , operator[?] Keyword[extends] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[V] operator[>] operator[>] identifier[entry] operator[:] identifier[multimap] operator[SEP] identifier[asMap] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[ImmutableList] operator[<] identifier[V] operator[>] identifier[list] operator[=] identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[list] operator[SEP] operator[SEP] identifier[size] operator[+=] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[ImmutableListMultimap] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] , identifier[size] operator[SEP] operator[SEP] }
@Override public List<String> getHeadLines(final String type) { ArrayList<String> lines = headers.get(type); return lines == null ? null : Collections.unmodifiableList(lines); }
class class_name[name] begin[{] method[getHeadLines, return_type[type[List]], modifier[public], parameter[type]] begin[{] local_variable[type[ArrayList], lines] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=lines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getHeadLines] operator[SEP] Keyword[final] identifier[String] identifier[type] operator[SEP] { identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[lines] operator[=] identifier[headers] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[lines] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[lines] operator[SEP] operator[SEP] }
private int processNextToken(RawTextNode node, final int offset, String text) { // Find the transition whose pattern matches earliest in the raw text (and is applicable) int numCharsConsumed; Context next; int earliestStart = Integer.MAX_VALUE; int earliestEnd = -1; Transition earliestTransition = null; Matcher earliestMatcher = null; List<Transition> ts = TRANSITIONS.get(context.state); if (ts == null) { throw new NullPointerException( "no transitions for state: " + context.state + " @" + node.substringLocation(offset, offset + 1)); } for (Transition transition : ts) { if (transition.pattern != null) { Matcher matcher = transition.pattern.matcher(text); // For each transition: // look for matches, if the match is later than the current earliest match, give up // otherwise if the match is applicable, store it. // NOTE: matcher.find() returns matches in sequential order. try { while (matcher.find() && matcher.start() < earliestStart) { int start = matcher.start(); int end = matcher.end(); if (transition.isApplicableTo(context, matcher)) { earliestStart = start; earliestEnd = end; earliestTransition = transition; earliestMatcher = matcher; break; } } } catch (StackOverflowError soe) { // catch and annotate with the pattern. throw new RuntimeException( String.format( "StackOverflow while trying to match: '%s' in context %s starting @ %s", transition.pattern, context, node.substringLocation(offset, offset + 1)), soe); } } else if (transition.literal != null) { int start = 0; int index; String needle = transition.literal; while ((index = text.indexOf(needle, start)) != -1 && index < earliestStart) { if (transition.isApplicableTo(context, null)) { earliestStart = index; earliestEnd = index + needle.length(); earliestTransition = transition; earliestMatcher = null; break; } } } else { if (text.length() < earliestStart && transition.isApplicableTo(context, null)) { earliestStart = text.length(); earliestEnd = text.length(); earliestTransition = transition; earliestMatcher = null; } } } if (earliestTransition != null) { int transitionOffset = offset; // the earliest start might be at the end for null transitions. if (earliestStart < text.length()) { transitionOffset += earliestStart; } next = earliestTransition.computeNextContext(node, transitionOffset, context, earliestMatcher); numCharsConsumed = earliestEnd; } else { throw SoyAutoescapeException.createWithNode( "Error determining next state when encountering \"" + text + "\" in " + context, // calculate a raw text node that points at the beginning of the string that couldn't // bet matched. node.substring(Integer.MAX_VALUE /* bogus id */, offset)); } if (numCharsConsumed == 0 && next.state == context.state) { throw new IllegalStateException("Infinite loop at `" + text + "` / " + context); } this.context = next; return numCharsConsumed; }
class class_name[name] begin[{] method[processNextToken, return_type[type[int]], modifier[private], parameter[node, offset, text]] begin[{] local_variable[type[int], numCharsConsumed] local_variable[type[Context], next] local_variable[type[int], earliestStart] local_variable[type[int], earliestEnd] local_variable[type[Transition], earliestTransition] local_variable[type[Matcher], earliestMatcher] local_variable[type[List], ts] if[binary_operation[member[.ts], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no transitions for state: "), operandr=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" @"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substringLocation, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=transition, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=literal, postfix_operators=[], prefix_operators=[], qualifier=transition, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=MemberReference(member=earliestStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=isApplicableTo, postfix_operators=[], prefix_operators=[], qualifier=transition, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestTransition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=transition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestMatcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=start)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=literal, postfix_operators=[], prefix_operators=[], qualifier=transition, selectors=[]), name=needle)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=isApplicableTo, postfix_operators=[], prefix_operators=[], qualifier=transition, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=needle, selectors=[], type_arguments=None), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestTransition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=transition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestMatcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), BreakStatement(goto=None, label=None)]))]), condition=BinaryOperation(operandl=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=needle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=earliestStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=transition.pattern, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), name=start)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=end, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=matcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isApplicableTo, postfix_operators=[], prefix_operators=[], qualifier=transition, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestTransition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=transition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=earliestMatcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=matcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), operandr=MemberReference(member=earliestStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="StackOverflow while trying to match: '%s' in context %s starting @ %s"), MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=transition, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substringLocation, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=soe, 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=soe, types=['StackOverflowError']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=transition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Transition, sub_type=None))), label=None) if[binary_operation[member[.earliestTransition], !=, literal[null]]] begin[{] local_variable[type[int], transitionOffset] if[binary_operation[member[.earliestStart], <, call[text.length, parameter[]]]] begin[{] assign[member[.transitionOffset], member[.earliestStart]] else begin[{] None end[}] assign[member[.next], call[earliestTransition.computeNextContext, parameter[member[.node], member[.transitionOffset], member[.context], member[.earliestMatcher]]]] assign[member[.numCharsConsumed], member[.earliestEnd]] else begin[{] ThrowStatement(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error determining next state when encountering \""), operandr=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" in "), operator=+), operandr=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], member=createWithNode, postfix_operators=[], prefix_operators=[], qualifier=SoyAutoescapeException, selectors=[], type_arguments=None), label=None) end[}] if[binary_operation[binary_operation[member[.numCharsConsumed], ==, literal[0]], &&, binary_operation[member[next.state], ==, member[context.state]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Infinite loop at `"), operandr=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="` / "), operator=+), operandr=MemberReference(member=context, 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=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.context]], member[.next]] return[member[.numCharsConsumed]] end[}] END[}]
Keyword[private] Keyword[int] identifier[processNextToken] operator[SEP] identifier[RawTextNode] identifier[node] , Keyword[final] Keyword[int] identifier[offset] , identifier[String] identifier[text] operator[SEP] { Keyword[int] identifier[numCharsConsumed] operator[SEP] identifier[Context] identifier[next] operator[SEP] Keyword[int] identifier[earliestStart] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[int] identifier[earliestEnd] operator[=] operator[-] Other[1] operator[SEP] identifier[Transition] identifier[earliestTransition] operator[=] Other[null] operator[SEP] identifier[Matcher] identifier[earliestMatcher] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[Transition] operator[>] identifier[ts] operator[=] identifier[TRANSITIONS] operator[SEP] identifier[get] operator[SEP] identifier[context] operator[SEP] identifier[state] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ts] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[+] identifier[context] operator[SEP] identifier[state] operator[+] literal[String] operator[+] identifier[node] operator[SEP] identifier[substringLocation] operator[SEP] identifier[offset] , identifier[offset] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Transition] identifier[transition] operator[:] identifier[ts] operator[SEP] { Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[pattern] operator[!=] Other[null] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[transition] operator[SEP] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[text] operator[SEP] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[&&] identifier[matcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[<] identifier[earliestStart] operator[SEP] { Keyword[int] identifier[start] operator[=] identifier[matcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[isApplicableTo] operator[SEP] identifier[context] , identifier[matcher] operator[SEP] operator[SEP] { identifier[earliestStart] operator[=] identifier[start] operator[SEP] identifier[earliestEnd] operator[=] identifier[end] operator[SEP] identifier[earliestTransition] operator[=] identifier[transition] operator[SEP] identifier[earliestMatcher] operator[=] identifier[matcher] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[StackOverflowError] identifier[soe] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[transition] operator[SEP] identifier[pattern] , identifier[context] , identifier[node] operator[SEP] identifier[substringLocation] operator[SEP] identifier[offset] , identifier[offset] operator[+] Other[1] operator[SEP] operator[SEP] , identifier[soe] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[literal] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] Keyword[int] identifier[index] operator[SEP] identifier[String] identifier[needle] operator[=] identifier[transition] operator[SEP] identifier[literal] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[text] operator[SEP] identifier[indexOf] operator[SEP] identifier[needle] , identifier[start] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[&&] identifier[index] operator[<] identifier[earliestStart] operator[SEP] { Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[isApplicableTo] operator[SEP] identifier[context] , Other[null] operator[SEP] operator[SEP] { identifier[earliestStart] operator[=] identifier[index] operator[SEP] identifier[earliestEnd] operator[=] identifier[index] operator[+] identifier[needle] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[earliestTransition] operator[=] identifier[transition] operator[SEP] identifier[earliestMatcher] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[earliestStart] operator[&&] identifier[transition] operator[SEP] identifier[isApplicableTo] operator[SEP] identifier[context] , Other[null] operator[SEP] operator[SEP] { identifier[earliestStart] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[earliestEnd] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[earliestTransition] operator[=] identifier[transition] operator[SEP] identifier[earliestMatcher] operator[=] Other[null] operator[SEP] } } } Keyword[if] operator[SEP] identifier[earliestTransition] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[transitionOffset] operator[=] identifier[offset] operator[SEP] Keyword[if] operator[SEP] identifier[earliestStart] operator[<] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[transitionOffset] operator[+=] identifier[earliestStart] operator[SEP] } identifier[next] operator[=] identifier[earliestTransition] operator[SEP] identifier[computeNextContext] operator[SEP] identifier[node] , identifier[transitionOffset] , identifier[context] , identifier[earliestMatcher] operator[SEP] operator[SEP] identifier[numCharsConsumed] operator[=] identifier[earliestEnd] operator[SEP] } Keyword[else] { Keyword[throw] identifier[SoyAutoescapeException] operator[SEP] identifier[createWithNode] operator[SEP] literal[String] operator[+] identifier[text] operator[+] literal[String] operator[+] identifier[context] , identifier[node] operator[SEP] identifier[substring] operator[SEP] identifier[Integer] operator[SEP] identifier[MAX_VALUE] , identifier[offset] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[numCharsConsumed] operator[==] Other[0] operator[&&] identifier[next] operator[SEP] identifier[state] operator[==] identifier[context] operator[SEP] identifier[state] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[text] operator[+] literal[String] operator[+] identifier[context] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[context] operator[=] identifier[next] operator[SEP] Keyword[return] identifier[numCharsConsumed] operator[SEP] }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public synchronized void start(final Listener listener, final Infrastructure infra) { if (listener == null) throw new IllegalArgumentException("Cannot pass null to " + BlockingQueueReceiver.class.getSimpleName() + ".setListener"); if (this.listener != null) throw new IllegalStateException( "Cannot set a new Listener (" + SafeString.objectDescription(listener) + ") on a " + BlockingQueueReceiver.class.getSimpleName() + " when there's one already set (" + SafeString.objectDescription(this.listener) + ")"); this.listener = listener; infra.getThreadingModel().runDaemon(this, "BQReceiver-" + address.toString()); }
class class_name[name] begin[{] method[start, return_type[void], modifier[synchronized public], parameter[listener, infra]] begin[{] if[binary_operation[member[.listener], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot pass null to "), 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=BlockingQueueReceiver, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".setListener"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.listener]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot set a new Listener ("), operandr=MethodInvocation(arguments=[MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=SafeString, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") on a "), operator=+), 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=BlockingQueueReceiver, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" when there's one already set ("), operator=+), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=listener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=SafeString, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.listener]], member[.listener]] call[infra.getThreadingModel, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[start] operator[SEP] Keyword[final] identifier[Listener] identifier[listener] , Keyword[final] identifier[Infrastructure] identifier[infra] operator[SEP] { Keyword[if] operator[SEP] identifier[listener] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[BlockingQueueReceiver] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[listener] operator[!=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[SafeString] operator[SEP] identifier[objectDescription] operator[SEP] identifier[listener] operator[SEP] operator[+] literal[String] operator[+] identifier[BlockingQueueReceiver] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[SafeString] operator[SEP] identifier[objectDescription] operator[SEP] Keyword[this] operator[SEP] identifier[listener] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[listener] operator[=] identifier[listener] operator[SEP] identifier[infra] operator[SEP] identifier[getThreadingModel] operator[SEP] operator[SEP] operator[SEP] identifier[runDaemon] operator[SEP] Keyword[this] , literal[String] operator[+] identifier[address] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static final short readShort(byte[] array, int offset) { if (array.length < offset + 2) { throw new IllegalArgumentException("no room in array"); } return (short) (((array[offset]<<8) & 0xff00) + (array[offset + 1] & 0xff )); }
class class_name[name] begin[{] method[readShort, return_type[type[short]], modifier[final public static], parameter[array, offset]] begin[{] if[binary_operation[member[array.length], <, binary_operation[member[.offset], +, literal[2]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no room in array")], 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[Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff00), operator=&), operandr=BinaryOperation(operandl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operator=+), type=BasicType(dimensions=[], name=short))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[short] identifier[readShort] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[array] , Keyword[int] identifier[offset] operator[SEP] { Keyword[if] operator[SEP] identifier[array] operator[SEP] identifier[length] operator[<] identifier[offset] operator[+] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] Keyword[short] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[array] operator[SEP] identifier[offset] operator[SEP] operator[<<] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] identifier[array] operator[SEP] identifier[offset] operator[+] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] }
public static String getConnectionUser(AlluxioConfiguration conf) throws AccessControlException { if (!SecurityUtils.isAuthenticationEnabled(conf)) { throw new AccessControlException(ExceptionMessage.AUTHENTICATION_IS_NOT_ENABLED.getMessage()); } User user = sConnectionUserThreadLocal.get(); if (user == null) { return null; } return user.getName(); }
class class_name[name] begin[{] method[getConnectionUser, return_type[type[String]], modifier[public static], parameter[conf]] begin[{] if[call[SecurityUtils.isAuthenticationEnabled, parameter[member[.conf]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ExceptionMessage.AUTHENTICATION_IS_NOT_ENABLED, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AccessControlException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[User], user] if[binary_operation[member[.user], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[user.getName, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getConnectionUser] operator[SEP] identifier[AlluxioConfiguration] identifier[conf] operator[SEP] Keyword[throws] identifier[AccessControlException] { Keyword[if] operator[SEP] operator[!] identifier[SecurityUtils] operator[SEP] identifier[isAuthenticationEnabled] operator[SEP] identifier[conf] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[AccessControlException] operator[SEP] identifier[ExceptionMessage] operator[SEP] identifier[AUTHENTICATION_IS_NOT_ENABLED] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[User] identifier[user] operator[=] identifier[sConnectionUserThreadLocal] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] }
private SepaVersion determinePainVersionInternal(HBCIPassportInternal passport, final String gvName) { log.debug("searching for supported pain versions for GV " + gvName); if (!passport.jobSupported(gvName)) { log.debug("don't have any BPD for GV " + gvName); return null; } List<SepaVersion> found = new ArrayList<>(); // GV-Restrictions laden und darüber iterieren Map<String, String> props = passport.getLowlevelJobRestrictions(gvName); for (String key : props.keySet()) { // Die Keys, welche die Schema-Versionen enthalten, heissen alle "suppformats*" if (!key.startsWith("suppformats")) continue; String urn = props.get(key); try { SepaVersion version = SepaVersion.byURN(urn); if (version.getType() == this.getPainType()) { if (!version.isSupported(this.getPainJobName())) { log.debug(" unsupported " + version); continue; } // Frueher wurde hier noch geschaut, ob die PAIN-Version per // PainVersion.getKnownVersions bekannt ist. In dem Fall wurde // stattdessen unsere verwendet, damit beim Senden des Auftrages // der korrekte URN verwendet wird. Das ist inzwischen nicht mehr // noetig, da das "PainVersion.byURN" (siehe oben) ohnehin bereits // macht - wenn wir die PAIN-Version kennen, nehmen wir gleich die // eigene Instanz. Siehe auch // TestPainVersion#test011 bzw. http://www.onlinebanking-forum.de/phpBB2/viewtopic.php?p=95160#95160 log.debug(" found " + version); found.add(version); } } catch (Exception e) { log.warn("ignoring invalid pain version " + urn); log.error(e.getMessage(), e); } } return SepaVersion.findGreatest(found); }
class class_name[name] begin[{] method[determinePainVersionInternal, return_type[type[SepaVersion]], modifier[private], parameter[passport, gvName]] begin[{] call[log.debug, parameter[binary_operation[literal["searching for supported pain versions for GV "], +, member[.gvName]]]] if[call[passport.jobSupported, parameter[member[.gvName]]]] begin[{] call[log.debug, parameter[binary_operation[literal["don't have any BPD for GV "], +, member[.gvName]]]] return[literal[null]] else begin[{] None end[}] local_variable[type[List], found] local_variable[type[Map], props] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="suppformats")], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=key, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), name=urn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=urn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=byURN, postfix_operators=[], prefix_operators=[], qualifier=SepaVersion, selectors=[], type_arguments=None), name=version)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SepaVersion, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=version, selectors=[], type_arguments=None), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getPainType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getPainJobName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=isSupported, postfix_operators=[], prefix_operators=['!'], qualifier=version, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" unsupported "), operandr=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" found "), operandr=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=found, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ignoring invalid pain version "), operandr=MemberReference(member=urn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[SepaVersion.findGreatest, parameter[member[.found]]]] end[}] END[}]
Keyword[private] identifier[SepaVersion] identifier[determinePainVersionInternal] operator[SEP] identifier[HBCIPassportInternal] identifier[passport] , Keyword[final] identifier[String] identifier[gvName] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[gvName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[passport] operator[SEP] identifier[jobSupported] operator[SEP] identifier[gvName] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[gvName] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[SepaVersion] operator[>] identifier[found] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[props] operator[=] identifier[passport] operator[SEP] identifier[getLowlevelJobRestrictions] operator[SEP] identifier[gvName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[props] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[key] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[String] identifier[urn] operator[=] identifier[props] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[try] { identifier[SepaVersion] identifier[version] operator[=] identifier[SepaVersion] operator[SEP] identifier[byURN] operator[SEP] identifier[urn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] Keyword[this] operator[SEP] identifier[getPainType] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[version] operator[SEP] identifier[isSupported] operator[SEP] Keyword[this] operator[SEP] identifier[getPainJobName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[version] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[version] operator[SEP] operator[SEP] identifier[found] operator[SEP] identifier[add] operator[SEP] identifier[version] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[urn] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[SepaVersion] operator[SEP] identifier[findGreatest] operator[SEP] identifier[found] operator[SEP] operator[SEP] }
public double getAndAdd(int index, double delta) { writeLock.lock(); double value = vector.get(index); vector.set(index, value + delta); writeLock.unlock(); return value; }
class class_name[name] begin[{] method[getAndAdd, return_type[type[double]], modifier[public], parameter[index, delta]] begin[{] call[writeLock.lock, parameter[]] local_variable[type[double], value] call[vector.set, parameter[member[.index], binary_operation[member[.value], +, member[.delta]]]] call[writeLock.unlock, parameter[]] return[member[.value]] end[}] END[}]
Keyword[public] Keyword[double] identifier[getAndAdd] operator[SEP] Keyword[int] identifier[index] , Keyword[double] identifier[delta] operator[SEP] { identifier[writeLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[value] operator[=] identifier[vector] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[vector] operator[SEP] identifier[set] operator[SEP] identifier[index] , identifier[value] operator[+] identifier[delta] operator[SEP] operator[SEP] identifier[writeLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] }
public static <T> DataSet<LongValue> count(DataSet<T> input) { return input .map(new MapTo<>(new LongValue(1))) .returns(LONG_VALUE_TYPE_INFO) .name("Emit 1") .reduce(new AddLongValue()) .name("Sum"); }
class class_name[name] begin[{] method[count, return_type[type[DataSet]], modifier[public static], parameter[input]] begin[{] return[call[input.map, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LongValue, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=MapTo, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[DataSet] operator[<] identifier[LongValue] operator[>] identifier[count] operator[SEP] identifier[DataSet] operator[<] identifier[T] operator[>] identifier[input] operator[SEP] { Keyword[return] identifier[input] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[MapTo] operator[<] operator[>] operator[SEP] Keyword[new] identifier[LongValue] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[returns] operator[SEP] identifier[LONG_VALUE_TYPE_INFO] operator[SEP] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[reduce] operator[SEP] Keyword[new] identifier[AddLongValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public String getPcType() { String result = m_loginForm.getPcType(); if (result == null) { result = CmsLoginForm.PC_TYPE_PUBLIC; } return result; }
class class_name[name] begin[{] method[getPcType, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] assign[member[.result], member[CmsLoginForm.PC_TYPE_PUBLIC]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[String] identifier[getPcType] operator[SEP] operator[SEP] { identifier[String] identifier[result] operator[=] identifier[m_loginForm] operator[SEP] identifier[getPcType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] { identifier[result] operator[=] identifier[CmsLoginForm] operator[SEP] identifier[PC_TYPE_PUBLIC] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static <E> Set<E> copyOf(Iterator<? extends E> elementsIterator) { Set<E> result = new HashSet<>(); while (elementsIterator.hasNext()) { result.add(elementsIterator.next()); } return Collections.unmodifiableSet(result); }
class class_name[name] begin[{] method[copyOf, return_type[type[Set]], modifier[public static], parameter[elementsIterator]] begin[{] local_variable[type[Set], result] while[call[elementsIterator.hasNext, parameter[]]] begin[{] call[result.add, parameter[call[elementsIterator.next, parameter[]]]] end[}] return[call[Collections.unmodifiableSet, parameter[member[.result]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[Set] operator[<] identifier[E] operator[>] identifier[copyOf] operator[SEP] identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] identifier[elementsIterator] operator[SEP] { identifier[Set] operator[<] identifier[E] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[elementsIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[elementsIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableSet] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
private RegistrationResponse registerJobMasterInternal( final JobMasterGateway jobMasterGateway, JobID jobId, String jobManagerAddress, ResourceID jobManagerResourceId) { if (jobManagerRegistrations.containsKey(jobId)) { JobManagerRegistration oldJobManagerRegistration = jobManagerRegistrations.get(jobId); if (Objects.equals(oldJobManagerRegistration.getJobMasterId(), jobMasterGateway.getFencingToken())) { // same registration log.debug("Job manager {}@{} was already registered.", jobMasterGateway.getFencingToken(), jobManagerAddress); } else { // tell old job manager that he is no longer the job leader disconnectJobManager( oldJobManagerRegistration.getJobID(), new Exception("New job leader for job " + jobId + " found.")); JobManagerRegistration jobManagerRegistration = new JobManagerRegistration( jobId, jobManagerResourceId, jobMasterGateway); jobManagerRegistrations.put(jobId, jobManagerRegistration); jmResourceIdRegistrations.put(jobManagerResourceId, jobManagerRegistration); } } else { // new registration for the job JobManagerRegistration jobManagerRegistration = new JobManagerRegistration( jobId, jobManagerResourceId, jobMasterGateway); jobManagerRegistrations.put(jobId, jobManagerRegistration); jmResourceIdRegistrations.put(jobManagerResourceId, jobManagerRegistration); } log.info("Registered job manager {}@{} for job {}.", jobMasterGateway.getFencingToken(), jobManagerAddress, jobId); jobManagerHeartbeatManager.monitorTarget(jobManagerResourceId, new HeartbeatTarget<Void>() { @Override public void receiveHeartbeat(ResourceID resourceID, Void payload) { // the ResourceManager will always send heartbeat requests to the JobManager } @Override public void requestHeartbeat(ResourceID resourceID, Void payload) { jobMasterGateway.heartbeatFromResourceManager(resourceID); } }); return new JobMasterRegistrationSuccess( getFencingToken(), resourceId); }
class class_name[name] begin[{] method[registerJobMasterInternal, return_type[type[RegistrationResponse]], modifier[private], parameter[jobMasterGateway, jobId, jobManagerAddress, jobManagerResourceId]] begin[{] if[call[jobManagerRegistrations.containsKey, parameter[member[.jobId]]]] begin[{] local_variable[type[JobManagerRegistration], oldJobManagerRegistration] if[call[Objects.equals, parameter[call[oldJobManagerRegistration.getJobMasterId, parameter[]], call[jobMasterGateway.getFencingToken, parameter[]]]]] begin[{] call[log.debug, parameter[literal["Job manager {}@{} was already registered."], call[jobMasterGateway.getFencingToken, parameter[]], member[.jobManagerAddress]]] else begin[{] call[.disconnectJobManager, parameter[call[oldJobManagerRegistration.getJobID, parameter[]], ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="New job leader for job "), operandr=MemberReference(member=jobId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" found."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))]] local_variable[type[JobManagerRegistration], jobManagerRegistration] call[jobManagerRegistrations.put, parameter[member[.jobId], member[.jobManagerRegistration]]] call[jmResourceIdRegistrations.put, parameter[member[.jobManagerResourceId], member[.jobManagerRegistration]]] end[}] else begin[{] local_variable[type[JobManagerRegistration], jobManagerRegistration] call[jobManagerRegistrations.put, parameter[member[.jobId], member[.jobManagerRegistration]]] call[jmResourceIdRegistrations.put, parameter[member[.jobManagerResourceId], member[.jobManagerRegistration]]] end[}] call[log.info, parameter[literal["Registered job manager {}@{} for job {}."], call[jobMasterGateway.getFencingToken, parameter[]], member[.jobManagerAddress], member[.jobId]]] call[jobManagerHeartbeatManager.monitorTarget, parameter[member[.jobManagerResourceId], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[], documentation=None, modifiers={'public'}, name=receiveHeartbeat, parameters=[FormalParameter(annotations=[], modifiers=set(), name=resourceID, type=ReferenceType(arguments=None, dimensions=[], name=ResourceID, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=payload, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=heartbeatFromResourceManager, postfix_operators=[], prefix_operators=[], qualifier=jobMasterGateway, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=requestHeartbeat, parameters=[FormalParameter(annotations=[], modifiers=set(), name=resourceID, type=ReferenceType(arguments=None, dimensions=[], name=ResourceID, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=payload, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=HeartbeatTarget, sub_type=None))]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getFencingToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=resourceId, 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=JobMasterRegistrationSuccess, sub_type=None))] end[}] END[}]
Keyword[private] identifier[RegistrationResponse] identifier[registerJobMasterInternal] operator[SEP] Keyword[final] identifier[JobMasterGateway] identifier[jobMasterGateway] , identifier[JobID] identifier[jobId] , identifier[String] identifier[jobManagerAddress] , identifier[ResourceID] identifier[jobManagerResourceId] operator[SEP] { Keyword[if] operator[SEP] identifier[jobManagerRegistrations] operator[SEP] identifier[containsKey] operator[SEP] identifier[jobId] operator[SEP] operator[SEP] { identifier[JobManagerRegistration] identifier[oldJobManagerRegistration] operator[=] identifier[jobManagerRegistrations] operator[SEP] identifier[get] operator[SEP] identifier[jobId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[oldJobManagerRegistration] operator[SEP] identifier[getJobMasterId] operator[SEP] operator[SEP] , identifier[jobMasterGateway] operator[SEP] identifier[getFencingToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[jobMasterGateway] operator[SEP] identifier[getFencingToken] operator[SEP] operator[SEP] , identifier[jobManagerAddress] operator[SEP] operator[SEP] } Keyword[else] { identifier[disconnectJobManager] operator[SEP] identifier[oldJobManagerRegistration] operator[SEP] identifier[getJobID] operator[SEP] operator[SEP] , Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[jobId] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[JobManagerRegistration] identifier[jobManagerRegistration] operator[=] Keyword[new] identifier[JobManagerRegistration] operator[SEP] identifier[jobId] , identifier[jobManagerResourceId] , identifier[jobMasterGateway] operator[SEP] operator[SEP] identifier[jobManagerRegistrations] operator[SEP] identifier[put] operator[SEP] identifier[jobId] , identifier[jobManagerRegistration] operator[SEP] operator[SEP] identifier[jmResourceIdRegistrations] operator[SEP] identifier[put] operator[SEP] identifier[jobManagerResourceId] , identifier[jobManagerRegistration] operator[SEP] operator[SEP] } } Keyword[else] { identifier[JobManagerRegistration] identifier[jobManagerRegistration] operator[=] Keyword[new] identifier[JobManagerRegistration] operator[SEP] identifier[jobId] , identifier[jobManagerResourceId] , identifier[jobMasterGateway] operator[SEP] operator[SEP] identifier[jobManagerRegistrations] operator[SEP] identifier[put] operator[SEP] identifier[jobId] , identifier[jobManagerRegistration] operator[SEP] operator[SEP] identifier[jmResourceIdRegistrations] operator[SEP] identifier[put] operator[SEP] identifier[jobManagerResourceId] , identifier[jobManagerRegistration] operator[SEP] operator[SEP] } identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[jobMasterGateway] operator[SEP] identifier[getFencingToken] operator[SEP] operator[SEP] , identifier[jobManagerAddress] , identifier[jobId] operator[SEP] operator[SEP] identifier[jobManagerHeartbeatManager] operator[SEP] identifier[monitorTarget] operator[SEP] identifier[jobManagerResourceId] , Keyword[new] identifier[HeartbeatTarget] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[receiveHeartbeat] operator[SEP] identifier[ResourceID] identifier[resourceID] , identifier[Void] identifier[payload] operator[SEP] { } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[requestHeartbeat] operator[SEP] identifier[ResourceID] identifier[resourceID] , identifier[Void] identifier[payload] operator[SEP] { identifier[jobMasterGateway] operator[SEP] identifier[heartbeatFromResourceManager] operator[SEP] identifier[resourceID] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JobMasterRegistrationSuccess] operator[SEP] identifier[getFencingToken] operator[SEP] operator[SEP] , identifier[resourceId] operator[SEP] operator[SEP] }
private void obtainBackButtonText() { CharSequence text; try { text = ThemeUtil.getText(this, R.attr.backButtonText); } catch (NotFoundException e) { text = getText(R.string.back_button_text); } setBackButtonText(text); }
class class_name[name] begin[{] method[obtainBackButtonText, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[CharSequence], text] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=backButtonText, postfix_operators=[], prefix_operators=[], qualifier=R.attr, selectors=[])], member=getText, postfix_operators=[], prefix_operators=[], qualifier=ThemeUtil, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=back_button_text, postfix_operators=[], prefix_operators=[], qualifier=R.string, selectors=[])], member=getText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NotFoundException']))], finally_block=None, label=None, resources=None) call[.setBackButtonText, parameter[member[.text]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[obtainBackButtonText] operator[SEP] operator[SEP] { identifier[CharSequence] identifier[text] operator[SEP] Keyword[try] { identifier[text] operator[=] identifier[ThemeUtil] operator[SEP] identifier[getText] operator[SEP] Keyword[this] , identifier[R] operator[SEP] identifier[attr] operator[SEP] identifier[backButtonText] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NotFoundException] identifier[e] operator[SEP] { identifier[text] operator[=] identifier[getText] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[back_button_text] operator[SEP] operator[SEP] } identifier[setBackButtonText] operator[SEP] identifier[text] operator[SEP] operator[SEP] }
public List<PropertyData> getChildPropertiesData(NodeData parent, List<QPathEntryFilter> itemDataFilters) throws RepositoryException { return persistentManager.getChildPropertiesData(parent, itemDataFilters); }
class class_name[name] begin[{] method[getChildPropertiesData, return_type[type[List]], modifier[public], parameter[parent, itemDataFilters]] begin[{] return[call[persistentManager.getChildPropertiesData, parameter[member[.parent], member[.itemDataFilters]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[PropertyData] operator[>] identifier[getChildPropertiesData] operator[SEP] identifier[NodeData] identifier[parent] , identifier[List] operator[<] identifier[QPathEntryFilter] operator[>] identifier[itemDataFilters] operator[SEP] Keyword[throws] identifier[RepositoryException] { Keyword[return] identifier[persistentManager] operator[SEP] identifier[getChildPropertiesData] operator[SEP] identifier[parent] , identifier[itemDataFilters] operator[SEP] operator[SEP] }
public static <T> Stream<Indexed<T>> zipWithIndex(Stream<T> source) { return zip(indices().mapToObj(Long::valueOf), source, Indexed::index) .onClose(source::close); }
class class_name[name] begin[{] method[zipWithIndex, return_type[type[Stream]], modifier[public static], parameter[source]] begin[{] return[call[.zip, parameter[call[.indices, parameter[]], member[.source], MethodReference(expression=MemberReference(member=Indexed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Stream] operator[<] identifier[Indexed] operator[<] identifier[T] operator[>] operator[>] identifier[zipWithIndex] operator[SEP] identifier[Stream] operator[<] identifier[T] operator[>] identifier[source] operator[SEP] { Keyword[return] identifier[zip] operator[SEP] identifier[indices] operator[SEP] operator[SEP] operator[SEP] identifier[mapToObj] operator[SEP] identifier[Long] operator[::] identifier[valueOf] operator[SEP] , identifier[source] , identifier[Indexed] operator[::] identifier[index] operator[SEP] operator[SEP] identifier[onClose] operator[SEP] identifier[source] operator[::] identifier[close] operator[SEP] operator[SEP] }
@java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getProperties() { return getPropertiesMap(); }
class class_name[name] begin[{] method[getProperties, return_type[type[java]], modifier[public], parameter[]] begin[{] return[call[.getPropertiesMap, parameter[]]] end[}] END[}]
annotation[@] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Deprecated] Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[String] , identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[String] operator[>] identifier[getProperties] operator[SEP] operator[SEP] { Keyword[return] identifier[getPropertiesMap] operator[SEP] operator[SEP] operator[SEP] }
public void releaseAll() { synchronized(this) { Object[] refSet = allocatedMemoryReferences.values().toArray(); if(refSet.length != 0) { logger.finer("Releasing allocated memory regions"); } for(Object ref : refSet) { release((MemoryReference) ref); } } }
class class_name[name] begin[{] method[releaseAll, return_type[void], modifier[public], parameter[]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] local_variable[type[Object], refSet] if[binary_operation[member[refSet.length], !=, literal[0]]] begin[{] call[logger.finer, parameter[literal["Releasing allocated memory regions"]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MemoryReference, sub_type=None))], member=release, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=refSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ref)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[releaseAll] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[Object] operator[SEP] operator[SEP] identifier[refSet] operator[=] identifier[allocatedMemoryReferences] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[refSet] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[logger] operator[SEP] identifier[finer] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Object] identifier[ref] operator[:] identifier[refSet] operator[SEP] { identifier[release] operator[SEP] operator[SEP] identifier[MemoryReference] operator[SEP] identifier[ref] operator[SEP] operator[SEP] } } }
public static String formatDate(long time) { // Map date/time to a GregorianCalendar object (local time zone). GregorianCalendar date = new GregorianCalendar(); date.setTimeInMillis(time); return formatDate(date, Calendar.SECOND); }
class class_name[name] begin[{] method[formatDate, return_type[type[String]], modifier[public static], parameter[time]] begin[{] local_variable[type[GregorianCalendar], date] call[date.setTimeInMillis, parameter[member[.time]]] return[call[.formatDate, parameter[member[.date], member[Calendar.SECOND]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[formatDate] operator[SEP] Keyword[long] identifier[time] operator[SEP] { identifier[GregorianCalendar] identifier[date] operator[=] Keyword[new] identifier[GregorianCalendar] operator[SEP] operator[SEP] operator[SEP] identifier[date] operator[SEP] identifier[setTimeInMillis] operator[SEP] identifier[time] operator[SEP] operator[SEP] Keyword[return] identifier[formatDate] operator[SEP] identifier[date] , identifier[Calendar] operator[SEP] identifier[SECOND] operator[SEP] operator[SEP] }
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { String redirectUrl = null; if (useForward) { if (forceHttps && "http".equals(request.getScheme())) { // First redirect the current request to HTTPS. // When that request is received, the forward to the login page will be // used. redirectUrl = buildHttpsRedirectUrlForRequest(request); } if (redirectUrl == null) { String loginForm = determineUrlToUseForThisRequest(request, response, authException); if (logger.isDebugEnabled()) { logger.debug("Server side forward to: " + loginForm); } RequestDispatcher dispatcher = request.getRequestDispatcher(loginForm); dispatcher.forward(request, response); return; } } else { // redirect to login page. Use https if forceHttps true redirectUrl = buildRedirectUrlToLoginPage(request, response, authException); } redirectStrategy.sendRedirect(request, response, redirectUrl); }
class class_name[name] begin[{] method[commence, return_type[void], modifier[public], parameter[request, response, authException]] begin[{] local_variable[type[String], redirectUrl] if[member[.useForward]] begin[{] if[binary_operation[member[.forceHttps], &&, literal["http"]]] begin[{] assign[member[.redirectUrl], call[.buildHttpsRedirectUrlForRequest, parameter[member[.request]]]] else begin[{] None end[}] if[binary_operation[member[.redirectUrl], ==, literal[null]]] begin[{] local_variable[type[String], loginForm] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[binary_operation[literal["Server side forward to: "], +, member[.loginForm]]]] else begin[{] None end[}] local_variable[type[RequestDispatcher], dispatcher] call[dispatcher.forward, parameter[member[.request], member[.response]]] return[None] else begin[{] None end[}] else begin[{] assign[member[.redirectUrl], call[.buildRedirectUrlToLoginPage, parameter[member[.request], member[.response], member[.authException]]]] end[}] call[redirectStrategy.sendRedirect, parameter[member[.request], member[.response], member[.redirectUrl]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[commence] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] , identifier[AuthenticationException] identifier[authException] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { identifier[String] identifier[redirectUrl] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[useForward] operator[SEP] { Keyword[if] operator[SEP] identifier[forceHttps] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[request] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[redirectUrl] operator[=] identifier[buildHttpsRedirectUrlForRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[redirectUrl] operator[==] Other[null] operator[SEP] { identifier[String] identifier[loginForm] operator[=] identifier[determineUrlToUseForThisRequest] operator[SEP] identifier[request] , identifier[response] , identifier[authException] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[loginForm] operator[SEP] operator[SEP] } identifier[RequestDispatcher] identifier[dispatcher] operator[=] identifier[request] operator[SEP] identifier[getRequestDispatcher] operator[SEP] identifier[loginForm] operator[SEP] operator[SEP] identifier[dispatcher] operator[SEP] identifier[forward] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[else] { identifier[redirectUrl] operator[=] identifier[buildRedirectUrlToLoginPage] operator[SEP] identifier[request] , identifier[response] , identifier[authException] operator[SEP] operator[SEP] } identifier[redirectStrategy] operator[SEP] identifier[sendRedirect] operator[SEP] identifier[request] , identifier[response] , identifier[redirectUrl] operator[SEP] operator[SEP] }
public GitlabLabel createLabel( Serializable projectId, String name, String color) throws IOException { String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabLabel.URL; return dispatch().with("name", name) .with("color", color) .to(tailUrl, GitlabLabel.class); }
class class_name[name] begin[{] method[createLabel, return_type[type[GitlabLabel]], modifier[public], parameter[projectId, name, color]] begin[{] local_variable[type[String], tailUrl] return[call[.dispatch, parameter[]]] end[}] END[}]
Keyword[public] identifier[GitlabLabel] identifier[createLabel] operator[SEP] identifier[Serializable] identifier[projectId] , identifier[String] identifier[name] , identifier[String] identifier[color] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[tailUrl] operator[=] identifier[GitlabProject] operator[SEP] identifier[URL] operator[+] literal[String] operator[+] identifier[sanitizeProjectId] operator[SEP] identifier[projectId] operator[SEP] operator[+] identifier[GitlabLabel] operator[SEP] identifier[URL] operator[SEP] Keyword[return] identifier[dispatch] operator[SEP] operator[SEP] operator[SEP] identifier[with] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[with] operator[SEP] literal[String] , identifier[color] operator[SEP] operator[SEP] identifier[to] operator[SEP] identifier[tailUrl] , identifier[GitlabLabel] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public int elementCount(boolean leaves) { if (!leaves) return mapVars.size() + 1; // Number of Maps plus 1 Array component else { int count = 0; for (Enumeration e = mapVars.elements(); e.hasMoreElements();) { BaseType bt = (BaseType) e.nextElement(); count += bt.elementCount(leaves); } count += arrayVar.elementCount(leaves); return count; } }
class class_name[name] begin[{] method[elementCount, return_type[type[int]], modifier[public], parameter[leaves]] begin[{] if[member[.leaves]] begin[{] return[binary_operation[call[mapVars.size, parameter[]], +, literal[1]]] else begin[{] local_variable[type[int], count] 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=Assignment(expressionl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=leaves, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementCount, 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=mapVars, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), update=None), label=None) assign[member[.count], call[arrayVar.elementCount, parameter[member[.leaves]]]] return[member[.count]] end[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[elementCount] operator[SEP] Keyword[boolean] identifier[leaves] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[leaves] operator[SEP] Keyword[return] identifier[mapVars] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[else] { Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Enumeration] identifier[e] operator[=] identifier[mapVars] 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[count] operator[+=] identifier[bt] operator[SEP] identifier[elementCount] operator[SEP] identifier[leaves] operator[SEP] operator[SEP] } identifier[count] operator[+=] identifier[arrayVar] operator[SEP] identifier[elementCount] operator[SEP] identifier[leaves] operator[SEP] operator[SEP] Keyword[return] identifier[count] operator[SEP] } }
private static Long parseLong(final String text) { if (text.length() == 0) { return null; } else { try { return Long.parseLong(text); } catch (NumberFormatException ex) { return null; } } }
class class_name[name] begin[{] method[parseLong, return_type[type[Long]], modifier[private static], parameter[text]] begin[{] if[binary_operation[call[text.length, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[Long] identifier[parseLong] operator[SEP] Keyword[final] identifier[String] identifier[text] operator[SEP] { Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[try] { Keyword[return] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[text] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[ex] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } }
public void fillContent(List<CmsCategoryTreeEntry> categoryRoot, List<String> selected) { setInitOpen(true); updateContentTree(categoryRoot, selected); }
class class_name[name] begin[{] method[fillContent, return_type[void], modifier[public], parameter[categoryRoot, selected]] begin[{] call[.setInitOpen, parameter[literal[true]]] call[.updateContentTree, parameter[member[.categoryRoot], member[.selected]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[fillContent] operator[SEP] identifier[List] operator[<] identifier[CmsCategoryTreeEntry] operator[>] identifier[categoryRoot] , identifier[List] operator[<] identifier[String] operator[>] identifier[selected] operator[SEP] { identifier[setInitOpen] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[updateContentTree] operator[SEP] identifier[categoryRoot] , identifier[selected] operator[SEP] operator[SEP] }
public static Random getRandom() { if (_isTest) { return _testRandom; } Random random = _freeRandomList.allocate(); if (random == null) { random = new SecureRandom(); } return random; }
class class_name[name] begin[{] method[getRandom, return_type[type[Random]], modifier[public static], parameter[]] begin[{] if[member[._isTest]] begin[{] return[member[._testRandom]] else begin[{] None end[}] local_variable[type[Random], random] if[binary_operation[member[.random], ==, literal[null]]] begin[{] assign[member[.random], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecureRandom, sub_type=None))] else begin[{] None end[}] return[member[.random]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Random] identifier[getRandom] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_isTest] operator[SEP] { Keyword[return] identifier[_testRandom] operator[SEP] } identifier[Random] identifier[random] operator[=] identifier[_freeRandomList] operator[SEP] identifier[allocate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[random] operator[==] Other[null] operator[SEP] { identifier[random] operator[=] Keyword[new] identifier[SecureRandom] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[random] operator[SEP] }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { serviceID = new ServiceID(in.readUTF(), in.readUTF(), in.readUTF()); convergenceName = in.readUTF(); }
class class_name[name] begin[{] method[readExternal, return_type[void], modifier[public], parameter[in]] begin[{] assign[member[.serviceID], ClassCreator(arguments=[MethodInvocation(arguments=[], member=readUTF, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=readUTF, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=readUTF, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceID, sub_type=None))] assign[member[.convergenceName], call[in.readUTF, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[readExternal] operator[SEP] identifier[ObjectInput] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] { identifier[serviceID] operator[=] Keyword[new] identifier[ServiceID] operator[SEP] identifier[in] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] , identifier[in] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] , identifier[in] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[convergenceName] operator[=] identifier[in] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] operator[SEP] }
@Override public void put(ByteArray keyBytes, Versioned<byte[]> valueBytes, byte[] transforms) throws VoldemortException { // acquire write lock writeLock.lock(); try { String key = ByteUtils.getString(keyBytes.get(), "UTF-8"); Versioned<String> value = new Versioned<String>(ByteUtils.getString(valueBytes.getValue(), "UTF-8"), valueBytes.getVersion()); Versioned<Object> valueObject = convertStringToObject(key, value); this.put(key, valueObject); } finally { writeLock.unlock(); } }
class class_name[name] begin[{] method[put, return_type[void], modifier[public], parameter[keyBytes, valueBytes, transforms]] begin[{] call[writeLock.lock, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=keyBytes, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=ByteUtils, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=valueBytes, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=ByteUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getVersion, postfix_operators=[], prefix_operators=[], qualifier=valueBytes, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Versioned, sub_type=None)), name=value)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Versioned, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertStringToObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=valueObject)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Versioned, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=writeLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[put] operator[SEP] identifier[ByteArray] identifier[keyBytes] , identifier[Versioned] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[valueBytes] , Keyword[byte] operator[SEP] operator[SEP] identifier[transforms] operator[SEP] Keyword[throws] identifier[VoldemortException] { identifier[writeLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[String] identifier[key] operator[=] identifier[ByteUtils] operator[SEP] identifier[getString] operator[SEP] identifier[keyBytes] operator[SEP] identifier[get] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[Versioned] operator[<] identifier[String] operator[>] identifier[value] operator[=] Keyword[new] identifier[Versioned] operator[<] identifier[String] operator[>] operator[SEP] identifier[ByteUtils] operator[SEP] identifier[getString] operator[SEP] identifier[valueBytes] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , literal[String] operator[SEP] , identifier[valueBytes] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Versioned] operator[<] identifier[Object] operator[>] identifier[valueObject] operator[=] identifier[convertStringToObject] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[valueObject] operator[SEP] operator[SEP] } Keyword[finally] { identifier[writeLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public double[] sample(int numSamples, Random rand) { double[] samples = new double[numSamples]; for(int i = 0; i < samples.length; i++) samples[i] = invCdf(rand.nextDouble()); return samples; }
class class_name[name] begin[{] method[sample, return_type[type[double]], modifier[public], parameter[numSamples, rand]] begin[{] local_variable[type[double], samples] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=samples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextDouble, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None)], member=invCdf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=samples, 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[.samples]] end[}] END[}]
Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[sample] operator[SEP] Keyword[int] identifier[numSamples] , identifier[Random] identifier[rand] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[samples] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numSamples] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[samples] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[samples] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[invCdf] operator[SEP] identifier[rand] operator[SEP] identifier[nextDouble] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[samples] operator[SEP] }
public JStormCache putMetricData(String topologyId, TopologyMetric tpMetric) { // map<key, [ts, metric_info]> Map<String, Object> batchData = new HashMap<>(); long ts = System.currentTimeMillis(); int tp = 0, comp = 0, compStream = 0, task = 0, stream = 0, worker = 0, netty = 0; if (tpMetric.get_componentMetric().get_metrics_size() > 0) { batchData.put(METRIC_DATA_30M_COMPONENT + topologyId, new Object[]{ts, tpMetric.get_componentMetric()}); comp += tpMetric.get_componentMetric().get_metrics_size(); } if (tpMetric.is_set_compStreamMetric() && tpMetric.get_compStreamMetric().get_metrics_size() > 0) { batchData.put(METRIC_DATA_30M_COMP_STREAM + topologyId, new Object[]{ts, tpMetric.get_compStreamMetric()}); compStream += tpMetric.get_compStreamMetric().get_metrics_size(); } if (tpMetric.get_taskMetric().get_metrics_size() > 0) { tryCombineMetricInfo(METRIC_DATA_30M_TASK + topologyId, tpMetric.get_taskMetric(), MetaType.TASK, ts); task += tpMetric.get_taskMetric().get_metrics_size(); } if (tpMetric.get_streamMetric().get_metrics_size() > 0) { tryCombineMetricInfo(METRIC_DATA_30M_STREAM + topologyId, tpMetric.get_streamMetric(), MetaType.STREAM, ts); stream += tpMetric.get_streamMetric().get_metrics_size(); } if (tpMetric.get_workerMetric().get_metrics_size() > 0) { tryCombineMetricInfo(METRIC_DATA_30M_WORKER + topologyId, tpMetric.get_workerMetric(), MetaType.WORKER, ts); worker += tpMetric.get_workerMetric().get_metrics_size(); } if (tpMetric.get_nettyMetric().get_metrics_size() > 0) { tryCombineMetricInfo(METRIC_DATA_30M_NETTY + topologyId, tpMetric.get_nettyMetric(), MetaType.NETTY, ts); netty += tpMetric.get_nettyMetric().get_metrics_size(); } // store 30 snapshots of topology metrics if (tpMetric.get_topologyMetric().get_metrics_size() > 0) { String keyPrefix = METRIC_DATA_30M_TOPOLOGY + topologyId + "-"; int page = getRingAvailableIndex(keyPrefix); batchData.put(keyPrefix + page, new Object[]{ts, tpMetric.get_topologyMetric()}); tp += tpMetric.get_topologyMetric().get_metrics_size(); } LOG.info("caching metric data for topology:{},tp:{},comp:{},comp_stream:{},task:{},stream:{},worker:{},netty:{},cost:{}", topologyId, tp, comp, compStream, task, stream, worker, netty, System.currentTimeMillis() - ts); return putBatch(batchData); }
class class_name[name] begin[{] method[putMetricData, return_type[type[JStormCache]], modifier[public], parameter[topologyId, tpMetric]] begin[{] local_variable[type[Map], batchData] local_variable[type[long], ts] local_variable[type[int], tp] if[binary_operation[call[tpMetric.get_componentMetric, parameter[]], >, literal[0]]] begin[{] call[batchData.put, parameter[binary_operation[member[.METRIC_DATA_30M_COMPONENT], +, member[.topologyId]], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get_componentMetric, postfix_operators=[], prefix_operators=[], qualifier=tpMetric, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[.comp], call[tpMetric.get_componentMetric, parameter[]]] else begin[{] None end[}] if[binary_operation[call[tpMetric.is_set_compStreamMetric, parameter[]], &&, binary_operation[call[tpMetric.get_compStreamMetric, parameter[]], >, literal[0]]]] begin[{] call[batchData.put, parameter[binary_operation[member[.METRIC_DATA_30M_COMP_STREAM], +, member[.topologyId]], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get_compStreamMetric, postfix_operators=[], prefix_operators=[], qualifier=tpMetric, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[.compStream], call[tpMetric.get_compStreamMetric, parameter[]]] else begin[{] None end[}] if[binary_operation[call[tpMetric.get_taskMetric, parameter[]], >, literal[0]]] begin[{] call[.tryCombineMetricInfo, parameter[binary_operation[member[.METRIC_DATA_30M_TASK], +, member[.topologyId]], call[tpMetric.get_taskMetric, parameter[]], member[MetaType.TASK], member[.ts]]] assign[member[.task], call[tpMetric.get_taskMetric, parameter[]]] else begin[{] None end[}] if[binary_operation[call[tpMetric.get_streamMetric, parameter[]], >, literal[0]]] begin[{] call[.tryCombineMetricInfo, parameter[binary_operation[member[.METRIC_DATA_30M_STREAM], +, member[.topologyId]], call[tpMetric.get_streamMetric, parameter[]], member[MetaType.STREAM], member[.ts]]] assign[member[.stream], call[tpMetric.get_streamMetric, parameter[]]] else begin[{] None end[}] if[binary_operation[call[tpMetric.get_workerMetric, parameter[]], >, literal[0]]] begin[{] call[.tryCombineMetricInfo, parameter[binary_operation[member[.METRIC_DATA_30M_WORKER], +, member[.topologyId]], call[tpMetric.get_workerMetric, parameter[]], member[MetaType.WORKER], member[.ts]]] assign[member[.worker], call[tpMetric.get_workerMetric, parameter[]]] else begin[{] None end[}] if[binary_operation[call[tpMetric.get_nettyMetric, parameter[]], >, literal[0]]] begin[{] call[.tryCombineMetricInfo, parameter[binary_operation[member[.METRIC_DATA_30M_NETTY], +, member[.topologyId]], call[tpMetric.get_nettyMetric, parameter[]], member[MetaType.NETTY], member[.ts]]] assign[member[.netty], call[tpMetric.get_nettyMetric, parameter[]]] else begin[{] None end[}] if[binary_operation[call[tpMetric.get_topologyMetric, parameter[]], >, literal[0]]] begin[{] local_variable[type[String], keyPrefix] local_variable[type[int], page] call[batchData.put, parameter[binary_operation[member[.keyPrefix], +, member[.page]], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get_topologyMetric, postfix_operators=[], prefix_operators=[], qualifier=tpMetric, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[.tp], call[tpMetric.get_topologyMetric, parameter[]]] else begin[{] None end[}] call[LOG.info, parameter[literal["caching metric data for topology:{},tp:{},comp:{},comp_stream:{},task:{},stream:{},worker:{},netty:{},cost:{}"], member[.topologyId], member[.tp], member[.comp], member[.compStream], member[.task], member[.stream], member[.worker], member[.netty], binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.ts]]]] return[call[.putBatch, parameter[member[.batchData]]]] end[}] END[}]
Keyword[public] identifier[JStormCache] identifier[putMetricData] operator[SEP] identifier[String] identifier[topologyId] , identifier[TopologyMetric] identifier[tpMetric] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[batchData] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[ts] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[tp] operator[=] Other[0] , identifier[comp] operator[=] Other[0] , identifier[compStream] operator[=] Other[0] , identifier[task] operator[=] Other[0] , identifier[stream] operator[=] Other[0] , identifier[worker] operator[=] Other[0] , identifier[netty] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[tpMetric] operator[SEP] identifier[get_componentMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[batchData] operator[SEP] identifier[put] operator[SEP] identifier[METRIC_DATA_30M_COMPONENT] operator[+] identifier[topologyId] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[ts] , identifier[tpMetric] operator[SEP] identifier[get_componentMetric] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[comp] operator[+=] identifier[tpMetric] operator[SEP] identifier[get_componentMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tpMetric] operator[SEP] identifier[is_set_compStreamMetric] operator[SEP] operator[SEP] operator[&&] identifier[tpMetric] operator[SEP] identifier[get_compStreamMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[batchData] operator[SEP] identifier[put] operator[SEP] identifier[METRIC_DATA_30M_COMP_STREAM] operator[+] identifier[topologyId] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[ts] , identifier[tpMetric] operator[SEP] identifier[get_compStreamMetric] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[compStream] operator[+=] identifier[tpMetric] operator[SEP] identifier[get_compStreamMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tpMetric] operator[SEP] identifier[get_taskMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[tryCombineMetricInfo] operator[SEP] identifier[METRIC_DATA_30M_TASK] operator[+] identifier[topologyId] , identifier[tpMetric] operator[SEP] identifier[get_taskMetric] operator[SEP] operator[SEP] , identifier[MetaType] operator[SEP] identifier[TASK] , identifier[ts] operator[SEP] operator[SEP] identifier[task] operator[+=] identifier[tpMetric] operator[SEP] identifier[get_taskMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tpMetric] operator[SEP] identifier[get_streamMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[tryCombineMetricInfo] operator[SEP] identifier[METRIC_DATA_30M_STREAM] operator[+] identifier[topologyId] , identifier[tpMetric] operator[SEP] identifier[get_streamMetric] operator[SEP] operator[SEP] , identifier[MetaType] operator[SEP] identifier[STREAM] , identifier[ts] operator[SEP] operator[SEP] identifier[stream] operator[+=] identifier[tpMetric] operator[SEP] identifier[get_streamMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tpMetric] operator[SEP] identifier[get_workerMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[tryCombineMetricInfo] operator[SEP] identifier[METRIC_DATA_30M_WORKER] operator[+] identifier[topologyId] , identifier[tpMetric] operator[SEP] identifier[get_workerMetric] operator[SEP] operator[SEP] , identifier[MetaType] operator[SEP] identifier[WORKER] , identifier[ts] operator[SEP] operator[SEP] identifier[worker] operator[+=] identifier[tpMetric] operator[SEP] identifier[get_workerMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tpMetric] operator[SEP] identifier[get_nettyMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[tryCombineMetricInfo] operator[SEP] identifier[METRIC_DATA_30M_NETTY] operator[+] identifier[topologyId] , identifier[tpMetric] operator[SEP] identifier[get_nettyMetric] operator[SEP] operator[SEP] , identifier[MetaType] operator[SEP] identifier[NETTY] , identifier[ts] operator[SEP] operator[SEP] identifier[netty] operator[+=] identifier[tpMetric] operator[SEP] identifier[get_nettyMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tpMetric] operator[SEP] identifier[get_topologyMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[String] identifier[keyPrefix] operator[=] identifier[METRIC_DATA_30M_TOPOLOGY] operator[+] identifier[topologyId] operator[+] literal[String] operator[SEP] Keyword[int] identifier[page] operator[=] identifier[getRingAvailableIndex] operator[SEP] identifier[keyPrefix] operator[SEP] operator[SEP] identifier[batchData] operator[SEP] identifier[put] operator[SEP] identifier[keyPrefix] operator[+] identifier[page] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[ts] , identifier[tpMetric] operator[SEP] identifier[get_topologyMetric] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[tp] operator[+=] identifier[tpMetric] operator[SEP] identifier[get_topologyMetric] operator[SEP] operator[SEP] operator[SEP] identifier[get_metrics_size] operator[SEP] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[topologyId] , identifier[tp] , identifier[comp] , identifier[compStream] , identifier[task] , identifier[stream] , identifier[worker] , identifier[netty] , identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[ts] operator[SEP] operator[SEP] Keyword[return] identifier[putBatch] operator[SEP] identifier[batchData] operator[SEP] operator[SEP] }
private String getEarName(final DeploymentUnit deploymentUnit) { final String duName = deploymentUnit.getName(); if (duName.endsWith(".ear")) { return duName.substring(0, duName.length() - ".ear".length()); } return null; }
class class_name[name] begin[{] method[getEarName, return_type[type[String]], modifier[private], parameter[deploymentUnit]] begin[{] local_variable[type[String], duName] if[call[duName.endsWith, parameter[literal[".ear"]]]] begin[{] return[call[duName.substring, parameter[literal[0], binary_operation[call[duName.length, parameter[]], -, literal[".ear"]]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[String] identifier[getEarName] operator[SEP] Keyword[final] identifier[DeploymentUnit] identifier[deploymentUnit] operator[SEP] { Keyword[final] identifier[String] identifier[duName] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[duName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[duName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[duName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] literal[String] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public Date unmarshal(String value) { if (value != null) { if (value.length() >= lengthOfDateFmtYYYY_MM_DD) { //Extract just the date from the string YYYY-MM-DD value = value.substring(0, lengthOfDateFmtYYYY_MM_DD); boolean isMatch = value.matches(datePattern); if (isMatch) { return DatatypeConverter.parseDate(value).getTime(); } else { return DatatypeConverter.parseDate(INVALIDDATE).getTime(); } } else { return DatatypeConverter.parseDate(INVALIDDATE).getTime(); } } else { return null; } }
class class_name[name] begin[{] method[unmarshal, return_type[type[Date]], modifier[public], parameter[value]] begin[{] if[binary_operation[member[.value], !=, literal[null]]] begin[{] if[binary_operation[call[value.length, parameter[]], >=, member[.lengthOfDateFmtYYYY_MM_DD]]] begin[{] assign[member[.value], call[value.substring, parameter[literal[0], member[.lengthOfDateFmtYYYY_MM_DD]]]] local_variable[type[boolean], isMatch] if[member[.isMatch]] begin[{] return[call[DatatypeConverter.parseDate, parameter[member[.value]]]] else begin[{] return[call[DatatypeConverter.parseDate, parameter[member[.INVALIDDATE]]]] end[}] else begin[{] return[call[DatatypeConverter.parseDate, parameter[member[.INVALIDDATE]]]] end[}] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] identifier[Date] identifier[unmarshal] operator[SEP] identifier[String] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>=] identifier[lengthOfDateFmtYYYY_MM_DD] operator[SEP] { identifier[value] operator[=] identifier[value] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lengthOfDateFmtYYYY_MM_DD] operator[SEP] operator[SEP] Keyword[boolean] identifier[isMatch] operator[=] identifier[value] operator[SEP] identifier[matches] operator[SEP] identifier[datePattern] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isMatch] operator[SEP] { Keyword[return] identifier[DatatypeConverter] operator[SEP] identifier[parseDate] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[DatatypeConverter] operator[SEP] identifier[parseDate] operator[SEP] identifier[INVALIDDATE] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] identifier[DatatypeConverter] operator[SEP] identifier[parseDate] operator[SEP] identifier[INVALIDDATE] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public void checkParameters(Class[] arguments) { // lets check that the argument types are valid if (!isValidMethod(arguments)) { throw new IllegalArgumentException( "Parameters to method: " + getName() + " do not match types: " + InvokerHelper.toString(getParameterTypes()) + " for arguments: " + InvokerHelper.toString(arguments)); } }
class class_name[name] begin[{] method[checkParameters, return_type[void], modifier[public], parameter[arguments]] begin[{] if[call[.isValidMethod, parameter[member[.arguments]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameters to method: "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" do not match types: "), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=InvokerHelper, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for arguments: "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=InvokerHelper, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[checkParameters] operator[SEP] identifier[Class] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isValidMethod] operator[SEP] identifier[arguments] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[InvokerHelper] operator[SEP] identifier[toString] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[InvokerHelper] operator[SEP] identifier[toString] operator[SEP] identifier[arguments] operator[SEP] operator[SEP] operator[SEP] } }
private void readCreator(TagValue tv) { int creatorSignature = tv.getBytesBigEndian(4, 4); creator = IccProfileCreators.getIccProfile(creatorSignature); }
class class_name[name] begin[{] method[readCreator, return_type[void], modifier[private], parameter[tv]] begin[{] local_variable[type[int], creatorSignature] assign[member[.creator], call[IccProfileCreators.getIccProfile, parameter[member[.creatorSignature]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[readCreator] operator[SEP] identifier[TagValue] identifier[tv] operator[SEP] { Keyword[int] identifier[creatorSignature] operator[=] identifier[tv] operator[SEP] identifier[getBytesBigEndian] operator[SEP] Other[4] , Other[4] operator[SEP] operator[SEP] identifier[creator] operator[=] identifier[IccProfileCreators] operator[SEP] identifier[getIccProfile] operator[SEP] identifier[creatorSignature] operator[SEP] operator[SEP] }
public java.util.List<String> getSubnetIds() { if (subnetIds == null) { subnetIds = new com.amazonaws.internal.SdkInternalList<String>(); } return subnetIds; }
class class_name[name] begin[{] method[getSubnetIds, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.subnetIds], ==, literal[null]]] begin[{] assign[member[.subnetIds], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.subnetIds]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getSubnetIds] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[subnetIds] operator[==] Other[null] operator[SEP] { identifier[subnetIds] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[subnetIds] operator[SEP] }
@Deprecated public <R> SingleOutputStreamOperator<R> apply(ReduceFunction<T> reduceFunction, AllWindowFunction<T, R, W> function) { TypeInformation<T> inType = input.getType(); TypeInformation<R> resultType = getAllWindowFunctionReturnType(function, inType); return apply(reduceFunction, function, resultType); }
class class_name[name] begin[{] method[apply, return_type[type[SingleOutputStreamOperator]], modifier[public], parameter[reduceFunction, function]] begin[{] local_variable[type[TypeInformation], inType] local_variable[type[TypeInformation], resultType] return[call[.apply, parameter[member[.reduceFunction], member[.function], member[.resultType]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] operator[<] identifier[R] operator[>] identifier[SingleOutputStreamOperator] operator[<] identifier[R] operator[>] identifier[apply] operator[SEP] identifier[ReduceFunction] operator[<] identifier[T] operator[>] identifier[reduceFunction] , identifier[AllWindowFunction] operator[<] identifier[T] , identifier[R] , identifier[W] operator[>] identifier[function] operator[SEP] { identifier[TypeInformation] operator[<] identifier[T] operator[>] identifier[inType] operator[=] identifier[input] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[TypeInformation] operator[<] identifier[R] operator[>] identifier[resultType] operator[=] identifier[getAllWindowFunctionReturnType] operator[SEP] identifier[function] , identifier[inType] operator[SEP] operator[SEP] Keyword[return] identifier[apply] operator[SEP] identifier[reduceFunction] , identifier[function] , identifier[resultType] operator[SEP] operator[SEP] }
public PropertyDataReader forProperty(InternalQName name, int type) { if (nodePropertyReader == null) { nodePropertyReader = new PropertyDataReader(parent, dataManager); } return nodePropertyReader.forProperty(name, type); }
class class_name[name] begin[{] method[forProperty, return_type[type[PropertyDataReader]], modifier[public], parameter[name, type]] begin[{] if[binary_operation[member[.nodePropertyReader], ==, literal[null]]] begin[{] assign[member[.nodePropertyReader], ClassCreator(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataManager, 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=PropertyDataReader, sub_type=None))] else begin[{] None end[}] return[call[nodePropertyReader.forProperty, parameter[member[.name], member[.type]]]] end[}] END[}]
Keyword[public] identifier[PropertyDataReader] identifier[forProperty] operator[SEP] identifier[InternalQName] identifier[name] , Keyword[int] identifier[type] operator[SEP] { Keyword[if] operator[SEP] identifier[nodePropertyReader] operator[==] Other[null] operator[SEP] { identifier[nodePropertyReader] operator[=] Keyword[new] identifier[PropertyDataReader] operator[SEP] identifier[parent] , identifier[dataManager] operator[SEP] operator[SEP] } Keyword[return] identifier[nodePropertyReader] operator[SEP] identifier[forProperty] operator[SEP] identifier[name] , identifier[type] operator[SEP] operator[SEP] }
private static void addFileToZip(String path, File file, ZipOutputStream zos) throws IOException { String currentPath = StringUtils.isNotEmpty(path)? path + "/" + file.getName(): file.getName(); zos.putNextEntry(new ZipEntry(currentPath)); InputStream is = new BufferedInputStream(new FileInputStream(file)); try { IOUtils.copy(is, zos); } finally { IOUtils.closeQuietly(is); } zos.closeEntry(); }
class class_name[name] begin[{] method[addFileToZip, return_type[void], modifier[private static], parameter[path, file, zos]] begin[{] local_variable[type[String], currentPath] call[zos.putNextEntry, parameter[ClassCreator(arguments=[MemberReference(member=currentPath, 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=ZipEntry, sub_type=None))]] local_variable[type[InputStream], is] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=zos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None) call[zos.closeEntry, parameter[]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[addFileToZip] operator[SEP] identifier[String] identifier[path] , identifier[File] identifier[file] , identifier[ZipOutputStream] identifier[zos] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[currentPath] operator[=] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[path] operator[SEP] operator[?] identifier[path] operator[+] literal[String] operator[+] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[:] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[zos] operator[SEP] identifier[putNextEntry] operator[SEP] Keyword[new] identifier[ZipEntry] operator[SEP] identifier[currentPath] operator[SEP] operator[SEP] operator[SEP] identifier[InputStream] identifier[is] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[IOUtils] operator[SEP] identifier[copy] operator[SEP] identifier[is] , identifier[zos] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[is] operator[SEP] operator[SEP] } identifier[zos] operator[SEP] identifier[closeEntry] operator[SEP] operator[SEP] operator[SEP] }
protected boolean isReversed(byte directionality) { switch (directionality) { case Character.DIRECTIONALITY_RIGHT_TO_LEFT: case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC: case Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING: case Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE: return true; default: return false; } }
class class_name[name] begin[{] method[isReversed, return_type[type[boolean]], modifier[protected], parameter[directionality]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=DIRECTIONALITY_RIGHT_TO_LEFT, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[]), MemberReference(member=DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[]), MemberReference(member=DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[]), MemberReference(member=DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])], expression=MemberReference(member=directionality, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isReversed] operator[SEP] Keyword[byte] identifier[directionality] operator[SEP] { Keyword[switch] operator[SEP] identifier[directionality] operator[SEP] { Keyword[case] identifier[Character] operator[SEP] identifier[DIRECTIONALITY_RIGHT_TO_LEFT] operator[:] Keyword[case] identifier[Character] operator[SEP] identifier[DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC] operator[:] Keyword[case] identifier[Character] operator[SEP] identifier[DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING] operator[:] Keyword[case] identifier[Character] operator[SEP] identifier[DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[boolean] operator[SEP] } }
public static Optional<Class> resolveSuperGenericTypeArgument(Class type) { try { Type genericSuperclass = type.getGenericSuperclass(); if (genericSuperclass instanceof ParameterizedType) { return resolveSingleTypeArgument(genericSuperclass); } return Optional.empty(); } catch (NoClassDefFoundError e) { return Optional.empty(); } }
class class_name[name] begin[{] method[resolveSuperGenericTypeArgument, return_type[type[Optional]], modifier[public static], parameter[type]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGenericSuperclass, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), name=genericSuperclass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=genericSuperclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=genericSuperclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveSingleTypeArgument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=empty, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=empty, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoClassDefFoundError']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[Class] operator[>] identifier[resolveSuperGenericTypeArgument] operator[SEP] identifier[Class] identifier[type] operator[SEP] { Keyword[try] { identifier[Type] identifier[genericSuperclass] operator[=] identifier[type] operator[SEP] identifier[getGenericSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[genericSuperclass] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] { Keyword[return] identifier[resolveSingleTypeArgument] operator[SEP] identifier[genericSuperclass] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoClassDefFoundError] identifier[e] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } }
private RedBlackTreeNode<Key, Value> balance(RedBlackTreeNode<Key, Value> h) { // assert (h != null); if (isRed(h.getRight())) h = rotateLeft(h); if (isRed(h.getLeft()) && isRed(h.getLeft().getLeft())) h = rotateRight(h); if (isRed(h.getLeft()) && isRed(h.getRight())) flipColors(h); h.setSize(size(h.getLeft()) + size(h.getRight()) + 1); return h; }
class class_name[name] begin[{] method[balance, return_type[type[RedBlackTreeNode]], modifier[private], parameter[h]] begin[{] if[call[.isRed, parameter[call[h.getRight, parameter[]]]]] begin[{] assign[member[.h], call[.rotateLeft, parameter[member[.h]]]] else begin[{] None end[}] if[binary_operation[call[.isRed, parameter[call[h.getLeft, parameter[]]]], &&, call[.isRed, parameter[call[h.getLeft, parameter[]]]]]] begin[{] assign[member[.h], call[.rotateRight, parameter[member[.h]]]] else begin[{] None end[}] if[binary_operation[call[.isRed, parameter[call[h.getLeft, parameter[]]]], &&, call[.isRed, parameter[call[h.getRight, parameter[]]]]]] begin[{] call[.flipColors, parameter[member[.h]]] else begin[{] None end[}] call[h.setSize, parameter[binary_operation[binary_operation[call[.size, parameter[call[h.getLeft, parameter[]]]], +, call[.size, parameter[call[h.getRight, parameter[]]]]], +, literal[1]]]] return[member[.h]] end[}] END[}]
Keyword[private] identifier[RedBlackTreeNode] operator[<] identifier[Key] , identifier[Value] operator[>] identifier[balance] operator[SEP] identifier[RedBlackTreeNode] operator[<] identifier[Key] , identifier[Value] operator[>] identifier[h] operator[SEP] { Keyword[if] operator[SEP] identifier[isRed] operator[SEP] identifier[h] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[h] operator[=] identifier[rotateLeft] operator[SEP] identifier[h] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isRed] operator[SEP] identifier[h] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[isRed] operator[SEP] identifier[h] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[h] operator[=] identifier[rotateRight] operator[SEP] identifier[h] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isRed] operator[SEP] identifier[h] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[isRed] operator[SEP] identifier[h] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flipColors] operator[SEP] identifier[h] operator[SEP] operator[SEP] identifier[h] operator[SEP] identifier[setSize] operator[SEP] identifier[size] operator[SEP] identifier[h] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[size] operator[SEP] identifier[h] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[h] operator[SEP] }
@Override public final OnlineBuyer getBuyr(final Map<String, Object> pRqVs, final IRequestData pRqDt) throws Exception { Long buyerId = null; String buyerIdStr = pRqDt.getCookieValue("cBuyerId"); if (buyerIdStr != null && buyerIdStr.length() > 0) { buyerId = Long.valueOf(buyerIdStr); } OnlineBuyer buyer = null; if (buyerId != null) { buyer = getSrvOrm().retrieveEntityById(pRqVs, OnlineBuyer.class, buyerId); } if (buyer != null && buyer.getRegEmail() != null && buyer.getBuSeId() != null) { String buSeId = pRqDt.getCookieValue("buSeId"); if (!buyer.getBuSeId().equals(buSeId)) { this.spamHnd.handle(pRqVs, pRqDt, 100, "Buyer. Authorized invasion? cBuyerId: " + buyerIdStr); //buyer also might clears cookie, so it's need new authorization //new/free buyer will be used till authorization: buyer = null; } } return buyer; }
class class_name[name] begin[{] method[getBuyr, return_type[type[OnlineBuyer]], modifier[final public], parameter[pRqVs, pRqDt]] begin[{] local_variable[type[Long], buyerId] local_variable[type[String], buyerIdStr] if[binary_operation[binary_operation[member[.buyerIdStr], !=, literal[null]], &&, binary_operation[call[buyerIdStr.length, parameter[]], >, literal[0]]]] begin[{] assign[member[.buyerId], call[Long.valueOf, parameter[member[.buyerIdStr]]]] else begin[{] None end[}] local_variable[type[OnlineBuyer], buyer] if[binary_operation[member[.buyerId], !=, literal[null]]] begin[{] assign[member[.buyer], call[.getSrvOrm, parameter[]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.buyer], !=, literal[null]], &&, binary_operation[call[buyer.getRegEmail, parameter[]], !=, literal[null]]], &&, binary_operation[call[buyer.getBuSeId, parameter[]], !=, literal[null]]]] begin[{] local_variable[type[String], buSeId] if[call[buyer.getBuSeId, parameter[]]] begin[{] THIS[member[None.spamHnd]call[None.handle, parameter[member[.pRqVs], member[.pRqDt], literal[100], binary_operation[literal["Buyer. Authorized invasion? cBuyerId: "], +, member[.buyerIdStr]]]]] assign[member[.buyer], literal[null]] else begin[{] None end[}] else begin[{] None end[}] return[member[.buyer]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[OnlineBuyer] identifier[getBuyr] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pRqVs] , Keyword[final] identifier[IRequestData] identifier[pRqDt] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Long] identifier[buyerId] operator[=] Other[null] operator[SEP] identifier[String] identifier[buyerIdStr] operator[=] identifier[pRqDt] operator[SEP] identifier[getCookieValue] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buyerIdStr] operator[!=] Other[null] operator[&&] identifier[buyerIdStr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[buyerId] operator[=] identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[buyerIdStr] operator[SEP] operator[SEP] } identifier[OnlineBuyer] identifier[buyer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[buyerId] operator[!=] Other[null] operator[SEP] { identifier[buyer] operator[=] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] identifier[retrieveEntityById] operator[SEP] identifier[pRqVs] , identifier[OnlineBuyer] operator[SEP] Keyword[class] , identifier[buyerId] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[buyer] operator[!=] Other[null] operator[&&] identifier[buyer] operator[SEP] identifier[getRegEmail] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[buyer] operator[SEP] identifier[getBuSeId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[buSeId] operator[=] identifier[pRqDt] operator[SEP] identifier[getCookieValue] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[buyer] operator[SEP] identifier[getBuSeId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[buSeId] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[spamHnd] operator[SEP] identifier[handle] operator[SEP] identifier[pRqVs] , identifier[pRqDt] , Other[100] , literal[String] operator[+] identifier[buyerIdStr] operator[SEP] operator[SEP] identifier[buyer] operator[=] Other[null] operator[SEP] } } Keyword[return] identifier[buyer] operator[SEP] }
@Override protected void addColumnComponent(HtmlDataTable dataTable, Map<String, String> tableAttributes, String elementName, Map<String, String> columnAttributes, StaticXmlMetawidget metawidget) { // Suppress columns that show Collection values. Their toString is never very nice, and nested tables look awful! // // Note: we don't just do N_TO_MANY values, as sometimes Collections are not annotated Class<?> clazz = WidgetBuilderUtils.getActualClassOrType(columnAttributes, null); if (clazz != null && (Collection.class.isAssignableFrom(clazz))) { return; } // FORGE-446: Expand columns that show one-to-one values String componentType = WidgetBuilderUtils.getComponentType(tableAttributes); if (TRUE.equals(columnAttributes.get(ONE_TO_ONE))) { String columnType = columnAttributes.get(TYPE); String inspectedType = metawidget.inspect(null, columnType); if (inspectedType != null) { Element root = XmlUtils.documentFromString(inspectedType).getDocumentElement(); NodeList elements = root.getFirstChild().getChildNodes(); Map<String, String> embeddedAttributes = CollectionUtils.newHashMap(); embeddedAttributes.put(TOP_LEVEL_PARAMETERIZED_TYPE, componentType); embeddedAttributes.put(PARAMETERIZED_TYPE, columnType); embeddedAttributes.put(PARAMETERIZED_TYPE_PATH, columnAttributes.get(NAME)); addColumnComponents(dataTable, embeddedAttributes, elements, metawidget); return; } } // FORGE-448: Don't display "owner" when showing relationships String columnName = columnAttributes.get(NAME); if (columnName.equals(tableAttributes.get(INVERSE_RELATIONSHIP))) { return; } // Create the column super.addColumnComponent(dataTable, tableAttributes, elementName, columnAttributes, metawidget); List<StaticWidget> columns = dataTable.getChildren(); HtmlColumn column = (HtmlColumn) columns.get(columns.size() - 1); // If we can determine the componentType, wrap it with a link if (tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE) != null) { componentType = tableAttributes.get(TOP_LEVEL_PARAMETERIZED_TYPE); } if (componentType != null) { String controllerName = StringUtils.decapitalize(ClassUtils.getSimpleName(componentType)); // Create a link... HtmlOutcomeTargetLink link = new HtmlOutcomeTargetLink(); String outcome = getTargetDir(); if (!outcome.isEmpty() && !outcome.startsWith("/")) { outcome = "/" + outcome; } link.putAttribute("outcome", outcome + "/" + controllerName + "/view"); // ...pointing to the id String primaryKeyName = "id"; String inspectedType = metawidget.inspect(null, componentType); if (inspectedType != null) { Element root = XmlUtils.documentFromString(inspectedType).getDocumentElement(); NodeList elements = root.getFirstChild().getChildNodes(); for (int loop = 0, length = elements.getLength(); loop < length; loop++) { Element element = (Element) elements.item(loop); if (element.hasAttribute(PRIMARY_KEY)) { primaryKeyName = element.getAttribute(NAME); break; } } } Param param = new Param(); param.putAttribute("name", "id"); param.putAttribute( "value", StaticFacesUtils.wrapExpression(dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR + primaryKeyName)); link.getChildren().add(param); link.getChildren().add(column.getChildren().remove(1)); if (columnAttributes.containsKey(FACES_LOOKUP) && columnAttributes.containsKey(REVERSE_PRIMARY_KEY)) { StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1); String displayExpression = dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR + StringUtils.decapitalize(columnAttributes.get(NAME)); output.setValue(StaticFacesUtils.wrapExpression(displayExpression)); } if (tableAttributes.get(PARAMETERIZED_TYPE_PATH) != null) { // Recreate the EL expression. This is done to ensure that correctly nested EL expressions are created for // expanded entities. The originally created expression in super.addColumnComponent is incorrect for // expanded entities since it assumes that all referenced names are at the same level String valueExpression = dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR + tableAttributes.get(PARAMETERIZED_TYPE_PATH) + StringUtils.SEPARATOR_DOT_CHAR + StringUtils.decapitalize(columnAttributes.get(NAME)); StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1); output.setValue(StaticFacesUtils.wrapExpression(valueExpression)); } column.getChildren().add(link); // If bidirectional, add a footer facet if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly()) { // If it's an inverse relationship, we really should have been able to determine sub-properties, so we // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type if (!ENTITY.equals(elementName)) { StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget(); Map<String, String> footerAttributes = CollectionUtils.newHashMap(); metawidget.initNestedMetawidget(footerMetawidget, footerAttributes); // (footer facets should never have a 'required' attribute) footerMetawidget.removeWidgetProcessor(footerMetawidget .getWidgetProcessor(RequiredAttributeProcessor.class)); footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName)); footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName); footerMetawidget.setLayout(new SimpleLayout()); Facet footerFacet = new Facet(); footerFacet.putAttribute("name", "footer"); footerFacet.getChildren().add(footerMetawidget); ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class); if (readableIdProcessor != null) { readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget); } HtmlMessage message = new HtmlMessage(); message.putAttribute("for", footerMetawidget.getAttribute("id")); message.putAttribute("styleClass", "error"); footerFacet.getChildren().add(message); column.getChildren().add(footerFacet); } } } }
class class_name[name] begin[{] method[addColumnComponent, return_type[void], modifier[protected], parameter[dataTable, tableAttributes, elementName, columnAttributes, metawidget]] begin[{] local_variable[type[Class], clazz] if[binary_operation[binary_operation[member[.clazz], !=, literal[null]], &&, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Collection, sub_type=None))]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], componentType] if[call[TRUE.equals, parameter[call[columnAttributes.get, parameter[member[.ONE_TO_ONE]]]]]] begin[{] local_variable[type[String], columnType] local_variable[type[String], inspectedType] if[binary_operation[member[.inspectedType], !=, literal[null]]] begin[{] local_variable[type[Element], root] local_variable[type[NodeList], elements] local_variable[type[Map], embeddedAttributes] call[embeddedAttributes.put, parameter[member[.TOP_LEVEL_PARAMETERIZED_TYPE], member[.componentType]]] call[embeddedAttributes.put, parameter[member[.PARAMETERIZED_TYPE], member[.columnType]]] call[embeddedAttributes.put, parameter[member[.PARAMETERIZED_TYPE_PATH], call[columnAttributes.get, parameter[member[.NAME]]]]] call[.addColumnComponents, parameter[member[.dataTable], member[.embeddedAttributes], member[.elements], member[.metawidget]]] return[None] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[String], columnName] if[call[columnName.equals, parameter[call[tableAttributes.get, parameter[member[.INVERSE_RELATIONSHIP]]]]]] begin[{] return[None] else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=dataTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tableAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metawidget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addColumnComponent, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) local_variable[type[List], columns] local_variable[type[HtmlColumn], column] if[binary_operation[call[tableAttributes.get, parameter[member[.TOP_LEVEL_PARAMETERIZED_TYPE]]], !=, literal[null]]] begin[{] assign[member[.componentType], call[tableAttributes.get, parameter[member[.TOP_LEVEL_PARAMETERIZED_TYPE]]]] else begin[{] None end[}] if[binary_operation[member[.componentType], !=, literal[null]]] begin[{] local_variable[type[String], controllerName] local_variable[type[HtmlOutcomeTargetLink], link] local_variable[type[String], outcome] if[binary_operation[call[outcome.isEmpty, parameter[]], &&, call[outcome.startsWith, parameter[literal["/"]]]]] begin[{] assign[member[.outcome], binary_operation[literal["/"], +, member[.outcome]]] else begin[{] None end[}] call[link.putAttribute, parameter[literal["outcome"], binary_operation[binary_operation[binary_operation[member[.outcome], +, literal["/"]], +, member[.controllerName]], +, literal["/view"]]]] local_variable[type[String], primaryKeyName] local_variable[type[String], inspectedType] if[binary_operation[member[.inspectedType], !=, literal[null]]] begin[{] local_variable[type[Element], root] local_variable[type[NodeList], elements] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=loop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=PRIMARY_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasAttribute, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=primaryKeyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=loop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=loop), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), name=length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=loop, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] local_variable[type[Param], param] call[param.putAttribute, parameter[literal["name"], literal["id"]]] call[param.putAttribute, parameter[literal["value"], call[StaticFacesUtils.wrapExpression, parameter[binary_operation[binary_operation[call[dataTable.getAttribute, parameter[literal["var"]]], +, member[StringUtils.SEPARATOR_DOT_CHAR]], +, member[.primaryKeyName]]]]]] call[link.getChildren, parameter[]] call[link.getChildren, parameter[]] if[binary_operation[call[columnAttributes.containsKey, parameter[member[.FACES_LOOKUP]]], &&, call[columnAttributes.containsKey, parameter[member[.REVERSE_PRIMARY_KEY]]]]] begin[{] local_variable[type[StaticHtmlMetawidget], output] local_variable[type[String], displayExpression] call[output.setValue, parameter[call[StaticFacesUtils.wrapExpression, parameter[member[.displayExpression]]]]] else begin[{] None end[}] if[binary_operation[call[tableAttributes.get, parameter[member[.PARAMETERIZED_TYPE_PATH]]], !=, literal[null]]] begin[{] local_variable[type[String], valueExpression] local_variable[type[StaticHtmlMetawidget], output] call[output.setValue, parameter[call[StaticFacesUtils.wrapExpression, parameter[member[.valueExpression]]]]] else begin[{] None end[}] call[column.getChildren, parameter[]] if[binary_operation[call[tableAttributes.containsKey, parameter[member[.INVERSE_RELATIONSHIP]]], &&, call[metawidget.isReadOnly, parameter[]]]] begin[{] if[call[ENTITY.equals, parameter[member[.elementName]]]] begin[{] local_variable[type[StaticHtmlMetawidget], footerMetawidget] local_variable[type[Map], footerAttributes] call[metawidget.initNestedMetawidget, parameter[member[.footerMetawidget], member[.footerAttributes]]] call[footerMetawidget.removeWidgetProcessor, parameter[call[footerMetawidget.getWidgetProcessor, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RequiredAttributeProcessor, sub_type=None))]]]] call[footerMetawidget.setValue, parameter[call[StaticFacesUtils.wrapExpression, parameter[binary_operation[binary_operation[member[.controllerName], +, literal["Bean.add."]], +, member[.columnName]]]]]] call[footerMetawidget.setPath, parameter[binary_operation[binary_operation[member[.componentType], +, member[StringUtils.SEPARATOR_FORWARD_SLASH_CHAR]], +, member[.columnName]]]] call[footerMetawidget.setLayout, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SimpleLayout, sub_type=None))]] local_variable[type[Facet], footerFacet] call[footerFacet.putAttribute, parameter[literal["name"], literal["footer"]]] call[footerFacet.getChildren, parameter[]] local_variable[type[ReadableIdProcessor], readableIdProcessor] if[binary_operation[member[.readableIdProcessor], !=, literal[null]]] begin[{] call[readableIdProcessor.processWidget, parameter[member[.footerMetawidget], member[.elementName], member[.columnAttributes], member[.metawidget]]] else begin[{] None end[}] local_variable[type[HtmlMessage], message] call[message.putAttribute, parameter[literal["for"], call[footerMetawidget.getAttribute, parameter[literal["id"]]]]] call[message.putAttribute, parameter[literal["styleClass"], literal["error"]]] call[footerFacet.getChildren, parameter[]] call[column.getChildren, parameter[]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[addColumnComponent] operator[SEP] identifier[HtmlDataTable] identifier[dataTable] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tableAttributes] , identifier[String] identifier[elementName] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[columnAttributes] , identifier[StaticXmlMetawidget] identifier[metawidget] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[WidgetBuilderUtils] operator[SEP] identifier[getActualClassOrType] operator[SEP] identifier[columnAttributes] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[!=] Other[null] operator[&&] operator[SEP] identifier[Collection] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[String] identifier[componentType] operator[=] identifier[WidgetBuilderUtils] operator[SEP] identifier[getComponentType] operator[SEP] identifier[tableAttributes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TRUE] operator[SEP] identifier[equals] operator[SEP] identifier[columnAttributes] operator[SEP] identifier[get] operator[SEP] identifier[ONE_TO_ONE] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[columnType] operator[=] identifier[columnAttributes] operator[SEP] identifier[get] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] identifier[String] identifier[inspectedType] operator[=] identifier[metawidget] operator[SEP] identifier[inspect] operator[SEP] Other[null] , identifier[columnType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inspectedType] operator[!=] Other[null] operator[SEP] { identifier[Element] identifier[root] operator[=] identifier[XmlUtils] operator[SEP] identifier[documentFromString] operator[SEP] identifier[inspectedType] operator[SEP] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[elements] operator[=] identifier[root] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[embeddedAttributes] operator[=] identifier[CollectionUtils] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] identifier[embeddedAttributes] operator[SEP] identifier[put] operator[SEP] identifier[TOP_LEVEL_PARAMETERIZED_TYPE] , identifier[componentType] operator[SEP] operator[SEP] identifier[embeddedAttributes] operator[SEP] identifier[put] operator[SEP] identifier[PARAMETERIZED_TYPE] , identifier[columnType] operator[SEP] operator[SEP] identifier[embeddedAttributes] operator[SEP] identifier[put] operator[SEP] identifier[PARAMETERIZED_TYPE_PATH] , identifier[columnAttributes] operator[SEP] identifier[get] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] operator[SEP] identifier[addColumnComponents] operator[SEP] identifier[dataTable] , identifier[embeddedAttributes] , identifier[elements] , identifier[metawidget] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } identifier[String] identifier[columnName] operator[=] identifier[columnAttributes] operator[SEP] identifier[get] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columnName] operator[SEP] identifier[equals] operator[SEP] identifier[tableAttributes] operator[SEP] identifier[get] operator[SEP] identifier[INVERSE_RELATIONSHIP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[addColumnComponent] operator[SEP] identifier[dataTable] , identifier[tableAttributes] , identifier[elementName] , identifier[columnAttributes] , identifier[metawidget] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[StaticWidget] operator[>] identifier[columns] operator[=] identifier[dataTable] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[HtmlColumn] identifier[column] operator[=] operator[SEP] identifier[HtmlColumn] operator[SEP] identifier[columns] operator[SEP] identifier[get] operator[SEP] identifier[columns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tableAttributes] operator[SEP] identifier[get] operator[SEP] identifier[TOP_LEVEL_PARAMETERIZED_TYPE] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[componentType] operator[=] identifier[tableAttributes] operator[SEP] identifier[get] operator[SEP] identifier[TOP_LEVEL_PARAMETERIZED_TYPE] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[controllerName] operator[=] identifier[StringUtils] operator[SEP] identifier[decapitalize] operator[SEP] identifier[ClassUtils] operator[SEP] identifier[getSimpleName] operator[SEP] identifier[componentType] operator[SEP] operator[SEP] operator[SEP] identifier[HtmlOutcomeTargetLink] identifier[link] operator[=] Keyword[new] identifier[HtmlOutcomeTargetLink] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[outcome] operator[=] identifier[getTargetDir] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[outcome] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[outcome] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[outcome] operator[=] literal[String] operator[+] identifier[outcome] operator[SEP] } identifier[link] operator[SEP] identifier[putAttribute] operator[SEP] literal[String] , identifier[outcome] operator[+] literal[String] operator[+] identifier[controllerName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[primaryKeyName] operator[=] literal[String] operator[SEP] identifier[String] identifier[inspectedType] operator[=] identifier[metawidget] operator[SEP] identifier[inspect] operator[SEP] Other[null] , identifier[componentType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inspectedType] operator[!=] Other[null] operator[SEP] { identifier[Element] identifier[root] operator[=] identifier[XmlUtils] operator[SEP] identifier[documentFromString] operator[SEP] identifier[inspectedType] operator[SEP] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[elements] operator[=] identifier[root] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[loop] operator[=] Other[0] , identifier[length] operator[=] identifier[elements] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[loop] operator[<] identifier[length] operator[SEP] identifier[loop] operator[++] operator[SEP] { identifier[Element] identifier[element] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[elements] operator[SEP] identifier[item] operator[SEP] identifier[loop] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[SEP] identifier[hasAttribute] operator[SEP] identifier[PRIMARY_KEY] operator[SEP] operator[SEP] { identifier[primaryKeyName] operator[=] identifier[element] operator[SEP] identifier[getAttribute] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } } identifier[Param] identifier[param] operator[=] Keyword[new] identifier[Param] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[putAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[putAttribute] operator[SEP] literal[String] , identifier[StaticFacesUtils] operator[SEP] identifier[wrapExpression] operator[SEP] identifier[dataTable] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[+] identifier[StringUtils] operator[SEP] identifier[SEPARATOR_DOT_CHAR] operator[+] identifier[primaryKeyName] operator[SEP] operator[SEP] operator[SEP] identifier[link] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[link] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[column] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columnAttributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[FACES_LOOKUP] operator[SEP] operator[&&] identifier[columnAttributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[REVERSE_PRIMARY_KEY] operator[SEP] operator[SEP] { identifier[StaticHtmlMetawidget] identifier[output] operator[=] operator[SEP] identifier[StaticHtmlMetawidget] operator[SEP] identifier[link] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[displayExpression] operator[=] identifier[dataTable] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[+] identifier[StringUtils] operator[SEP] identifier[SEPARATOR_DOT_CHAR] operator[+] identifier[StringUtils] operator[SEP] identifier[decapitalize] operator[SEP] identifier[columnAttributes] operator[SEP] identifier[get] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[setValue] operator[SEP] identifier[StaticFacesUtils] operator[SEP] identifier[wrapExpression] operator[SEP] identifier[displayExpression] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tableAttributes] operator[SEP] identifier[get] operator[SEP] identifier[PARAMETERIZED_TYPE_PATH] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[valueExpression] operator[=] identifier[dataTable] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[+] identifier[StringUtils] operator[SEP] identifier[SEPARATOR_DOT_CHAR] operator[+] identifier[tableAttributes] operator[SEP] identifier[get] operator[SEP] identifier[PARAMETERIZED_TYPE_PATH] operator[SEP] operator[+] identifier[StringUtils] operator[SEP] identifier[SEPARATOR_DOT_CHAR] operator[+] identifier[StringUtils] operator[SEP] identifier[decapitalize] operator[SEP] identifier[columnAttributes] operator[SEP] identifier[get] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] operator[SEP] identifier[StaticHtmlMetawidget] identifier[output] operator[=] operator[SEP] identifier[StaticHtmlMetawidget] operator[SEP] identifier[link] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[setValue] operator[SEP] identifier[StaticFacesUtils] operator[SEP] identifier[wrapExpression] operator[SEP] identifier[valueExpression] operator[SEP] operator[SEP] operator[SEP] } identifier[column] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[link] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tableAttributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[INVERSE_RELATIONSHIP] operator[SEP] operator[&&] operator[!] identifier[metawidget] operator[SEP] identifier[isReadOnly] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[ENTITY] operator[SEP] identifier[equals] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] { identifier[StaticHtmlMetawidget] identifier[footerMetawidget] operator[=] Keyword[new] identifier[StaticHtmlMetawidget] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[footerAttributes] operator[=] identifier[CollectionUtils] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] identifier[metawidget] operator[SEP] identifier[initNestedMetawidget] operator[SEP] identifier[footerMetawidget] , identifier[footerAttributes] operator[SEP] operator[SEP] identifier[footerMetawidget] operator[SEP] identifier[removeWidgetProcessor] operator[SEP] identifier[footerMetawidget] operator[SEP] identifier[getWidgetProcessor] operator[SEP] identifier[RequiredAttributeProcessor] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[footerMetawidget] operator[SEP] identifier[setValue] operator[SEP] identifier[StaticFacesUtils] operator[SEP] identifier[wrapExpression] operator[SEP] identifier[controllerName] operator[+] literal[String] operator[+] identifier[columnName] operator[SEP] operator[SEP] operator[SEP] identifier[footerMetawidget] operator[SEP] identifier[setPath] operator[SEP] identifier[componentType] operator[+] identifier[StringUtils] operator[SEP] identifier[SEPARATOR_FORWARD_SLASH_CHAR] operator[+] identifier[columnName] operator[SEP] operator[SEP] identifier[footerMetawidget] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[SimpleLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Facet] identifier[footerFacet] operator[=] Keyword[new] identifier[Facet] operator[SEP] operator[SEP] operator[SEP] identifier[footerFacet] operator[SEP] identifier[putAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[footerFacet] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[footerMetawidget] operator[SEP] operator[SEP] identifier[ReadableIdProcessor] identifier[readableIdProcessor] operator[=] identifier[metawidget] operator[SEP] identifier[getWidgetProcessor] operator[SEP] identifier[ReadableIdProcessor] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readableIdProcessor] operator[!=] Other[null] operator[SEP] { identifier[readableIdProcessor] operator[SEP] identifier[processWidget] operator[SEP] identifier[footerMetawidget] , identifier[elementName] , identifier[columnAttributes] , identifier[metawidget] operator[SEP] operator[SEP] } identifier[HtmlMessage] identifier[message] operator[=] Keyword[new] identifier[HtmlMessage] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[putAttribute] operator[SEP] literal[String] , identifier[footerMetawidget] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[putAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[footerFacet] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[footerFacet] operator[SEP] operator[SEP] } } } }
public @Nullable Drawable setCurrent(@Nullable Drawable newDelegate) { Drawable previousDelegate = setCurrentWithoutInvalidate(newDelegate); invalidateSelf(); return previousDelegate; }
class class_name[name] begin[{] method[setCurrent, return_type[type[Drawable]], modifier[public], parameter[newDelegate]] begin[{] local_variable[type[Drawable], previousDelegate] call[.invalidateSelf, parameter[]] return[member[.previousDelegate]] end[}] END[}]
Keyword[public] annotation[@] identifier[Nullable] identifier[Drawable] identifier[setCurrent] operator[SEP] annotation[@] identifier[Nullable] identifier[Drawable] identifier[newDelegate] operator[SEP] { identifier[Drawable] identifier[previousDelegate] operator[=] identifier[setCurrentWithoutInvalidate] operator[SEP] identifier[newDelegate] operator[SEP] operator[SEP] identifier[invalidateSelf] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[previousDelegate] operator[SEP] }
private void checkIsValid(final Document document, final Source source) throws SAXException, IOException { final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); final Schema schema = schemaFactory.newSchema(source); final Validator validator = schema.newValidator(); validator.validate(new DOMSource(document)); }
class class_name[name] begin[{] method[checkIsValid, return_type[void], modifier[private], parameter[document, source]] begin[{] local_variable[type[SchemaFactory], schemaFactory] local_variable[type[Schema], schema] local_variable[type[Validator], validator] call[validator.validate, parameter[ClassCreator(arguments=[MemberReference(member=document, 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=DOMSource, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkIsValid] operator[SEP] Keyword[final] identifier[Document] identifier[document] , Keyword[final] identifier[Source] identifier[source] operator[SEP] Keyword[throws] identifier[SAXException] , identifier[IOException] { Keyword[final] identifier[SchemaFactory] identifier[schemaFactory] operator[=] identifier[SchemaFactory] operator[SEP] identifier[newInstance] operator[SEP] identifier[XMLConstants] operator[SEP] identifier[W3C_XML_SCHEMA_NS_URI] operator[SEP] operator[SEP] Keyword[final] identifier[Schema] identifier[schema] operator[=] identifier[schemaFactory] operator[SEP] identifier[newSchema] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[final] identifier[Validator] identifier[validator] operator[=] identifier[schema] operator[SEP] identifier[newValidator] operator[SEP] operator[SEP] operator[SEP] identifier[validator] operator[SEP] identifier[validate] operator[SEP] Keyword[new] identifier[DOMSource] operator[SEP] identifier[document] operator[SEP] operator[SEP] operator[SEP] }
public static double toleranceDistance(int zoom, int pixelWidth, int pixelHeight) { return toleranceDistance(zoom, Math.max(pixelWidth, pixelHeight)); }
class class_name[name] begin[{] method[toleranceDistance, return_type[type[double]], modifier[public static], parameter[zoom, pixelWidth, pixelHeight]] begin[{] return[call[.toleranceDistance, parameter[member[.zoom], call[Math.max, parameter[member[.pixelWidth], member[.pixelHeight]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[toleranceDistance] operator[SEP] Keyword[int] identifier[zoom] , Keyword[int] identifier[pixelWidth] , Keyword[int] identifier[pixelHeight] operator[SEP] { Keyword[return] identifier[toleranceDistance] operator[SEP] identifier[zoom] , identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[pixelWidth] , identifier[pixelHeight] operator[SEP] operator[SEP] operator[SEP] }
public void triggerPurge(final Runnable afterPurgeAction) { OpenCms.getExecutor().execute(new Runnable() { @SuppressWarnings("synthetic-access") public void run() { try { m_purgeLock.writeLock().lock(); for (ReentrantReadWriteLock lock : m_fileLocks.values()) { lock.writeLock().lock(); } doPurge(afterPurgeAction); } catch (Exception e) { LOG.error("Error while purging jsp repository: " + e.getLocalizedMessage(), e); } finally { for (ReentrantReadWriteLock lock : m_fileLocks.values()) { try { lock.writeLock().unlock(); } catch (Exception e) { LOG.warn(e.getLocalizedMessage(), e); } } m_purgeLock.writeLock().unlock(); } } }); }
class class_name[name] begin[{] method[triggerPurge, return_type[void], modifier[public], parameter[afterPurgeAction]] begin[{] call[OpenCms.getExecutor, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[triggerPurge] operator[SEP] Keyword[final] identifier[Runnable] identifier[afterPurgeAction] operator[SEP] { identifier[OpenCms] operator[SEP] identifier[getExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[m_purgeLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ReentrantReadWriteLock] identifier[lock] operator[:] identifier[m_fileLocks] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] } identifier[doPurge] operator[SEP] identifier[afterPurgeAction] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[for] operator[SEP] identifier[ReentrantReadWriteLock] identifier[lock] operator[:] identifier[m_fileLocks] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } identifier[m_purgeLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public static String randomString(int length, int min, int max, @NonNull CharMatcher validChar) { if (length <= 0) { return EMPTY; } Random random = new Random(); int maxRandom = max - min; char[] array = new char[length]; for (int i = 0; i < array.length; i++) { char c; do { c = (char) (random.nextInt(maxRandom) + min); } while (Character.isLowSurrogate(c) || Character.isHighSurrogate(c) || !validChar.matches(c)); array[i] = c; } return new String(array); }
class class_name[name] begin[{] method[randomString, return_type[type[String]], modifier[public static], parameter[length, min, max, validChar]] begin[{] if[binary_operation[member[.length], <=, literal[0]]] begin[{] return[member[.EMPTY]] else begin[{] None end[}] local_variable[type[Random], random] local_variable[type[int], maxRandom] local_variable[type[char], array] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), DoStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=maxRandom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=random, selectors=[], type_arguments=None), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), type=BasicType(dimensions=[], name=char))), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLowSurrogate, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isHighSurrogate, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=['!'], qualifier=validChar, selectors=[], type_arguments=None), operator=||), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[ClassCreator(arguments=[MemberReference(member=array, 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=String, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[randomString] operator[SEP] Keyword[int] identifier[length] , Keyword[int] identifier[min] , Keyword[int] identifier[max] , annotation[@] identifier[NonNull] identifier[CharMatcher] identifier[validChar] operator[SEP] { Keyword[if] operator[SEP] identifier[length] operator[<=] Other[0] operator[SEP] { Keyword[return] identifier[EMPTY] operator[SEP] } identifier[Random] identifier[random] operator[=] Keyword[new] identifier[Random] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[maxRandom] operator[=] identifier[max] operator[-] identifier[min] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[array] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[SEP] Keyword[do] { identifier[c] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] identifier[maxRandom] operator[SEP] operator[+] identifier[min] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[Character] operator[SEP] identifier[isLowSurrogate] operator[SEP] identifier[c] operator[SEP] operator[||] identifier[Character] operator[SEP] identifier[isHighSurrogate] operator[SEP] identifier[c] operator[SEP] operator[||] operator[!] identifier[validChar] operator[SEP] identifier[matches] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[c] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[array] operator[SEP] operator[SEP] }
public SubGraphPredicate withInputSubgraph(int inputNum, @NonNull OpPredicate opPredicate){ opInputSubgraphPredicates.put(inputNum, opPredicate); return this; }
class class_name[name] begin[{] method[withInputSubgraph, return_type[type[SubGraphPredicate]], modifier[public], parameter[inputNum, opPredicate]] begin[{] call[opInputSubgraphPredicates.put, parameter[member[.inputNum], member[.opPredicate]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[SubGraphPredicate] identifier[withInputSubgraph] operator[SEP] Keyword[int] identifier[inputNum] , annotation[@] identifier[NonNull] identifier[OpPredicate] identifier[opPredicate] operator[SEP] { identifier[opInputSubgraphPredicates] operator[SEP] identifier[put] operator[SEP] identifier[inputNum] , identifier[opPredicate] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static void mergeWindows(Collection<TimeWindow> windows, MergingWindowAssigner.MergeCallback<TimeWindow> c) { // sort the windows by the start time and then merge overlapping windows List<TimeWindow> sortedWindows = new ArrayList<>(windows); Collections.sort(sortedWindows, new Comparator<TimeWindow>() { @Override public int compare(TimeWindow o1, TimeWindow o2) { return Long.compare(o1.getStart(), o2.getStart()); } }); List<Tuple2<TimeWindow, Set<TimeWindow>>> merged = new ArrayList<>(); Tuple2<TimeWindow, Set<TimeWindow>> currentMerge = null; for (TimeWindow candidate: sortedWindows) { if (currentMerge == null) { currentMerge = new Tuple2<>(); currentMerge.f0 = candidate; currentMerge.f1 = new HashSet<>(); currentMerge.f1.add(candidate); } else if (currentMerge.f0.intersects(candidate)) { currentMerge.f0 = currentMerge.f0.cover(candidate); currentMerge.f1.add(candidate); } else { merged.add(currentMerge); currentMerge = new Tuple2<>(); currentMerge.f0 = candidate; currentMerge.f1 = new HashSet<>(); currentMerge.f1.add(candidate); } } if (currentMerge != null) { merged.add(currentMerge); } for (Tuple2<TimeWindow, Set<TimeWindow>> m: merged) { if (m.f1.size() > 1) { c.merge(m.f1, m.f0); } } }
class class_name[name] begin[{] method[mergeWindows, return_type[void], modifier[public static], parameter[windows, c]] begin[{] local_variable[type[List], sortedWindows] call[Collections.sort, parameter[member[.sortedWindows], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=o1, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=o2, selectors=[], type_arguments=None)], member=compare, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=TimeWindow, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=o2, type=ReferenceType(arguments=None, dimensions=[], name=TimeWindow, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), 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=TimeWindow, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))]] local_variable[type[List], merged] local_variable[type[Tuple2], currentMerge] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentMerge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intersects, postfix_operators=[], prefix_operators=[], qualifier=currentMerge.f0, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentMerge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=merged, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentMerge, 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=[], dimensions=None, name=Tuple2, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=f0, postfix_operators=[], prefix_operators=[], qualifier=currentMerge, selectors=[]), type==, value=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=f1, postfix_operators=[], prefix_operators=[], qualifier=currentMerge, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=currentMerge.f1, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=f0, postfix_operators=[], prefix_operators=[], qualifier=currentMerge, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cover, postfix_operators=[], prefix_operators=[], qualifier=currentMerge.f0, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=currentMerge.f1, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentMerge, 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=[], dimensions=None, name=Tuple2, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=f0, postfix_operators=[], prefix_operators=[], qualifier=currentMerge, selectors=[]), type==, value=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=f1, postfix_operators=[], prefix_operators=[], qualifier=currentMerge, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=currentMerge.f1, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sortedWindows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=candidate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimeWindow, sub_type=None))), label=None) if[binary_operation[member[.currentMerge], !=, literal[null]]] begin[{] call[merged.add, parameter[member[.currentMerge]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=m.f1, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=f1, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[]), MemberReference(member=f0, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[])], member=merge, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=merged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TimeWindow, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TimeWindow, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=[], name=Tuple2, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[mergeWindows] operator[SEP] identifier[Collection] operator[<] identifier[TimeWindow] operator[>] identifier[windows] , identifier[MergingWindowAssigner] operator[SEP] identifier[MergeCallback] operator[<] identifier[TimeWindow] operator[>] identifier[c] operator[SEP] { identifier[List] operator[<] identifier[TimeWindow] operator[>] identifier[sortedWindows] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[windows] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[sortedWindows] , Keyword[new] identifier[Comparator] operator[<] identifier[TimeWindow] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[TimeWindow] identifier[o1] , identifier[TimeWindow] identifier[o2] operator[SEP] { Keyword[return] identifier[Long] operator[SEP] identifier[compare] operator[SEP] identifier[o1] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] , identifier[o2] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Tuple2] operator[<] identifier[TimeWindow] , identifier[Set] operator[<] identifier[TimeWindow] operator[>] operator[>] operator[>] identifier[merged] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Tuple2] operator[<] identifier[TimeWindow] , identifier[Set] operator[<] identifier[TimeWindow] operator[>] operator[>] identifier[currentMerge] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[TimeWindow] identifier[candidate] operator[:] identifier[sortedWindows] operator[SEP] { Keyword[if] operator[SEP] identifier[currentMerge] operator[==] Other[null] operator[SEP] { identifier[currentMerge] operator[=] Keyword[new] identifier[Tuple2] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f0] operator[=] identifier[candidate] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f1] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f1] operator[SEP] identifier[add] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f0] operator[SEP] identifier[intersects] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] { identifier[currentMerge] operator[SEP] identifier[f0] operator[=] identifier[currentMerge] operator[SEP] identifier[f0] operator[SEP] identifier[cover] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f1] operator[SEP] identifier[add] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] } Keyword[else] { identifier[merged] operator[SEP] identifier[add] operator[SEP] identifier[currentMerge] operator[SEP] operator[SEP] identifier[currentMerge] operator[=] Keyword[new] identifier[Tuple2] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f0] operator[=] identifier[candidate] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f1] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[currentMerge] operator[SEP] identifier[f1] operator[SEP] identifier[add] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[currentMerge] operator[!=] Other[null] operator[SEP] { identifier[merged] operator[SEP] identifier[add] operator[SEP] identifier[currentMerge] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Tuple2] operator[<] identifier[TimeWindow] , identifier[Set] operator[<] identifier[TimeWindow] operator[>] operator[>] identifier[m] operator[:] identifier[merged] operator[SEP] { Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[f1] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[c] operator[SEP] identifier[merge] operator[SEP] identifier[m] operator[SEP] identifier[f1] , identifier[m] operator[SEP] identifier[f0] operator[SEP] operator[SEP] } } }
public String entityToTable(String entityName) { int index = entityName.lastIndexOf('.'); if(index >= 0){ entityName = entityName.substring(index + 1); } index = entityName.lastIndexOf('$'); if(index >= 0){ entityName = entityName.substring(index + 1); } StringBuilder sb = new StringBuilder(); for(int i=0;i<entityName.length();i++){ char c = entityName.charAt(i); if(c >= 'A' && c <= 'Z' && sb.length() > 0){ sb.append('_'); } sb.append(String.valueOf(c).toUpperCase()); } return sb.toString(); }
class class_name[name] begin[{] method[entityToTable, return_type[type[String]], modifier[public], parameter[entityName]] begin[{] local_variable[type[int], index] if[binary_operation[member[.index], >=, literal[0]]] begin[{] assign[member[.entityName], call[entityName.substring, parameter[binary_operation[member[.index], +, literal[1]]]]] else begin[{] None end[}] assign[member[.index], call[entityName.lastIndexOf, parameter[literal['$']]]] if[binary_operation[member[.index], >=, literal[0]]] begin[{] assign[member[.entityName], call[entityName.substring, parameter[binary_operation[member[.index], +, literal[1]]]]] else begin[{] None end[}] local_variable[type[StringBuilder], sb] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=entityName, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Z'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=entityName, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[entityToTable] operator[SEP] identifier[String] identifier[entityName] operator[SEP] { Keyword[int] identifier[index] operator[=] identifier[entityName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] { identifier[entityName] operator[=] identifier[entityName] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] } identifier[index] operator[=] identifier[entityName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] { identifier[entityName] operator[=] identifier[entityName] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[entityName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[entityName] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[&&] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public GetFolderResult withSubFolders(Folder... subFolders) { if (this.subFolders == null) { setSubFolders(new java.util.ArrayList<Folder>(subFolders.length)); } for (Folder ele : subFolders) { this.subFolders.add(ele); } return this; }
class class_name[name] begin[{] method[withSubFolders, return_type[type[GetFolderResult]], modifier[public], parameter[subFolders]] begin[{] if[binary_operation[THIS[member[None.subFolders]], ==, literal[null]]] begin[{] call[.setSubFolders, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=subFolders, 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=Folder, 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=subFolders, 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=subFolders, 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=Folder, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[GetFolderResult] identifier[withSubFolders] operator[SEP] identifier[Folder] operator[...] identifier[subFolders] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[subFolders] operator[==] Other[null] operator[SEP] { identifier[setSubFolders] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[Folder] operator[>] operator[SEP] identifier[subFolders] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Folder] identifier[ele] operator[:] identifier[subFolders] operator[SEP] { Keyword[this] operator[SEP] identifier[subFolders] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private void mapAndSetOffset() { try { final RandomAccessFile backingFile = new RandomAccessFile(this.file, "rw"); backingFile.setLength(this.size); final FileChannel ch = backingFile.getChannel(); this.addr = (Long) mmap.invoke(ch, 1, 0L, this.size); ch.close(); backingFile.close(); } catch (Exception e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[mapAndSetOffset, return_type[void], modifier[private], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=file, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rw")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RandomAccessFile, sub_type=None)), name=backingFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=RandomAccessFile, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=setLength, postfix_operators=[], prefix_operators=[], qualifier=backingFile, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=backingFile, selectors=[], type_arguments=None), name=ch)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=FileChannel, sub_type=None)), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=addr, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=mmap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=ch, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=backingFile, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[mapAndSetOffset] operator[SEP] operator[SEP] { Keyword[try] { Keyword[final] identifier[RandomAccessFile] identifier[backingFile] operator[=] Keyword[new] identifier[RandomAccessFile] operator[SEP] Keyword[this] operator[SEP] identifier[file] , literal[String] operator[SEP] operator[SEP] identifier[backingFile] operator[SEP] identifier[setLength] operator[SEP] Keyword[this] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[final] identifier[FileChannel] identifier[ch] operator[=] identifier[backingFile] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[addr] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[mmap] operator[SEP] identifier[invoke] operator[SEP] identifier[ch] , Other[1] , Other[0L] , Keyword[this] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[ch] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[backingFile] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
@Override public <T> T get(IKvEntryMapper<T> mapper, String table, String key) { byte[] data = get(table, key); return data != null ? mapper.mapEntry(table, key, data) : null; }
class class_name[name] begin[{] method[get, return_type[type[T]], modifier[public], parameter[mapper, table, key]] begin[{] local_variable[type[byte], data] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mapEntry, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[get] operator[SEP] identifier[IKvEntryMapper] operator[<] identifier[T] operator[>] identifier[mapper] , identifier[String] identifier[table] , identifier[String] identifier[key] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[get] operator[SEP] identifier[table] , identifier[key] operator[SEP] operator[SEP] Keyword[return] identifier[data] operator[!=] Other[null] operator[?] identifier[mapper] operator[SEP] identifier[mapEntry] operator[SEP] identifier[table] , identifier[key] , identifier[data] operator[SEP] operator[:] Other[null] operator[SEP] }
public static List<File> extractContainedLibraries(URL jarFile) throws ProgramInvocationException { Random rnd = new Random(); JarFile jar = null; try { jar = new JarFile(new File(jarFile.toURI())); final List<JarEntry> containedJarFileEntries = new ArrayList<JarEntry>(); Enumeration<JarEntry> entries = jar.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); if (name.length() > 8 && name.startsWith("lib/") && name.endsWith(".jar")) { containedJarFileEntries.add(entry); } } if (containedJarFileEntries.isEmpty()) { return Collections.emptyList(); } else { // go over all contained jar files final List<File> extractedTempLibraries = new ArrayList<File>(containedJarFileEntries.size()); final byte[] buffer = new byte[4096]; boolean incomplete = true; try { for (int i = 0; i < containedJarFileEntries.size(); i++) { final JarEntry entry = containedJarFileEntries.get(i); String name = entry.getName(); // '/' as in case of zip, jar // java.util.zip.ZipEntry#isDirectory always looks only for '/' not for File.separator name = name.replace('/', '_'); File tempFile; try { tempFile = File.createTempFile(rnd.nextInt(Integer.MAX_VALUE) + "_", name); tempFile.deleteOnExit(); } catch (IOException e) { throw new ProgramInvocationException( "An I/O error occurred while creating temporary file to extract nested library '" + entry.getName() + "'.", e); } extractedTempLibraries.add(tempFile); // copy the temp file contents to a temporary File OutputStream out = null; InputStream in = null; try { out = new FileOutputStream(tempFile); in = new BufferedInputStream(jar.getInputStream(entry)); int numRead = 0; while ((numRead = in.read(buffer)) != -1) { out.write(buffer, 0, numRead); } } catch (IOException e) { throw new ProgramInvocationException("An I/O error occurred while extracting nested library '" + entry.getName() + "' to temporary file '" + tempFile.getAbsolutePath() + "'."); } finally { if (out != null) { out.close(); } if (in != null) { in.close(); } } } incomplete = false; } finally { if (incomplete) { deleteExtractedLibraries(extractedTempLibraries); } } return extractedTempLibraries; } } catch (Throwable t) { throw new ProgramInvocationException("Unknown I/O error while extracting contained jar files.", t); } finally { if (jar != null) { try { jar.close(); } catch (Throwable t) {} } } }
class class_name[name] begin[{] method[extractContainedLibraries, return_type[type[List]], modifier[public static], parameter[jarFile]] begin[{] local_variable[type[Random], rnd] local_variable[type[JarFile], jar] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=jar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=jarFile, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JarFile, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=containedJarFileEntries)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=jar, selectors=[], type_arguments=None), name=entries)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None))], dimensions=[], name=Enumeration, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="lib/")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".jar")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=containedJarFileEntries, selectors=[], type_arguments=None), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=containedJarFileEntries, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=containedJarFileEntries, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=extractedTempLibraries)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buffer)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=incomplete)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=containedJarFileEntries, selectors=[], type_arguments=None), name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_')], member=replace, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=tempFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tempFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[])], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rnd, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_"), operator=+), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTempFile, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=deleteOnExit, postfix_operators=[], prefix_operators=[], qualifier=tempFile, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An I/O error occurred while creating temporary file to extract nested library '"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'."), 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=ProgramInvocationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tempFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=extractedTempLibraries, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=tempFile, 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=FileOutputStream, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=jar, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=numRead)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=numRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=numRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An I/O error occurred while extracting nested library '"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' to temporary file '"), operator=+), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=tempFile, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProgramInvocationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=containedJarFileEntries, 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), StatementExpression(expression=Assignment(expressionl=MemberReference(member=incomplete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=incomplete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=extractedTempLibraries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteExtractedLibraries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None), ReturnStatement(expression=MemberReference(member=extractedTempLibraries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown I/O error while extracting contained jar files."), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProgramInvocationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=jar, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[File] operator[>] identifier[extractContainedLibraries] operator[SEP] identifier[URL] identifier[jarFile] operator[SEP] Keyword[throws] identifier[ProgramInvocationException] { identifier[Random] identifier[rnd] operator[=] Keyword[new] identifier[Random] operator[SEP] operator[SEP] operator[SEP] identifier[JarFile] identifier[jar] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[jar] operator[=] Keyword[new] identifier[JarFile] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[jarFile] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[JarEntry] operator[>] identifier[containedJarFileEntries] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[JarEntry] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Enumeration] operator[<] identifier[JarEntry] operator[>] identifier[entries] operator[=] identifier[jar] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[entries] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[JarEntry] identifier[entry] operator[=] identifier[entries] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[8] operator[&&] identifier[name] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[name] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[containedJarFileEntries] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[containedJarFileEntries] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[List] operator[<] identifier[File] operator[>] identifier[extractedTempLibraries] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[File] operator[>] operator[SEP] identifier[containedJarFileEntries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[4096] operator[SEP] operator[SEP] Keyword[boolean] identifier[incomplete] operator[=] literal[boolean] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[containedJarFileEntries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[JarEntry] identifier[entry] operator[=] identifier[containedJarFileEntries] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[name] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[File] identifier[tempFile] operator[SEP] Keyword[try] { identifier[tempFile] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] identifier[rnd] operator[SEP] identifier[nextInt] operator[SEP] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[+] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[tempFile] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ProgramInvocationException] operator[SEP] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[extractedTempLibraries] operator[SEP] identifier[add] operator[SEP] identifier[tempFile] operator[SEP] operator[SEP] identifier[OutputStream] identifier[out] operator[=] Other[null] operator[SEP] identifier[InputStream] identifier[in] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[out] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[tempFile] operator[SEP] operator[SEP] identifier[in] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[jar] operator[SEP] identifier[getInputStream] operator[SEP] identifier[entry] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numRead] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[numRead] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , Other[0] , identifier[numRead] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ProgramInvocationException] operator[SEP] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[tempFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[out] operator[!=] Other[null] operator[SEP] { identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[in] operator[!=] Other[null] operator[SEP] { identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } } identifier[incomplete] operator[=] literal[boolean] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[incomplete] operator[SEP] { identifier[deleteExtractedLibraries] operator[SEP] identifier[extractedTempLibraries] operator[SEP] operator[SEP] } } Keyword[return] identifier[extractedTempLibraries] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[throw] Keyword[new] identifier[ProgramInvocationException] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[jar] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[jar] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { } } } }
public FeatureList getFeatureList() throws IOException, ServerException { if (this.session.featureList != null) { return this.session.featureList; } // TODO: this can also be optimized. Instead of parsing the // reply after it is reveiced, we can parse it as it is // received. Reply featReply = null; try { featReply = controlChannel.execute(Command.FEAT); if (featReply.getCode() != 211) { throw ServerException.embedUnexpectedReplyCodeException( new UnexpectedReplyCodeException(featReply), "Server refused returning features"); } } catch (FTPReplyParseException rpe) { throw ServerException.embedFTPReplyParseException(rpe); } catch (UnexpectedReplyCodeException urce) { throw ServerException.embedUnexpectedReplyCodeException( urce, "Server refused returning features"); } this.session.featureList = new FeatureList(featReply.getMessage()); return session.featureList; }
class class_name[name] begin[{] method[getFeatureList, return_type[type[FeatureList]], modifier[public], parameter[]] begin[{] if[binary_operation[THIS[member[None.session]member[None.featureList]], !=, literal[null]]] begin[{] return[THIS[member[None.session]member[None.featureList]]] else begin[{] None end[}] local_variable[type[Reply], featReply] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=featReply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=FEAT, postfix_operators=[], prefix_operators=[], qualifier=Command, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=controlChannel, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCode, postfix_operators=[], prefix_operators=[], qualifier=featReply, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=211), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=featReply, 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=UnexpectedReplyCodeException, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Server refused returning features")], member=embedUnexpectedReplyCodeException, postfix_operators=[], prefix_operators=[], qualifier=ServerException, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=rpe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=embedFTPReplyParseException, postfix_operators=[], prefix_operators=[], qualifier=ServerException, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=rpe, types=['FTPReplyParseException'])), CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=urce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Server refused returning features")], member=embedUnexpectedReplyCodeException, postfix_operators=[], prefix_operators=[], qualifier=ServerException, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=urce, types=['UnexpectedReplyCodeException']))], finally_block=None, label=None, resources=None) assign[THIS[member[None.session]member[None.featureList]], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=featReply, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FeatureList, sub_type=None))] return[member[session.featureList]] end[}] END[}]
Keyword[public] identifier[FeatureList] identifier[getFeatureList] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServerException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[session] operator[SEP] identifier[featureList] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[session] operator[SEP] identifier[featureList] operator[SEP] } identifier[Reply] identifier[featReply] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[featReply] operator[=] identifier[controlChannel] operator[SEP] identifier[execute] operator[SEP] identifier[Command] operator[SEP] identifier[FEAT] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[featReply] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[!=] Other[211] operator[SEP] { Keyword[throw] identifier[ServerException] operator[SEP] identifier[embedUnexpectedReplyCodeException] operator[SEP] Keyword[new] identifier[UnexpectedReplyCodeException] operator[SEP] identifier[featReply] operator[SEP] , literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[FTPReplyParseException] identifier[rpe] operator[SEP] { Keyword[throw] identifier[ServerException] operator[SEP] identifier[embedFTPReplyParseException] operator[SEP] identifier[rpe] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnexpectedReplyCodeException] identifier[urce] operator[SEP] { Keyword[throw] identifier[ServerException] operator[SEP] identifier[embedUnexpectedReplyCodeException] operator[SEP] identifier[urce] , literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[session] operator[SEP] identifier[featureList] operator[=] Keyword[new] identifier[FeatureList] operator[SEP] identifier[featReply] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[session] operator[SEP] identifier[featureList] operator[SEP] }
public Coder getCoder() { long cPtr = VideoJNI.MuxerStream_getCoder(swigCPtr, this); return (cPtr == 0) ? null : new Coder(cPtr, false); }
class class_name[name] begin[{] method[getCoder, return_type[type[Coder]], modifier[public], parameter[]] begin[{] local_variable[type[long], cPtr] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=ClassCreator(arguments=[MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Coder, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Coder] identifier[getCoder] operator[SEP] operator[SEP] { Keyword[long] identifier[cPtr] operator[=] identifier[VideoJNI] operator[SEP] identifier[MuxerStream_getCoder] operator[SEP] identifier[swigCPtr] , Keyword[this] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[cPtr] operator[==] Other[0] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[Coder] operator[SEP] identifier[cPtr] , literal[boolean] operator[SEP] operator[SEP] }
public static managed_device[] get(nitro_service client) throws Exception { managed_device resource = new managed_device(); resource.validate("get"); return (managed_device[]) resource.get_resources(client); }
class class_name[name] begin[{] method[get, return_type[type[managed_device]], modifier[public static], parameter[client]] begin[{] local_variable[type[managed_device], resource] call[resource.validate, parameter[literal["get"]]] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_resources, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=managed_device, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[managed_device] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] { identifier[managed_device] identifier[resource] operator[=] Keyword[new] identifier[managed_device] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[managed_device] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[get_resources] operator[SEP] identifier[client] operator[SEP] operator[SEP] }
public static Set<IndexFlavor> complementOf(final Set<IndexFlavor> indexFlavors) { final Set<IndexFlavor> set = allOf(); set.removeAll(indexFlavors); return set; }
class class_name[name] begin[{] method[complementOf, return_type[type[Set]], modifier[public static], parameter[indexFlavors]] begin[{] local_variable[type[Set], set] call[set.removeAll, parameter[member[.indexFlavors]]] return[member[.set]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[IndexFlavor] operator[>] identifier[complementOf] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[IndexFlavor] operator[>] identifier[indexFlavors] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[IndexFlavor] operator[>] identifier[set] operator[=] identifier[allOf] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[removeAll] operator[SEP] identifier[indexFlavors] operator[SEP] operator[SEP] Keyword[return] identifier[set] operator[SEP] }
static public String intToHexString(int n, int width) { StringBuilder dest = new StringBuilder(width); dest.append(Integer.toHexString(n)); while (dest.length() < width) { dest.insert(0, ' '); } return dest.toString(); }
class class_name[name] begin[{] method[intToHexString, return_type[type[String]], modifier[public static], parameter[n, width]] begin[{] local_variable[type[StringBuilder], dest] call[dest.append, parameter[call[Integer.toHexString, parameter[member[.n]]]]] while[binary_operation[call[dest.length, parameter[]], <, member[.width]]] begin[{] call[dest.insert, parameter[literal[0], literal[' ']]] end[}] return[call[dest.toString, parameter[]]] end[}] END[}]
Keyword[static] Keyword[public] identifier[String] identifier[intToHexString] operator[SEP] Keyword[int] identifier[n] , Keyword[int] identifier[width] operator[SEP] { identifier[StringBuilder] identifier[dest] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[width] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[n] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[dest] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[width] operator[SEP] { identifier[dest] operator[SEP] identifier[insert] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[dest] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static int checkPreconditionI( final int value, final boolean condition, final IntFunction<String> describer) { return innerCheckI(value, condition, describer); }
class class_name[name] begin[{] method[checkPreconditionI, return_type[type[int]], modifier[public static], parameter[value, condition, describer]] begin[{] return[call[.innerCheckI, parameter[member[.value], member[.condition], member[.describer]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[checkPreconditionI] operator[SEP] Keyword[final] Keyword[int] identifier[value] , Keyword[final] Keyword[boolean] identifier[condition] , Keyword[final] identifier[IntFunction] operator[<] identifier[String] operator[>] identifier[describer] operator[SEP] { Keyword[return] identifier[innerCheckI] operator[SEP] identifier[value] , identifier[condition] , identifier[describer] operator[SEP] operator[SEP] }
public Dater setClock(String clock) { String tip = "clock format must HH:mm:ss"; checkArgument(checkNotNull(clock).length() == 8, tip); List<String> pieces = Splitter.on(":").splitToList(clock); checkArgument(pieces.size() == 3, tip); return setClock(Ints.tryParse(pieces.get(0)), Ints.tryParse(pieces.get(1)), Ints.tryParse(pieces.get(2))); }
class class_name[name] begin[{] method[setClock, return_type[type[Dater]], modifier[public], parameter[clock]] begin[{] local_variable[type[String], tip] call[.checkArgument, parameter[binary_operation[call[.checkNotNull, parameter[member[.clock]]], ==, literal[8]], member[.tip]]] local_variable[type[List], pieces] call[.checkArgument, parameter[binary_operation[call[pieces.size, parameter[]], ==, literal[3]], member[.tip]]] return[call[.setClock, parameter[call[Ints.tryParse, parameter[call[pieces.get, parameter[literal[0]]]]], call[Ints.tryParse, parameter[call[pieces.get, parameter[literal[1]]]]], call[Ints.tryParse, parameter[call[pieces.get, parameter[literal[2]]]]]]]] end[}] END[}]
Keyword[public] identifier[Dater] identifier[setClock] operator[SEP] identifier[String] identifier[clock] operator[SEP] { identifier[String] identifier[tip] operator[=] literal[String] operator[SEP] identifier[checkArgument] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[clock] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[8] , identifier[tip] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[pieces] operator[=] identifier[Splitter] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[splitToList] operator[SEP] identifier[clock] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[pieces] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[3] , identifier[tip] operator[SEP] operator[SEP] Keyword[return] identifier[setClock] operator[SEP] identifier[Ints] operator[SEP] identifier[tryParse] operator[SEP] identifier[pieces] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] , identifier[Ints] operator[SEP] identifier[tryParse] operator[SEP] identifier[pieces] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] , identifier[Ints] operator[SEP] identifier[tryParse] operator[SEP] identifier[pieces] operator[SEP] identifier[get] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void writeResource(CmsDbContext dbc, CmsResource resource) throws CmsException { // access was granted - write the resource resource.setUserLastModified(dbc.currentUser().getId()); CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID()) ? dbc.currentProject().getUuid() : dbc.getProjectId(); getVfsDriver(dbc).writeResource(dbc, projectId, resource, UPDATE_RESOURCE_STATE); // make sure the written resource has the state correctly set if (resource.getState().isUnchanged()) { resource.setState(CmsResource.STATE_CHANGED); } // delete in content relations if the new type is not parseable if (!(OpenCms.getResourceManager().getResourceType(resource.getTypeId()) instanceof I_CmsLinkParseable)) { deleteRelationsWithSiblings(dbc, resource); } // update the cache m_monitor.clearResourceCache(); Map<String, Object> data = new HashMap<String, Object>(2); data.put(I_CmsEventListener.KEY_RESOURCE, resource); data.put(I_CmsEventListener.KEY_CHANGE, new Integer(CHANGED_RESOURCE)); OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_RESOURCE_MODIFIED, data)); }
class class_name[name] begin[{] method[writeResource, return_type[void], modifier[public], parameter[dbc, resource]] begin[{] call[resource.setUserLastModified, parameter[call[dbc.currentUser, parameter[]]]] local_variable[type[CmsUUID], projectId] call[.getVfsDriver, parameter[member[.dbc]]] if[call[resource.getState, parameter[]]] begin[{] call[resource.setState, parameter[member[CmsResource.STATE_CHANGED]]] else begin[{] None end[}] if[binary_operation[call[OpenCms.getResourceManager, parameter[]], instanceof, type[I_CmsLinkParseable]]] begin[{] call[.deleteRelationsWithSiblings, parameter[member[.dbc], member[.resource]]] else begin[{] None end[}] call[m_monitor.clearResourceCache, parameter[]] local_variable[type[Map], data] call[data.put, parameter[member[I_CmsEventListener.KEY_RESOURCE], member[.resource]]] call[data.put, parameter[member[I_CmsEventListener.KEY_CHANGE], ClassCreator(arguments=[MemberReference(member=CHANGED_RESOURCE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] call[OpenCms.fireCmsEvent, parameter[ClassCreator(arguments=[MemberReference(member=EVENT_RESOURCE_MODIFIED, postfix_operators=[], prefix_operators=[], qualifier=I_CmsEventListener, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsEvent, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[writeResource] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[CmsResource] identifier[resource] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[resource] operator[SEP] identifier[setUserLastModified] operator[SEP] identifier[dbc] operator[SEP] identifier[currentUser] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CmsUUID] identifier[projectId] operator[=] operator[SEP] operator[SEP] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] operator[:] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[writeResource] operator[SEP] identifier[dbc] , identifier[projectId] , identifier[resource] , identifier[UPDATE_RESOURCE_STATE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resource] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] identifier[isUnchanged] operator[SEP] operator[SEP] operator[SEP] { identifier[resource] operator[SEP] identifier[setState] operator[SEP] identifier[CmsResource] operator[SEP] identifier[STATE_CHANGED] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getResourceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceType] operator[SEP] identifier[resource] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] operator[SEP] Keyword[instanceof] identifier[I_CmsLinkParseable] operator[SEP] operator[SEP] { identifier[deleteRelationsWithSiblings] operator[SEP] identifier[dbc] , identifier[resource] operator[SEP] operator[SEP] } identifier[m_monitor] operator[SEP] identifier[clearResourceCache] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[data] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[put] operator[SEP] identifier[I_CmsEventListener] operator[SEP] identifier[KEY_RESOURCE] , identifier[resource] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[put] operator[SEP] identifier[I_CmsEventListener] operator[SEP] identifier[KEY_CHANGE] , Keyword[new] identifier[Integer] operator[SEP] identifier[CHANGED_RESOURCE] operator[SEP] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[fireCmsEvent] operator[SEP] Keyword[new] identifier[CmsEvent] operator[SEP] identifier[I_CmsEventListener] operator[SEP] identifier[EVENT_RESOURCE_MODIFIED] , identifier[data] operator[SEP] operator[SEP] operator[SEP] }
public static XMLStreamReader getXMLStreamReader(Source source) { if (source instanceof StAXSource) { return ((StAXSource) source).getXMLStreamReader(); } else if (source instanceof StaxSource) { return ((StaxSource) source).getXMLStreamReader(); } else { throw new IllegalArgumentException("Source '" + source + "' is neither StaxSource nor StAXSource"); } }
class class_name[name] begin[{] method[getXMLStreamReader, return_type[type[XMLStreamReader]], modifier[public static], parameter[source]] begin[{] if[binary_operation[member[.source], instanceof, type[StAXSource]]] begin[{] return[Cast(expression=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StAXSource, sub_type=None))] else begin[{] if[binary_operation[member[.source], instanceof, type[StaxSource]]] begin[{] return[Cast(expression=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StaxSource, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source '"), operandr=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is neither StaxSource nor StAXSource"), 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) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[XMLStreamReader] identifier[getXMLStreamReader] operator[SEP] identifier[Source] identifier[source] operator[SEP] { Keyword[if] operator[SEP] identifier[source] Keyword[instanceof] identifier[StAXSource] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[StAXSource] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[getXMLStreamReader] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[source] Keyword[instanceof] identifier[StaxSource] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[StaxSource] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[getXMLStreamReader] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[source] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static float makeFloatValue( Object obj ) { if( obj == null ) { return Float.NaN; } return CommonServices.getCoercionManager().makePrimitiveFloatFrom( obj ); }
class class_name[name] begin[{] method[makeFloatValue, return_type[type[float]], modifier[public static], parameter[obj]] begin[{] if[binary_operation[member[.obj], ==, literal[null]]] begin[{] return[member[Float.NaN]] else begin[{] None end[}] return[call[CommonServices.getCoercionManager, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[float] identifier[makeFloatValue] operator[SEP] identifier[Object] identifier[obj] operator[SEP] { Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Float] operator[SEP] identifier[NaN] operator[SEP] } Keyword[return] identifier[CommonServices] operator[SEP] identifier[getCoercionManager] operator[SEP] operator[SEP] operator[SEP] identifier[makePrimitiveFloatFrom] operator[SEP] identifier[obj] operator[SEP] operator[SEP] }
@Override protected void consume() { int size = 0; LinkedHashSet<E> batch = new LinkedHashSet<E>(); E obj = null; try { obj = queue.take(); } catch (InterruptedException e) { return; } batch.add(obj); size++; if (pollTimeout == 0){ // no waiting while(size < maxBatchSize && (obj = queue.poll()) != null){ batch.add(obj); size++; } }else{ // need to wait for a while try { while(size < maxBatchSize && (obj = queue.poll(pollTimeout, pollTimeoutUnit)) != null){ batch.add(obj); size++; } } catch (InterruptedException e) { // do nothing because we need to have the batch processed; } } process(batch); }
class class_name[name] begin[{] method[consume, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[int], size] local_variable[type[LinkedHashSet], batch] local_variable[type[E], obj] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=take, postfix_operators=[], prefix_operators=[], qualifier=queue, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) call[batch.add, parameter[member[.obj]]] member[.size] if[binary_operation[member[.pollTimeout], ==, literal[0]]] begin[{] while[binary_operation[binary_operation[member[.size], <, member[.maxBatchSize]], &&, binary_operation[assign[member[.obj], call[queue.poll, parameter[]]], !=, literal[null]]]] begin[{] call[batch.add, parameter[member[.obj]]] member[.size] end[}] else begin[{] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=batch, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=size, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxBatchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=pollTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pollTimeoutUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=poll, postfix_operators=[], prefix_operators=[], qualifier=queue, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] call[.process, parameter[member[.batch]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[consume] operator[SEP] operator[SEP] { Keyword[int] identifier[size] operator[=] Other[0] operator[SEP] identifier[LinkedHashSet] operator[<] identifier[E] operator[>] identifier[batch] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[E] identifier[obj] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[obj] operator[=] identifier[queue] operator[SEP] identifier[take] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { Keyword[return] operator[SEP] } identifier[batch] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[size] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[pollTimeout] operator[==] Other[0] operator[SEP] { Keyword[while] operator[SEP] identifier[size] operator[<] identifier[maxBatchSize] operator[&&] operator[SEP] identifier[obj] operator[=] identifier[queue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[batch] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[size] operator[++] operator[SEP] } } Keyword[else] { Keyword[try] { Keyword[while] operator[SEP] identifier[size] operator[<] identifier[maxBatchSize] operator[&&] operator[SEP] identifier[obj] operator[=] identifier[queue] operator[SEP] identifier[poll] operator[SEP] identifier[pollTimeout] , identifier[pollTimeoutUnit] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[batch] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[size] operator[++] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } } identifier[process] operator[SEP] identifier[batch] operator[SEP] operator[SEP] }
public Deserializer getListDeserializer(String type) throws HessianProtocolException { Deserializer deserializer = getDeserializer(type); if (deserializer != null) return deserializer; else if (_arrayListDeserializer != null) return _arrayListDeserializer; else { _arrayListDeserializer = new CollectionDeserializer(ArrayList.class); return _arrayListDeserializer; } }
class class_name[name] begin[{] method[getListDeserializer, return_type[type[Deserializer]], modifier[public], parameter[type]] begin[{] local_variable[type[Deserializer], deserializer] if[binary_operation[member[.deserializer], !=, literal[null]]] begin[{] return[member[.deserializer]] else begin[{] if[binary_operation[member[._arrayListDeserializer], !=, literal[null]]] begin[{] return[member[._arrayListDeserializer]] else begin[{] assign[member[._arrayListDeserializer], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CollectionDeserializer, sub_type=None))] return[member[._arrayListDeserializer]] end[}] end[}] end[}] END[}]
Keyword[public] identifier[Deserializer] identifier[getListDeserializer] operator[SEP] identifier[String] identifier[type] operator[SEP] Keyword[throws] identifier[HessianProtocolException] { identifier[Deserializer] identifier[deserializer] operator[=] identifier[getDeserializer] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deserializer] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[deserializer] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[_arrayListDeserializer] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[_arrayListDeserializer] operator[SEP] Keyword[else] { identifier[_arrayListDeserializer] operator[=] Keyword[new] identifier[CollectionDeserializer] operator[SEP] identifier[ArrayList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[_arrayListDeserializer] operator[SEP] } }
public void setImageUrlAttribute(String name, String value) { ensureAttributes(); Attribute attribute = new ImageUrlAttribute(value); attribute.setEditable(isEditable(name)); getAllAttributes().put(name, attribute); }
class class_name[name] begin[{] method[setImageUrlAttribute, return_type[void], modifier[public], parameter[name, value]] begin[{] call[.ensureAttributes, parameter[]] local_variable[type[Attribute], attribute] call[attribute.setEditable, parameter[call[.isEditable, parameter[member[.name]]]]] call[.getAllAttributes, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setImageUrlAttribute] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] operator[SEP] { identifier[ensureAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[Attribute] identifier[attribute] operator[=] Keyword[new] identifier[ImageUrlAttribute] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[setEditable] operator[SEP] identifier[isEditable] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[getAllAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[attribute] operator[SEP] operator[SEP] }
@TargetApi(18) public void stopMonitoringBeaconsInRegion(@NonNull Region region) throws RemoteException { if (!isBleAvailableOrSimulated()) { LogManager.w(TAG, "Method invocation will be ignored."); return; } if (determineIfCalledFromSeparateScannerProcess()) { return; } if (mScheduledScanJobsEnabled) { MonitoringStatus.getInstanceForApplication(mContext).removeRegion(region); } applyChangesToServices(BeaconService.MSG_STOP_MONITORING, region); if (isScannerInDifferentProcess()) { MonitoringStatus.getInstanceForApplication(mContext).removeLocalRegion(region); } }
class class_name[name] begin[{] method[stopMonitoringBeaconsInRegion, return_type[void], modifier[public], parameter[region]] begin[{] if[call[.isBleAvailableOrSimulated, parameter[]]] begin[{] call[LogManager.w, parameter[member[.TAG], literal["Method invocation will be ignored."]]] return[None] else begin[{] None end[}] if[call[.determineIfCalledFromSeparateScannerProcess, parameter[]]] begin[{] return[None] else begin[{] None end[}] if[member[.mScheduledScanJobsEnabled]] begin[{] call[MonitoringStatus.getInstanceForApplication, parameter[member[.mContext]]] else begin[{] None end[}] call[.applyChangesToServices, parameter[member[BeaconService.MSG_STOP_MONITORING], member[.region]]] if[call[.isScannerInDifferentProcess, parameter[]]] begin[{] call[MonitoringStatus.getInstanceForApplication, parameter[member[.mContext]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[TargetApi] operator[SEP] Other[18] operator[SEP] Keyword[public] Keyword[void] identifier[stopMonitoringBeaconsInRegion] operator[SEP] annotation[@] identifier[NonNull] identifier[Region] identifier[region] operator[SEP] Keyword[throws] identifier[RemoteException] { Keyword[if] operator[SEP] operator[!] identifier[isBleAvailableOrSimulated] operator[SEP] operator[SEP] operator[SEP] { identifier[LogManager] operator[SEP] identifier[w] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[determineIfCalledFromSeparateScannerProcess] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[mScheduledScanJobsEnabled] operator[SEP] { identifier[MonitoringStatus] operator[SEP] identifier[getInstanceForApplication] operator[SEP] identifier[mContext] operator[SEP] operator[SEP] identifier[removeRegion] operator[SEP] identifier[region] operator[SEP] operator[SEP] } identifier[applyChangesToServices] operator[SEP] identifier[BeaconService] operator[SEP] identifier[MSG_STOP_MONITORING] , identifier[region] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isScannerInDifferentProcess] operator[SEP] operator[SEP] operator[SEP] { identifier[MonitoringStatus] operator[SEP] identifier[getInstanceForApplication] operator[SEP] identifier[mContext] operator[SEP] operator[SEP] identifier[removeLocalRegion] operator[SEP] identifier[region] operator[SEP] operator[SEP] } }
public static boolean filterSeat(SeatBidOrBuilder seatbid, @Nullable String seatFilter) { return seatFilter == null ? !seatbid.hasSeat() : seatFilter == SEAT_ANY || seatFilter.equals(seatbid.getSeat()); }
class class_name[name] begin[{] method[filterSeat, return_type[type[boolean]], modifier[public static], parameter[seatbid, seatFilter]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=seatFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=seatFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SEAT_ANY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSeat, postfix_operators=[], prefix_operators=[], qualifier=seatbid, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=seatFilter, selectors=[], type_arguments=None), operator=||), if_true=MethodInvocation(arguments=[], member=hasSeat, postfix_operators=[], prefix_operators=['!'], qualifier=seatbid, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[filterSeat] operator[SEP] identifier[SeatBidOrBuilder] identifier[seatbid] , annotation[@] identifier[Nullable] identifier[String] identifier[seatFilter] operator[SEP] { Keyword[return] identifier[seatFilter] operator[==] Other[null] operator[?] operator[!] identifier[seatbid] operator[SEP] identifier[hasSeat] operator[SEP] operator[SEP] operator[:] identifier[seatFilter] operator[==] identifier[SEAT_ANY] operator[||] identifier[seatFilter] operator[SEP] identifier[equals] operator[SEP] identifier[seatbid] operator[SEP] identifier[getSeat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean process() throws BimserverDatabaseException, QueryException { if (converted) { return true; } else { converted = true; queryObjectProvider.push(new QueryOidsAndTypesStackFrame(queryObjectProvider, eClass, jsonQuery, reusable, new ArrayList<>(oids))); return false; } }
class class_name[name] begin[{] method[process, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[member[.converted]] begin[{] return[literal[true]] else begin[{] assign[member[.converted], literal[true]] call[queryObjectProvider.push, parameter[ClassCreator(arguments=[MemberReference(member=queryObjectProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=eClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reusable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=oids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QueryOidsAndTypesStackFrame, sub_type=None))]] return[literal[false]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[process] operator[SEP] operator[SEP] Keyword[throws] identifier[BimserverDatabaseException] , identifier[QueryException] { Keyword[if] operator[SEP] identifier[converted] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { identifier[converted] operator[=] literal[boolean] operator[SEP] identifier[queryObjectProvider] operator[SEP] identifier[push] operator[SEP] Keyword[new] identifier[QueryOidsAndTypesStackFrame] operator[SEP] identifier[queryObjectProvider] , identifier[eClass] , identifier[jsonQuery] , identifier[reusable] , Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[oids] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
public ConversationList listConversations(final int offset, final int limit) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_PATH; return messageBirdService.requestList(url, offset, limit, ConversationList.class); }
class class_name[name] begin[{] method[listConversations, return_type[type[ConversationList]], modifier[public], parameter[offset, limit]] begin[{] local_variable[type[String], url] return[call[messageBirdService.requestList, parameter[member[.url], member[.offset], member[.limit], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConversationList, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[ConversationList] identifier[listConversations] operator[SEP] Keyword[final] Keyword[int] identifier[offset] , Keyword[final] Keyword[int] identifier[limit] operator[SEP] Keyword[throws] identifier[UnauthorizedException] , identifier[GeneralException] { identifier[String] identifier[url] operator[=] identifier[CONVERSATIONS_BASE_URL] operator[+] identifier[CONVERSATION_PATH] operator[SEP] Keyword[return] identifier[messageBirdService] operator[SEP] identifier[requestList] operator[SEP] identifier[url] , identifier[offset] , identifier[limit] , identifier[ConversationList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }