code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static void close(@Nullable Object object) throws IOException { if (object instanceof Closeable) { ((Closeable) object).close(); } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public static], parameter[object]] begin[{] if[binary_operation[member[.object], instanceof, type[Closeable]]] begin[{] Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Closeable, sub_type=None)) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[close] operator[SEP] annotation[@] identifier[Nullable] identifier[Object] identifier[object] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Closeable] operator[SEP] { operator[SEP] operator[SEP] identifier[Closeable] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public Object opt(String key) { return key == null ? null : m_map.get(key); }
class class_name[name] begin[{] method[opt, return_type[type[Object]], modifier[public], parameter[key]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=m_map, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Object] identifier[opt] operator[SEP] identifier[String] identifier[key] operator[SEP] { Keyword[return] identifier[key] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[m_map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] }
private synchronized void pushRequestContext(ServletContext context, ServletRequest req, ServletResponse resp) { getRequestStack().push(new RequestContext(context, req, resp)); }
class class_name[name] begin[{] method[pushRequestContext, return_type[void], modifier[synchronized private], parameter[context, req, resp]] begin[{] call[.getRequestStack, parameter[]] end[}] END[}]
Keyword[private] Keyword[synchronized] Keyword[void] identifier[pushRequestContext] operator[SEP] identifier[ServletContext] identifier[context] , identifier[ServletRequest] identifier[req] , identifier[ServletResponse] identifier[resp] operator[SEP] { identifier[getRequestStack] operator[SEP] operator[SEP] operator[SEP] identifier[push] operator[SEP] Keyword[new] identifier[RequestContext] operator[SEP] identifier[context] , identifier[req] , identifier[resp] operator[SEP] operator[SEP] operator[SEP] }
private long[] calcBucketOffset(long timestampMs) { long bucketOffset = toTimeSeriesPoint(timestampMs); long delta = bucketOffset % (RESOLUTION_MS * BUCKET_SIZE); long bucketId = bucketOffset - delta; return new long[] { bucketId, bucketOffset }; }
class class_name[name] begin[{] method[calcBucketOffset, return_type[type[long]], modifier[private], parameter[timestampMs]] begin[{] local_variable[type[long], bucketOffset] local_variable[type[long], delta] local_variable[type[long], bucketId] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=bucketId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucketOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long))] end[}] END[}]
Keyword[private] Keyword[long] operator[SEP] operator[SEP] identifier[calcBucketOffset] operator[SEP] Keyword[long] identifier[timestampMs] operator[SEP] { Keyword[long] identifier[bucketOffset] operator[=] identifier[toTimeSeriesPoint] operator[SEP] identifier[timestampMs] operator[SEP] operator[SEP] Keyword[long] identifier[delta] operator[=] identifier[bucketOffset] operator[%] operator[SEP] identifier[RESOLUTION_MS] operator[*] identifier[BUCKET_SIZE] operator[SEP] operator[SEP] Keyword[long] identifier[bucketId] operator[=] identifier[bucketOffset] operator[-] identifier[delta] operator[SEP] Keyword[return] Keyword[new] Keyword[long] operator[SEP] operator[SEP] { identifier[bucketId] , identifier[bucketOffset] } operator[SEP] }
public static String randomString(Long numberOfLetters, boolean useNumbers, TestContext context) { return randomString(numberOfLetters, RandomStringFunction.MIXED, useNumbers, context); }
class class_name[name] begin[{] method[randomString, return_type[type[String]], modifier[public static], parameter[numberOfLetters, useNumbers, context]] begin[{] return[call[.randomString, parameter[member[.numberOfLetters], member[RandomStringFunction.MIXED], member[.useNumbers], member[.context]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[randomString] operator[SEP] identifier[Long] identifier[numberOfLetters] , Keyword[boolean] identifier[useNumbers] , identifier[TestContext] identifier[context] operator[SEP] { Keyword[return] identifier[randomString] operator[SEP] identifier[numberOfLetters] , identifier[RandomStringFunction] operator[SEP] identifier[MIXED] , identifier[useNumbers] , identifier[context] operator[SEP] operator[SEP] }
public void setMinDateLastModified(String minDateLastModified) { m_parameters.setMinDateLastModified( CmsStringUtil.getLongValue(minDateLastModified, Long.MIN_VALUE, "minDateLastModified")); }
class class_name[name] begin[{] method[setMinDateLastModified, return_type[void], modifier[public], parameter[minDateLastModified]] begin[{] call[m_parameters.setMinDateLastModified, parameter[call[CmsStringUtil.getLongValue, parameter[member[.minDateLastModified], member[Long.MIN_VALUE], literal["minDateLastModified"]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMinDateLastModified] operator[SEP] identifier[String] identifier[minDateLastModified] operator[SEP] { identifier[m_parameters] operator[SEP] identifier[setMinDateLastModified] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[getLongValue] operator[SEP] identifier[minDateLastModified] , identifier[Long] operator[SEP] identifier[MIN_VALUE] , literal[String] operator[SEP] operator[SEP] operator[SEP] }
public <T> T[] toArrayCached(T[] a) { T[] readCacheArray = generatedCacheMap.values().toArray(a); T[] writeCacheArray = resultSetCacheMap.values().toArray(a); T[] combinedCacheArray = (T[]) java.lang.reflect.Array. newInstance(a.getClass().getComponentType(), readCacheArray.length + writeCacheArray.length); System.arraycopy(readCacheArray, 0, combinedCacheArray, 0, readCacheArray.length); System.arraycopy(writeCacheArray, 0, combinedCacheArray, readCacheArray.length, writeCacheArray.length); return combinedCacheArray; }
class class_name[name] begin[{] method[toArrayCached, return_type[type[T]], modifier[public], parameter[a]] begin[{] local_variable[type[T], readCacheArray] local_variable[type[T], writeCacheArray] local_variable[type[T], combinedCacheArray] call[System.arraycopy, parameter[member[.readCacheArray], literal[0], member[.combinedCacheArray], literal[0], member[readCacheArray.length]]] call[System.arraycopy, parameter[member[.writeCacheArray], literal[0], member[.combinedCacheArray], member[readCacheArray.length], member[writeCacheArray.length]]] return[member[.combinedCacheArray]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[toArrayCached] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[a] operator[SEP] { identifier[T] operator[SEP] operator[SEP] identifier[readCacheArray] operator[=] identifier[generatedCacheMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[writeCacheArray] operator[=] identifier[resultSetCacheMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[combinedCacheArray] operator[=] operator[SEP] identifier[T] operator[SEP] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[a] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[readCacheArray] operator[SEP] identifier[length] operator[+] identifier[writeCacheArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[readCacheArray] , Other[0] , identifier[combinedCacheArray] , Other[0] , identifier[readCacheArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[writeCacheArray] , Other[0] , identifier[combinedCacheArray] , identifier[readCacheArray] operator[SEP] identifier[length] , identifier[writeCacheArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[combinedCacheArray] operator[SEP] }
private int restart(final boolean basic, final Destination dst, final int eraseCode, final int channel) throws KNXTimeoutException, KNXRemoteException, KNXLinkClosedException, KNXDisconnectException, InterruptedException { int time = 0; if (basic) { send(dst, priority, DataUnitBuilder.createLengthOptimizedAPDU(RESTART, null), 0); } else { final byte[] sdu = new byte[] { 0x01, (byte) eraseCode, (byte) channel, }; final byte[] send = DataUnitBuilder.createLengthOptimizedAPDU(RESTART, sdu); final byte[] apdu = sendWait2(dst, priority, send, RESTART, 3, 3); // check we get a restart response if ((apdu[1] & 0x32) == 0) throw new KNXInvalidResponseException("restart response bit not set"); // defined error codes: 0,1,2,3 final String[] codes = new String[] { "Success", "Access Denied", "Unsupported Erase Code", "Invalid Channel Number", "Unknown Error" }; final int error = Math.min(apdu[2] & 0xff, 4); if (error > 0) throw new KNXRemoteException("master reset: " + codes[error]); time = ((apdu[3] & 0xff) << 8) | (apdu[4] & 0xff); } if (dst.isConnectionOriented()) { // a remote endpoint is allowed to not send a TL disconnect before restart, but // a TL disconnect timeout shall not be treated as protocol error final Object lock = new Object(); final TransportListener l = new TLListener() { @Override public void disconnected(final Destination d) { if (d.equals(dst)) synchronized (lock) { lock.notify(); } }; }; tl.addTransportListener(l); try { synchronized (lock) { while (dst.getState() != Destination.State.Disconnected) lock.wait(); } } finally { tl.removeTransportListener(l); } // always force a disconnect from our side tl.disconnect(dst); } return time; }
class class_name[name] begin[{] method[restart, return_type[type[int]], modifier[private], parameter[basic, dst, eraseCode, channel]] begin[{] local_variable[type[int], time] if[member[.basic]] begin[{] call[.send, parameter[member[.dst], member[.priority], call[DataUnitBuilder.createLengthOptimizedAPDU, parameter[member[.RESTART], literal[null]]], literal[0]]] else begin[{] local_variable[type[byte], sdu] local_variable[type[byte], send] local_variable[type[byte], apdu] if[binary_operation[binary_operation[member[.apdu], &, literal[0x32]], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="restart response bit not set")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KNXInvalidResponseException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], codes] local_variable[type[int], error] if[binary_operation[member[.error], >, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="master reset: "), operandr=MemberReference(member=codes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=error, 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=KNXRemoteException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.time], binary_operation[binary_operation[binary_operation[member[.apdu], &, literal[0xff]], <<, literal[8]], |, binary_operation[member[.apdu], &, literal[0xff]]]] end[}] if[call[dst.isConnectionOriented, parameter[]]] begin[{] local_variable[type[Object], lock] local_variable[type[TransportListener], l] call[tl.addTransportListener, parameter[member[.l]]] TryStatement(block=[SynchronizedStatement(block=[WhileStatement(body=StatementExpression(expression=MethodInvocation(arguments=[], member=wait, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=dst, selectors=[], type_arguments=None), operandr=MemberReference(member=Disconnected, postfix_operators=[], prefix_operators=[], qualifier=Destination.State, selectors=[]), operator=!=), label=None)], label=None, lock=MemberReference(member=lock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeTransportListener, postfix_operators=[], prefix_operators=[], qualifier=tl, selectors=[], type_arguments=None), label=None)], label=None, resources=None) call[tl.disconnect, parameter[member[.dst]]] else begin[{] None end[}] return[member[.time]] end[}] END[}]
Keyword[private] Keyword[int] identifier[restart] operator[SEP] Keyword[final] Keyword[boolean] identifier[basic] , Keyword[final] identifier[Destination] identifier[dst] , Keyword[final] Keyword[int] identifier[eraseCode] , Keyword[final] Keyword[int] identifier[channel] operator[SEP] Keyword[throws] identifier[KNXTimeoutException] , identifier[KNXRemoteException] , identifier[KNXLinkClosedException] , identifier[KNXDisconnectException] , identifier[InterruptedException] { Keyword[int] identifier[time] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[basic] operator[SEP] { identifier[send] operator[SEP] identifier[dst] , identifier[priority] , identifier[DataUnitBuilder] operator[SEP] identifier[createLengthOptimizedAPDU] operator[SEP] identifier[RESTART] , Other[null] operator[SEP] , Other[0] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[sdu] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] { literal[Integer] , operator[SEP] Keyword[byte] operator[SEP] identifier[eraseCode] , operator[SEP] Keyword[byte] operator[SEP] identifier[channel] , } operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[send] operator[=] identifier[DataUnitBuilder] operator[SEP] identifier[createLengthOptimizedAPDU] operator[SEP] identifier[RESTART] , identifier[sdu] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[apdu] operator[=] identifier[sendWait2] operator[SEP] identifier[dst] , identifier[priority] , identifier[send] , identifier[RESTART] , Other[3] , Other[3] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[apdu] operator[SEP] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[KNXInvalidResponseException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[codes] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] { literal[String] , literal[String] , literal[String] , literal[String] , literal[String] } operator[SEP] Keyword[final] Keyword[int] identifier[error] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[apdu] operator[SEP] Other[2] operator[SEP] operator[&] literal[Integer] , Other[4] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[error] operator[>] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[KNXRemoteException] operator[SEP] literal[String] operator[+] identifier[codes] operator[SEP] identifier[error] operator[SEP] operator[SEP] operator[SEP] identifier[time] operator[=] operator[SEP] operator[SEP] identifier[apdu] operator[SEP] Other[3] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[|] operator[SEP] identifier[apdu] operator[SEP] Other[4] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[dst] operator[SEP] identifier[isConnectionOriented] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Object] identifier[lock] operator[=] Keyword[new] identifier[Object] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[TransportListener] identifier[l] operator[=] Keyword[new] identifier[TLListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[disconnected] operator[SEP] Keyword[final] identifier[Destination] identifier[d] operator[SEP] { Keyword[if] operator[SEP] identifier[d] operator[SEP] identifier[equals] operator[SEP] identifier[dst] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { identifier[lock] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] } operator[SEP] identifier[tl] operator[SEP] identifier[addTransportListener] operator[SEP] identifier[l] operator[SEP] operator[SEP] Keyword[try] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { Keyword[while] operator[SEP] identifier[dst] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[!=] identifier[Destination] operator[SEP] identifier[State] operator[SEP] identifier[Disconnected] operator[SEP] identifier[lock] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[tl] operator[SEP] identifier[removeTransportListener] operator[SEP] identifier[l] operator[SEP] operator[SEP] } identifier[tl] operator[SEP] identifier[disconnect] operator[SEP] identifier[dst] operator[SEP] operator[SEP] } Keyword[return] identifier[time] operator[SEP] }
public ArrayList<OvhStack> project_serviceName_stack_GET(String serviceName) throws IOException { String qPath = "/cloud/project/{serviceName}/stack"; StringBuilder sb = path(qPath, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t15); }
class class_name[name] begin[{] method[project_serviceName_stack_GET, return_type[type[ArrayList]], modifier[public], parameter[serviceName]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], member[.t15]]]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[OvhStack] operator[>] identifier[project_serviceName_stack_GET] operator[SEP] identifier[String] identifier[serviceName] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t15] operator[SEP] operator[SEP] }
public OvhExchangeExternalContact organizationName_service_exchangeService_externalContact_externalEmailAddress_GET(String organizationName, String exchangeService, String externalEmailAddress) throws IOException { String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/externalContact/{externalEmailAddress}"; StringBuilder sb = path(qPath, organizationName, exchangeService, externalEmailAddress); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhExchangeExternalContact.class); }
class class_name[name] begin[{] method[organizationName_service_exchangeService_externalContact_externalEmailAddress_GET, return_type[type[OvhExchangeExternalContact]], modifier[public], parameter[organizationName, exchangeService, externalEmailAddress]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhExchangeExternalContact, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhExchangeExternalContact] identifier[organizationName_service_exchangeService_externalContact_externalEmailAddress_GET] operator[SEP] identifier[String] identifier[organizationName] , identifier[String] identifier[exchangeService] , identifier[String] identifier[externalEmailAddress] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[organizationName] , identifier[exchangeService] , identifier[externalEmailAddress] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhExchangeExternalContact] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void load() throws IOException { try { Future<Void> task = loadNB(); task.get(); } catch (ExecutionException e) { Throwable t = e.getCause(); if (t instanceof IOException) { throw (IOException)t; } throw new IOException(t); } catch (InterruptedException e) { throw new IOException("Loading of the properties file \"" + getFile().getAbsolutePath() + "\" was interrupted."); } }
class class_name[name] begin[{] method[load, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=loadNB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=task)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=[], name=Future, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=task, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None)), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ExecutionException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Loading of the properties file \""), operandr=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" was interrupted."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[load] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[Future] operator[<] identifier[Void] operator[>] identifier[task] operator[=] identifier[loadNB] operator[SEP] operator[SEP] operator[SEP] identifier[task] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ExecutionException] identifier[e] operator[SEP] { identifier[Throwable] identifier[t] operator[=] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[IOException] operator[SEP] { Keyword[throw] operator[SEP] identifier[IOException] operator[SEP] identifier[t] operator[SEP] } Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[t] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } }
final public void saveAsync(final OnSavedCallback callback) { new AsyncTask<Model, Void, Boolean>() { protected Boolean doInBackground(Model... params) { return params[0].save(); } protected void onPostExecute(Boolean result) { if (result && callback != null) { callback.onSaved(); } } }.execute(this); }
class class_name[name] begin[{] method[saveAsync, return_type[void], modifier[final public], parameter[callback]] begin[{] ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=save, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], documentation=None, modifiers={'protected'}, name=doInBackground, parameters=[FormalParameter(annotations=[], modifiers=set(), name=params, type=ReferenceType(arguments=None, dimensions=[], name=Model, sub_type=None), varargs=True)], return_type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=onSaved, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'protected'}, name=onPostExecute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Model, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=AsyncTask, sub_type=None)) end[}] END[}]
Keyword[final] Keyword[public] Keyword[void] identifier[saveAsync] operator[SEP] Keyword[final] identifier[OnSavedCallback] identifier[callback] operator[SEP] { Keyword[new] identifier[AsyncTask] operator[<] identifier[Model] , identifier[Void] , identifier[Boolean] operator[>] operator[SEP] operator[SEP] { Keyword[protected] identifier[Boolean] identifier[doInBackground] operator[SEP] identifier[Model] operator[...] identifier[params] operator[SEP] { Keyword[return] identifier[params] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] } Keyword[protected] Keyword[void] identifier[onPostExecute] operator[SEP] identifier[Boolean] identifier[result] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[&&] identifier[callback] operator[!=] Other[null] operator[SEP] { identifier[callback] operator[SEP] identifier[onSaved] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] identifier[execute] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
private void writeReport(final OutputStream outputStream) { Transformer transformer; try { transformer = TransformerFactory.newInstance().newTransformer(); transformer.transform(new DOMSource(doc), new StreamResult(outputStream)); } catch (Exception e) { throw WroRuntimeException.wrap(e, "Problem during Document transformation").logError(); } }
class class_name[name] begin[{] method[writeReport, return_type[void], modifier[private], parameter[outputStream]] begin[{] local_variable[type[Transformer], transformer] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=transformer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=TransformerFactory, selectors=[MethodInvocation(arguments=[], member=newTransformer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=doc, 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)), ClassCreator(arguments=[MemberReference(member=outputStream, 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=StreamResult, sub_type=None))], member=transform, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Problem during Document transformation")], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=WroRuntimeException, selectors=[MethodInvocation(arguments=[], member=logError, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[writeReport] operator[SEP] Keyword[final] identifier[OutputStream] identifier[outputStream] operator[SEP] { identifier[Transformer] identifier[transformer] operator[SEP] Keyword[try] { identifier[transformer] operator[=] identifier[TransformerFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[newTransformer] operator[SEP] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[transform] operator[SEP] Keyword[new] identifier[DOMSource] operator[SEP] identifier[doc] operator[SEP] , Keyword[new] identifier[StreamResult] operator[SEP] identifier[outputStream] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[WroRuntimeException] operator[SEP] identifier[wrap] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP] identifier[logError] operator[SEP] operator[SEP] operator[SEP] } }
public BatchGetRepositoriesResult withRepositoriesNotFound(String... repositoriesNotFound) { if (this.repositoriesNotFound == null) { setRepositoriesNotFound(new java.util.ArrayList<String>(repositoriesNotFound.length)); } for (String ele : repositoriesNotFound) { this.repositoriesNotFound.add(ele); } return this; }
class class_name[name] begin[{] method[withRepositoriesNotFound, return_type[type[BatchGetRepositoriesResult]], modifier[public], parameter[repositoriesNotFound]] begin[{] if[binary_operation[THIS[member[None.repositoriesNotFound]], ==, literal[null]]] begin[{] call[.setRepositoriesNotFound, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=repositoriesNotFound, 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=repositoriesNotFound, 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=repositoriesNotFound, 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[BatchGetRepositoriesResult] identifier[withRepositoriesNotFound] operator[SEP] identifier[String] operator[...] identifier[repositoriesNotFound] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[repositoriesNotFound] operator[==] Other[null] operator[SEP] { identifier[setRepositoriesNotFound] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[repositoriesNotFound] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[repositoriesNotFound] operator[SEP] { Keyword[this] operator[SEP] identifier[repositoriesNotFound] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private TlvHeader readHeader() throws IOException { int firstByte = in.read(); if (firstByte < 0) { // no data to read throw new EOFException(); } boolean tlv16 = (firstByte & TLV16_FLAG) != 0; boolean nonCritical = (firstByte & NON_CRITICAL_FLAG) != 0; boolean forward = (firstByte & FORWARD_FLAG) != 0; int type = firstByte & TYPE_MASK; int length; if (tlv16) { int typeLSB = in.readUnsignedByte(); type = (type << BYTE_BITS) | typeLSB; length = in.readUnsignedShort(); } else { length = in.readUnsignedByte(); } if (type > TYPE_MASK && !tlv16) { throw new IOException("Invalid TLV header. TLV type > 0x1f but TLV8 encoding is used"); } if (length > BYTE_MAX && !tlv16) { throw new IOException("Invalid TLV header. TLV length > 0xff but TLV8 encoding is used"); } return new TlvHeader(tlv16, nonCritical, forward, type, length); }
class class_name[name] begin[{] method[readHeader, return_type[type[TlvHeader]], modifier[private], parameter[]] begin[{] local_variable[type[int], firstByte] if[binary_operation[member[.firstByte], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EOFException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[boolean], tlv16] local_variable[type[boolean], nonCritical] local_variable[type[boolean], forward] local_variable[type[int], type] local_variable[type[int], length] if[member[.tlv16]] begin[{] local_variable[type[int], typeLSB] assign[member[.type], binary_operation[binary_operation[member[.type], <<, member[.BYTE_BITS]], |, member[.typeLSB]]] assign[member[.length], call[in.readUnsignedShort, parameter[]]] else begin[{] assign[member[.length], call[in.readUnsignedByte, parameter[]]] end[}] if[binary_operation[binary_operation[member[.type], >, member[.TYPE_MASK]], &&, member[.tlv16]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid TLV header. TLV type > 0x1f but TLV8 encoding is used")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.length], >, member[.BYTE_MAX]], &&, member[.tlv16]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid TLV header. TLV length > 0xff but TLV8 encoding is used")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=tlv16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nonCritical, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=forward, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TlvHeader, sub_type=None))] end[}] END[}]
Keyword[private] identifier[TlvHeader] identifier[readHeader] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[firstByte] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstByte] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[tlv16] operator[=] operator[SEP] identifier[firstByte] operator[&] identifier[TLV16_FLAG] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[boolean] identifier[nonCritical] operator[=] operator[SEP] identifier[firstByte] operator[&] identifier[NON_CRITICAL_FLAG] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[boolean] identifier[forward] operator[=] operator[SEP] identifier[firstByte] operator[&] identifier[FORWARD_FLAG] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[int] identifier[type] operator[=] identifier[firstByte] operator[&] identifier[TYPE_MASK] operator[SEP] Keyword[int] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[tlv16] operator[SEP] { Keyword[int] identifier[typeLSB] operator[=] identifier[in] operator[SEP] identifier[readUnsignedByte] operator[SEP] operator[SEP] operator[SEP] identifier[type] operator[=] operator[SEP] identifier[type] operator[<<] identifier[BYTE_BITS] operator[SEP] operator[|] identifier[typeLSB] operator[SEP] identifier[length] operator[=] identifier[in] operator[SEP] identifier[readUnsignedShort] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[length] operator[=] identifier[in] operator[SEP] identifier[readUnsignedByte] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[type] operator[>] identifier[TYPE_MASK] operator[&&] operator[!] identifier[tlv16] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[length] operator[>] identifier[BYTE_MAX] operator[&&] operator[!] identifier[tlv16] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[TlvHeader] operator[SEP] identifier[tlv16] , identifier[nonCritical] , identifier[forward] , identifier[type] , identifier[length] operator[SEP] operator[SEP] }
public void registerExistingChecksums(File featureDir, String symbolicName, String fileName) { ChecksumData checksums = checksumsMap.get(featureDir); if (checksums == null) { checksums = new ChecksumData(); checksumsMap.put(featureDir, checksums); } checksums.registerExistingChecksums(symbolicName, fileName); }
class class_name[name] begin[{] method[registerExistingChecksums, return_type[void], modifier[public], parameter[featureDir, symbolicName, fileName]] begin[{] local_variable[type[ChecksumData], checksums] if[binary_operation[member[.checksums], ==, literal[null]]] begin[{] assign[member[.checksums], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChecksumData, sub_type=None))] call[checksumsMap.put, parameter[member[.featureDir], member[.checksums]]] else begin[{] None end[}] call[checksums.registerExistingChecksums, parameter[member[.symbolicName], member[.fileName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerExistingChecksums] operator[SEP] identifier[File] identifier[featureDir] , identifier[String] identifier[symbolicName] , identifier[String] identifier[fileName] operator[SEP] { identifier[ChecksumData] identifier[checksums] operator[=] identifier[checksumsMap] operator[SEP] identifier[get] operator[SEP] identifier[featureDir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[checksums] operator[==] Other[null] operator[SEP] { identifier[checksums] operator[=] Keyword[new] identifier[ChecksumData] operator[SEP] operator[SEP] operator[SEP] identifier[checksumsMap] operator[SEP] identifier[put] operator[SEP] identifier[featureDir] , identifier[checksums] operator[SEP] operator[SEP] } identifier[checksums] operator[SEP] identifier[registerExistingChecksums] operator[SEP] identifier[symbolicName] , identifier[fileName] operator[SEP] operator[SEP] }
@Override public Group getGroupByPDB(ResidueNumber resNum) throws StructureException { String pdbresnum = resNum.toString(); if ( pdbResnumMap.containsKey(pdbresnum)) { Integer pos = pdbResnumMap.get(pdbresnum); return groups.get(pos); } else { throw new StructureException("unknown PDB residue number " + pdbresnum + " in chain " + authId); } }
class class_name[name] begin[{] method[getGroupByPDB, return_type[type[Group]], modifier[public], parameter[resNum]] begin[{] local_variable[type[String], pdbresnum] if[call[pdbResnumMap.containsKey, parameter[member[.pdbresnum]]]] begin[{] local_variable[type[Integer], pos] return[call[groups.get, parameter[member[.pos]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown PDB residue number "), operandr=MemberReference(member=pdbresnum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in chain "), operator=+), operandr=MemberReference(member=authId, 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=StructureException, sub_type=None)), label=None) end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Group] identifier[getGroupByPDB] operator[SEP] identifier[ResidueNumber] identifier[resNum] operator[SEP] Keyword[throws] identifier[StructureException] { identifier[String] identifier[pdbresnum] operator[=] identifier[resNum] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pdbResnumMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[pdbresnum] operator[SEP] operator[SEP] { identifier[Integer] identifier[pos] operator[=] identifier[pdbResnumMap] operator[SEP] identifier[get] operator[SEP] identifier[pdbresnum] operator[SEP] operator[SEP] Keyword[return] identifier[groups] operator[SEP] identifier[get] operator[SEP] identifier[pos] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[StructureException] operator[SEP] literal[String] operator[+] identifier[pdbresnum] operator[+] literal[String] operator[+] identifier[authId] operator[SEP] operator[SEP] } }
public WhiteSpaceInfo getWhiteSpaceInfo( XPathContext support, int targetElement, DTM dtm) throws TransformerException { if (null != m_whiteSpaceInfoList) return (WhiteSpaceInfo) m_whiteSpaceInfoList.getTemplate(support, targetElement, null, false, dtm); else return null; }
class class_name[name] begin[{] method[getWhiteSpaceInfo, return_type[type[WhiteSpaceInfo]], modifier[public], parameter[support, targetElement, dtm]] begin[{] if[binary_operation[literal[null], !=, member[.m_whiteSpaceInfoList]]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=support, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=dtm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTemplate, postfix_operators=[], prefix_operators=[], qualifier=m_whiteSpaceInfoList, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=WhiteSpaceInfo, sub_type=None))] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] identifier[WhiteSpaceInfo] identifier[getWhiteSpaceInfo] operator[SEP] identifier[XPathContext] identifier[support] , Keyword[int] identifier[targetElement] , identifier[DTM] identifier[dtm] operator[SEP] Keyword[throws] identifier[TransformerException] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[m_whiteSpaceInfoList] operator[SEP] Keyword[return] operator[SEP] identifier[WhiteSpaceInfo] operator[SEP] identifier[m_whiteSpaceInfoList] operator[SEP] identifier[getTemplate] operator[SEP] identifier[support] , identifier[targetElement] , Other[null] , literal[boolean] , identifier[dtm] operator[SEP] operator[SEP] Keyword[else] Keyword[return] Other[null] operator[SEP] }
public List<String> getCustomBundlePropertyAsList(String bundleName, String key) { List<String> propertiesList = new ArrayList<>(); StringTokenizer tk = new StringTokenizer(getCustomBundleProperty(bundleName, key, ""), ","); while (tk.hasMoreTokens()) propertiesList.add(tk.nextToken().trim()); return propertiesList; }
class class_name[name] begin[{] method[getCustomBundlePropertyAsList, return_type[type[List]], modifier[public], parameter[bundleName, key]] begin[{] local_variable[type[List], propertiesList] local_variable[type[StringTokenizer], tk] while[call[tk.hasMoreTokens, parameter[]]] begin[{] call[propertiesList.add, parameter[call[tk.nextToken, parameter[]]]] end[}] return[member[.propertiesList]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getCustomBundlePropertyAsList] operator[SEP] identifier[String] identifier[bundleName] , identifier[String] identifier[key] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[propertiesList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[tk] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[getCustomBundleProperty] operator[SEP] identifier[bundleName] , identifier[key] , literal[String] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tk] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] identifier[propertiesList] operator[SEP] identifier[add] operator[SEP] identifier[tk] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[propertiesList] operator[SEP] }
public int compareTo(BigDecimal val) { // Quick path for equal scale and non-inflated case. if (scale == val.scale) { long xs = intCompact; long ys = val.intCompact; if (xs != INFLATED && ys != INFLATED) return xs != ys ? ((xs > ys) ? 1 : -1) : 0; } int xsign = this.signum(); int ysign = val.signum(); if (xsign != ysign) return (xsign > ysign) ? 1 : -1; if (xsign == 0) return 0; int cmp = compareMagnitude(val); return (xsign > 0) ? cmp : -cmp; }
class class_name[name] begin[{] method[compareTo, return_type[type[int]], modifier[public], parameter[val]] begin[{] if[binary_operation[member[.scale], ==, member[val.scale]]] begin[{] local_variable[type[long], xs] local_variable[type[long], ys] if[binary_operation[binary_operation[member[.xs], !=, member[.INFLATED]], &&, binary_operation[member[.ys], !=, member[.INFLATED]]]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=xs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=xs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)))] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], xsign] local_variable[type[int], ysign] if[binary_operation[member[.xsign], !=, member[.ysign]]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=xsign, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ysign, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))] else begin[{] None end[}] if[binary_operation[member[.xsign], ==, literal[0]]] begin[{] return[literal[0]] else begin[{] None end[}] local_variable[type[int], cmp] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=xsign, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=MemberReference(member=cmp, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), if_true=MemberReference(member=cmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] identifier[BigDecimal] identifier[val] operator[SEP] { Keyword[if] operator[SEP] identifier[scale] operator[==] identifier[val] operator[SEP] identifier[scale] operator[SEP] { Keyword[long] identifier[xs] operator[=] identifier[intCompact] operator[SEP] Keyword[long] identifier[ys] operator[=] identifier[val] operator[SEP] identifier[intCompact] operator[SEP] Keyword[if] operator[SEP] identifier[xs] operator[!=] identifier[INFLATED] operator[&&] identifier[ys] operator[!=] identifier[INFLATED] operator[SEP] Keyword[return] identifier[xs] operator[!=] identifier[ys] operator[?] operator[SEP] operator[SEP] identifier[xs] operator[>] identifier[ys] operator[SEP] operator[?] Other[1] operator[:] operator[-] Other[1] operator[SEP] operator[:] Other[0] operator[SEP] } Keyword[int] identifier[xsign] operator[=] Keyword[this] operator[SEP] identifier[signum] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ysign] operator[=] identifier[val] operator[SEP] identifier[signum] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xsign] operator[!=] identifier[ysign] operator[SEP] Keyword[return] operator[SEP] identifier[xsign] operator[>] identifier[ysign] operator[SEP] operator[?] Other[1] operator[:] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[xsign] operator[==] Other[0] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[int] identifier[cmp] operator[=] identifier[compareMagnitude] operator[SEP] identifier[val] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[xsign] operator[>] Other[0] operator[SEP] operator[?] identifier[cmp] operator[:] operator[-] identifier[cmp] operator[SEP] }
public void set_value(short[] p_data,int x,int y) throws DevFailed { // // Throw exception if type is not correct // if (data_type != Tango_DEV_SHORT && data_type != Tango_DEV_USHORT) { StringBuffer o = new StringBuffer("Invalid data type for attribute "); o.append(name); Except.throw_exception("API_AttrOptProp",o.toString(), "Attribute.set_value"); } // // Check that data size is less than the given max // if ((x > max_x) || (y > max_y)) { StringBuffer o = new StringBuffer("Data size for attribute "); o.append(name); o.append(" exceeds given limit"); Except.throw_exception("API_AttrOptProp", o.toString(), "Attribute.set_value"); } // // Compute data size and set default quality to valid // dim_x = x; dim_y = y; set_data_size(); quality = AttrQuality.ATTR_VALID; // // If the data is wanted from the State command, store it in a sequence. // If the attribute has an associated writable attribute, store data in a // temporary buffer (the write value must be added before the data is sent // back to the caller) // if (date == false) { if (p_data.length == data_size) value.sh_seq = p_data; else { value.sh_seq = new short[data_size]; System.arraycopy(p_data, 0, value.sh_seq, 0, data_size); } } else { if ((is_writ_associated() == true)) tmp_sh[0] = p_data[0]; else { if (p_data.length == data_size) value.sh_seq = p_data; else { value.sh_seq = new short[data_size]; System.arraycopy(p_data, 0, value.sh_seq, 0, data_size); } } } value_flag = true; // // Reset alarm flags // min_alarm_on = false; max_alarm_on = false; // // Get time // set_time(); }
class class_name[name] begin[{] method[set_value, return_type[void], modifier[public], parameter[p_data, x, y]] begin[{] if[binary_operation[binary_operation[member[.data_type], !=, member[.Tango_DEV_SHORT]], &&, binary_operation[member[.data_type], !=, member[.Tango_DEV_USHORT]]]] begin[{] local_variable[type[StringBuffer], o] call[o.append, parameter[member[.name]]] call[Except.throw_exception, parameter[literal["API_AttrOptProp"], call[o.toString, parameter[]], literal["Attribute.set_value"]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.x], >, member[.max_x]], ||, binary_operation[member[.y], >, member[.max_y]]]] begin[{] local_variable[type[StringBuffer], o] call[o.append, parameter[member[.name]]] call[o.append, parameter[literal[" exceeds given limit"]]] call[Except.throw_exception, parameter[literal["API_AttrOptProp"], call[o.toString, parameter[]], literal["Attribute.set_value"]]] else begin[{] None end[}] assign[member[.dim_x], member[.x]] assign[member[.dim_y], member[.y]] call[.set_data_size, parameter[]] assign[member[.quality], member[AttrQuality.ATTR_VALID]] if[binary_operation[member[.date], ==, literal[false]]] begin[{] if[binary_operation[member[p_data.length], ==, member[.data_size]]] begin[{] assign[member[value.sh_seq], member[.p_data]] else begin[{] assign[member[value.sh_seq], ArrayCreator(dimensions=[MemberReference(member=data_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=short))] call[System.arraycopy, parameter[member[.p_data], literal[0], member[value.sh_seq], literal[0], member[.data_size]]] end[}] else begin[{] if[binary_operation[call[.is_writ_associated, parameter[]], ==, literal[true]]] begin[{] assign[member[.tmp_sh], member[.p_data]] else begin[{] if[binary_operation[member[p_data.length], ==, member[.data_size]]] begin[{] assign[member[value.sh_seq], member[.p_data]] else begin[{] assign[member[value.sh_seq], ArrayCreator(dimensions=[MemberReference(member=data_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=short))] call[System.arraycopy, parameter[member[.p_data], literal[0], member[value.sh_seq], literal[0], member[.data_size]]] end[}] end[}] end[}] assign[member[.value_flag], literal[true]] assign[member[.min_alarm_on], literal[false]] assign[member[.max_alarm_on], literal[false]] call[.set_time, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[set_value] operator[SEP] Keyword[short] operator[SEP] operator[SEP] identifier[p_data] , Keyword[int] identifier[x] , Keyword[int] identifier[y] operator[SEP] Keyword[throws] identifier[DevFailed] { Keyword[if] operator[SEP] identifier[data_type] operator[!=] identifier[Tango_DEV_SHORT] operator[&&] identifier[data_type] operator[!=] identifier[Tango_DEV_USHORT] operator[SEP] { identifier[StringBuffer] identifier[o] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[o] operator[SEP] identifier[append] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Except] operator[SEP] identifier[throw_exception] operator[SEP] literal[String] , identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[x] operator[>] identifier[max_x] operator[SEP] operator[||] operator[SEP] identifier[y] operator[>] identifier[max_y] operator[SEP] operator[SEP] { identifier[StringBuffer] identifier[o] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[o] operator[SEP] identifier[append] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[o] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Except] operator[SEP] identifier[throw_exception] operator[SEP] literal[String] , identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] } identifier[dim_x] operator[=] identifier[x] operator[SEP] identifier[dim_y] operator[=] identifier[y] operator[SEP] identifier[set_data_size] operator[SEP] operator[SEP] operator[SEP] identifier[quality] operator[=] identifier[AttrQuality] operator[SEP] identifier[ATTR_VALID] operator[SEP] Keyword[if] operator[SEP] identifier[date] operator[==] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[p_data] operator[SEP] identifier[length] operator[==] identifier[data_size] operator[SEP] identifier[value] operator[SEP] identifier[sh_seq] operator[=] identifier[p_data] operator[SEP] Keyword[else] { identifier[value] operator[SEP] identifier[sh_seq] operator[=] Keyword[new] Keyword[short] operator[SEP] identifier[data_size] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[p_data] , Other[0] , identifier[value] operator[SEP] identifier[sh_seq] , Other[0] , identifier[data_size] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] identifier[is_writ_associated] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] operator[SEP] identifier[tmp_sh] operator[SEP] Other[0] operator[SEP] operator[=] identifier[p_data] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[else] { Keyword[if] operator[SEP] identifier[p_data] operator[SEP] identifier[length] operator[==] identifier[data_size] operator[SEP] identifier[value] operator[SEP] identifier[sh_seq] operator[=] identifier[p_data] operator[SEP] Keyword[else] { identifier[value] operator[SEP] identifier[sh_seq] operator[=] Keyword[new] Keyword[short] operator[SEP] identifier[data_size] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[p_data] , Other[0] , identifier[value] operator[SEP] identifier[sh_seq] , Other[0] , identifier[data_size] operator[SEP] operator[SEP] } } } identifier[value_flag] operator[=] literal[boolean] operator[SEP] identifier[min_alarm_on] operator[=] literal[boolean] operator[SEP] identifier[max_alarm_on] operator[=] literal[boolean] operator[SEP] identifier[set_time] operator[SEP] operator[SEP] operator[SEP] }
public Optional<MirroringService> mirroringService() { if (pluginsForLeaderOnly == null) { return Optional.empty(); } return pluginsForLeaderOnly.findFirstPlugin(DefaultMirroringServicePlugin.class) .map(DefaultMirroringServicePlugin::mirroringService); }
class class_name[name] begin[{] method[mirroringService, return_type[type[Optional]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.pluginsForLeaderOnly], ==, literal[null]]] begin[{] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] return[call[pluginsForLeaderOnly.findFirstPlugin, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultMirroringServicePlugin, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Optional] operator[<] identifier[MirroringService] operator[>] identifier[mirroringService] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[pluginsForLeaderOnly] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[pluginsForLeaderOnly] operator[SEP] identifier[findFirstPlugin] operator[SEP] identifier[DefaultMirroringServicePlugin] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[DefaultMirroringServicePlugin] operator[::] identifier[mirroringService] operator[SEP] operator[SEP] }
public Matrix4x3d translationRotateScaleMul(Vector3dc translation, Quaterniondc quat, Vector3dc scale, Matrix4x3dc m) { return translationRotateScaleMul(translation.x(), translation.y(), translation.z(), quat.x(), quat.y(), quat.z(), quat.w(), scale.x(), scale.y(), scale.z(), m); }
class class_name[name] begin[{] method[translationRotateScaleMul, return_type[type[Matrix4x3d]], modifier[public], parameter[translation, quat, scale, m]] begin[{] return[call[.translationRotateScaleMul, parameter[call[translation.x, parameter[]], call[translation.y, parameter[]], call[translation.z, parameter[]], call[quat.x, parameter[]], call[quat.y, parameter[]], call[quat.z, parameter[]], call[quat.w, parameter[]], call[scale.x, parameter[]], call[scale.y, parameter[]], call[scale.z, parameter[]], member[.m]]]] end[}] END[}]
Keyword[public] identifier[Matrix4x3d] identifier[translationRotateScaleMul] operator[SEP] identifier[Vector3dc] identifier[translation] , identifier[Quaterniondc] identifier[quat] , identifier[Vector3dc] identifier[scale] , identifier[Matrix4x3dc] identifier[m] operator[SEP] { Keyword[return] identifier[translationRotateScaleMul] operator[SEP] identifier[translation] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[translation] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[translation] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[quat] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[quat] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[quat] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[quat] operator[SEP] identifier[w] operator[SEP] operator[SEP] , identifier[scale] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[scale] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[scale] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[m] operator[SEP] operator[SEP] }
public String get(String attributeName) { // check first for a namespace-less attribute String attr = attributes.get(new XAttributeName(attributeName, null, null)); if (attr == null) { // find any attribute ignoring namespace for (XAttributeName n : attributes.keySet()) { if (Objects.equals(n.name, attributeName)) { return attributes.get(n); } } } return attr; }
class class_name[name] begin[{] method[get, return_type[type[String]], modifier[public], parameter[attributeName]] begin[{] local_variable[type[String], attr] if[binary_operation[member[.attr], ==, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[]), MemberReference(member=attributeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=Objects, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XAttributeName, sub_type=None))), label=None) else begin[{] None end[}] return[member[.attr]] end[}] END[}]
Keyword[public] identifier[String] identifier[get] operator[SEP] identifier[String] identifier[attributeName] operator[SEP] { identifier[String] identifier[attr] operator[=] identifier[attributes] operator[SEP] identifier[get] operator[SEP] Keyword[new] identifier[XAttributeName] operator[SEP] identifier[attributeName] , Other[null] , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[==] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[XAttributeName] identifier[n] operator[:] identifier[attributes] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[n] operator[SEP] identifier[name] , identifier[attributeName] operator[SEP] operator[SEP] { Keyword[return] identifier[attributes] operator[SEP] identifier[get] operator[SEP] identifier[n] operator[SEP] operator[SEP] } } } Keyword[return] identifier[attr] operator[SEP] }
public void centerContent() { if (stopPartsPositioning) return; if (!isVisible()) return; boolean windowHset = false; int windowH = 0; int headerH = 0; int footerH = 0; int contentH = 0; int marginTop = 0; final JQMHeader header = getHeader(); final JQMFooter footer = getFooter(); if (contentCentered) { boolean isFixedHeader = header != null && (header.isFixed() || pseudoFixedToolbars); boolean isFixedFooter = footer != null && (footer.isFixed() || pseudoFixedToolbars); boolean needCentering = (header == null && footer == null) || (isFixedHeader && isFixedFooter) || (isFixedHeader && footer == null) || (isFixedFooter && header == null); if (needCentering && !isFixedToolbarsHidden()) { contentH = content.getOffsetHeight(); if (contentH > 0) { if (header != null) headerH = header.getOffsetHeight(); if (footer != null) footerH = footer.getOffsetHeight(); windowH = Window.getClientHeight(); windowHset = true; marginTop = (windowH - headerH - footerH - contentH) / 2; } } } if (marginTop <= 0) content.getElement().getStyle().clearMarginTop(); else content.getElement().getStyle().setMarginTop(marginTop, Unit.PX); if (footer != null) { int footerMarginTop = 0; footerH = footer.getOffsetHeight(); if (pseudoFixedToolbars && footerH > 0 && !footer.isFixed()) { if (!windowHset) { windowH = Window.getClientHeight(); windowHset = true; contentH = content.getOffsetHeight(); if (header != null) headerH = header.getOffsetHeight(); } footerMarginTop = windowH - headerH - contentH - marginTop - footerH; } if (footerMarginTop <= 0) footer.getElement().getStyle().clearMarginTop(); else footer.getElement().getStyle().setMarginTop(footerMarginTop, Unit.PX); } }
class class_name[name] begin[{] method[centerContent, return_type[void], modifier[public], parameter[]] begin[{] if[member[.stopPartsPositioning]] begin[{] return[None] else begin[{] None end[}] if[call[.isVisible, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[boolean], windowHset] local_variable[type[int], windowH] local_variable[type[int], headerH] local_variable[type[int], footerH] local_variable[type[int], contentH] local_variable[type[int], marginTop] local_variable[type[JQMHeader], header] local_variable[type[JQMFooter], footer] if[member[.contentCentered]] begin[{] local_variable[type[boolean], isFixedHeader] local_variable[type[boolean], isFixedFooter] local_variable[type[boolean], needCentering] if[binary_operation[member[.needCentering], &&, call[.isFixedToolbarsHidden, parameter[]]]] begin[{] assign[member[.contentH], call[content.getOffsetHeight, parameter[]]] if[binary_operation[member[.contentH], >, literal[0]]] begin[{] if[binary_operation[member[.header], !=, literal[null]]] begin[{] assign[member[.headerH], call[header.getOffsetHeight, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.footer], !=, literal[null]]] begin[{] assign[member[.footerH], call[footer.getOffsetHeight, parameter[]]] else begin[{] None end[}] assign[member[.windowH], call[Window.getClientHeight, parameter[]]] assign[member[.windowHset], literal[true]] assign[member[.marginTop], binary_operation[binary_operation[binary_operation[binary_operation[member[.windowH], -, member[.headerH]], -, member[.footerH]], -, member[.contentH]], /, literal[2]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.marginTop], <=, literal[0]]] begin[{] call[content.getElement, parameter[]] else begin[{] call[content.getElement, parameter[]] end[}] if[binary_operation[member[.footer], !=, literal[null]]] begin[{] local_variable[type[int], footerMarginTop] assign[member[.footerH], call[footer.getOffsetHeight, parameter[]]] if[binary_operation[binary_operation[member[.pseudoFixedToolbars], &&, binary_operation[member[.footerH], >, literal[0]]], &&, call[footer.isFixed, parameter[]]]] begin[{] if[member[.windowHset]] begin[{] assign[member[.windowH], call[Window.getClientHeight, parameter[]]] assign[member[.windowHset], literal[true]] assign[member[.contentH], call[content.getOffsetHeight, parameter[]]] if[binary_operation[member[.header], !=, literal[null]]] begin[{] assign[member[.headerH], call[header.getOffsetHeight, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.footerMarginTop], binary_operation[binary_operation[binary_operation[binary_operation[member[.windowH], -, member[.headerH]], -, member[.contentH]], -, member[.marginTop]], -, member[.footerH]]] else begin[{] None end[}] if[binary_operation[member[.footerMarginTop], <=, literal[0]]] begin[{] call[footer.getElement, parameter[]] else begin[{] call[footer.getElement, parameter[]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[centerContent] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[stopPartsPositioning] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isVisible] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[boolean] identifier[windowHset] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[windowH] operator[=] Other[0] operator[SEP] Keyword[int] identifier[headerH] operator[=] Other[0] operator[SEP] Keyword[int] identifier[footerH] operator[=] Other[0] operator[SEP] Keyword[int] identifier[contentH] operator[=] Other[0] operator[SEP] Keyword[int] identifier[marginTop] operator[=] Other[0] operator[SEP] Keyword[final] identifier[JQMHeader] identifier[header] operator[=] identifier[getHeader] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[JQMFooter] identifier[footer] operator[=] identifier[getFooter] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contentCentered] operator[SEP] { Keyword[boolean] identifier[isFixedHeader] operator[=] identifier[header] operator[!=] Other[null] operator[&&] operator[SEP] identifier[header] operator[SEP] identifier[isFixed] operator[SEP] operator[SEP] operator[||] identifier[pseudoFixedToolbars] operator[SEP] operator[SEP] Keyword[boolean] identifier[isFixedFooter] operator[=] identifier[footer] operator[!=] Other[null] operator[&&] operator[SEP] identifier[footer] operator[SEP] identifier[isFixed] operator[SEP] operator[SEP] operator[||] identifier[pseudoFixedToolbars] operator[SEP] operator[SEP] Keyword[boolean] identifier[needCentering] operator[=] operator[SEP] identifier[header] operator[==] Other[null] operator[&&] identifier[footer] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[isFixedHeader] operator[&&] identifier[isFixedFooter] operator[SEP] operator[||] operator[SEP] identifier[isFixedHeader] operator[&&] identifier[footer] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[isFixedFooter] operator[&&] identifier[header] operator[==] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[needCentering] operator[&&] operator[!] identifier[isFixedToolbarsHidden] operator[SEP] operator[SEP] operator[SEP] { identifier[contentH] operator[=] identifier[content] operator[SEP] identifier[getOffsetHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contentH] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[header] operator[!=] Other[null] operator[SEP] identifier[headerH] operator[=] identifier[header] operator[SEP] identifier[getOffsetHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[footer] operator[!=] Other[null] operator[SEP] identifier[footerH] operator[=] identifier[footer] operator[SEP] identifier[getOffsetHeight] operator[SEP] operator[SEP] operator[SEP] identifier[windowH] operator[=] identifier[Window] operator[SEP] identifier[getClientHeight] operator[SEP] operator[SEP] operator[SEP] identifier[windowHset] operator[=] literal[boolean] operator[SEP] identifier[marginTop] operator[=] operator[SEP] identifier[windowH] operator[-] identifier[headerH] operator[-] identifier[footerH] operator[-] identifier[contentH] operator[SEP] operator[/] Other[2] operator[SEP] } } } Keyword[if] operator[SEP] identifier[marginTop] operator[<=] Other[0] operator[SEP] identifier[content] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[clearMarginTop] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[content] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[setMarginTop] operator[SEP] identifier[marginTop] , identifier[Unit] operator[SEP] identifier[PX] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[footer] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[footerMarginTop] operator[=] Other[0] operator[SEP] identifier[footerH] operator[=] identifier[footer] operator[SEP] identifier[getOffsetHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pseudoFixedToolbars] operator[&&] identifier[footerH] operator[>] Other[0] operator[&&] operator[!] identifier[footer] operator[SEP] identifier[isFixed] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[windowHset] operator[SEP] { identifier[windowH] operator[=] identifier[Window] operator[SEP] identifier[getClientHeight] operator[SEP] operator[SEP] operator[SEP] identifier[windowHset] operator[=] literal[boolean] operator[SEP] identifier[contentH] operator[=] identifier[content] operator[SEP] identifier[getOffsetHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[header] operator[!=] Other[null] operator[SEP] identifier[headerH] operator[=] identifier[header] operator[SEP] identifier[getOffsetHeight] operator[SEP] operator[SEP] operator[SEP] } identifier[footerMarginTop] operator[=] identifier[windowH] operator[-] identifier[headerH] operator[-] identifier[contentH] operator[-] identifier[marginTop] operator[-] identifier[footerH] operator[SEP] } Keyword[if] operator[SEP] identifier[footerMarginTop] operator[<=] Other[0] operator[SEP] identifier[footer] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[clearMarginTop] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[footer] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[setMarginTop] operator[SEP] identifier[footerMarginTop] , identifier[Unit] operator[SEP] identifier[PX] operator[SEP] operator[SEP] } }
private Triangle insertPointSimple(Set<Vector3> vertices, Vector3 p) { if (!allCollinear) { return insertNonColinear(p); } else { return insertColinear(vertices, p); } }
class class_name[name] begin[{] method[insertPointSimple, return_type[type[Triangle]], modifier[private], parameter[vertices, p]] begin[{] if[member[.allCollinear]] begin[{] return[call[.insertNonColinear, parameter[member[.p]]]] else begin[{] return[call[.insertColinear, parameter[member[.vertices], member[.p]]]] end[}] end[}] END[}]
Keyword[private] identifier[Triangle] identifier[insertPointSimple] operator[SEP] identifier[Set] operator[<] identifier[Vector3] operator[>] identifier[vertices] , identifier[Vector3] identifier[p] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[allCollinear] operator[SEP] { Keyword[return] identifier[insertNonColinear] operator[SEP] identifier[p] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[insertColinear] operator[SEP] identifier[vertices] , identifier[p] operator[SEP] operator[SEP] } }
public static Method getSetter(String fieldName, Class<?> clazz, Class<?> fieldType) { String setterName = buildSetterName(fieldName); try { // Using getMathods(), getMathod(...) expects exact parameter type // matching and ignores inheritance-tree. Method[] methods = clazz.getMethods(); for(Method method : methods) { if(method.getName().equals(setterName)) { Class<?>[] paramTypes = method.getParameterTypes(); if(paramTypes != null && paramTypes.length == 1 && paramTypes[0].isAssignableFrom(fieldType)) { return method; } } } return null; } catch (SecurityException e) { throw LOG.unableToAccessMethod(setterName, clazz.getName()); } }
class class_name[name] begin[{] method[getSetter, return_type[type[Method]], modifier[public static], parameter[fieldName, clazz, fieldType]] begin[{] local_variable[type[String], setterName] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMethods, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), name=methods)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Method, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[MemberReference(member=setterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=paramTypes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[None], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paramTypes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=&&), operandr=MemberReference(member=paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[MemberReference(member=fieldType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, 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=[ReturnStatement(expression=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=setterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None)], member=unableToAccessMethod, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SecurityException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Method] identifier[getSetter] operator[SEP] identifier[String] identifier[fieldName] , identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Class] operator[<] operator[?] operator[>] identifier[fieldType] operator[SEP] { identifier[String] identifier[setterName] operator[=] identifier[buildSetterName] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] Keyword[try] { identifier[Method] operator[SEP] operator[SEP] identifier[methods] operator[=] identifier[clazz] operator[SEP] identifier[getMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Method] identifier[method] operator[:] identifier[methods] operator[SEP] { Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[setterName] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[paramTypes] operator[=] identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[paramTypes] operator[!=] Other[null] operator[&&] identifier[paramTypes] operator[SEP] identifier[length] operator[==] Other[1] operator[&&] identifier[paramTypes] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[fieldType] operator[SEP] operator[SEP] { Keyword[return] identifier[method] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[e] operator[SEP] { Keyword[throw] identifier[LOG] operator[SEP] identifier[unableToAccessMethod] operator[SEP] identifier[setterName] , identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public <T> T eval(Object value, T defaultValue) { T result = null; if (value instanceof String) { String expression = (String) value; if (StringUtils.isNotBlank(expression)) { expression = expression.replaceAll("@\\{([^\\}]+)\\}", "\\${$1}"); Class type = defaultValue != null ? defaultValue.getClass() : String.class; if (String.class.equals(type) && !expression.contains("${") && !expression.contains("#{")) { result = (T) expression; // no change if it does not contain an actual EL expression } else { ELContext elContext = getELContext(); ValueExpression valueExpression = createValueExpression(elContext, expression, type); result = (T) valueExpression.getValue(elContext); } } } return result != null ? result : defaultValue; }
class class_name[name] begin[{] method[eval, return_type[type[T]], modifier[public], parameter[value, defaultValue]] begin[{] local_variable[type[T], result] if[binary_operation[member[.value], instanceof, type[String]]] begin[{] local_variable[type[String], expression] if[call[StringUtils.isNotBlank, parameter[member[.expression]]]] begin[{] assign[member[.expression], call[expression.replaceAll, parameter[literal["@\\{([^\\}]+)\\}"], literal["\\${$1}"]]]] local_variable[type[Class], type] if[binary_operation[binary_operation[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), &&, call[expression.contains, parameter[literal["${"]]]], &&, call[expression.contains, parameter[literal["#{"]]]]] begin[{] assign[member[.result], Cast(expression=MemberReference(member=expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] local_variable[type[ELContext], elContext] local_variable[type[ValueExpression], valueExpression] assign[member[.result], Cast(expression=MethodInvocation(arguments=[MemberReference(member=elContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=valueExpression, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] else begin[{] None end[}] else begin[{] None end[}] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[eval] operator[SEP] identifier[Object] identifier[value] , identifier[T] identifier[defaultValue] operator[SEP] { identifier[T] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[String] operator[SEP] { identifier[String] identifier[expression] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[expression] operator[SEP] operator[SEP] { identifier[expression] operator[=] identifier[expression] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Class] identifier[type] operator[=] identifier[defaultValue] operator[!=] Other[null] operator[?] identifier[defaultValue] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[:] identifier[String] operator[SEP] Keyword[class] operator[SEP] Keyword[if] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[&&] operator[!] identifier[expression] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[expression] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[result] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[expression] operator[SEP] } Keyword[else] { identifier[ELContext] identifier[elContext] operator[=] identifier[getELContext] operator[SEP] operator[SEP] operator[SEP] identifier[ValueExpression] identifier[valueExpression] operator[=] identifier[createValueExpression] operator[SEP] identifier[elContext] , identifier[expression] , identifier[type] operator[SEP] operator[SEP] identifier[result] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[valueExpression] operator[SEP] identifier[getValue] operator[SEP] identifier[elContext] operator[SEP] operator[SEP] } } } Keyword[return] identifier[result] operator[!=] Other[null] operator[?] identifier[result] operator[:] identifier[defaultValue] operator[SEP] }
private ClientResponse getActionClientResponse( EntityActionOperation entityActionOperation) { entityActionOperation.setProxyData(createProxyData()); Builder webResource = getResource(entityActionOperation.getUri()) .queryParams(entityActionOperation.getQueryParameters()) .accept(entityActionOperation.getAcceptType()) .accept(MediaType.APPLICATION_XML_TYPE) .type(MediaType.APPLICATION_XML_TYPE); if (entityActionOperation.getRequestContents() != null) { webResource = webResource.entity( entityActionOperation.getRequestContents(), entityActionOperation.getContentType()); } return webResource.method(entityActionOperation.getVerb(), ClientResponse.class); }
class class_name[name] begin[{] method[getActionClientResponse, return_type[type[ClientResponse]], modifier[private], parameter[entityActionOperation]] begin[{] call[entityActionOperation.setProxyData, parameter[call[.createProxyData, parameter[]]]] local_variable[type[Builder], webResource] if[binary_operation[call[entityActionOperation.getRequestContents, parameter[]], !=, literal[null]]] begin[{] assign[member[.webResource], call[webResource.entity, parameter[call[entityActionOperation.getRequestContents, parameter[]], call[entityActionOperation.getContentType, parameter[]]]]] else begin[{] None end[}] return[call[webResource.method, parameter[call[entityActionOperation.getVerb, parameter[]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientResponse, sub_type=None))]]] end[}] END[}]
Keyword[private] identifier[ClientResponse] identifier[getActionClientResponse] operator[SEP] identifier[EntityActionOperation] identifier[entityActionOperation] operator[SEP] { identifier[entityActionOperation] operator[SEP] identifier[setProxyData] operator[SEP] identifier[createProxyData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Builder] identifier[webResource] operator[=] identifier[getResource] operator[SEP] identifier[entityActionOperation] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[queryParams] operator[SEP] identifier[entityActionOperation] operator[SEP] identifier[getQueryParameters] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[accept] operator[SEP] identifier[entityActionOperation] operator[SEP] identifier[getAcceptType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[accept] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_XML_TYPE] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_XML_TYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityActionOperation] operator[SEP] identifier[getRequestContents] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[entity] operator[SEP] identifier[entityActionOperation] operator[SEP] identifier[getRequestContents] operator[SEP] operator[SEP] , identifier[entityActionOperation] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[webResource] operator[SEP] identifier[method] operator[SEP] identifier[entityActionOperation] operator[SEP] identifier[getVerb] operator[SEP] operator[SEP] , identifier[ClientResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
static String doHttp( String postURL, String text ) { String returnValue = null; StringBuilder sb = new StringBuilder(); sb.append( "bsh.client=Remote" ); sb.append( "&bsh.script=" ); // This requires Java 1.3 try { sb.append( URLEncoder.encode( text, "UTF-8" ) ); } catch ( UnsupportedEncodingException e ) { e.printStackTrace(); } String formData = sb.toString( ); try { URL url = new URL( postURL ); HttpURLConnection urlcon = (HttpURLConnection) url.openConnection( ); urlcon.setRequestMethod("POST"); urlcon.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); urlcon.setDoOutput(true); urlcon.setDoInput(true); PrintWriter pout = new PrintWriter( new OutputStreamWriter( urlcon.getOutputStream(), "8859_1"), true ); pout.print( formData ); pout.flush(); // read results... int rc = urlcon.getResponseCode(); if ( rc != HttpURLConnection.HTTP_OK ) System.out.println("Error, HTTP response: "+rc ); returnValue = urlcon.getHeaderField("Bsh-Return"); try (BufferedReader bin = new BufferedReader( new FileReader(urlcon.getInputStream()) )) { String line; while ( (line=bin.readLine()) != null ) System.out.println( line ); } System.out.println( "Return Value: "+returnValue ); } catch (MalformedURLException e) { System.out.println(e); // bad postURL } catch (IOException e2) { System.out.println(e2); // I/O error } return returnValue; }
class class_name[name] begin[{] method[doHttp, return_type[type[String]], modifier[static], parameter[postURL, text]] begin[{] local_variable[type[String], returnValue] local_variable[type[StringBuilder], sb] call[sb.append, parameter[literal["bsh.client=Remote"]]] call[sb.append, parameter[literal["&bsh.script="]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) local_variable[type[String], formData] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=postURL, 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=URL, sub_type=None)), name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None)), name=urlcon)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="POST")], member=setRequestMethod, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-type"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="application/x-www-form-urlencoded")], member=setRequestProperty, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDoOutput, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDoInput, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="8859_1")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OutputStreamWriter, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrintWriter, sub_type=None)), name=pout)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PrintWriter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=formData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=pout, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=pout, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None), name=rc)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HTTP_OK, postfix_operators=[], prefix_operators=[], qualifier=HttpURLConnection, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error, HTTP response: "), operandr=MemberReference(member=rc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=returnValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bsh-Return")], member=getHeaderField, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None)), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=bin, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=bin, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=urlcon, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)))]), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Return Value: "), operandr=MemberReference(member=returnValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e2, types=['IOException']))], finally_block=None, label=None, resources=None) return[member[.returnValue]] end[}] END[}]
Keyword[static] identifier[String] identifier[doHttp] operator[SEP] identifier[String] identifier[postURL] , identifier[String] identifier[text] operator[SEP] { identifier[String] identifier[returnValue] operator[=] Other[null] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[text] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[formData] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[URL] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[postURL] operator[SEP] operator[SEP] identifier[HttpURLConnection] identifier[urlcon] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[urlcon] operator[SEP] identifier[setRequestMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[urlcon] operator[SEP] identifier[setRequestProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[urlcon] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[urlcon] operator[SEP] identifier[setDoInput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[pout] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] Keyword[new] identifier[OutputStreamWriter] operator[SEP] identifier[urlcon] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] , literal[String] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[pout] operator[SEP] identifier[print] operator[SEP] identifier[formData] operator[SEP] operator[SEP] identifier[pout] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rc] operator[=] identifier[urlcon] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rc] operator[!=] identifier[HttpURLConnection] operator[SEP] identifier[HTTP_OK] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[rc] operator[SEP] operator[SEP] identifier[returnValue] operator[=] identifier[urlcon] operator[SEP] identifier[getHeaderField] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedReader] identifier[bin] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[FileReader] operator[SEP] identifier[urlcon] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[bin] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[line] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[returnValue] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e2] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[e2] operator[SEP] operator[SEP] } Keyword[return] identifier[returnValue] operator[SEP] }
protected void writeSummary(TestClassReport testClassReport) throws IOException { if (isReportMessage(testClassReport)) { writer.append("[IMPORTANT]").append(NEW_LINE); writer.append("====").append(NEW_LINE); writer.append(testClassReport.getReportMessage()).append(NEW_LINE); writer.append("====").append(NEW_LINE).append(NEW_LINE); } int[] results = countSummary(testClassReport.getTestMethodReports()); writer.append(".").append(this.resourceBundle.getString("asciidoc.reporter.testResult")).append(NEW_LINE); writer.append("****").append(NEW_LINE); writer.append("*").append(this.resourceBundle.getString("asciidoc.reporter.passed")).append("*").append(" ").append(Integer.toString(results[PASSED_INDEX])) .append(NEW_LINE).append(NEW_LINE); writer.append("*").append(this.resourceBundle.getString("asciidoc.reporter.failed")).append("*").append(" ").append(Integer.toString(results[FAILED_INDEX])) .append(NEW_LINE).append(NEW_LINE); writer.append("****").append(NEW_LINE).append(NEW_LINE); writeProperties(testClassReport.getPropertyEntries()); }
class class_name[name] begin[{] method[writeSummary, return_type[void], modifier[protected], parameter[testClassReport]] begin[{] if[call[.isReportMessage, parameter[member[.testClassReport]]]] begin[{] call[writer.append, parameter[literal["[IMPORTANT]"]]] call[writer.append, parameter[literal["===="]]] call[writer.append, parameter[call[testClassReport.getReportMessage, parameter[]]]] call[writer.append, parameter[literal["===="]]] else begin[{] None end[}] local_variable[type[int], results] call[writer.append, parameter[literal["."]]] call[writer.append, parameter[literal["****"]]] call[writer.append, parameter[literal["*"]]] call[writer.append, parameter[literal["*"]]] call[writer.append, parameter[literal["****"]]] call[.writeProperties, parameter[call[testClassReport.getPropertyEntries, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[writeSummary] operator[SEP] identifier[TestClassReport] identifier[testClassReport] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[isReportMessage] operator[SEP] identifier[testClassReport] operator[SEP] operator[SEP] { identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] identifier[testClassReport] operator[SEP] identifier[getReportMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] } Keyword[int] operator[SEP] operator[SEP] identifier[results] operator[=] identifier[countSummary] operator[SEP] identifier[testClassReport] operator[SEP] identifier[getTestMethodReports] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[resourceBundle] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[resourceBundle] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[results] operator[SEP] identifier[PASSED_INDEX] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[resourceBundle] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[results] operator[SEP] identifier[FAILED_INDEX] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[NEW_LINE] operator[SEP] operator[SEP] identifier[writeProperties] operator[SEP] identifier[testClassReport] operator[SEP] identifier[getPropertyEntries] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private Map<String, DependencyInfo> removeMungedSymbols( Map<String, DependencyInfo> depFiles, Map<String, DependencyInfo> jsFiles) { Map<String, DependencyInfo> newJsFiles = new LinkedHashMap<>(); Map<String, DependencyInfo> providesMap = new LinkedHashMap<>(); addToProvideMap(depFiles.values(), providesMap, true); addToProvideMap(jsFiles.values(), providesMap, false); for (DependencyInfo dependencyInfo : jsFiles.values()) { ArrayList<Require> newRequires = new ArrayList<>(); for (Require require : dependencyInfo.getRequires()) { if (require.getType() == Require.Type.ES6_IMPORT) { // Symbols are unique per file and have nothing to do with paths so map lookups are safe // here. DependencyInfo provider = providesMap.get(require.getSymbol()); if (provider == null) { reportMissingFile(dependencyInfo, require.getRawText()); } else { // If this is an ES6 module then set the symbol to be its relative path to Closure. // ES6 modules in a dependency file do not "provide" anything. Requires can match // a provided symbol or a relative path to Closure. newRequires.add(require.withSymbol(provider.getPathRelativeToClosureBase())); } } else { // Require is by symbol already so no need to change it. newRequires.add(require); } } ImmutableList<String> provides = dependencyInfo.getProvides(); if ("es6".equals(dependencyInfo.getLoadFlags().get("module"))) { String mungedProvide = loader.resolve(dependencyInfo.getName()).toModuleName(); // Filter out the munged symbol. // Note that at the moment ES6 modules should not have any other provides! In the future // we may have additional mechanisms to add goog symbols. But for not nothing is officially // supported. ImmutableList.Builder<String> builder = ImmutableList.builder(); for (String provide : provides) { if (!provide.equals(mungedProvide) && !provide.equals(dependencyInfo.getPathRelativeToClosureBase())) { builder.add(provide); } } provides = builder.build(); } newJsFiles.put( dependencyInfo.getPathRelativeToClosureBase(), SimpleDependencyInfo.builder( dependencyInfo.getPathRelativeToClosureBase(), dependencyInfo.getName()) .setProvides(provides) .setRequires(newRequires) .setLoadFlags(dependencyInfo.getLoadFlags()) .build()); } return newJsFiles; }
class class_name[name] begin[{] method[removeMungedSymbols, return_type[type[Map]], modifier[private], parameter[depFiles, jsFiles]] begin[{] local_variable[type[Map], newJsFiles] local_variable[type[Map], providesMap] call[.addToProvideMap, parameter[call[depFiles.values, parameter[]], member[.providesMap], literal[true]]] call[.addToProvideMap, parameter[call[jsFiles.values, parameter[]], member[.providesMap], literal[false]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=newRequires)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Require, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=require, selectors=[], type_arguments=None), operandr=MemberReference(member=ES6_IMPORT, postfix_operators=[], prefix_operators=[], qualifier=Require.Type, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=require, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newRequires, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=require, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=providesMap, selectors=[], type_arguments=None), name=provider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DependencyInfo, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPathRelativeToClosureBase, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None)], member=withSymbol, postfix_operators=[], prefix_operators=[], qualifier=require, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=newRequires, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dependencyInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRawText, postfix_operators=[], prefix_operators=[], qualifier=require, selectors=[], type_arguments=None)], member=reportMissingFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRequires, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=require)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Require, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getProvides, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None), name=provides)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=ImmutableList, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLoadFlags, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="module")], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="es6"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None)], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[MethodInvocation(arguments=[], member=toModuleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=mungedProvide)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=builder, postfix_operators=[], prefix_operators=[], qualifier=ImmutableList, selectors=[], type_arguments=None), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImmutableList, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Builder, sub_type=None))), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=mungedProvide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=provide, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPathRelativeToClosureBase, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=provide, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=provide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=provides, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=provide)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=provides, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPathRelativeToClosureBase, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPathRelativeToClosureBase, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None)], member=builder, postfix_operators=[], prefix_operators=[], qualifier=SimpleDependencyInfo, selectors=[MethodInvocation(arguments=[MemberReference(member=provides, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProvides, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=newRequires, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRequires, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLoadFlags, postfix_operators=[], prefix_operators=[], qualifier=dependencyInfo, selectors=[], type_arguments=None)], member=setLoadFlags, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=newJsFiles, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=jsFiles, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dependencyInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DependencyInfo, sub_type=None))), label=None) return[member[.newJsFiles]] end[}] END[}]
Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[DependencyInfo] operator[>] identifier[removeMungedSymbols] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[DependencyInfo] operator[>] identifier[depFiles] , identifier[Map] operator[<] identifier[String] , identifier[DependencyInfo] operator[>] identifier[jsFiles] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[DependencyInfo] operator[>] identifier[newJsFiles] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[DependencyInfo] operator[>] identifier[providesMap] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addToProvideMap] operator[SEP] identifier[depFiles] operator[SEP] identifier[values] operator[SEP] operator[SEP] , identifier[providesMap] , literal[boolean] operator[SEP] operator[SEP] identifier[addToProvideMap] operator[SEP] identifier[jsFiles] operator[SEP] identifier[values] operator[SEP] operator[SEP] , identifier[providesMap] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DependencyInfo] identifier[dependencyInfo] operator[:] identifier[jsFiles] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[ArrayList] operator[<] identifier[Require] operator[>] identifier[newRequires] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Require] identifier[require] operator[:] identifier[dependencyInfo] operator[SEP] identifier[getRequires] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[require] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Require] operator[SEP] identifier[Type] operator[SEP] identifier[ES6_IMPORT] operator[SEP] { identifier[DependencyInfo] identifier[provider] operator[=] identifier[providesMap] operator[SEP] identifier[get] operator[SEP] identifier[require] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[provider] operator[==] Other[null] operator[SEP] { identifier[reportMissingFile] operator[SEP] identifier[dependencyInfo] , identifier[require] operator[SEP] identifier[getRawText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[newRequires] operator[SEP] identifier[add] operator[SEP] identifier[require] operator[SEP] identifier[withSymbol] operator[SEP] identifier[provider] operator[SEP] identifier[getPathRelativeToClosureBase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[newRequires] operator[SEP] identifier[add] operator[SEP] identifier[require] operator[SEP] operator[SEP] } } identifier[ImmutableList] operator[<] identifier[String] operator[>] identifier[provides] operator[=] identifier[dependencyInfo] operator[SEP] identifier[getProvides] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[dependencyInfo] operator[SEP] identifier[getLoadFlags] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[mungedProvide] operator[=] identifier[loader] operator[SEP] identifier[resolve] operator[SEP] identifier[dependencyInfo] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toModuleName] operator[SEP] operator[SEP] operator[SEP] identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[String] operator[>] identifier[builder] operator[=] identifier[ImmutableList] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[provide] operator[:] identifier[provides] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[provide] operator[SEP] identifier[equals] operator[SEP] identifier[mungedProvide] operator[SEP] operator[&&] operator[!] identifier[provide] operator[SEP] identifier[equals] operator[SEP] identifier[dependencyInfo] operator[SEP] identifier[getPathRelativeToClosureBase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[add] operator[SEP] identifier[provide] operator[SEP] operator[SEP] } } identifier[provides] operator[=] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } identifier[newJsFiles] operator[SEP] identifier[put] operator[SEP] identifier[dependencyInfo] operator[SEP] identifier[getPathRelativeToClosureBase] operator[SEP] operator[SEP] , identifier[SimpleDependencyInfo] operator[SEP] identifier[builder] operator[SEP] identifier[dependencyInfo] operator[SEP] identifier[getPathRelativeToClosureBase] operator[SEP] operator[SEP] , identifier[dependencyInfo] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setProvides] operator[SEP] identifier[provides] operator[SEP] operator[SEP] identifier[setRequires] operator[SEP] identifier[newRequires] operator[SEP] operator[SEP] identifier[setLoadFlags] operator[SEP] identifier[dependencyInfo] operator[SEP] identifier[getLoadFlags] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[newJsFiles] operator[SEP] }
public ImageView addNewImageView(float pScale_Left, float pScale_Top, float pScale_Width, float pScale_Height) { return addNewImageView((Drawable)null, pScale_Left, pScale_Top, pScale_Width, pScale_Height, false); }
class class_name[name] begin[{] method[addNewImageView, return_type[type[ImageView]], modifier[public], parameter[pScale_Left, pScale_Top, pScale_Width, pScale_Height]] begin[{] return[call[.addNewImageView, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Drawable, sub_type=None)), member[.pScale_Left], member[.pScale_Top], member[.pScale_Width], member[.pScale_Height], literal[false]]]] end[}] END[}]
Keyword[public] identifier[ImageView] identifier[addNewImageView] operator[SEP] Keyword[float] identifier[pScale_Left] , Keyword[float] identifier[pScale_Top] , Keyword[float] identifier[pScale_Width] , Keyword[float] identifier[pScale_Height] operator[SEP] { Keyword[return] identifier[addNewImageView] operator[SEP] operator[SEP] identifier[Drawable] operator[SEP] Other[null] , identifier[pScale_Left] , identifier[pScale_Top] , identifier[pScale_Width] , identifier[pScale_Height] , literal[boolean] operator[SEP] operator[SEP] }
protected void activate(ComponentContext ctxt) { this.bundle = ctxt.getUsingBundle(); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "Activating for bundle " + this.bundle); } this.localServlets = new HashSet<Servlet>(); this.localFilters = new HashSet<Filter>(); this.contextManager = new ServletContextManager(this.bundle, ctxt.getProperties()); }
class class_name[name] begin[{] method[activate, return_type[void], modifier[protected], parameter[ctxt]] begin[{] assign[THIS[member[None.bundle]], call[ctxt.getUsingBundle, parameter[]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{] call[Tr.event, parameter[THIS[], member[.tc], binary_operation[literal["Activating for bundle "], +, THIS[member[None.bundle]]]]] else begin[{] None end[}] assign[THIS[member[None.localServlets]], 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=Servlet, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))] assign[THIS[member[None.localFilters]], 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=Filter, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))] assign[THIS[member[None.contextManager]], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=ctxt, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServletContextManager, sub_type=None))] end[}] END[}]
Keyword[protected] Keyword[void] identifier[activate] operator[SEP] identifier[ComponentContext] identifier[ctxt] operator[SEP] { Keyword[this] operator[SEP] identifier[bundle] operator[=] identifier[ctxt] operator[SEP] identifier[getUsingBundle] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[bundle] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[localServlets] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Servlet] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[localFilters] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Filter] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[contextManager] operator[=] Keyword[new] identifier[ServletContextManager] operator[SEP] Keyword[this] operator[SEP] identifier[bundle] , identifier[ctxt] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private JsfFaceletDescriptor findJsfTemplateDescriptor(String templateFqn, String path, ScannerContext context) { String includedFile = absolutifyFilePath(path, templateFqn); return getJsfTemplateDescriptor(includedFile, context); }
class class_name[name] begin[{] method[findJsfTemplateDescriptor, return_type[type[JsfFaceletDescriptor]], modifier[private], parameter[templateFqn, path, context]] begin[{] local_variable[type[String], includedFile] return[call[.getJsfTemplateDescriptor, parameter[member[.includedFile], member[.context]]]] end[}] END[}]
Keyword[private] identifier[JsfFaceletDescriptor] identifier[findJsfTemplateDescriptor] operator[SEP] identifier[String] identifier[templateFqn] , identifier[String] identifier[path] , identifier[ScannerContext] identifier[context] operator[SEP] { identifier[String] identifier[includedFile] operator[=] identifier[absolutifyFilePath] operator[SEP] identifier[path] , identifier[templateFqn] operator[SEP] operator[SEP] Keyword[return] identifier[getJsfTemplateDescriptor] operator[SEP] identifier[includedFile] , identifier[context] operator[SEP] operator[SEP] }
@Nonnull public Section addCodeSection(@Nullable Component component, @Nonnull Format format, @Nonnull String content) { return addSection(component, "Code", format, content); }
class class_name[name] begin[{] method[addCodeSection, return_type[type[Section]], modifier[public], parameter[component, format, content]] begin[{] return[call[.addSection, parameter[member[.component], literal["Code"], member[.format], member[.content]]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[Section] identifier[addCodeSection] operator[SEP] annotation[@] identifier[Nullable] identifier[Component] identifier[component] , annotation[@] identifier[Nonnull] identifier[Format] identifier[format] , annotation[@] identifier[Nonnull] identifier[String] identifier[content] operator[SEP] { Keyword[return] identifier[addSection] operator[SEP] identifier[component] , literal[String] , identifier[format] , identifier[content] operator[SEP] operator[SEP] }
public UserNotification getUserNotificationById( Long userNotificationPkParam) { UserNotification userNoti = new UserNotification(); userNoti.setId(userNotificationPkParam); if(this.serviceTicket != null) { userNoti.setServiceTicket(this.serviceTicket); } try { return new UserNotification(this.postJson( userNoti, WS.Path.UserNotification.Version1.getById())); } //Json format issues... catch (JSONException jsonExcept) { throw new FluidClientException(jsonExcept.getMessage(), FluidClientException.ErrorCode.JSON_PARSING); } }
class class_name[name] begin[{] method[getUserNotificationById, return_type[type[UserNotification]], modifier[public], parameter[userNotificationPkParam]] begin[{] local_variable[type[UserNotification], userNoti] call[userNoti.setId, parameter[member[.userNotificationPkParam]]] if[binary_operation[THIS[member[None.serviceTicket]], !=, literal[null]]] begin[{] call[userNoti.setServiceTicket, parameter[THIS[member[None.serviceTicket]]]] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=userNoti, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getById, postfix_operators=[], prefix_operators=[], qualifier=WS.Path.UserNotification.Version1, selectors=[], type_arguments=None)], member=postJson, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UserNotification, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=jsonExcept, selectors=[], type_arguments=None), MemberReference(member=JSON_PARSING, postfix_operators=[], prefix_operators=[], qualifier=FluidClientException.ErrorCode, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FluidClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=jsonExcept, types=['JSONException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[UserNotification] identifier[getUserNotificationById] operator[SEP] identifier[Long] identifier[userNotificationPkParam] operator[SEP] { identifier[UserNotification] identifier[userNoti] operator[=] Keyword[new] identifier[UserNotification] operator[SEP] operator[SEP] operator[SEP] identifier[userNoti] operator[SEP] identifier[setId] operator[SEP] identifier[userNotificationPkParam] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[serviceTicket] operator[!=] Other[null] operator[SEP] { identifier[userNoti] operator[SEP] identifier[setServiceTicket] operator[SEP] Keyword[this] operator[SEP] identifier[serviceTicket] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] Keyword[new] identifier[UserNotification] operator[SEP] Keyword[this] operator[SEP] identifier[postJson] operator[SEP] identifier[userNoti] , identifier[WS] operator[SEP] identifier[Path] operator[SEP] identifier[UserNotification] operator[SEP] identifier[Version1] operator[SEP] identifier[getById] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JSONException] identifier[jsonExcept] operator[SEP] { Keyword[throw] Keyword[new] identifier[FluidClientException] operator[SEP] identifier[jsonExcept] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[FluidClientException] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[JSON_PARSING] operator[SEP] operator[SEP] } }
public static <T> T notNullNotEquals (final T aValue, @Nonnull final Supplier <? extends String> aName, @Nonnull final T aUnexpectedValue) { notNull (aValue, aName); notNull (aUnexpectedValue, "UnexpectedValue"); if (isEnabled ()) if (aValue.equals (aUnexpectedValue)) throw new IllegalArgumentException ("The value of '" + aName.get () + "' may not be equal to " + aUnexpectedValue + "!"); return aValue; }
class class_name[name] begin[{] method[notNullNotEquals, return_type[type[T]], modifier[public static], parameter[aValue, aName, aUnexpectedValue]] begin[{] call[.notNull, parameter[member[.aValue], member[.aName]]] call[.notNull, parameter[member[.aUnexpectedValue], literal["UnexpectedValue"]]] if[call[.isEnabled, parameter[]]] begin[{] if[call[aValue.equals, parameter[member[.aUnexpectedValue]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value of '"), operandr=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=aName, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' may not be equal to "), operator=+), operandr=MemberReference(member=aUnexpectedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] return[member[.aValue]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[notNullNotEquals] operator[SEP] Keyword[final] identifier[T] identifier[aValue] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Supplier] operator[<] operator[?] Keyword[extends] identifier[String] operator[>] identifier[aName] , annotation[@] identifier[Nonnull] Keyword[final] identifier[T] identifier[aUnexpectedValue] operator[SEP] { identifier[notNull] operator[SEP] identifier[aValue] , identifier[aName] operator[SEP] operator[SEP] identifier[notNull] operator[SEP] identifier[aUnexpectedValue] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aValue] operator[SEP] identifier[equals] operator[SEP] identifier[aUnexpectedValue] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[aName] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[aUnexpectedValue] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[aValue] operator[SEP] }
public static <A, B, C, D, E> Choice5<A, B, C, D, E> b(B b) { return new _B<>(b); }
class class_name[name] begin[{] method[b, return_type[type[Choice5]], modifier[public static], parameter[b]] begin[{] return[ClassCreator(arguments=[MemberReference(member=b, 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=_B, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] , identifier[B] , identifier[C] , identifier[D] , identifier[E] operator[>] identifier[Choice5] operator[<] identifier[A] , identifier[B] , identifier[C] , identifier[D] , identifier[E] operator[>] identifier[b] operator[SEP] identifier[B] identifier[b] operator[SEP] { Keyword[return] Keyword[new] identifier[_B] operator[<] operator[>] operator[SEP] identifier[b] operator[SEP] operator[SEP] }
public void setSparseComponent(int component, int[] indices, double[] values) { if (component >= pointers.length) { increaseSizeTo(component + 1); } assert (indices.length == values.length); if (indices.length == 0) { pointers[component] = new double[2]; sparse[component] = true; copyOnWrite[component] = false; } else { double[] sparseInfo = new double[indices.length * 2]; for (int i = 0; i < indices.length; i++) { sparseInfo[i * 2] = indices[i]; sparseInfo[(i * 2) + 1] = values[i]; } pointers[component] = sparseInfo; sparse[component] = true; copyOnWrite[component] = false; } }
class class_name[name] begin[{] method[setSparseComponent, return_type[void], modifier[public], parameter[component, indices, values]] begin[{] if[binary_operation[member[.component], >=, member[pointers.length]]] begin[{] call[.increaseSizeTo, parameter[binary_operation[member[.component], +, literal[1]]]] else begin[{] None end[}] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=indices, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[]), operator===), label=None, value=None) if[binary_operation[member[indices.length], ==, literal[0]]] begin[{] assign[member[.pointers], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] assign[member[.sparse], literal[true]] assign[member[.copyOnWrite], literal[false]] else begin[{] local_variable[type[double], sparseInfo] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sparseInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*))]), type==, value=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sparseInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=indices, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.pointers], member[.sparseInfo]] assign[member[.sparse], literal[true]] assign[member[.copyOnWrite], literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSparseComponent] operator[SEP] Keyword[int] identifier[component] , Keyword[int] operator[SEP] operator[SEP] identifier[indices] , Keyword[double] operator[SEP] operator[SEP] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[component] operator[>=] identifier[pointers] operator[SEP] identifier[length] operator[SEP] { identifier[increaseSizeTo] operator[SEP] identifier[component] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[assert] operator[SEP] identifier[indices] operator[SEP] identifier[length] operator[==] identifier[values] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[indices] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[pointers] operator[SEP] identifier[component] operator[SEP] operator[=] Keyword[new] Keyword[double] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[sparse] operator[SEP] identifier[component] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[copyOnWrite] operator[SEP] identifier[component] operator[SEP] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[double] operator[SEP] operator[SEP] identifier[sparseInfo] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[indices] operator[SEP] identifier[length] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[indices] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sparseInfo] operator[SEP] identifier[i] operator[*] Other[2] operator[SEP] operator[=] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[sparseInfo] operator[SEP] operator[SEP] identifier[i] operator[*] Other[2] operator[SEP] operator[+] Other[1] operator[SEP] operator[=] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[pointers] operator[SEP] identifier[component] operator[SEP] operator[=] identifier[sparseInfo] operator[SEP] identifier[sparse] operator[SEP] identifier[component] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[copyOnWrite] operator[SEP] identifier[component] operator[SEP] operator[=] literal[boolean] operator[SEP] } }
protected void resumeFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception { //get job Job job=faxJob.getHylaFaxJob(); //get job ID long faxJobID=job.getId(); //resume job client.retry(faxJobID); }
class class_name[name] begin[{] method[resumeFaxJob, return_type[void], modifier[protected], parameter[faxJob, client]] begin[{] local_variable[type[Job], job] local_variable[type[long], faxJobID] call[client.retry, parameter[member[.faxJobID]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[resumeFaxJob] operator[SEP] identifier[HylaFaxJob] identifier[faxJob] , identifier[HylaFAXClient] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Job] identifier[job] operator[=] identifier[faxJob] operator[SEP] identifier[getHylaFaxJob] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[faxJobID] operator[=] identifier[job] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[retry] operator[SEP] identifier[faxJobID] operator[SEP] operator[SEP] }
public void updateLastSeenUniqueIds(VoltMessage message) { long sequenceWithUniqueId = Long.MIN_VALUE; boolean commandLog = (message instanceof TransactionInfoBaseMessage && (((TransactionInfoBaseMessage)message).isForReplay())); boolean sentinel = message instanceof MultiPartitionParticipantMessage; // if replay if (commandLog || sentinel) { sequenceWithUniqueId = ((TransactionInfoBaseMessage)message).getUniqueId(); // Update last seen and last polled txnId for replicas m_replaySequencer.updateLastSeenUniqueId(sequenceWithUniqueId, (TransactionInfoBaseMessage) message); m_replaySequencer.updateLastPolledUniqueId(sequenceWithUniqueId, (TransactionInfoBaseMessage) message); } }
class class_name[name] begin[{] method[updateLastSeenUniqueIds, return_type[void], modifier[public], parameter[message]] begin[{] local_variable[type[long], sequenceWithUniqueId] local_variable[type[boolean], commandLog] local_variable[type[boolean], sentinel] if[binary_operation[member[.commandLog], ||, member[.sentinel]]] begin[{] assign[member[.sequenceWithUniqueId], Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TransactionInfoBaseMessage, sub_type=None))] call[m_replaySequencer.updateLastSeenUniqueId, parameter[member[.sequenceWithUniqueId], Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TransactionInfoBaseMessage, sub_type=None))]] call[m_replaySequencer.updateLastPolledUniqueId, parameter[member[.sequenceWithUniqueId], Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TransactionInfoBaseMessage, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[updateLastSeenUniqueIds] operator[SEP] identifier[VoltMessage] identifier[message] operator[SEP] { Keyword[long] identifier[sequenceWithUniqueId] operator[=] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[SEP] Keyword[boolean] identifier[commandLog] operator[=] operator[SEP] identifier[message] Keyword[instanceof] identifier[TransactionInfoBaseMessage] operator[&&] operator[SEP] operator[SEP] operator[SEP] identifier[TransactionInfoBaseMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[isForReplay] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[sentinel] operator[=] identifier[message] Keyword[instanceof] identifier[MultiPartitionParticipantMessage] operator[SEP] Keyword[if] operator[SEP] identifier[commandLog] operator[||] identifier[sentinel] operator[SEP] { identifier[sequenceWithUniqueId] operator[=] operator[SEP] operator[SEP] identifier[TransactionInfoBaseMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[getUniqueId] operator[SEP] operator[SEP] operator[SEP] identifier[m_replaySequencer] operator[SEP] identifier[updateLastSeenUniqueId] operator[SEP] identifier[sequenceWithUniqueId] , operator[SEP] identifier[TransactionInfoBaseMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[m_replaySequencer] operator[SEP] identifier[updateLastPolledUniqueId] operator[SEP] identifier[sequenceWithUniqueId] , operator[SEP] identifier[TransactionInfoBaseMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] } }
public static <T> void invoke(String expression, QueryExprInvoker<T> invoker, ExprApplier<T> exprApplier) { QueryExprInvoker.invoke(parse(expression), invoker, exprApplier); }
class class_name[name] begin[{] method[invoke, return_type[void], modifier[public static], parameter[expression, invoker, exprApplier]] begin[{] call[QueryExprInvoker.invoke, parameter[call[.parse, parameter[member[.expression]]], member[.invoker], member[.exprApplier]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[void] identifier[invoke] operator[SEP] identifier[String] identifier[expression] , identifier[QueryExprInvoker] operator[<] identifier[T] operator[>] identifier[invoker] , identifier[ExprApplier] operator[<] identifier[T] operator[>] identifier[exprApplier] operator[SEP] { identifier[QueryExprInvoker] operator[SEP] identifier[invoke] operator[SEP] identifier[parse] operator[SEP] identifier[expression] operator[SEP] , identifier[invoker] , identifier[exprApplier] operator[SEP] operator[SEP] }
@Override public ORecordIteratorClusters<REC> last() { currentClusterIdx = clusterIds.length - 1; current.clusterPosition = liveUpdated ? database.countClusterElements(clusterIds[currentClusterIdx]) : lastClusterPosition + 1; return this; }
class class_name[name] begin[{] method[last, return_type[type[ORecordIteratorClusters]], modifier[public], parameter[]] begin[{] assign[member[.currentClusterIdx], binary_operation[member[clusterIds.length], -, literal[1]]] assign[member[current.clusterPosition], TernaryExpression(condition=MemberReference(member=liveUpdated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=BinaryOperation(operandl=MemberReference(member=lastClusterPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), if_true=MethodInvocation(arguments=[MemberReference(member=clusterIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=currentClusterIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=countClusterElements, postfix_operators=[], prefix_operators=[], qualifier=database, selectors=[], type_arguments=None))] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ORecordIteratorClusters] operator[<] identifier[REC] operator[>] identifier[last] operator[SEP] operator[SEP] { identifier[currentClusterIdx] operator[=] identifier[clusterIds] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[current] operator[SEP] identifier[clusterPosition] operator[=] identifier[liveUpdated] operator[?] identifier[database] operator[SEP] identifier[countClusterElements] operator[SEP] identifier[clusterIds] operator[SEP] identifier[currentClusterIdx] operator[SEP] operator[SEP] operator[:] identifier[lastClusterPosition] operator[+] Other[1] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static int getIsolationLevel(Object obj) { Class c = ProxyHelper.getRealClass(obj); int isolationLevel = IsolationLevels.IL_READ_UNCOMMITTED; try { ClassDescriptor cld = TxManagerFactory.instance().getCurrentTransaction().getBroker().getClassDescriptor(c); isolationLevel = cld.getIsolationLevel(); } catch (PersistenceBrokerException e) { LoggerFactory.getDefaultLogger().error("[LockStrategyFactory] Can't detect locking isolation level", e); } return isolationLevel; }
class class_name[name] begin[{] method[getIsolationLevel, return_type[type[int]], modifier[public static], parameter[obj]] begin[{] local_variable[type[Class], c] local_variable[type[int], isolationLevel] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=TxManagerFactory, selectors=[MethodInvocation(arguments=[], member=getCurrentTransaction, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getBroker, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClassDescriptor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=cld)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassDescriptor, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isolationLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getIsolationLevel, postfix_operators=[], prefix_operators=[], qualifier=cld, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefaultLogger, postfix_operators=[], prefix_operators=[], qualifier=LoggerFactory, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[LockStrategyFactory] Can't detect locking isolation level"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PersistenceBrokerException']))], finally_block=None, label=None, resources=None) return[member[.isolationLevel]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getIsolationLevel] operator[SEP] identifier[Object] identifier[obj] operator[SEP] { identifier[Class] identifier[c] operator[=] identifier[ProxyHelper] operator[SEP] identifier[getRealClass] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[int] identifier[isolationLevel] operator[=] identifier[IsolationLevels] operator[SEP] identifier[IL_READ_UNCOMMITTED] operator[SEP] Keyword[try] { identifier[ClassDescriptor] identifier[cld] operator[=] identifier[TxManagerFactory] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[getBroker] operator[SEP] operator[SEP] operator[SEP] identifier[getClassDescriptor] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[isolationLevel] operator[=] identifier[cld] operator[SEP] identifier[getIsolationLevel] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PersistenceBrokerException] identifier[e] operator[SEP] { identifier[LoggerFactory] operator[SEP] identifier[getDefaultLogger] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[isolationLevel] operator[SEP] }
private List<AssignmentField> getAllAssignmentExtendedAttributes() { ArrayList<AssignmentField> result = new ArrayList<AssignmentField>(); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_COST)); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_DATE)); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_DURATION)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_COST)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_DATE)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_DURATION)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_FLAG)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_NUMBER)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_RESOURCE_MULTI_VALUE)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_RESOURCE_OUTLINE_CODE)); result.addAll(Arrays.asList(AssignmentFieldLists.ENTERPRISE_TEXT)); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_FINISH)); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_FLAG)); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_NUMBER)); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_START)); result.addAll(Arrays.asList(AssignmentFieldLists.CUSTOM_TEXT)); return result; }
class class_name[name] begin[{] method[getAllAssignmentExtendedAttributes, return_type[type[List]], modifier[private], parameter[]] begin[{] local_variable[type[ArrayList], result] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_COST]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_DATE]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_DURATION]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_COST]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_DATE]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_DURATION]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_FLAG]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_NUMBER]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_RESOURCE_MULTI_VALUE]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_RESOURCE_OUTLINE_CODE]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.ENTERPRISE_TEXT]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_FINISH]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_FLAG]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_NUMBER]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_START]]]]] call[result.addAll, parameter[call[Arrays.asList, parameter[member[AssignmentFieldLists.CUSTOM_TEXT]]]]] return[member[.result]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[AssignmentField] operator[>] identifier[getAllAssignmentExtendedAttributes] operator[SEP] operator[SEP] { identifier[ArrayList] operator[<] identifier[AssignmentField] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[AssignmentField] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_COST] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_DATE] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_DURATION] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_COST] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_DATE] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_DURATION] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_FLAG] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_NUMBER] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_RESOURCE_MULTI_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_RESOURCE_OUTLINE_CODE] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_TEXT] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_FINISH] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_FLAG] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_NUMBER] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_START] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[CUSTOM_TEXT] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public Stream<T> orderedNodes() { TopoSorter<T> sorter = new TopoSorter<>(this); return sorter.result.stream(); }
class class_name[name] begin[{] method[orderedNodes, return_type[type[Stream]], modifier[public], parameter[]] begin[{] local_variable[type[TopoSorter], sorter] return[call[sorter.result.stream, parameter[]]] end[}] END[}]
Keyword[public] identifier[Stream] operator[<] identifier[T] operator[>] identifier[orderedNodes] operator[SEP] operator[SEP] { identifier[TopoSorter] operator[<] identifier[T] operator[>] identifier[sorter] operator[=] Keyword[new] identifier[TopoSorter] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[sorter] operator[SEP] identifier[result] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] }
protected boolean exportWithMinimalMetaData(String path) { String checkPath = path.startsWith("/") ? path + "/" : "/" + path + "/"; for (String p : m_parameters.getResourcesToExportWithMetaData()) { if (checkPath.startsWith(p)) { return false; } } return true; }
class class_name[name] begin[{] method[exportWithMinimalMetaData, return_type[type[boolean]], modifier[protected], parameter[path]] begin[{] local_variable[type[String], checkPath] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=checkPath, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getResourcesToExportWithMetaData, postfix_operators=[], prefix_operators=[], qualifier=m_parameters, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[true]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[exportWithMinimalMetaData] operator[SEP] identifier[String] identifier[path] operator[SEP] { identifier[String] identifier[checkPath] operator[=] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[?] identifier[path] operator[+] literal[String] operator[:] literal[String] operator[+] identifier[path] operator[+] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[p] operator[:] identifier[m_parameters] operator[SEP] identifier[getResourcesToExportWithMetaData] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[checkPath] operator[SEP] identifier[startsWith] operator[SEP] identifier[p] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
private void translateTypeDeclaration(WyilFile.Decl.Type declaration) { WyilFile.Tuple<WyilFile.Expr> invariants = declaration.getInvariant(); WyalFile.Stmt.Block[] invariant = new WyalFile.Stmt.Block[invariants.size()]; WyalFile.Type type = convert(declaration.getType(), declaration); WyalFile.VariableDeclaration var; if (invariants.size() > 0) { WyilFile.Decl.Variable v = declaration.getVariableDeclaration(); // First, translate the invariant (if applicable) GlobalEnvironment globalEnvironment = new GlobalEnvironment(declaration); LocalEnvironment localEnvironment = new LocalEnvironment(globalEnvironment); var = localEnvironment.read(v); for (int i = 0; i != invariant.length; ++i) { invariant[i] = translateAsBlock(invariants.get(i), localEnvironment); } } else { var = new WyalFile.VariableDeclaration(type, new WyalFile.Identifier("self")); } // Done Name name = declaration.getQualifiedName().toName(); WyalFile.Declaration td = new WyalFile.Declaration.Named.Type(name, var, invariant); allocate(td, declaration.getParent(WyilFile.Attribute.Span.class)); }
class class_name[name] begin[{] method[translateTypeDeclaration, return_type[void], modifier[private], parameter[declaration]] begin[{] local_variable[type[WyilFile], invariants] local_variable[type[WyalFile], invariant] local_variable[type[WyalFile], type] local_variable[type[WyalFile], var] if[binary_operation[call[invariants.size, parameter[]], >, literal[0]]] begin[{] local_variable[type[WyilFile], v] local_variable[type[GlobalEnvironment], globalEnvironment] local_variable[type[LocalEnvironment], localEnvironment] assign[member[.var], call[localEnvironment.read, parameter[member[.v]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=invariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=invariants, selectors=[], type_arguments=None), MemberReference(member=localEnvironment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=translateAsBlock, 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=invariant, selectors=[]), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) else begin[{] assign[member[.var], ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="self")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WyalFile, sub_type=ReferenceType(arguments=None, dimensions=None, name=Identifier, sub_type=None)))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WyalFile, sub_type=ReferenceType(arguments=None, dimensions=None, name=VariableDeclaration, sub_type=None)))] end[}] local_variable[type[Name], name] local_variable[type[WyalFile], td] call[.allocate, parameter[member[.td], call[declaration.getParent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=WyilFile.Attribute, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Span, sub_type=None))]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[translateTypeDeclaration] operator[SEP] identifier[WyilFile] operator[SEP] identifier[Decl] operator[SEP] identifier[Type] identifier[declaration] operator[SEP] { identifier[WyilFile] operator[SEP] identifier[Tuple] operator[<] identifier[WyilFile] operator[SEP] identifier[Expr] operator[>] identifier[invariants] operator[=] identifier[declaration] operator[SEP] identifier[getInvariant] operator[SEP] operator[SEP] operator[SEP] identifier[WyalFile] operator[SEP] identifier[Stmt] operator[SEP] identifier[Block] operator[SEP] operator[SEP] identifier[invariant] operator[=] Keyword[new] identifier[WyalFile] operator[SEP] identifier[Stmt] operator[SEP] identifier[Block] operator[SEP] identifier[invariants] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[WyalFile] operator[SEP] identifier[Type] identifier[type] operator[=] identifier[convert] operator[SEP] identifier[declaration] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[declaration] operator[SEP] operator[SEP] identifier[WyalFile] operator[SEP] identifier[VariableDeclaration] identifier[var] operator[SEP] Keyword[if] operator[SEP] identifier[invariants] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[WyilFile] operator[SEP] identifier[Decl] operator[SEP] identifier[Variable] identifier[v] operator[=] identifier[declaration] operator[SEP] identifier[getVariableDeclaration] operator[SEP] operator[SEP] operator[SEP] identifier[GlobalEnvironment] identifier[globalEnvironment] operator[=] Keyword[new] identifier[GlobalEnvironment] operator[SEP] identifier[declaration] operator[SEP] operator[SEP] identifier[LocalEnvironment] identifier[localEnvironment] operator[=] Keyword[new] identifier[LocalEnvironment] operator[SEP] identifier[globalEnvironment] operator[SEP] operator[SEP] identifier[var] operator[=] identifier[localEnvironment] operator[SEP] identifier[read] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[!=] identifier[invariant] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[invariant] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[translateAsBlock] operator[SEP] identifier[invariants] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[localEnvironment] operator[SEP] operator[SEP] } } Keyword[else] { identifier[var] operator[=] Keyword[new] identifier[WyalFile] operator[SEP] identifier[VariableDeclaration] operator[SEP] identifier[type] , Keyword[new] identifier[WyalFile] operator[SEP] identifier[Identifier] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[Name] identifier[name] operator[=] identifier[declaration] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[toName] operator[SEP] operator[SEP] operator[SEP] identifier[WyalFile] operator[SEP] identifier[Declaration] identifier[td] operator[=] Keyword[new] identifier[WyalFile] operator[SEP] identifier[Declaration] operator[SEP] identifier[Named] operator[SEP] identifier[Type] operator[SEP] identifier[name] , identifier[var] , identifier[invariant] operator[SEP] operator[SEP] identifier[allocate] operator[SEP] identifier[td] , identifier[declaration] operator[SEP] identifier[getParent] operator[SEP] identifier[WyilFile] operator[SEP] identifier[Attribute] operator[SEP] identifier[Span] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] }
public static Point2D[] calculateGisModelBulge(Point2D[] newPts, double[] bulges) { Vector ptspol = new Vector(); Point2D init = new Point2D.Double(); Point2D end = new Point2D.Double(); for (int j=0; j<newPts.length; j++) { init = newPts[j]; if (j!=newPts.length-1) end = newPts[j+1]; if (bulges[j]==0 || j==newPts.length-1 || (init.getX()==end.getX() && init.getY()==end.getY())) { ptspol.add(init); } else { ArcFromBulgeCalculator arcCalculator = new ArcFromBulgeCalculator(init, end, bulges[j]); Vector arc = arcCalculator.getPoints(1); if (bulges[j]<0) { for (int k=arc.size()-1; k>=0; k--) { ptspol.add(arc.get(k)); } ptspol.remove(ptspol.size()-1); } else { for (int k=0;k<arc.size();k++) { ptspol.add(arc.get(k)); } ptspol.remove(ptspol.size()-1); } } } Point2D[] points = new Point2D[ptspol.size()]; for (int j=0;j<ptspol.size();j++) { points[j] = (Point2D)ptspol.get(j); } return points; }
class class_name[name] begin[{] method[calculateGisModelBulge, return_type[type[Point2D]], modifier[public static], parameter[newPts, bulges]] begin[{] local_variable[type[Vector], ptspol] local_variable[type[Point2D], init] local_variable[type[Point2D], end] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=init, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newPts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=newPts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newPts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])), label=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bulges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=newPts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=init, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=end, selectors=[], type_arguments=None), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getY, postfix_operators=[], prefix_operators=[], qualifier=init, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getY, postfix_operators=[], prefix_operators=[], qualifier=end, selectors=[], type_arguments=None), operator===), operator=&&), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=init, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bulges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, 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=ArcFromBulgeCalculator, sub_type=None)), name=arcCalculator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ArcFromBulgeCalculator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getPoints, postfix_operators=[], prefix_operators=[], qualifier=arcCalculator, selectors=[], type_arguments=None), name=arc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vector, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bulges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=remove, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=remove, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=init, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=newPts, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[Point2D], points] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Point2D, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=ptspol, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.points]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Point2D] operator[SEP] operator[SEP] identifier[calculateGisModelBulge] operator[SEP] identifier[Point2D] operator[SEP] operator[SEP] identifier[newPts] , Keyword[double] operator[SEP] operator[SEP] identifier[bulges] operator[SEP] { identifier[Vector] identifier[ptspol] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] identifier[Point2D] identifier[init] operator[=] Keyword[new] identifier[Point2D] operator[SEP] identifier[Double] operator[SEP] operator[SEP] operator[SEP] identifier[Point2D] identifier[end] operator[=] Keyword[new] identifier[Point2D] operator[SEP] identifier[Double] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[newPts] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[init] operator[=] identifier[newPts] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[j] operator[!=] identifier[newPts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[end] operator[=] identifier[newPts] operator[SEP] identifier[j] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bulges] operator[SEP] identifier[j] operator[SEP] operator[==] Other[0] operator[||] identifier[j] operator[==] identifier[newPts] operator[SEP] identifier[length] operator[-] Other[1] operator[||] operator[SEP] identifier[init] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[==] identifier[end] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[&&] identifier[init] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[==] identifier[end] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[ptspol] operator[SEP] identifier[add] operator[SEP] identifier[init] operator[SEP] operator[SEP] } Keyword[else] { identifier[ArcFromBulgeCalculator] identifier[arcCalculator] operator[=] Keyword[new] identifier[ArcFromBulgeCalculator] operator[SEP] identifier[init] , identifier[end] , identifier[bulges] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] identifier[Vector] identifier[arc] operator[=] identifier[arcCalculator] operator[SEP] identifier[getPoints] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bulges] operator[SEP] identifier[j] operator[SEP] operator[<] Other[0] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] identifier[arc] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[k] operator[>=] Other[0] operator[SEP] identifier[k] operator[--] operator[SEP] { identifier[ptspol] operator[SEP] identifier[add] operator[SEP] identifier[arc] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP] } identifier[ptspol] operator[SEP] identifier[remove] operator[SEP] identifier[ptspol] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[arc] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[k] operator[++] operator[SEP] { identifier[ptspol] operator[SEP] identifier[add] operator[SEP] identifier[arc] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP] } identifier[ptspol] operator[SEP] identifier[remove] operator[SEP] identifier[ptspol] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } } } identifier[Point2D] operator[SEP] operator[SEP] identifier[points] operator[=] Keyword[new] identifier[Point2D] operator[SEP] identifier[ptspol] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[ptspol] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[points] operator[SEP] identifier[j] operator[SEP] operator[=] operator[SEP] identifier[Point2D] operator[SEP] identifier[ptspol] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] } Keyword[return] identifier[points] operator[SEP] }
@Override public Set<Attribute<X, ?>> getDeclaredAttributes() { Set<Attribute<X, ?>> attributes = new HashSet<Attribute<X, ?>>(); if (declaredSingluarAttribs != null) { attributes.addAll(declaredSingluarAttribs.values()); } if (declaredPluralAttributes != null) { attributes.addAll(declaredPluralAttributes.values()); } return attributes; }
class class_name[name] begin[{] method[getDeclaredAttributes, return_type[type[Set]], modifier[public], parameter[]] begin[{] local_variable[type[Set], attributes] if[binary_operation[member[.declaredSingluarAttribs], !=, literal[null]]] begin[{] call[attributes.addAll, parameter[call[declaredSingluarAttribs.values, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.declaredPluralAttributes], !=, literal[null]]] begin[{] call[attributes.addAll, parameter[call[declaredPluralAttributes.values, parameter[]]]] else begin[{] None end[}] return[member[.attributes]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[Attribute] operator[<] identifier[X] , operator[?] operator[>] operator[>] identifier[getDeclaredAttributes] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[Attribute] operator[<] identifier[X] , operator[?] operator[>] operator[>] identifier[attributes] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Attribute] operator[<] identifier[X] , operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[declaredSingluarAttribs] operator[!=] Other[null] operator[SEP] { identifier[attributes] operator[SEP] identifier[addAll] operator[SEP] identifier[declaredSingluarAttribs] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[declaredPluralAttributes] operator[!=] Other[null] operator[SEP] { identifier[attributes] operator[SEP] identifier[addAll] operator[SEP] identifier[declaredPluralAttributes] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[attributes] operator[SEP] }
private void updateMinimum(Node node) { // Check if a comparator was set. if (entryComparator != null) { // Use the comparator to compare the candidate new minimum with the current one and check if the new one // should be set. if (entryComparator.compare(node.element, minNode.element) < 0) { // Update the minimum node. minNode = node; } } // No comparator was set so use the natural ordering. else { // Cast the candidate new minimum element into a Comparable and compare it with the existing minimum // to check if the new one should be set. if (((Comparable) node.element).compareTo(minNode.element) < 0) { // Update the minimum node. minNode = node; } } }
class class_name[name] begin[{] method[updateMinimum, return_type[void], modifier[private], parameter[node]] begin[{] if[binary_operation[member[.entryComparator], !=, literal[null]]] begin[{] if[binary_operation[call[entryComparator.compare, parameter[member[node.element], member[minNode.element]]], <, literal[0]]] begin[{] assign[member[.minNode], member[.node]] else begin[{] None end[}] else begin[{] if[binary_operation[Cast(expression=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Comparable, sub_type=None)), <, literal[0]]] begin[{] assign[member[.minNode], member[.node]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[updateMinimum] operator[SEP] identifier[Node] identifier[node] operator[SEP] { Keyword[if] operator[SEP] identifier[entryComparator] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[entryComparator] operator[SEP] identifier[compare] operator[SEP] identifier[node] operator[SEP] identifier[element] , identifier[minNode] operator[SEP] identifier[element] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[minNode] operator[=] identifier[node] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[Comparable] operator[SEP] identifier[node] operator[SEP] identifier[element] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[minNode] operator[SEP] identifier[element] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[minNode] operator[=] identifier[node] operator[SEP] } } }
protected void decrementBinaryReferenceCount( Object fieldValue, Set<BinaryKey> unusedBinaryKeys, Set<BinaryKey> usedBinaryKeys) { if (fieldValue instanceof List<?>) { for (Object value : (List<?>)fieldValue) { decrementBinaryReferenceCount(value, unusedBinaryKeys, usedBinaryKeys); } } else if (fieldValue instanceof Object[]) { for (Object value : (Object[])fieldValue) { decrementBinaryReferenceCount(value, unusedBinaryKeys, usedBinaryKeys); } } else { String sha1 = null; if (fieldValue instanceof Document) { Document docValue = (Document)fieldValue; sha1 = docValue.getString(SHA1_FIELD); } else if (fieldValue instanceof BinaryKey) { sha1 = fieldValue.toString(); } else if (fieldValue instanceof org.modeshape.jcr.api.Binary && !(fieldValue instanceof InMemoryBinaryValue)) { sha1 = ((org.modeshape.jcr.api.Binary)fieldValue).getHexHash(); } if (sha1 != null) { BinaryKey binaryKey = new BinaryKey(sha1); // Find the document metadata and decrement the usage count ... // Don't acquire a lock since we should've done so at the beginning of the #save method EditableDocument sha1Usage = documentStore.edit(keyForBinaryReferenceDocument(sha1), false); if (sha1Usage != null) { Long countValue = sha1Usage.getLong(REFERENCE_COUNT); assert countValue != null; long count = countValue - 1; assert count >= 0; if (count == 0) { // We're not using the binary value anymore ... if (unusedBinaryKeys != null) { unusedBinaryKeys.add(binaryKey); } if (usedBinaryKeys != null) { usedBinaryKeys.remove(binaryKey); } } sha1Usage.setNumber(REFERENCE_COUNT, count); } else { // The documentStore doesn't contain the binary ref count doc, so we're no longer using the binary value ... if (unusedBinaryKeys != null) { unusedBinaryKeys.add(binaryKey); } if (usedBinaryKeys != null) { usedBinaryKeys.remove(binaryKey); } } } } }
class class_name[name] begin[{] method[decrementBinaryReferenceCount, return_type[void], modifier[protected], parameter[fieldValue, unusedBinaryKeys, usedBinaryKeys]] begin[{] if[binary_operation[member[.fieldValue], instanceof, type[List]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unusedBinaryKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=usedBinaryKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decrementBinaryReferenceCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=fieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=List, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] if[binary_operation[member[.fieldValue], instanceof, type[Object]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unusedBinaryKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=usedBinaryKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decrementBinaryReferenceCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=fieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] local_variable[type[String], sha1] if[binary_operation[member[.fieldValue], instanceof, type[Document]]] begin[{] local_variable[type[Document], docValue] assign[member[.sha1], call[docValue.getString, parameter[member[.SHA1_FIELD]]]] else begin[{] if[binary_operation[member[.fieldValue], instanceof, type[BinaryKey]]] begin[{] assign[member[.sha1], call[fieldValue.toString, parameter[]]] else begin[{] if[binary_operation[binary_operation[member[.fieldValue], instanceof, type[org]], &&, binary_operation[member[.fieldValue], instanceof, type[InMemoryBinaryValue]]]] begin[{] assign[member[.sha1], Cast(expression=MemberReference(member=fieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=modeshape, sub_type=ReferenceType(arguments=None, dimensions=None, name=jcr, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=Binary, sub_type=None))))))] else begin[{] None end[}] end[}] end[}] if[binary_operation[member[.sha1], !=, literal[null]]] begin[{] local_variable[type[BinaryKey], binaryKey] local_variable[type[EditableDocument], sha1Usage] if[binary_operation[member[.sha1Usage], !=, literal[null]]] begin[{] local_variable[type[Long], countValue] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=countValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) local_variable[type[long], count] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None) if[binary_operation[member[.count], ==, literal[0]]] begin[{] if[binary_operation[member[.unusedBinaryKeys], !=, literal[null]]] begin[{] call[unusedBinaryKeys.add, parameter[member[.binaryKey]]] else begin[{] None end[}] if[binary_operation[member[.usedBinaryKeys], !=, literal[null]]] begin[{] call[usedBinaryKeys.remove, parameter[member[.binaryKey]]] else begin[{] None end[}] else begin[{] None end[}] call[sha1Usage.setNumber, parameter[member[.REFERENCE_COUNT], member[.count]]] else begin[{] if[binary_operation[member[.unusedBinaryKeys], !=, literal[null]]] begin[{] call[unusedBinaryKeys.add, parameter[member[.binaryKey]]] else begin[{] None end[}] if[binary_operation[member[.usedBinaryKeys], !=, literal[null]]] begin[{] call[usedBinaryKeys.remove, parameter[member[.binaryKey]]] else begin[{] None end[}] end[}] else begin[{] None end[}] end[}] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[decrementBinaryReferenceCount] operator[SEP] identifier[Object] identifier[fieldValue] , identifier[Set] operator[<] identifier[BinaryKey] operator[>] identifier[unusedBinaryKeys] , identifier[Set] operator[<] identifier[BinaryKey] operator[>] identifier[usedBinaryKeys] operator[SEP] { Keyword[if] operator[SEP] identifier[fieldValue] Keyword[instanceof] identifier[List] operator[<] operator[?] operator[>] operator[SEP] { Keyword[for] operator[SEP] identifier[Object] identifier[value] operator[:] operator[SEP] identifier[List] operator[<] operator[?] operator[>] operator[SEP] identifier[fieldValue] operator[SEP] { identifier[decrementBinaryReferenceCount] operator[SEP] identifier[value] , identifier[unusedBinaryKeys] , identifier[usedBinaryKeys] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[fieldValue] Keyword[instanceof] identifier[Object] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Object] identifier[value] operator[:] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[fieldValue] operator[SEP] { identifier[decrementBinaryReferenceCount] operator[SEP] identifier[value] , identifier[unusedBinaryKeys] , identifier[usedBinaryKeys] operator[SEP] operator[SEP] } } Keyword[else] { identifier[String] identifier[sha1] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[fieldValue] Keyword[instanceof] identifier[Document] operator[SEP] { identifier[Document] identifier[docValue] operator[=] operator[SEP] identifier[Document] operator[SEP] identifier[fieldValue] operator[SEP] identifier[sha1] operator[=] identifier[docValue] operator[SEP] identifier[getString] operator[SEP] identifier[SHA1_FIELD] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldValue] Keyword[instanceof] identifier[BinaryKey] operator[SEP] { identifier[sha1] operator[=] identifier[fieldValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fieldValue] Keyword[instanceof] identifier[org] operator[SEP] identifier[modeshape] operator[SEP] identifier[jcr] operator[SEP] identifier[api] operator[SEP] identifier[Binary] operator[&&] operator[!] operator[SEP] identifier[fieldValue] Keyword[instanceof] identifier[InMemoryBinaryValue] operator[SEP] operator[SEP] { identifier[sha1] operator[=] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[modeshape] operator[SEP] identifier[jcr] operator[SEP] identifier[api] operator[SEP] identifier[Binary] operator[SEP] identifier[fieldValue] operator[SEP] operator[SEP] identifier[getHexHash] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[sha1] operator[!=] Other[null] operator[SEP] { identifier[BinaryKey] identifier[binaryKey] operator[=] Keyword[new] identifier[BinaryKey] operator[SEP] identifier[sha1] operator[SEP] operator[SEP] identifier[EditableDocument] identifier[sha1Usage] operator[=] identifier[documentStore] operator[SEP] identifier[edit] operator[SEP] identifier[keyForBinaryReferenceDocument] operator[SEP] identifier[sha1] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sha1Usage] operator[!=] Other[null] operator[SEP] { identifier[Long] identifier[countValue] operator[=] identifier[sha1Usage] operator[SEP] identifier[getLong] operator[SEP] identifier[REFERENCE_COUNT] operator[SEP] operator[SEP] Keyword[assert] identifier[countValue] operator[!=] Other[null] operator[SEP] Keyword[long] identifier[count] operator[=] identifier[countValue] operator[-] Other[1] operator[SEP] Keyword[assert] identifier[count] operator[>=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[unusedBinaryKeys] operator[!=] Other[null] operator[SEP] { identifier[unusedBinaryKeys] operator[SEP] identifier[add] operator[SEP] identifier[binaryKey] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[usedBinaryKeys] operator[!=] Other[null] operator[SEP] { identifier[usedBinaryKeys] operator[SEP] identifier[remove] operator[SEP] identifier[binaryKey] operator[SEP] operator[SEP] } } identifier[sha1Usage] operator[SEP] identifier[setNumber] operator[SEP] identifier[REFERENCE_COUNT] , identifier[count] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[unusedBinaryKeys] operator[!=] Other[null] operator[SEP] { identifier[unusedBinaryKeys] operator[SEP] identifier[add] operator[SEP] identifier[binaryKey] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[usedBinaryKeys] operator[!=] Other[null] operator[SEP] { identifier[usedBinaryKeys] operator[SEP] identifier[remove] operator[SEP] identifier[binaryKey] operator[SEP] operator[SEP] } } } } }
public String getCanonicalID() { if (canonicalID == null) { synchronized(this) { if (canonicalID == null) { canonicalID = getCanonicalID(getID()); assert(canonicalID != null); if (canonicalID == null) { // This should never happen... canonicalID = getID(); } } } } return canonicalID; }
class class_name[name] begin[{] method[getCanonicalID, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.canonicalID], ==, literal[null]]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] if[binary_operation[member[.canonicalID], ==, literal[null]]] begin[{] assign[member[.canonicalID], call[.getCanonicalID, parameter[call[.getID, parameter[]]]]] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=canonicalID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) if[binary_operation[member[.canonicalID], ==, literal[null]]] begin[{] assign[member[.canonicalID], call[.getID, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] END[}] else begin[{] None end[}] return[member[.canonicalID]] end[}] END[}]
Keyword[public] identifier[String] identifier[getCanonicalID] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[canonicalID] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[if] operator[SEP] identifier[canonicalID] operator[==] Other[null] operator[SEP] { identifier[canonicalID] operator[=] identifier[getCanonicalID] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[canonicalID] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[canonicalID] operator[==] Other[null] operator[SEP] { identifier[canonicalID] operator[=] identifier[getID] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[return] identifier[canonicalID] operator[SEP] }
public void marshall(Serializer serializer, ProtocolMarshaller protocolMarshaller) { if (serializer == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(serializer.getParquetSerDe(), PARQUETSERDE_BINDING); protocolMarshaller.marshall(serializer.getOrcSerDe(), ORCSERDE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[serializer, protocolMarshaller]] begin[{] if[binary_operation[member[.serializer], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParquetSerDe, postfix_operators=[], prefix_operators=[], qualifier=serializer, selectors=[], type_arguments=None), MemberReference(member=PARQUETSERDE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrcSerDe, postfix_operators=[], prefix_operators=[], qualifier=serializer, selectors=[], type_arguments=None), MemberReference(member=ORCSERDE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[Serializer] identifier[serializer] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[serializer] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[serializer] operator[SEP] identifier[getParquetSerDe] operator[SEP] operator[SEP] , identifier[PARQUETSERDE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[serializer] operator[SEP] identifier[getOrcSerDe] operator[SEP] operator[SEP] , identifier[ORCSERDE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private InputStream decompressBody() { if (!decompress) { return body; } // if has no body, some server still set content-encoding header, // GZIPInputStream wrap empty input stream will cause exception. we should check this if (method.equals(Methods.HEAD) || (statusCode >= 100 && statusCode < 200) || statusCode == NOT_MODIFIED || statusCode == NO_CONTENT) { return body; } String contentEncoding = headers.getHeader(NAME_CONTENT_ENCODING); if (contentEncoding == null) { return body; } //we should remove the content-encoding header here? switch (contentEncoding) { case "gzip": try { return new GZIPInputStream(body); } catch (IOException e) { Closeables.closeQuietly(body); throw new RequestsException(e); } case "deflate": // Note: deflate implements may or may not wrap in zlib due to rfc confusing. // here deal with deflate without zlib header return new InflaterInputStream(body, new Inflater(true)); case "identity": case "compress": //historic; deprecated in most applications and replaced by gzip or deflate default: return body; } }
class class_name[name] begin[{] method[decompressBody, return_type[type[InputStream]], modifier[private], parameter[]] begin[{] if[member[.decompress]] begin[{] return[member[.body]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[call[method.equals, parameter[member[Methods.HEAD]]], ||, binary_operation[binary_operation[member[.statusCode], >=, literal[100]], &&, binary_operation[member[.statusCode], <, literal[200]]]], ||, binary_operation[member[.statusCode], ==, member[.NOT_MODIFIED]]], ||, binary_operation[member[.statusCode], ==, member[.NO_CONTENT]]]] begin[{] return[member[.body]] else begin[{] None end[}] local_variable[type[String], contentEncoding] if[binary_operation[member[.contentEncoding], ==, literal[null]]] begin[{] return[member[.body]] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="gzip")], statements=[TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GZIPInputStream, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=Closeables, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RequestsException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="deflate")], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Inflater, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InflaterInputStream, sub_type=None)), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="identity"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="compress")], statements=[ReturnStatement(expression=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MemberReference(member=contentEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[private] identifier[InputStream] identifier[decompressBody] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[decompress] operator[SEP] { Keyword[return] identifier[body] operator[SEP] } Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[equals] operator[SEP] identifier[Methods] operator[SEP] identifier[HEAD] operator[SEP] operator[||] operator[SEP] identifier[statusCode] operator[>=] Other[100] operator[&&] identifier[statusCode] operator[<] Other[200] operator[SEP] operator[||] identifier[statusCode] operator[==] identifier[NOT_MODIFIED] operator[||] identifier[statusCode] operator[==] identifier[NO_CONTENT] operator[SEP] { Keyword[return] identifier[body] operator[SEP] } identifier[String] identifier[contentEncoding] operator[=] identifier[headers] operator[SEP] identifier[getHeader] operator[SEP] identifier[NAME_CONTENT_ENCODING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contentEncoding] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[body] operator[SEP] } Keyword[switch] operator[SEP] identifier[contentEncoding] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[try] { Keyword[return] Keyword[new] identifier[GZIPInputStream] operator[SEP] identifier[body] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[Closeables] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[body] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RequestsException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[case] literal[String] operator[:] Keyword[return] Keyword[new] identifier[InflaterInputStream] operator[SEP] identifier[body] , Keyword[new] identifier[Inflater] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[default] operator[:] Keyword[return] identifier[body] operator[SEP] } }
public static Reader reader(final Version version) { return new Reader(GPX.xmlReader(version), Mode.STRICT); }
class class_name[name] begin[{] method[reader, return_type[type[Reader]], modifier[public static], parameter[version]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=xmlReader, postfix_operators=[], prefix_operators=[], qualifier=GPX, selectors=[], type_arguments=None), MemberReference(member=STRICT, postfix_operators=[], prefix_operators=[], qualifier=Mode, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Reader, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Reader] identifier[reader] operator[SEP] Keyword[final] identifier[Version] identifier[version] operator[SEP] { Keyword[return] Keyword[new] identifier[Reader] operator[SEP] identifier[GPX] operator[SEP] identifier[xmlReader] operator[SEP] identifier[version] operator[SEP] , identifier[Mode] operator[SEP] identifier[STRICT] operator[SEP] operator[SEP] }
public Method findMethod(Object candidate) { Assert.notNull(candidate, "candidate object must not be null"); Class<?> targetClass = AopUtils.getTargetClass(candidate); if (targetClass == null) { targetClass = candidate.getClass(); } return this.findMethod(targetClass); }
class class_name[name] begin[{] method[findMethod, return_type[type[Method]], modifier[public], parameter[candidate]] begin[{] call[Assert.notNull, parameter[member[.candidate], literal["candidate object must not be null"]]] local_variable[type[Class], targetClass] if[binary_operation[member[.targetClass], ==, literal[null]]] begin[{] assign[member[.targetClass], call[candidate.getClass, parameter[]]] else begin[{] None end[}] return[THIS[call[None.findMethod, parameter[member[.targetClass]]]]] end[}] END[}]
Keyword[public] identifier[Method] identifier[findMethod] operator[SEP] identifier[Object] identifier[candidate] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[candidate] , literal[String] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[targetClass] operator[=] identifier[AopUtils] operator[SEP] identifier[getTargetClass] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetClass] operator[==] Other[null] operator[SEP] { identifier[targetClass] operator[=] identifier[candidate] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[findMethod] operator[SEP] identifier[targetClass] operator[SEP] operator[SEP] }
public static boolean isLocalContactUri(Uri uri) { return isLocalContentUri(uri) && ContactsContract.AUTHORITY.equals(uri.getAuthority()) && !uri.getPath().startsWith(LOCAL_CONTACT_IMAGE_URI.getPath()); }
class class_name[name] begin[{] method[isLocalContactUri, return_type[type[boolean]], modifier[public static], parameter[uri]] begin[{] return[binary_operation[binary_operation[call[.isLocalContentUri, parameter[member[.uri]]], &&, call[ContactsContract.AUTHORITY.equals, parameter[call[uri.getAuthority, parameter[]]]]], &&, call[uri.getPath, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isLocalContactUri] operator[SEP] identifier[Uri] identifier[uri] operator[SEP] { Keyword[return] identifier[isLocalContentUri] operator[SEP] identifier[uri] operator[SEP] operator[&&] identifier[ContactsContract] operator[SEP] identifier[AUTHORITY] operator[SEP] identifier[equals] operator[SEP] identifier[uri] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[uri] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[LOCAL_CONTACT_IMAGE_URI] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE(String serviceName, String namespaceId, String imageId, String permissionId) throws IOException { String qPath = "/caas/registry/{serviceName}/namespaces/{namespaceId}/images/{imageId}/permissions/{permissionId}"; StringBuilder sb = path(qPath, serviceName, namespaceId, imageId, permissionId); exec(qPath, "DELETE", sb.toString(), null); }
class class_name[name] begin[{] method[serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE, return_type[void], modifier[public], parameter[serviceName, namespaceId, imageId, permissionId]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.exec, parameter[member[.qPath], literal["DELETE"], call[sb.toString, parameter[]], literal[null]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[namespaceId] , identifier[String] identifier[imageId] , identifier[String] identifier[permissionId] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[namespaceId] , identifier[imageId] , identifier[permissionId] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] }
private void build(Subroutine subroutine) throws CFGBuilderException { // Prime the work list subroutine.addEdgeAndExplore(subroutine.getEntry(), subroutine.getStartInstruction(), START_EDGE); // Keep going until all basic blocks in the subroutine have been added while (subroutine.hasMoreWork()) { WorkListItem item = subroutine.nextItem(); InstructionHandle handle = item.getStartInstruction(); BasicBlock basicBlock = item.getBasicBlock(); // Add exception handler block (ETB) for exception-throwing // instructions if (isPEI(handle)) { if (DEBUG) { System.out.println("ETB block " + basicBlock.getLabel() + " for " + handle); } handleExceptions(subroutine, handle, basicBlock); BasicBlock body = subroutine.allocateBasicBlock(); subroutine.addEdge(basicBlock, body, FALL_THROUGH_EDGE); basicBlock = body; } if (DEBUG) { System.out.println("BODY block " + basicBlock.getLabel() + " for " + handle); } if (!basicBlock.isEmpty()) { throw new IllegalStateException("Block isn't empty!"); } // Add instructions until we get to the end of the block boolean endOfBasicBlock = false; do { Instruction ins = handle.getInstruction(); // Add the instruction to the block if (DEBUG) { System.out.println("BB " + basicBlock.getLabel() + ": adding" + handle); } basicBlock.addInstruction(handle); subroutine.addInstruction(handle); short opcode = ins.getOpcode(); // TODO: should check instruction to ensure that in a JSR // subroutine // no assignments are made to the local containing the return // address. // if (ins instanceof ASTORE) ... if (opcode == Const.JSR || opcode == Const.JSR_W) { // Find JSR subroutine, add it to subroutine work list if // we haven't built a CFG for it yet JsrInstruction jsr = (JsrInstruction) ins; InstructionHandle jsrTarget = jsr.getTarget(); Subroutine jsrSubroutine = jsrSubroutineMap.get(jsrTarget); if (jsrSubroutine == null) { jsrSubroutine = new Subroutine(jsrTarget); jsrSubroutineMap.put(jsrTarget, jsrSubroutine); subroutineWorkList.add(jsrSubroutine); } // This ends the basic block. // Add a JSR_EDGE to the successor. // It will be replaced later by the inlined JSR subroutine. subroutine.addEdgeAndExplore(basicBlock, handle.getNext(), JSR_EDGE); endOfBasicBlock = true; } else if (opcode == Const.RET) { // End of JSR subroutine subroutine.addEdge(basicBlock, subroutine.getExit(), RET_EDGE); endOfBasicBlock = true; } else { TargetEnumeratingVisitor visitor = new TargetEnumeratingVisitor(handle, cpg); if (visitor.isEndOfBasicBlock()) { endOfBasicBlock = true; // Add control edges as appropriate if (visitor.instructionIsThrow()) { handleExceptions(subroutine, handle, basicBlock); } else if (visitor.instructionIsExit()) { subroutine.setExitBlock(basicBlock); } else if (visitor.instructionIsReturn()) { subroutine.setReturnBlock(basicBlock); } else { Iterator<Target> i = visitor.targetIterator(); while (i.hasNext()) { Target target = i.next(); subroutine.addEdgeAndExplore(basicBlock, target.getTargetInstruction(), target.getEdgeType()); } } } } if (!endOfBasicBlock) { InstructionHandle next = handle.getNext(); if (next == null) { throw new CFGBuilderException("Control falls off end of method: " + handle); } // Is the next instruction a control merge or a PEI? if (isMerge(next) || isPEI(next)) { subroutine.addEdgeAndExplore(basicBlock, next, FALL_THROUGH_EDGE); endOfBasicBlock = true; } else { // Basic block continues handle = next; } } } while (!endOfBasicBlock); } }
class class_name[name] begin[{] method[build, return_type[void], modifier[private], parameter[subroutine]] begin[{] call[subroutine.addEdgeAndExplore, parameter[call[subroutine.getEntry, parameter[]], call[subroutine.getStartInstruction, parameter[]], member[.START_EDGE]]] while[call[subroutine.hasMoreWork, parameter[]]] begin[{] local_variable[type[WorkListItem], item] local_variable[type[InstructionHandle], handle] local_variable[type[BasicBlock], basicBlock] if[call[.isPEI, parameter[member[.handle]]]] begin[{] if[member[.DEBUG]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["ETB block "], +, call[basicBlock.getLabel, parameter[]]], +, literal[" for "]], +, member[.handle]]]] else begin[{] None end[}] call[.handleExceptions, parameter[member[.subroutine], member[.handle], member[.basicBlock]]] local_variable[type[BasicBlock], body] call[subroutine.addEdge, parameter[member[.basicBlock], member[.body], member[.FALL_THROUGH_EDGE]]] assign[member[.basicBlock], member[.body]] else begin[{] None end[}] if[member[.DEBUG]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["BODY block "], +, call[basicBlock.getLabel, parameter[]]], +, literal[" for "]], +, member[.handle]]]] else begin[{] None end[}] if[call[basicBlock.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Block isn't empty!")], 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[}] local_variable[type[boolean], endOfBasicBlock] do[member[.endOfBasicBlock]] begin[{] local_variable[type[Instruction], ins] if[member[.DEBUG]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["BB "], +, call[basicBlock.getLabel, parameter[]]], +, literal[": adding"]], +, member[.handle]]]] else begin[{] None end[}] call[basicBlock.addInstruction, parameter[member[.handle]]] call[subroutine.addInstruction, parameter[member[.handle]]] local_variable[type[short], opcode] if[binary_operation[binary_operation[member[.opcode], ==, member[Const.JSR]], ||, binary_operation[member[.opcode], ==, member[Const.JSR_W]]]] begin[{] local_variable[type[JsrInstruction], jsr] local_variable[type[InstructionHandle], jsrTarget] local_variable[type[Subroutine], jsrSubroutine] if[binary_operation[member[.jsrSubroutine], ==, literal[null]]] begin[{] assign[member[.jsrSubroutine], ClassCreator(arguments=[MemberReference(member=jsrTarget, 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=Subroutine, sub_type=None))] call[jsrSubroutineMap.put, parameter[member[.jsrTarget], member[.jsrSubroutine]]] call[subroutineWorkList.add, parameter[member[.jsrSubroutine]]] else begin[{] None end[}] call[subroutine.addEdgeAndExplore, parameter[member[.basicBlock], call[handle.getNext, parameter[]], member[.JSR_EDGE]]] assign[member[.endOfBasicBlock], literal[true]] else begin[{] if[binary_operation[member[.opcode], ==, member[Const.RET]]] begin[{] call[subroutine.addEdge, parameter[member[.basicBlock], call[subroutine.getExit, parameter[]], member[.RET_EDGE]]] assign[member[.endOfBasicBlock], literal[true]] else begin[{] local_variable[type[TargetEnumeratingVisitor], visitor] if[call[visitor.isEndOfBasicBlock, parameter[]]] begin[{] assign[member[.endOfBasicBlock], literal[true]] if[call[visitor.instructionIsThrow, parameter[]]] begin[{] call[.handleExceptions, parameter[member[.subroutine], member[.handle], member[.basicBlock]]] else begin[{] if[call[visitor.instructionIsExit, parameter[]]] begin[{] call[subroutine.setExitBlock, parameter[member[.basicBlock]]] else begin[{] if[call[visitor.instructionIsReturn, parameter[]]] begin[{] call[subroutine.setReturnBlock, parameter[member[.basicBlock]]] else begin[{] local_variable[type[Iterator], i] while[call[i.hasNext, parameter[]]] begin[{] local_variable[type[Target], target] call[subroutine.addEdgeAndExplore, parameter[member[.basicBlock], call[target.getTargetInstruction, parameter[]], call[target.getEdgeType, parameter[]]]] end[}] end[}] end[}] end[}] else begin[{] None end[}] end[}] end[}] if[member[.endOfBasicBlock]] begin[{] local_variable[type[InstructionHandle], next] if[binary_operation[member[.next], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Control falls off end of method: "), operandr=MemberReference(member=handle, 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=CFGBuilderException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[.isMerge, parameter[member[.next]]], ||, call[.isPEI, parameter[member[.next]]]]] begin[{] call[subroutine.addEdgeAndExplore, parameter[member[.basicBlock], member[.next], member[.FALL_THROUGH_EDGE]]] assign[member[.endOfBasicBlock], literal[true]] else begin[{] assign[member[.handle], member[.next]] end[}] else begin[{] None end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[build] operator[SEP] identifier[Subroutine] identifier[subroutine] operator[SEP] Keyword[throws] identifier[CFGBuilderException] { identifier[subroutine] operator[SEP] identifier[addEdgeAndExplore] operator[SEP] identifier[subroutine] operator[SEP] identifier[getEntry] operator[SEP] operator[SEP] , identifier[subroutine] operator[SEP] identifier[getStartInstruction] operator[SEP] operator[SEP] , identifier[START_EDGE] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[subroutine] operator[SEP] identifier[hasMoreWork] operator[SEP] operator[SEP] operator[SEP] { identifier[WorkListItem] identifier[item] operator[=] identifier[subroutine] operator[SEP] identifier[nextItem] operator[SEP] operator[SEP] operator[SEP] identifier[InstructionHandle] identifier[handle] operator[=] identifier[item] operator[SEP] identifier[getStartInstruction] operator[SEP] operator[SEP] operator[SEP] identifier[BasicBlock] identifier[basicBlock] operator[=] identifier[item] operator[SEP] identifier[getBasicBlock] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPEI] operator[SEP] identifier[handle] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[basicBlock] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[handle] operator[SEP] operator[SEP] } identifier[handleExceptions] operator[SEP] identifier[subroutine] , identifier[handle] , identifier[basicBlock] operator[SEP] operator[SEP] identifier[BasicBlock] identifier[body] operator[=] identifier[subroutine] operator[SEP] identifier[allocateBasicBlock] operator[SEP] operator[SEP] operator[SEP] identifier[subroutine] operator[SEP] identifier[addEdge] operator[SEP] identifier[basicBlock] , identifier[body] , identifier[FALL_THROUGH_EDGE] operator[SEP] operator[SEP] identifier[basicBlock] operator[=] identifier[body] operator[SEP] } Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[basicBlock] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[handle] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[basicBlock] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[boolean] identifier[endOfBasicBlock] operator[=] literal[boolean] operator[SEP] Keyword[do] { identifier[Instruction] identifier[ins] operator[=] identifier[handle] operator[SEP] identifier[getInstruction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[basicBlock] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[handle] operator[SEP] operator[SEP] } identifier[basicBlock] operator[SEP] identifier[addInstruction] operator[SEP] identifier[handle] operator[SEP] operator[SEP] identifier[subroutine] operator[SEP] identifier[addInstruction] operator[SEP] identifier[handle] operator[SEP] operator[SEP] Keyword[short] identifier[opcode] operator[=] identifier[ins] operator[SEP] identifier[getOpcode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[opcode] operator[==] identifier[Const] operator[SEP] identifier[JSR] operator[||] identifier[opcode] operator[==] identifier[Const] operator[SEP] identifier[JSR_W] operator[SEP] { identifier[JsrInstruction] identifier[jsr] operator[=] operator[SEP] identifier[JsrInstruction] operator[SEP] identifier[ins] operator[SEP] identifier[InstructionHandle] identifier[jsrTarget] operator[=] identifier[jsr] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] identifier[Subroutine] identifier[jsrSubroutine] operator[=] identifier[jsrSubroutineMap] operator[SEP] identifier[get] operator[SEP] identifier[jsrTarget] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsrSubroutine] operator[==] Other[null] operator[SEP] { identifier[jsrSubroutine] operator[=] Keyword[new] identifier[Subroutine] operator[SEP] identifier[jsrTarget] operator[SEP] operator[SEP] identifier[jsrSubroutineMap] operator[SEP] identifier[put] operator[SEP] identifier[jsrTarget] , identifier[jsrSubroutine] operator[SEP] operator[SEP] identifier[subroutineWorkList] operator[SEP] identifier[add] operator[SEP] identifier[jsrSubroutine] operator[SEP] operator[SEP] } identifier[subroutine] operator[SEP] identifier[addEdgeAndExplore] operator[SEP] identifier[basicBlock] , identifier[handle] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] , identifier[JSR_EDGE] operator[SEP] operator[SEP] identifier[endOfBasicBlock] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[opcode] operator[==] identifier[Const] operator[SEP] identifier[RET] operator[SEP] { identifier[subroutine] operator[SEP] identifier[addEdge] operator[SEP] identifier[basicBlock] , identifier[subroutine] operator[SEP] identifier[getExit] operator[SEP] operator[SEP] , identifier[RET_EDGE] operator[SEP] operator[SEP] identifier[endOfBasicBlock] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[TargetEnumeratingVisitor] identifier[visitor] operator[=] Keyword[new] identifier[TargetEnumeratingVisitor] operator[SEP] identifier[handle] , identifier[cpg] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[visitor] operator[SEP] identifier[isEndOfBasicBlock] operator[SEP] operator[SEP] operator[SEP] { identifier[endOfBasicBlock] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[visitor] operator[SEP] identifier[instructionIsThrow] operator[SEP] operator[SEP] operator[SEP] { identifier[handleExceptions] operator[SEP] identifier[subroutine] , identifier[handle] , identifier[basicBlock] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[visitor] operator[SEP] identifier[instructionIsExit] operator[SEP] operator[SEP] operator[SEP] { identifier[subroutine] operator[SEP] identifier[setExitBlock] operator[SEP] identifier[basicBlock] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[visitor] operator[SEP] identifier[instructionIsReturn] operator[SEP] operator[SEP] operator[SEP] { identifier[subroutine] operator[SEP] identifier[setReturnBlock] operator[SEP] identifier[basicBlock] operator[SEP] operator[SEP] } Keyword[else] { identifier[Iterator] operator[<] identifier[Target] operator[>] identifier[i] operator[=] identifier[visitor] operator[SEP] identifier[targetIterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Target] identifier[target] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[subroutine] operator[SEP] identifier[addEdgeAndExplore] operator[SEP] identifier[basicBlock] , identifier[target] operator[SEP] identifier[getTargetInstruction] operator[SEP] operator[SEP] , identifier[target] operator[SEP] identifier[getEdgeType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[if] operator[SEP] operator[!] identifier[endOfBasicBlock] operator[SEP] { identifier[InstructionHandle] identifier[next] operator[=] identifier[handle] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[next] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[CFGBuilderException] operator[SEP] literal[String] operator[+] identifier[handle] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isMerge] operator[SEP] identifier[next] operator[SEP] operator[||] identifier[isPEI] operator[SEP] identifier[next] operator[SEP] operator[SEP] { identifier[subroutine] operator[SEP] identifier[addEdgeAndExplore] operator[SEP] identifier[basicBlock] , identifier[next] , identifier[FALL_THROUGH_EDGE] operator[SEP] operator[SEP] identifier[endOfBasicBlock] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[handle] operator[=] identifier[next] operator[SEP] } } } Keyword[while] operator[SEP] operator[!] identifier[endOfBasicBlock] operator[SEP] operator[SEP] } }
public Object get(IConverter converter, Object sourceObject, TypeReference<?> destinationType) { return convertedObjects.get(new ConvertedObjectsKey(converter, sourceObject, destinationType)); }
class class_name[name] begin[{] method[get, return_type[type[Object]], modifier[public], parameter[converter, sourceObject, destinationType]] begin[{] return[call[convertedObjects.get, parameter[ClassCreator(arguments=[MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sourceObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationType, 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=ConvertedObjectsKey, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[get] operator[SEP] identifier[IConverter] identifier[converter] , identifier[Object] identifier[sourceObject] , identifier[TypeReference] operator[<] operator[?] operator[>] identifier[destinationType] operator[SEP] { Keyword[return] identifier[convertedObjects] operator[SEP] identifier[get] operator[SEP] Keyword[new] identifier[ConvertedObjectsKey] operator[SEP] identifier[converter] , identifier[sourceObject] , identifier[destinationType] operator[SEP] operator[SEP] operator[SEP] }
@Override public synchronized void add(DiscoveryEntry discoveryEntry) { logger.debug("adding discovery entry: {}", discoveryEntry); if (!(discoveryEntry instanceof GlobalDiscoveryEntryPersisted)) { return; } GlobalDiscoveryEntryPersisted globalDiscoveryEntry = (GlobalDiscoveryEntryPersisted) discoveryEntry; if (globalDiscoveryEntry.getDomain() == null || globalDiscoveryEntry.getInterfaceName() == null || globalDiscoveryEntry.getParticipantId() == null || globalDiscoveryEntry.getAddress() == null) { String message = "discoveryEntry being registered is not complete: " + discoveryEntry; logger.error(message); throw new JoynrCommunicationException(message); } GlobalDiscoveryEntryPersisted discoveryEntryFound = entityManager.find(GlobalDiscoveryEntryPersisted.class, discoveryEntry.getParticipantId()); EntityTransaction transaction = entityManager.getTransaction(); try { transaction.begin(); if (discoveryEntryFound != null) { entityManager.merge(discoveryEntry); } else { entityManager.persist(discoveryEntry); } transaction.commit(); } catch (Exception e) { if (transaction.isActive()) { transaction.rollback(); } logger.error("unable to add discoveryEntry: " + discoveryEntry, e); } }
class class_name[name] begin[{] method[add, return_type[void], modifier[synchronized public], parameter[discoveryEntry]] begin[{] call[logger.debug, parameter[literal["adding discovery entry: {}"], member[.discoveryEntry]]] if[binary_operation[member[.discoveryEntry], instanceof, type[GlobalDiscoveryEntryPersisted]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[GlobalDiscoveryEntryPersisted], globalDiscoveryEntry] if[binary_operation[binary_operation[binary_operation[binary_operation[call[globalDiscoveryEntry.getDomain, parameter[]], ==, literal[null]], ||, binary_operation[call[globalDiscoveryEntry.getInterfaceName, parameter[]], ==, literal[null]]], ||, binary_operation[call[globalDiscoveryEntry.getParticipantId, parameter[]], ==, literal[null]]], ||, binary_operation[call[globalDiscoveryEntry.getAddress, parameter[]], ==, literal[null]]]] begin[{] local_variable[type[String], message] call[logger.error, parameter[member[.message]]] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, 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=JoynrCommunicationException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[GlobalDiscoveryEntryPersisted], discoveryEntryFound] local_variable[type[EntityTransaction], transaction] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=begin, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=discoveryEntryFound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=discoveryEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=persist, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=discoveryEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=merge, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isActive, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=rollback, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unable to add discoveryEntry: "), operandr=MemberReference(member=discoveryEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[add] operator[SEP] identifier[DiscoveryEntry] identifier[discoveryEntry] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[discoveryEntry] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[discoveryEntry] Keyword[instanceof] identifier[GlobalDiscoveryEntryPersisted] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[GlobalDiscoveryEntryPersisted] identifier[globalDiscoveryEntry] operator[=] operator[SEP] identifier[GlobalDiscoveryEntryPersisted] operator[SEP] identifier[discoveryEntry] operator[SEP] Keyword[if] operator[SEP] identifier[globalDiscoveryEntry] operator[SEP] identifier[getDomain] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[globalDiscoveryEntry] operator[SEP] identifier[getInterfaceName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[globalDiscoveryEntry] operator[SEP] identifier[getParticipantId] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[globalDiscoveryEntry] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[String] identifier[message] operator[=] literal[String] operator[+] identifier[discoveryEntry] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[JoynrCommunicationException] operator[SEP] identifier[message] operator[SEP] operator[SEP] } identifier[GlobalDiscoveryEntryPersisted] identifier[discoveryEntryFound] operator[=] identifier[entityManager] operator[SEP] identifier[find] operator[SEP] identifier[GlobalDiscoveryEntryPersisted] operator[SEP] Keyword[class] , identifier[discoveryEntry] operator[SEP] identifier[getParticipantId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[EntityTransaction] identifier[transaction] operator[=] identifier[entityManager] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[transaction] operator[SEP] identifier[begin] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[discoveryEntryFound] operator[!=] Other[null] operator[SEP] { identifier[entityManager] operator[SEP] identifier[merge] operator[SEP] identifier[discoveryEntry] operator[SEP] operator[SEP] } Keyword[else] { identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] identifier[discoveryEntry] operator[SEP] operator[SEP] } identifier[transaction] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[transaction] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] { identifier[transaction] operator[SEP] identifier[rollback] operator[SEP] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[discoveryEntry] , identifier[e] operator[SEP] operator[SEP] } }
public void runQueryWithArrayParameters() throws InterruptedException { // [START bigquery_query_params_arrays] // BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); String gender = "M"; String[] states = {"WA", "WI", "WV", "WY"}; String query = "SELECT name, sum(number) as count\n" + "FROM `bigquery-public-data.usa_names.usa_1910_2013`\n" + "WHERE gender = @gender\n" + "AND state IN UNNEST(@states)\n" + "GROUP BY name\n" + "ORDER BY count DESC\n" + "LIMIT 10;"; // Note: Standard SQL is required to use query parameters. QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query) .addNamedParameter("gender", QueryParameterValue.string(gender)) .addNamedParameter("states", QueryParameterValue.array(states, String.class)) .build(); // Print the results. for (FieldValueList row : bigquery.query(queryConfig).iterateAll()) { for (FieldValue val : row) { System.out.printf("%s,", val.toString()); } System.out.printf("\n"); } // [END bigquery_query_params_arrays] }
class class_name[name] begin[{] method[runQueryWithArrayParameters, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[String], gender] local_variable[type[String], states] local_variable[type[String], query] local_variable[type[QueryJobConfiguration], queryConfig] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s,"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldValue, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=queryConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=query, postfix_operators=[], prefix_operators=[], qualifier=bigquery, selectors=[MethodInvocation(arguments=[], member=iterateAll, 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=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldValueList, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[runQueryWithArrayParameters] operator[SEP] operator[SEP] Keyword[throws] identifier[InterruptedException] { identifier[String] identifier[gender] operator[=] literal[String] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[states] operator[=] { literal[String] , literal[String] , literal[String] , literal[String] } operator[SEP] identifier[String] identifier[query] operator[=] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] identifier[QueryJobConfiguration] identifier[queryConfig] operator[=] identifier[QueryJobConfiguration] operator[SEP] identifier[newBuilder] operator[SEP] identifier[query] operator[SEP] operator[SEP] identifier[addNamedParameter] operator[SEP] literal[String] , identifier[QueryParameterValue] operator[SEP] identifier[string] operator[SEP] identifier[gender] operator[SEP] operator[SEP] operator[SEP] identifier[addNamedParameter] operator[SEP] literal[String] , identifier[QueryParameterValue] operator[SEP] identifier[array] operator[SEP] identifier[states] , identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FieldValueList] identifier[row] operator[:] identifier[bigquery] operator[SEP] identifier[query] operator[SEP] identifier[queryConfig] operator[SEP] operator[SEP] identifier[iterateAll] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[FieldValue] identifier[val] operator[:] identifier[row] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[val] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public void setDay(Day d) { if (m_day != null) { m_parentCalendar.removeHoursFromDay(this); } m_day = d; m_parentCalendar.attachHoursToDay(this); }
class class_name[name] begin[{] method[setDay, return_type[void], modifier[public], parameter[d]] begin[{] if[binary_operation[member[.m_day], !=, literal[null]]] begin[{] call[m_parentCalendar.removeHoursFromDay, parameter[THIS[]]] else begin[{] None end[}] assign[member[.m_day], member[.d]] call[m_parentCalendar.attachHoursToDay, parameter[THIS[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDay] operator[SEP] identifier[Day] identifier[d] operator[SEP] { Keyword[if] operator[SEP] identifier[m_day] operator[!=] Other[null] operator[SEP] { identifier[m_parentCalendar] operator[SEP] identifier[removeHoursFromDay] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } identifier[m_day] operator[=] identifier[d] operator[SEP] identifier[m_parentCalendar] operator[SEP] identifier[attachHoursToDay] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "userDefinedCSRef") public JAXBElement<UserDefinedCSRefType> createUserDefinedCSRef(UserDefinedCSRefType value) { return new JAXBElement<UserDefinedCSRefType>(_UserDefinedCSRef_QNAME, UserDefinedCSRefType.class, null, value); }
class class_name[name] begin[{] method[createUserDefinedCSRef, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_UserDefinedCSRef_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UserDefinedCSRefType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, 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=UserDefinedCSRefType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[UserDefinedCSRefType] operator[>] identifier[createUserDefinedCSRef] operator[SEP] identifier[UserDefinedCSRefType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[UserDefinedCSRefType] operator[>] operator[SEP] identifier[_UserDefinedCSRef_QNAME] , identifier[UserDefinedCSRefType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public static List<Point3d> atomsToPoints(Collection<Atom> atoms) { ArrayList<Point3d> points = new ArrayList<>(atoms.size()); for (Atom atom : atoms) { points.add(atom.getCoordsAsPoint3d()); } return points; }
class class_name[name] begin[{] method[atomsToPoints, return_type[type[List]], modifier[public static], parameter[atoms]] begin[{] local_variable[type[ArrayList], points] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCoordsAsPoint3d, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=points, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=atoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Atom, sub_type=None))), label=None) return[member[.points]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Point3d] operator[>] identifier[atomsToPoints] operator[SEP] identifier[Collection] operator[<] identifier[Atom] operator[>] identifier[atoms] operator[SEP] { identifier[ArrayList] operator[<] identifier[Point3d] operator[>] identifier[points] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[atoms] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Atom] identifier[atom] operator[:] identifier[atoms] operator[SEP] { identifier[points] operator[SEP] identifier[add] operator[SEP] identifier[atom] operator[SEP] identifier[getCoordsAsPoint3d] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[points] operator[SEP] }
public boolean destroyGuacamoleSession(String authToken) { // Remove corresponding GuacamoleSession if the token is valid GuacamoleSession session = tokenSessionMap.remove(authToken); if (session == null) return false; // Invalidate the removed session session.invalidate(); return true; }
class class_name[name] begin[{] method[destroyGuacamoleSession, return_type[type[boolean]], modifier[public], parameter[authToken]] begin[{] local_variable[type[GuacamoleSession], session] if[binary_operation[member[.session], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] call[session.invalidate, parameter[]] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[destroyGuacamoleSession] operator[SEP] identifier[String] identifier[authToken] operator[SEP] { identifier[GuacamoleSession] identifier[session] operator[=] identifier[tokenSessionMap] operator[SEP] identifier[remove] operator[SEP] identifier[authToken] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[session] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[session] operator[SEP] identifier[invalidate] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
protected Statement createBindableStatement(PropertyNode propertyNode, Expression fieldExpression) { // create statementBody return stmt(callThisX("firePropertyChange", args(constX(propertyNode.getName()), fieldExpression, assignX(fieldExpression, varX("value"))))); }
class class_name[name] begin[{] method[createBindableStatement, return_type[type[Statement]], modifier[protected], parameter[propertyNode, fieldExpression]] begin[{] return[call[.stmt, parameter[call[.callThisX, parameter[literal["firePropertyChange"], call[.args, parameter[call[.constX, parameter[call[propertyNode.getName, parameter[]]]], member[.fieldExpression], call[.assignX, parameter[member[.fieldExpression], call[.varX, parameter[literal["value"]]]]]]]]]]]] end[}] END[}]
Keyword[protected] identifier[Statement] identifier[createBindableStatement] operator[SEP] identifier[PropertyNode] identifier[propertyNode] , identifier[Expression] identifier[fieldExpression] operator[SEP] { Keyword[return] identifier[stmt] operator[SEP] identifier[callThisX] operator[SEP] literal[String] , identifier[args] operator[SEP] identifier[constX] operator[SEP] identifier[propertyNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , identifier[fieldExpression] , identifier[assignX] operator[SEP] identifier[fieldExpression] , identifier[varX] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void useProviderForType(Class<?> type, FakeProvider<?> provider) { if (bridge == null) { throw new IllegalStateException("Must call initMocks() before calling useProviderForType()"); } if (bridge.registeredMocks.containsKey(type)) { throw new IllegalArgumentException( "Can't use a provider for a type that already has a @GwtMock declared"); } bridge.registeredProviders.put(type, provider); }
class class_name[name] begin[{] method[useProviderForType, return_type[void], modifier[public static], parameter[type, provider]] begin[{] if[binary_operation[member[.bridge], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Must call initMocks() before calling useProviderForType()")], 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[}] if[call[bridge.registeredMocks.containsKey, parameter[member[.type]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't use a provider for a type that already has a @GwtMock declared")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[bridge.registeredProviders.put, parameter[member[.type], member[.provider]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[useProviderForType] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] , identifier[FakeProvider] operator[<] operator[?] operator[>] identifier[provider] operator[SEP] { Keyword[if] operator[SEP] identifier[bridge] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[bridge] operator[SEP] identifier[registeredMocks] operator[SEP] identifier[containsKey] operator[SEP] identifier[type] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[bridge] operator[SEP] identifier[registeredProviders] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[provider] operator[SEP] operator[SEP] }
public BoxWebLink.Info createWebLink(String name, URL linkURL) { return this.createWebLink(name, linkURL, null); }
class class_name[name] begin[{] method[createWebLink, return_type[type[BoxWebLink]], modifier[public], parameter[name, linkURL]] begin[{] return[THIS[call[None.createWebLink, parameter[member[.name], member[.linkURL], literal[null]]]]] end[}] END[}]
Keyword[public] identifier[BoxWebLink] operator[SEP] identifier[Info] identifier[createWebLink] operator[SEP] identifier[String] identifier[name] , identifier[URL] identifier[linkURL] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[createWebLink] operator[SEP] identifier[name] , identifier[linkURL] , Other[null] operator[SEP] operator[SEP] }
public <T> Component unregister(Class<T> type, Annotation qualifier) throws ProviderMissingException { //Detach corresponding provider from it's component Provider<T> provider = findProvider(type, qualifier); provider.setComponent(null); String key = PokeHelper.makeProviderKey(type, qualifier); Component targetComponent = getRootComponent().componentLocator.get(key); targetComponent.providers.remove(key); if (targetComponent.scopeCache != null) { targetComponent.scopeCache.removeInstance(PokeHelper.makeProviderKey(type, qualifier)); } Component root = getRootComponent(); //Remove it from root component's locator root.componentLocator.remove(key); return this; }
class class_name[name] begin[{] method[unregister, return_type[type[Component]], modifier[public], parameter[type, qualifier]] begin[{] local_variable[type[Provider], provider] call[provider.setComponent, parameter[literal[null]]] local_variable[type[String], key] local_variable[type[Component], targetComponent] call[targetComponent.providers.remove, parameter[member[.key]]] if[binary_operation[member[targetComponent.scopeCache], !=, literal[null]]] begin[{] call[targetComponent.scopeCache.removeInstance, parameter[call[PokeHelper.makeProviderKey, parameter[member[.type], member[.qualifier]]]]] else begin[{] None end[}] local_variable[type[Component], root] call[root.componentLocator.remove, parameter[member[.key]]] return[THIS[]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Component] identifier[unregister] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] , identifier[Annotation] identifier[qualifier] operator[SEP] Keyword[throws] identifier[ProviderMissingException] { identifier[Provider] operator[<] identifier[T] operator[>] identifier[provider] operator[=] identifier[findProvider] operator[SEP] identifier[type] , identifier[qualifier] operator[SEP] operator[SEP] identifier[provider] operator[SEP] identifier[setComponent] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[String] identifier[key] operator[=] identifier[PokeHelper] operator[SEP] identifier[makeProviderKey] operator[SEP] identifier[type] , identifier[qualifier] operator[SEP] operator[SEP] identifier[Component] identifier[targetComponent] operator[=] identifier[getRootComponent] operator[SEP] operator[SEP] operator[SEP] identifier[componentLocator] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[targetComponent] operator[SEP] identifier[providers] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetComponent] operator[SEP] identifier[scopeCache] operator[!=] Other[null] operator[SEP] { identifier[targetComponent] operator[SEP] identifier[scopeCache] operator[SEP] identifier[removeInstance] operator[SEP] identifier[PokeHelper] operator[SEP] identifier[makeProviderKey] operator[SEP] identifier[type] , identifier[qualifier] operator[SEP] operator[SEP] operator[SEP] } identifier[Component] identifier[root] operator[=] identifier[getRootComponent] operator[SEP] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[componentLocator] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public char getValueAsChar(int index) throws IOException { if (index >= structure.valueSizes.size()) { throw new IOException("Index " + index + " is out of range."); } return Bytes.toChar(value, structure.valueByteOffsets.get(index)); }
class class_name[name] begin[{] method[getValueAsChar, return_type[type[char]], modifier[public], parameter[index]] begin[{] if[binary_operation[member[.index], >=, call[structure.valueSizes.size, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Index "), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is out of range."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] return[call[Bytes.toChar, parameter[member[.value], call[structure.valueByteOffsets.get, parameter[member[.index]]]]]] end[}] END[}]
Keyword[public] Keyword[char] identifier[getValueAsChar] operator[SEP] Keyword[int] identifier[index] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[index] operator[>=] identifier[structure] operator[SEP] identifier[valueSizes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[index] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[Bytes] operator[SEP] identifier[toChar] operator[SEP] identifier[value] , identifier[structure] operator[SEP] identifier[valueByteOffsets] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] }
@Override public void setAttribute(String key, Object value) { if (value == null) { setAttribute(key, null); } else { setAttribute(key, Collections.singletonList(value)); } }
class class_name[name] begin[{] method[setAttribute, return_type[void], modifier[public], parameter[key, value]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] call[.setAttribute, parameter[member[.key], literal[null]]] else begin[{] call[.setAttribute, parameter[member[.key], call[Collections.singletonList, parameter[member[.value]]]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setAttribute] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { identifier[setAttribute] operator[SEP] identifier[key] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[setAttribute] operator[SEP] identifier[key] , identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } }
private void init() { _smoothed = true; _chartType = ChartType.LINE; _subDivisions = 16; _snapToTicks = false; _selectorFillColor = Color.WHITE; _selectorStrokeColor = Color.RED; _selectorSize = 10; _decimals = 2; _interactive = true; _tooltipTimeout = 2000; formatString = "%.2f"; strokePaths = new ArrayList<>(); clickHandler = e -> select(e); endOfTransformationHandler = e -> selectorTooltip.hide(); seriesListener = change -> { while (change.next()) { if (change.wasAdded()) { change.getAddedSubList().forEach(addedItem -> { final Series<X, Y> series = addedItem; final Path strokePath = (Path) ((Group) series.getNode()).getChildren().get(1); final Path fillPath = (Path) ((Group) series.getNode()).getChildren().get(0); fillPath.addEventHandler(MouseEvent.MOUSE_PRESSED, clickHandler); strokePath.addEventHandler(MouseEvent.MOUSE_PRESSED, clickHandler); strokePaths.add(strokePath); series.getData().forEach(data -> data.YValueProperty().addListener(o -> layoutPlotChildren())); }); } else if (change.wasRemoved()) { change.getRemoved().forEach(removedItem -> { final Series<X, Y> series = removedItem; final Path strokePath = (Path) ((Group) series.getNode()).getChildren().get(1); final Path fillPath = (Path) ((Group) series.getNode()).getChildren().get(0); fillPath.removeEventHandler(MouseEvent.MOUSE_PRESSED, clickHandler); strokePath.removeEventHandler(MouseEvent.MOUSE_PRESSED, clickHandler); strokePaths.remove(strokePath); }); } } }; // Add selector to chart selector = new Circle(); selector.setFill(_selectorFillColor); selector.setStroke(_selectorStrokeColor); selector.setOpacity(0); selectorTooltip = new Tooltip(""); Tooltip.install(selector, selectorTooltip); FadeTransition fadeIn = new FadeTransition(Duration.millis(100), selector); fadeIn.setFromValue(0); fadeIn.setToValue(1); timeBeforeFadeOut = new PauseTransition(Duration.millis(_tooltipTimeout)); FadeTransition fadeOut = new FadeTransition(Duration.millis(100), selector); fadeOut.setFromValue(1); fadeOut.setToValue(0); fadeInFadeOut = new SequentialTransition(fadeIn, timeBeforeFadeOut, fadeOut); fadeInFadeOut.setOnFinished(endOfTransformationHandler); chartPlotBackground = getChartPlotBackground(); chartPlotBackground.widthProperty().addListener(o -> resizeSelector()); chartPlotBackground.heightProperty().addListener(o -> resizeSelector()); chartPlotBackground.layoutYProperty().addListener(o -> resizeSelector()); Path horizontalGridLines = getHorizontalGridLines(); if (null != horizontalGridLines) { horizontalGridLines.setMouseTransparent(true); } Path verticalGridLines = getVerticalGridLines(); if (null != verticalGridLines) { verticalGridLines.setMouseTransparent(true); } getChartChildren().addAll(selector); }
class class_name[name] begin[{] method[init, return_type[void], modifier[private], parameter[]] begin[{] assign[member[._smoothed], literal[true]] assign[member[._chartType], member[ChartType.LINE]] assign[member[._subDivisions], literal[16]] assign[member[._snapToTicks], literal[false]] assign[member[._selectorFillColor], member[Color.WHITE]] assign[member[._selectorStrokeColor], member[Color.RED]] assign[member[._selectorSize], literal[10]] assign[member[._decimals], literal[2]] assign[member[._interactive], literal[true]] assign[member[._tooltipTimeout], literal[2000]] assign[member[.formatString], literal["%.2f"]] assign[member[.strokePaths], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] assign[member[.clickHandler], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=select, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] assign[member[.endOfTransformationHandler], LambdaExpression(body=MethodInvocation(arguments=[], member=hide, postfix_operators=[], prefix_operators=[], qualifier=selectorTooltip, selectors=[], type_arguments=None), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] assign[member[.seriesListener], LambdaExpression(body=[WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=wasAdded, postfix_operators=[], prefix_operators=[], qualifier=change, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=wasRemoved, postfix_operators=[], prefix_operators=[], qualifier=change, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRemoved, postfix_operators=[], prefix_operators=[], qualifier=change, selectors=[MethodInvocation(arguments=[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=removedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=series)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=X, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Y, sub_type=None))], dimensions=[], name=Series, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), name=strokePath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), name=fillPath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MOUSE_PRESSED, postfix_operators=[], prefix_operators=[], qualifier=MouseEvent, selectors=[]), MemberReference(member=clickHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeEventHandler, postfix_operators=[], prefix_operators=[], qualifier=fillPath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MOUSE_PRESSED, postfix_operators=[], prefix_operators=[], qualifier=MouseEvent, selectors=[]), MemberReference(member=clickHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeEventHandler, postfix_operators=[], prefix_operators=[], qualifier=strokePath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=strokePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=strokePaths, selectors=[], type_arguments=None), label=None)], parameters=[MemberReference(member=removedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=forEach, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getAddedSubList, postfix_operators=[], prefix_operators=[], qualifier=change, selectors=[MethodInvocation(arguments=[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=addedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=series)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=X, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Y, sub_type=None))], dimensions=[], name=Series, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), name=strokePath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), name=fillPath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MOUSE_PRESSED, postfix_operators=[], prefix_operators=[], qualifier=MouseEvent, selectors=[]), MemberReference(member=clickHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addEventHandler, postfix_operators=[], prefix_operators=[], qualifier=fillPath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MOUSE_PRESSED, postfix_operators=[], prefix_operators=[], qualifier=MouseEvent, selectors=[]), MemberReference(member=clickHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addEventHandler, postfix_operators=[], prefix_operators=[], qualifier=strokePath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=strokePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=strokePaths, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=YValueProperty, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=layoutPlotChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=addListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=forEach, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], parameters=[MemberReference(member=addedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=forEach, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=change, selectors=[], type_arguments=None), label=None)], parameters=[MemberReference(member=change, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] assign[member[.selector], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Circle, sub_type=None))] call[selector.setFill, parameter[member[._selectorFillColor]]] call[selector.setStroke, parameter[member[._selectorStrokeColor]]] call[selector.setOpacity, parameter[literal[0]]] assign[member[.selectorTooltip], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Tooltip, sub_type=None))] call[Tooltip.install, parameter[member[.selector], member[.selectorTooltip]]] local_variable[type[FadeTransition], fadeIn] call[fadeIn.setFromValue, parameter[literal[0]]] call[fadeIn.setToValue, parameter[literal[1]]] assign[member[.timeBeforeFadeOut], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=_tooltipTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=millis, postfix_operators=[], prefix_operators=[], qualifier=Duration, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PauseTransition, sub_type=None))] local_variable[type[FadeTransition], fadeOut] call[fadeOut.setFromValue, parameter[literal[1]]] call[fadeOut.setToValue, parameter[literal[0]]] assign[member[.fadeInFadeOut], ClassCreator(arguments=[MemberReference(member=fadeIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeBeforeFadeOut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fadeOut, 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=SequentialTransition, sub_type=None))] call[fadeInFadeOut.setOnFinished, parameter[member[.endOfTransformationHandler]]] assign[member[.chartPlotBackground], call[.getChartPlotBackground, parameter[]]] call[chartPlotBackground.widthProperty, parameter[]] call[chartPlotBackground.heightProperty, parameter[]] call[chartPlotBackground.layoutYProperty, parameter[]] local_variable[type[Path], horizontalGridLines] if[binary_operation[literal[null], !=, member[.horizontalGridLines]]] begin[{] call[horizontalGridLines.setMouseTransparent, parameter[literal[true]]] else begin[{] None end[}] local_variable[type[Path], verticalGridLines] if[binary_operation[literal[null], !=, member[.verticalGridLines]]] begin[{] call[verticalGridLines.setMouseTransparent, parameter[literal[true]]] else begin[{] None end[}] call[.getChartChildren, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[init] operator[SEP] operator[SEP] { identifier[_smoothed] operator[=] literal[boolean] operator[SEP] identifier[_chartType] operator[=] identifier[ChartType] operator[SEP] identifier[LINE] operator[SEP] identifier[_subDivisions] operator[=] Other[16] operator[SEP] identifier[_snapToTicks] operator[=] literal[boolean] operator[SEP] identifier[_selectorFillColor] operator[=] identifier[Color] operator[SEP] identifier[WHITE] operator[SEP] identifier[_selectorStrokeColor] operator[=] identifier[Color] operator[SEP] identifier[RED] operator[SEP] identifier[_selectorSize] operator[=] Other[10] operator[SEP] identifier[_decimals] operator[=] Other[2] operator[SEP] identifier[_interactive] operator[=] literal[boolean] operator[SEP] identifier[_tooltipTimeout] operator[=] Other[2000] operator[SEP] identifier[formatString] operator[=] literal[String] operator[SEP] identifier[strokePaths] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[clickHandler] operator[=] identifier[e] operator[->] identifier[select] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[endOfTransformationHandler] operator[=] identifier[e] operator[->] identifier[selectorTooltip] operator[SEP] identifier[hide] operator[SEP] operator[SEP] operator[SEP] identifier[seriesListener] operator[=] identifier[change] operator[->] { Keyword[while] operator[SEP] identifier[change] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[change] operator[SEP] identifier[wasAdded] operator[SEP] operator[SEP] operator[SEP] { identifier[change] operator[SEP] identifier[getAddedSubList] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[addedItem] operator[->] { Keyword[final] identifier[Series] operator[<] identifier[X] , identifier[Y] operator[>] identifier[series] operator[=] identifier[addedItem] operator[SEP] Keyword[final] identifier[Path] identifier[strokePath] operator[=] operator[SEP] identifier[Path] operator[SEP] operator[SEP] operator[SEP] identifier[Group] operator[SEP] identifier[series] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[Path] identifier[fillPath] operator[=] operator[SEP] identifier[Path] operator[SEP] operator[SEP] operator[SEP] identifier[Group] operator[SEP] identifier[series] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[fillPath] operator[SEP] identifier[addEventHandler] operator[SEP] identifier[MouseEvent] operator[SEP] identifier[MOUSE_PRESSED] , identifier[clickHandler] operator[SEP] operator[SEP] identifier[strokePath] operator[SEP] identifier[addEventHandler] operator[SEP] identifier[MouseEvent] operator[SEP] identifier[MOUSE_PRESSED] , identifier[clickHandler] operator[SEP] operator[SEP] identifier[strokePaths] operator[SEP] identifier[add] operator[SEP] identifier[strokePath] operator[SEP] operator[SEP] identifier[series] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[data] operator[->] identifier[data] operator[SEP] identifier[YValueProperty] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[o] operator[->] identifier[layoutPlotChildren] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[change] operator[SEP] identifier[wasRemoved] operator[SEP] operator[SEP] operator[SEP] { identifier[change] operator[SEP] identifier[getRemoved] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[removedItem] operator[->] { Keyword[final] identifier[Series] operator[<] identifier[X] , identifier[Y] operator[>] identifier[series] operator[=] identifier[removedItem] operator[SEP] Keyword[final] identifier[Path] identifier[strokePath] operator[=] operator[SEP] identifier[Path] operator[SEP] operator[SEP] operator[SEP] identifier[Group] operator[SEP] identifier[series] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[Path] identifier[fillPath] operator[=] operator[SEP] identifier[Path] operator[SEP] operator[SEP] operator[SEP] identifier[Group] operator[SEP] identifier[series] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[fillPath] operator[SEP] identifier[removeEventHandler] operator[SEP] identifier[MouseEvent] operator[SEP] identifier[MOUSE_PRESSED] , identifier[clickHandler] operator[SEP] operator[SEP] identifier[strokePath] operator[SEP] identifier[removeEventHandler] operator[SEP] identifier[MouseEvent] operator[SEP] identifier[MOUSE_PRESSED] , identifier[clickHandler] operator[SEP] operator[SEP] identifier[strokePaths] operator[SEP] identifier[remove] operator[SEP] identifier[strokePath] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } } } operator[SEP] identifier[selector] operator[=] Keyword[new] identifier[Circle] operator[SEP] operator[SEP] operator[SEP] identifier[selector] operator[SEP] identifier[setFill] operator[SEP] identifier[_selectorFillColor] operator[SEP] operator[SEP] identifier[selector] operator[SEP] identifier[setStroke] operator[SEP] identifier[_selectorStrokeColor] operator[SEP] operator[SEP] identifier[selector] operator[SEP] identifier[setOpacity] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[selectorTooltip] operator[=] Keyword[new] identifier[Tooltip] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Tooltip] operator[SEP] identifier[install] operator[SEP] identifier[selector] , identifier[selectorTooltip] operator[SEP] operator[SEP] identifier[FadeTransition] identifier[fadeIn] operator[=] Keyword[new] identifier[FadeTransition] operator[SEP] identifier[Duration] operator[SEP] identifier[millis] operator[SEP] Other[100] operator[SEP] , identifier[selector] operator[SEP] operator[SEP] identifier[fadeIn] operator[SEP] identifier[setFromValue] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[fadeIn] operator[SEP] identifier[setToValue] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[timeBeforeFadeOut] operator[=] Keyword[new] identifier[PauseTransition] operator[SEP] identifier[Duration] operator[SEP] identifier[millis] operator[SEP] identifier[_tooltipTimeout] operator[SEP] operator[SEP] operator[SEP] identifier[FadeTransition] identifier[fadeOut] operator[=] Keyword[new] identifier[FadeTransition] operator[SEP] identifier[Duration] operator[SEP] identifier[millis] operator[SEP] Other[100] operator[SEP] , identifier[selector] operator[SEP] operator[SEP] identifier[fadeOut] operator[SEP] identifier[setFromValue] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[fadeOut] operator[SEP] identifier[setToValue] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[fadeInFadeOut] operator[=] Keyword[new] identifier[SequentialTransition] operator[SEP] identifier[fadeIn] , identifier[timeBeforeFadeOut] , identifier[fadeOut] operator[SEP] operator[SEP] identifier[fadeInFadeOut] operator[SEP] identifier[setOnFinished] operator[SEP] identifier[endOfTransformationHandler] operator[SEP] operator[SEP] identifier[chartPlotBackground] operator[=] identifier[getChartPlotBackground] operator[SEP] operator[SEP] operator[SEP] identifier[chartPlotBackground] operator[SEP] identifier[widthProperty] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[o] operator[->] identifier[resizeSelector] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[chartPlotBackground] operator[SEP] identifier[heightProperty] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[o] operator[->] identifier[resizeSelector] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[chartPlotBackground] operator[SEP] identifier[layoutYProperty] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[o] operator[->] identifier[resizeSelector] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[horizontalGridLines] operator[=] identifier[getHorizontalGridLines] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[horizontalGridLines] operator[SEP] { identifier[horizontalGridLines] operator[SEP] identifier[setMouseTransparent] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } identifier[Path] identifier[verticalGridLines] operator[=] identifier[getVerticalGridLines] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[verticalGridLines] operator[SEP] { identifier[verticalGridLines] operator[SEP] identifier[setMouseTransparent] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } identifier[getChartChildren] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[selector] operator[SEP] operator[SEP] }
public static List<WayDataBlock> toWayDataBlockList(Geometry geometry) { List<WayDataBlock> res = new ArrayList<>(); if (geometry instanceof MultiPolygon) { MultiPolygon mp = (MultiPolygon) geometry; for (int i = 0; i < mp.getNumGeometries(); i++) { Polygon p = (Polygon) mp.getGeometryN(i); List<Integer> outer = toCoordinateList(p.getExteriorRing()); if (outer.size() / 2 > 0) { List<List<Integer>> inner = new ArrayList<>(); for (int j = 0; j < p.getNumInteriorRing(); j++) { List<Integer> innr = toCoordinateList(p.getInteriorRingN(j)); if (innr.size() / 2 > 0) { inner.add(innr); } } res.add(new WayDataBlock(outer, inner)); } } } else if (geometry instanceof Polygon) { Polygon p = (Polygon) geometry; List<Integer> outer = toCoordinateList(p.getExteriorRing()); if (outer.size() / 2 > 0) { List<List<Integer>> inner = new ArrayList<>(); for (int i = 0; i < p.getNumInteriorRing(); i++) { List<Integer> innr = toCoordinateList(p.getInteriorRingN(i)); if (innr.size() / 2 > 0) { inner.add(innr); } } res.add(new WayDataBlock(outer, inner)); } } else if (geometry instanceof MultiLineString) { MultiLineString ml = (MultiLineString) geometry; for (int i = 0; i < ml.getNumGeometries(); i++) { LineString l = (LineString) ml.getGeometryN(i); List<Integer> outer = toCoordinateList(l); if (outer.size() / 2 > 0) { res.add(new WayDataBlock(outer, null)); } } } else if (geometry instanceof LinearRing || geometry instanceof LineString) { List<Integer> outer = toCoordinateList(geometry); if (outer.size() / 2 > 0) { res.add(new WayDataBlock(outer, null)); } } else if (geometry instanceof GeometryCollection) { GeometryCollection gc = (GeometryCollection) geometry; for (int i = 0; i < gc.getNumGeometries(); i++) { List<WayDataBlock> recursiveResult = toWayDataBlockList(gc.getGeometryN(i)); for (WayDataBlock wayDataBlock : recursiveResult) { List<Integer> outer = wayDataBlock.getOuterWay(); if (outer.size() / 2 > 0) { res.add(wayDataBlock); } } } } return res; }
class class_name[name] begin[{] method[toWayDataBlockList, return_type[type[List]], modifier[public static], parameter[geometry]] begin[{] local_variable[type[List], res] if[binary_operation[member[.geometry], instanceof, type[MultiPolygon]]] begin[{] local_variable[type[MultiPolygon], mp] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeometryN, postfix_operators=[], prefix_operators=[], qualifier=mp, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None)), name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getExteriorRing, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=toCoordinateList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=outer)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=outer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=inner)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInteriorRingN, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=toCoordinateList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=innr)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=innr, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=innr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=inner, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumInteriorRing, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=outer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inner, 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=WayDataBlock, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumGeometries, postfix_operators=[], prefix_operators=[], qualifier=mp, 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) else begin[{] if[binary_operation[member[.geometry], instanceof, type[Polygon]]] begin[{] local_variable[type[Polygon], p] local_variable[type[List], outer] if[binary_operation[binary_operation[call[outer.size, parameter[]], /, literal[2]], >, literal[0]]] begin[{] local_variable[type[List], inner] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInteriorRingN, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=toCoordinateList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=innr)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=innr, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=innr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=inner, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumInteriorRing, postfix_operators=[], prefix_operators=[], qualifier=p, 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) call[res.add, parameter[ClassCreator(arguments=[MemberReference(member=outer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inner, 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=WayDataBlock, sub_type=None))]] else begin[{] None end[}] else begin[{] if[binary_operation[member[.geometry], instanceof, type[MultiLineString]]] begin[{] local_variable[type[MultiLineString], ml] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeometryN, postfix_operators=[], prefix_operators=[], qualifier=ml, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=LineString, sub_type=None)), name=l)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LineString, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toCoordinateList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=outer)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=outer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=outer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WayDataBlock, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumGeometries, postfix_operators=[], prefix_operators=[], qualifier=ml, 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) else begin[{] if[binary_operation[binary_operation[member[.geometry], instanceof, type[LinearRing]], ||, binary_operation[member[.geometry], instanceof, type[LineString]]]] begin[{] local_variable[type[List], outer] if[binary_operation[binary_operation[call[outer.size, parameter[]], /, literal[2]], >, literal[0]]] begin[{] call[res.add, parameter[ClassCreator(arguments=[MemberReference(member=outer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WayDataBlock, sub_type=None))]] else begin[{] None end[}] else begin[{] if[binary_operation[member[.geometry], instanceof, type[GeometryCollection]]] begin[{] local_variable[type[GeometryCollection], gc] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeometryN, postfix_operators=[], prefix_operators=[], qualifier=gc, selectors=[], type_arguments=None)], member=toWayDataBlockList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=recursiveResult)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WayDataBlock, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getOuterWay, postfix_operators=[], prefix_operators=[], qualifier=wayDataBlock, selectors=[], type_arguments=None), name=outer)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=outer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=wayDataBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=recursiveResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=wayDataBlock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WayDataBlock, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumGeometries, postfix_operators=[], prefix_operators=[], qualifier=gc, 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) else begin[{] None end[}] end[}] end[}] end[}] end[}] return[member[.res]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[WayDataBlock] operator[>] identifier[toWayDataBlockList] operator[SEP] identifier[Geometry] identifier[geometry] operator[SEP] { identifier[List] operator[<] identifier[WayDataBlock] operator[>] identifier[res] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[MultiPolygon] operator[SEP] { identifier[MultiPolygon] identifier[mp] operator[=] operator[SEP] identifier[MultiPolygon] operator[SEP] identifier[geometry] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[mp] operator[SEP] identifier[getNumGeometries] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Polygon] identifier[p] operator[=] operator[SEP] identifier[Polygon] operator[SEP] identifier[mp] operator[SEP] identifier[getGeometryN] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[outer] operator[=] identifier[toCoordinateList] operator[SEP] identifier[p] operator[SEP] identifier[getExteriorRing] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[>] Other[0] operator[SEP] { identifier[List] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[inner] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[p] operator[SEP] identifier[getNumInteriorRing] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[innr] operator[=] identifier[toCoordinateList] operator[SEP] identifier[p] operator[SEP] identifier[getInteriorRingN] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[innr] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[>] Other[0] operator[SEP] { identifier[inner] operator[SEP] identifier[add] operator[SEP] identifier[innr] operator[SEP] operator[SEP] } } identifier[res] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WayDataBlock] operator[SEP] identifier[outer] , identifier[inner] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[Polygon] operator[SEP] { identifier[Polygon] identifier[p] operator[=] operator[SEP] identifier[Polygon] operator[SEP] identifier[geometry] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[outer] operator[=] identifier[toCoordinateList] operator[SEP] identifier[p] operator[SEP] identifier[getExteriorRing] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[>] Other[0] operator[SEP] { identifier[List] operator[<] identifier[List] operator[<] identifier[Integer] operator[>] operator[>] identifier[inner] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[p] operator[SEP] identifier[getNumInteriorRing] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[innr] operator[=] identifier[toCoordinateList] operator[SEP] identifier[p] operator[SEP] identifier[getInteriorRingN] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[innr] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[>] Other[0] operator[SEP] { identifier[inner] operator[SEP] identifier[add] operator[SEP] identifier[innr] operator[SEP] operator[SEP] } } identifier[res] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WayDataBlock] operator[SEP] identifier[outer] , identifier[inner] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[MultiLineString] operator[SEP] { identifier[MultiLineString] identifier[ml] operator[=] operator[SEP] identifier[MultiLineString] operator[SEP] identifier[geometry] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ml] operator[SEP] identifier[getNumGeometries] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[LineString] identifier[l] operator[=] operator[SEP] identifier[LineString] operator[SEP] identifier[ml] operator[SEP] identifier[getGeometryN] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[outer] operator[=] identifier[toCoordinateList] operator[SEP] identifier[l] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[>] Other[0] operator[SEP] { identifier[res] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WayDataBlock] operator[SEP] identifier[outer] , Other[null] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[LinearRing] operator[||] identifier[geometry] Keyword[instanceof] identifier[LineString] operator[SEP] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[outer] operator[=] identifier[toCoordinateList] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[>] Other[0] operator[SEP] { identifier[res] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WayDataBlock] operator[SEP] identifier[outer] , Other[null] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[GeometryCollection] operator[SEP] { identifier[GeometryCollection] identifier[gc] operator[=] operator[SEP] identifier[GeometryCollection] operator[SEP] identifier[geometry] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[gc] operator[SEP] identifier[getNumGeometries] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[List] operator[<] identifier[WayDataBlock] operator[>] identifier[recursiveResult] operator[=] identifier[toWayDataBlockList] operator[SEP] identifier[gc] operator[SEP] identifier[getGeometryN] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[WayDataBlock] identifier[wayDataBlock] operator[:] identifier[recursiveResult] operator[SEP] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[outer] operator[=] identifier[wayDataBlock] operator[SEP] identifier[getOuterWay] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[>] Other[0] operator[SEP] { identifier[res] operator[SEP] identifier[add] operator[SEP] identifier[wayDataBlock] operator[SEP] operator[SEP] } } } } Keyword[return] identifier[res] operator[SEP] }
private void getJavaSource() { String[] resourceFiles = new String[getConfigurationFiles().length + 1]; resourceFiles[0] = getSourceFileName(); for (int i = 0; i < getConfigurationFiles().length; i++) { resourceFiles[i + 1] = getConfigurationFiles()[i]; } GetResourceRequest request = new GetResourceRequest(resourceFiles); GwtCommand command = new GwtCommand(GetResourceRequest.COMMAND); command.setCommandRequest(request); GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<GetResourceResponse>() { public void execute(GetResourceResponse response) { if (response.getResources() == null) { return; } showFiles(response.getResources()); } }); }
class class_name[name] begin[{] method[getJavaSource, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[String], resourceFiles] assign[member[.resourceFiles], call[.getSourceFileName, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=resourceFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=MethodInvocation(arguments=[], member=getConfigurationFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=MethodInvocation(arguments=[], member=getConfigurationFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[GetResourceRequest], request] local_variable[type[GwtCommand], command] call[command.setCommandRequest, parameter[member[.request]]] call[GwtCommandDispatcher.getInstance, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[getJavaSource] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[resourceFiles] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[getConfigurationFiles] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] identifier[resourceFiles] operator[SEP] Other[0] operator[SEP] operator[=] identifier[getSourceFileName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getConfigurationFiles] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[resourceFiles] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[=] identifier[getConfigurationFiles] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[GetResourceRequest] identifier[request] operator[=] Keyword[new] identifier[GetResourceRequest] operator[SEP] identifier[resourceFiles] operator[SEP] operator[SEP] identifier[GwtCommand] identifier[command] operator[=] Keyword[new] identifier[GwtCommand] operator[SEP] identifier[GetResourceRequest] operator[SEP] identifier[COMMAND] operator[SEP] operator[SEP] identifier[command] operator[SEP] identifier[setCommandRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[GwtCommandDispatcher] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[command] , Keyword[new] identifier[AbstractCommandCallback] operator[<] identifier[GetResourceResponse] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[GetResourceResponse] identifier[response] operator[SEP] { Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[showFiles] operator[SEP] identifier[response] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public ServiceFuture<StreamingEndpointInner> createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback<StreamingEndpointInner> serviceCallback) { return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); }
class class_name[name] begin[{] method[createAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, accountName, streamingEndpointName, parameters, autoStart, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.createWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.streamingEndpointName], member[.parameters], member[.autoStart]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[StreamingEndpointInner] operator[>] identifier[createAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[streamingEndpointName] , identifier[StreamingEndpointInner] identifier[parameters] , identifier[Boolean] identifier[autoStart] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[StreamingEndpointInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[createWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[streamingEndpointName] , identifier[parameters] , identifier[autoStart] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public static void listen(int tryCount, long delay, ClipboardListener listener, boolean sync) { ClipboardMonitor.INSTANCE// .setTryCount(tryCount)// .setDelay(delay)// .addListener(listener)// .listen(sync); }
class class_name[name] begin[{] method[listen, return_type[void], modifier[public static], parameter[tryCount, delay, listener, sync]] begin[{] call[ClipboardMonitor.INSTANCE.setTryCount, parameter[member[.tryCount]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[listen] operator[SEP] Keyword[int] identifier[tryCount] , Keyword[long] identifier[delay] , identifier[ClipboardListener] identifier[listener] , Keyword[boolean] identifier[sync] operator[SEP] { identifier[ClipboardMonitor] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[setTryCount] operator[SEP] identifier[tryCount] operator[SEP] operator[SEP] identifier[setDelay] operator[SEP] identifier[delay] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[listener] operator[SEP] operator[SEP] identifier[listen] operator[SEP] identifier[sync] operator[SEP] operator[SEP] }
public static Element nextElement(XMLExtendedStreamReader reader, Namespace expectedNamespace) throws XMLStreamException { Element element = nextElement(reader); if (element == null) { return null; } else if (element != Element.UNKNOWN && expectedNamespace.equals(Namespace.forUri(reader.getNamespaceURI()))) { return element; } throw unexpectedElement(reader); }
class class_name[name] begin[{] method[nextElement, return_type[type[Element]], modifier[public static], parameter[reader, expectedNamespace]] begin[{] local_variable[type[Element], element] if[binary_operation[member[.element], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] if[binary_operation[binary_operation[member[.element], !=, member[Element.UNKNOWN]], &&, call[expectedNamespace.equals, parameter[call[Namespace.forUri, parameter[call[reader.getNamespaceURI, parameter[]]]]]]]] begin[{] return[member[.element]] else begin[{] None end[}] end[}] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Element] identifier[nextElement] operator[SEP] identifier[XMLExtendedStreamReader] identifier[reader] , identifier[Namespace] identifier[expectedNamespace] operator[SEP] Keyword[throws] identifier[XMLStreamException] { identifier[Element] identifier[element] operator[=] identifier[nextElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[element] operator[!=] identifier[Element] operator[SEP] identifier[UNKNOWN] operator[&&] identifier[expectedNamespace] operator[SEP] identifier[equals] operator[SEP] identifier[Namespace] operator[SEP] identifier[forUri] operator[SEP] identifier[reader] operator[SEP] identifier[getNamespaceURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[element] operator[SEP] } Keyword[throw] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP] }
public void marshall(SeverityLevel severityLevel, ProtocolMarshaller protocolMarshaller) { if (severityLevel == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(severityLevel.getCode(), CODE_BINDING); protocolMarshaller.marshall(severityLevel.getName(), NAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[severityLevel, protocolMarshaller]] begin[{] if[binary_operation[member[.severityLevel], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCode, postfix_operators=[], prefix_operators=[], qualifier=severityLevel, selectors=[], type_arguments=None), MemberReference(member=CODE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=severityLevel, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[SeverityLevel] identifier[severityLevel] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[severityLevel] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[severityLevel] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] , identifier[CODE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[severityLevel] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void start() { if (!started) try { for (RepositoryEntry repConfiguration : repConfigurations()) { String repName = repConfiguration.getName(); String wsName = null; if (props != null) { wsName = props.getProperty(repName); if (wsName == null) wsName = repConfiguration.getDefaultWorkspaceName(); } else { wsName = repConfiguration.getDefaultWorkspaceName(); } addRegistryLocation(repName, wsName); InputStream xml = SecurityHelper.doPrivilegedAction(new PrivilegedAction<InputStream>() { public InputStream run() { return getClass().getResourceAsStream(NT_FILE); } }); try { repositoryService.getRepository(repName).getNodeTypeManager() .registerNodeTypes(xml, ExtendedNodeTypeManager.IGNORE_IF_EXISTS, NodeTypeDataManager.TEXT_XML); } finally { try { xml.close(); } catch (Exception e) { if (LOG.isTraceEnabled()) { LOG.trace("An exception occurred: " + e.getMessage()); } } } } initStorage(false); started = true; } catch (RepositoryConfigurationException e) { LOG.error(e.getLocalizedMessage(), e); } catch (RepositoryException e) { LOG.error(e.getLocalizedMessage(), e); } else if (LOG.isDebugEnabled()) LOG.warn("Registry service already started"); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] if[member[.started]] begin[{] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=repConfiguration, selectors=[], type_arguments=None), name=repName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=wsName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=wsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDefaultWorkspaceName, postfix_operators=[], prefix_operators=[], qualifier=repConfiguration, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=wsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=repName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=wsName, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=wsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDefaultWorkspaceName, postfix_operators=[], prefix_operators=[], qualifier=repConfiguration, selectors=[], type_arguments=None)), label=None))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=repName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRegistryLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=NT_FILE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResourceAsStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None))], dimensions=None, name=PrivilegedAction, sub_type=None))], member=doPrivilegedAction, postfix_operators=[], prefix_operators=[], qualifier=SecurityHelper, selectors=[], type_arguments=None), name=xml)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=repName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRepository, postfix_operators=[], prefix_operators=[], qualifier=repositoryService, selectors=[MethodInvocation(arguments=[], member=getNodeTypeManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=xml, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=IGNORE_IF_EXISTS, postfix_operators=[], prefix_operators=[], qualifier=ExtendedNodeTypeManager, selectors=[]), MemberReference(member=TEXT_XML, postfix_operators=[], prefix_operators=[], qualifier=NodeTypeDataManager, selectors=[])], member=registerNodeTypes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=xml, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, 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="An exception occurred: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=trace, 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)], label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=repConfigurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=repConfiguration)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RepositoryEntry, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=initStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=started, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, 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=['RepositoryConfigurationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, 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=['RepositoryException']))], finally_block=None, label=None, resources=None) else begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.warn, parameter[literal["Registry service already started"]]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[started] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[RepositoryEntry] identifier[repConfiguration] operator[:] identifier[repConfigurations] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[repName] operator[=] identifier[repConfiguration] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[wsName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[props] operator[!=] Other[null] operator[SEP] { identifier[wsName] operator[=] identifier[props] operator[SEP] identifier[getProperty] operator[SEP] identifier[repName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wsName] operator[==] Other[null] operator[SEP] identifier[wsName] operator[=] identifier[repConfiguration] operator[SEP] identifier[getDefaultWorkspaceName] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[wsName] operator[=] identifier[repConfiguration] operator[SEP] identifier[getDefaultWorkspaceName] operator[SEP] operator[SEP] operator[SEP] } identifier[addRegistryLocation] operator[SEP] identifier[repName] , identifier[wsName] operator[SEP] operator[SEP] identifier[InputStream] identifier[xml] operator[=] identifier[SecurityHelper] operator[SEP] identifier[doPrivilegedAction] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[InputStream] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[InputStream] identifier[run] operator[SEP] operator[SEP] { Keyword[return] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[NT_FILE] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[try] { identifier[repositoryService] operator[SEP] identifier[getRepository] operator[SEP] identifier[repName] operator[SEP] operator[SEP] identifier[getNodeTypeManager] operator[SEP] operator[SEP] operator[SEP] identifier[registerNodeTypes] operator[SEP] identifier[xml] , identifier[ExtendedNodeTypeManager] operator[SEP] identifier[IGNORE_IF_EXISTS] , identifier[NodeTypeDataManager] operator[SEP] identifier[TEXT_XML] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { identifier[xml] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } identifier[initStorage] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[started] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[RepositoryConfigurationException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RepositoryException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public Blob updateBlob(String bucketName, String blobName) { // [START updateBlob] Map<String, String> newMetadata = new HashMap<>(); newMetadata.put("key", "value"); storage.update(BlobInfo.newBuilder(bucketName, blobName).setMetadata(null).build()); Blob blob = storage.update(BlobInfo.newBuilder(bucketName, blobName).setMetadata(newMetadata).build()); // [END updateBlob] return blob; }
class class_name[name] begin[{] method[updateBlob, return_type[type[Blob]], modifier[public], parameter[bucketName, blobName]] begin[{] local_variable[type[Map], newMetadata] call[newMetadata.put, parameter[literal["key"], literal["value"]]] call[storage.update, parameter[call[BlobInfo.newBuilder, parameter[member[.bucketName], member[.blobName]]]]] local_variable[type[Blob], blob] return[member[.blob]] end[}] END[}]
Keyword[public] identifier[Blob] identifier[updateBlob] operator[SEP] identifier[String] identifier[bucketName] , identifier[String] identifier[blobName] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[newMetadata] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[newMetadata] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[storage] operator[SEP] identifier[update] operator[SEP] identifier[BlobInfo] operator[SEP] identifier[newBuilder] operator[SEP] identifier[bucketName] , identifier[blobName] operator[SEP] operator[SEP] identifier[setMetadata] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Blob] identifier[blob] operator[=] identifier[storage] operator[SEP] identifier[update] operator[SEP] identifier[BlobInfo] operator[SEP] identifier[newBuilder] operator[SEP] identifier[bucketName] , identifier[blobName] operator[SEP] operator[SEP] identifier[setMetadata] operator[SEP] identifier[newMetadata] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[blob] operator[SEP] }
@Override public void visit(final Multimedia multimedia) { for (final GedObject gedObject : multimedia.getAttributes()) { gedObject.accept(this); } }
class class_name[name] begin[{] method[visit, return_type[void], modifier[public], parameter[multimedia]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=gedObject, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=multimedia, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=gedObject)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=GedObject, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visit] operator[SEP] Keyword[final] identifier[Multimedia] identifier[multimedia] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[GedObject] identifier[gedObject] operator[:] identifier[multimedia] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] { identifier[gedObject] operator[SEP] identifier[accept] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } }
protected void rvfcalculate(double[] x) { value = 0.0; if (derivativeNumerator == null) { derivativeNumerator = new double[x.length]; for (int d = 0; d < data.length; d++) { // if (d == testMin) { // d = testMax - 1; // continue; // } int[] features = data[d]; for (int f = 0; f < features.length; f++) { int i = indexOf(features[f], labels[d]); if (dataweights == null) { derivativeNumerator[i] -= values[d][f]; } else { derivativeNumerator[i] -= dataweights[d]*values[d][f]; } } } } copy(derivative, derivativeNumerator); // Arrays.fill(derivative, 0.0); double[] sums = new double[numClasses]; double[] probs = new double[numClasses]; // double[] counts = new double[numClasses]; // Arrays.fill(counts, 0.0); for (int d = 0; d < data.length; d++) { // if (d == testMin) { // d = testMax - 1; // continue; // } int[] features = data[d]; // activation Arrays.fill(sums, 0.0); for (int c = 0; c < numClasses; c++) { for (int f = 0; f < features.length; f++) { int i = indexOf(features[f], c); sums[c] += x[i] * values[d][f]; } } // expectation (slower routine replaced by fast way) // double total = Double.NEGATIVE_INFINITY; // for (int c=0; c<numClasses; c++) { // total = SloppyMath.logAdd(total, sums[c]); // } double total = ArrayMath.logSum(sums); for (int c = 0; c < numClasses; c++) { probs[c] = Math.exp(sums[c] - total); if (dataweights != null) { probs[c] *= dataweights[d]; } for (int f = 0; f < features.length; f++) { int i = indexOf(features[f], c); derivative[i] += probs[c] * values[d][f]; } } double dV = sums[labels[d]] - total; if (dataweights != null) { dV *= dataweights[d]; } value -= dV; } value += prior.compute(x, derivative); }
class class_name[name] begin[{] method[rvfcalculate, return_type[void], modifier[protected], parameter[x]] begin[{] assign[member[.value], literal[0.0]] if[binary_operation[member[.derivativeNumerator], ==, literal[null]]] begin[{] assign[member[.derivativeNumerator], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=features)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=features, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dataweights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=derivativeNumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=-=, value=BinaryOperation(operandl=MemberReference(member=dataweights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=derivativeNumerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=-=, value=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=f)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=f, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] call[.copy, parameter[member[.derivative], member[.derivativeNumerator]]] local_variable[type[double], sums] local_variable[type[double], probs] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=features)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sums, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0)], member=fill, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=features, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sums, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=f)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=f, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numClasses, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sums, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logSum, postfix_operators=[], prefix_operators=[], qualifier=ArrayMath, selectors=[], type_arguments=None), name=total)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=probs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=sums, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=exp, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dataweights, 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=probs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=*=, value=MemberReference(member=dataweights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=features, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=derivative, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=BinaryOperation(operandl=MemberReference(member=probs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=f)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=f, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numClasses, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=sums, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))]), operandr=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=dV)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dataweights, 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=dV, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=MemberReference(member=dataweights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=dV, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.value], call[prior.compute, parameter[member[.x], member[.derivative]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[rvfcalculate] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[x] operator[SEP] { identifier[value] operator[=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[derivativeNumerator] operator[==] Other[null] operator[SEP] { identifier[derivativeNumerator] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[x] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[=] Other[0] operator[SEP] identifier[d] operator[<] identifier[data] operator[SEP] identifier[length] operator[SEP] identifier[d] operator[++] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[features] operator[=] identifier[data] operator[SEP] identifier[d] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[f] operator[=] Other[0] operator[SEP] identifier[f] operator[<] identifier[features] operator[SEP] identifier[length] operator[SEP] identifier[f] operator[++] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[indexOf] operator[SEP] identifier[features] operator[SEP] identifier[f] operator[SEP] , identifier[labels] operator[SEP] identifier[d] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataweights] operator[==] Other[null] operator[SEP] { identifier[derivativeNumerator] operator[SEP] identifier[i] operator[SEP] operator[-=] identifier[values] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[f] operator[SEP] operator[SEP] } Keyword[else] { identifier[derivativeNumerator] operator[SEP] identifier[i] operator[SEP] operator[-=] identifier[dataweights] operator[SEP] identifier[d] operator[SEP] operator[*] identifier[values] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[f] operator[SEP] operator[SEP] } } } } identifier[copy] operator[SEP] identifier[derivative] , identifier[derivativeNumerator] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[sums] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numClasses] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[probs] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numClasses] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[=] Other[0] operator[SEP] identifier[d] operator[<] identifier[data] operator[SEP] identifier[length] operator[SEP] identifier[d] operator[++] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[features] operator[=] identifier[data] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[sums] , literal[Float] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[numClasses] operator[SEP] identifier[c] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[f] operator[=] Other[0] operator[SEP] identifier[f] operator[<] identifier[features] operator[SEP] identifier[length] operator[SEP] identifier[f] operator[++] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[indexOf] operator[SEP] identifier[features] operator[SEP] identifier[f] operator[SEP] , identifier[c] operator[SEP] operator[SEP] identifier[sums] operator[SEP] identifier[c] operator[SEP] operator[+=] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[values] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[f] operator[SEP] operator[SEP] } } Keyword[double] identifier[total] operator[=] identifier[ArrayMath] operator[SEP] identifier[logSum] operator[SEP] identifier[sums] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[numClasses] operator[SEP] identifier[c] operator[++] operator[SEP] { identifier[probs] operator[SEP] identifier[c] operator[SEP] operator[=] identifier[Math] operator[SEP] identifier[exp] operator[SEP] identifier[sums] operator[SEP] identifier[c] operator[SEP] operator[-] identifier[total] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataweights] operator[!=] Other[null] operator[SEP] { identifier[probs] operator[SEP] identifier[c] operator[SEP] operator[*=] identifier[dataweights] operator[SEP] identifier[d] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[f] operator[=] Other[0] operator[SEP] identifier[f] operator[<] identifier[features] operator[SEP] identifier[length] operator[SEP] identifier[f] operator[++] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[indexOf] operator[SEP] identifier[features] operator[SEP] identifier[f] operator[SEP] , identifier[c] operator[SEP] operator[SEP] identifier[derivative] operator[SEP] identifier[i] operator[SEP] operator[+=] identifier[probs] operator[SEP] identifier[c] operator[SEP] operator[*] identifier[values] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[f] operator[SEP] operator[SEP] } } Keyword[double] identifier[dV] operator[=] identifier[sums] operator[SEP] identifier[labels] operator[SEP] identifier[d] operator[SEP] operator[SEP] operator[-] identifier[total] operator[SEP] Keyword[if] operator[SEP] identifier[dataweights] operator[!=] Other[null] operator[SEP] { identifier[dV] operator[*=] identifier[dataweights] operator[SEP] identifier[d] operator[SEP] operator[SEP] } identifier[value] operator[-=] identifier[dV] operator[SEP] } identifier[value] operator[+=] identifier[prior] operator[SEP] identifier[compute] operator[SEP] identifier[x] , identifier[derivative] operator[SEP] operator[SEP] }
@SafeVarargs protected final Move<? super SolutionType> getBestMove(Collection<? extends Move<? super SolutionType>> moves, boolean requireImprovement, Predicate<? super Move<? super SolutionType>>... filters){ return this.getBestMove(moves, requireImprovement, false, filters); }
class class_name[name] begin[{] method[getBestMove, return_type[type[Move]], modifier[final protected], parameter[moves, requireImprovement, filters]] begin[{] return[THIS[call[None.getBestMove, parameter[member[.moves], member[.requireImprovement], literal[false], member[.filters]]]]] end[}] END[}]
annotation[@] identifier[SafeVarargs] Keyword[protected] Keyword[final] identifier[Move] operator[<] operator[?] Keyword[super] identifier[SolutionType] operator[>] identifier[getBestMove] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Move] operator[<] operator[?] Keyword[super] identifier[SolutionType] operator[>] operator[>] identifier[moves] , Keyword[boolean] identifier[requireImprovement] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[Move] operator[<] operator[?] Keyword[super] identifier[SolutionType] operator[>] operator[>] operator[...] identifier[filters] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[getBestMove] operator[SEP] identifier[moves] , identifier[requireImprovement] , literal[boolean] , identifier[filters] operator[SEP] operator[SEP] }
public static Properties stringToProperties(String str) { Properties result = new Properties(); return stringToProperties(str, result); }
class class_name[name] begin[{] method[stringToProperties, return_type[type[Properties]], modifier[public static], parameter[str]] begin[{] local_variable[type[Properties], result] return[call[.stringToProperties, parameter[member[.str], member[.result]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Properties] identifier[stringToProperties] operator[SEP] identifier[String] identifier[str] operator[SEP] { identifier[Properties] identifier[result] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[stringToProperties] operator[SEP] identifier[str] , identifier[result] operator[SEP] operator[SEP] }
@Override public <T> CachedResource<T> getResource( Resource resource, Loader<T> builder, long checkInterval) throws IOException { if (Included.PLAIN == this.resourcesElementsProvider.getDefaultIncludedType()) { this.logger.trace( "Resoure Aggregation Disabled, ignoring resource cache and loading '" + resource + "' directly"); return this.loadResource(resource, builder); } // Look for the resource in the cache, since it has been wrapped with a SelfPopulatingCache // it should never return null. final GetResourceArguments<T> arguments = new GetResourceArguments<T>(resource, builder); final Element element = this.entryFactory.getWithData(this.resourceCache, resource, arguments); CachedResource<T> cachedResource = (CachedResource<T>) element.getObjectValue(); if (this.logger.isTraceEnabled()) { this.logger.trace("Found " + cachedResource + " in cache"); } // Found it, now check if the last-load time is within the check interval final long lastCheckTime = cachedResource.getLastCheckTime(); if (lastCheckTime + checkInterval >= System.currentTimeMillis()) { if (this.logger.isTraceEnabled()) { this.logger.trace( cachedResource + " is within checkInterval " + checkInterval + ", returning"); } return cachedResource; } if (this.logger.isTraceEnabled()) { this.logger.trace( cachedResource + " is older than checkInterval " + checkInterval + ", checking for modification"); } // If the resource has not been modified return the cached resource. final boolean resourceModified = this.checkIfModified(cachedResource); if (!resourceModified) { cachedResource.setLastCheckTime(System.currentTimeMillis()); this.resourceCache.put( element); // do a cache put to notify the cache the object has been modified return cachedResource; } // The resource has been modified, reload it. cachedResource = this.loadResource(resource, builder); // Cache the loaded resource this.resourceCache.put(new Element(resource, cachedResource)); if (this.logger.isDebugEnabled()) { this.logger.debug("Loaded and cached " + cachedResource); } return cachedResource; }
class class_name[name] begin[{] method[getResource, return_type[type[CachedResource]], modifier[public], parameter[resource, builder, checkInterval]] begin[{] if[binary_operation[member[Included.PLAIN], ==, THIS[member[None.resourcesElementsProvider]call[None.getDefaultIncludedType, parameter[]]]]] begin[{] THIS[member[None.logger]call[None.trace, parameter[binary_operation[binary_operation[literal["Resoure Aggregation Disabled, ignoring resource cache and loading '"], +, member[.resource]], +, literal["' directly"]]]]] return[THIS[call[None.loadResource, parameter[member[.resource], member[.builder]]]]] else begin[{] None end[}] local_variable[type[GetResourceArguments], arguments] local_variable[type[Element], element] local_variable[type[CachedResource], cachedResource] if[THIS[member[None.logger]call[None.isTraceEnabled, parameter[]]]] begin[{] THIS[member[None.logger]call[None.trace, parameter[binary_operation[binary_operation[literal["Found "], +, member[.cachedResource]], +, literal[" in cache"]]]]] else begin[{] None end[}] local_variable[type[long], lastCheckTime] if[binary_operation[binary_operation[member[.lastCheckTime], +, member[.checkInterval]], >=, call[System.currentTimeMillis, parameter[]]]] begin[{] if[THIS[member[None.logger]call[None.isTraceEnabled, parameter[]]]] begin[{] THIS[member[None.logger]call[None.trace, parameter[binary_operation[binary_operation[binary_operation[member[.cachedResource], +, literal[" is within checkInterval "]], +, member[.checkInterval]], +, literal[", returning"]]]]] else begin[{] None end[}] return[member[.cachedResource]] else begin[{] None end[}] if[THIS[member[None.logger]call[None.isTraceEnabled, parameter[]]]] begin[{] THIS[member[None.logger]call[None.trace, parameter[binary_operation[binary_operation[binary_operation[member[.cachedResource], +, literal[" is older than checkInterval "]], +, member[.checkInterval]], +, literal[", checking for modification"]]]]] else begin[{] None end[}] local_variable[type[boolean], resourceModified] if[member[.resourceModified]] begin[{] call[cachedResource.setLastCheckTime, parameter[call[System.currentTimeMillis, parameter[]]]] THIS[member[None.resourceCache]call[None.put, parameter[member[.element]]]] return[member[.cachedResource]] else begin[{] None end[}] assign[member[.cachedResource], THIS[call[None.loadResource, parameter[member[.resource], member[.builder]]]]] THIS[member[None.resourceCache]call[None.put, parameter[ClassCreator(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cachedResource, 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=Element, sub_type=None))]]] if[THIS[member[None.logger]call[None.isDebugEnabled, parameter[]]]] begin[{] THIS[member[None.logger]call[None.debug, parameter[binary_operation[literal["Loaded and cached "], +, member[.cachedResource]]]]] else begin[{] None end[}] return[member[.cachedResource]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[CachedResource] operator[<] identifier[T] operator[>] identifier[getResource] operator[SEP] identifier[Resource] identifier[resource] , identifier[Loader] operator[<] identifier[T] operator[>] identifier[builder] , Keyword[long] identifier[checkInterval] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[Included] operator[SEP] identifier[PLAIN] operator[==] Keyword[this] operator[SEP] identifier[resourcesElementsProvider] operator[SEP] identifier[getDefaultIncludedType] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[resource] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[loadResource] operator[SEP] identifier[resource] , identifier[builder] operator[SEP] operator[SEP] } Keyword[final] identifier[GetResourceArguments] operator[<] identifier[T] operator[>] identifier[arguments] operator[=] Keyword[new] identifier[GetResourceArguments] operator[<] identifier[T] operator[>] operator[SEP] identifier[resource] , identifier[builder] operator[SEP] operator[SEP] Keyword[final] identifier[Element] identifier[element] operator[=] Keyword[this] operator[SEP] identifier[entryFactory] operator[SEP] identifier[getWithData] operator[SEP] Keyword[this] operator[SEP] identifier[resourceCache] , identifier[resource] , identifier[arguments] operator[SEP] operator[SEP] identifier[CachedResource] operator[<] identifier[T] operator[>] identifier[cachedResource] operator[=] operator[SEP] identifier[CachedResource] operator[<] identifier[T] operator[>] operator[SEP] identifier[element] operator[SEP] identifier[getObjectValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[cachedResource] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[final] Keyword[long] identifier[lastCheckTime] operator[=] identifier[cachedResource] operator[SEP] identifier[getLastCheckTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastCheckTime] operator[+] identifier[checkInterval] operator[>=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[cachedResource] operator[+] literal[String] operator[+] identifier[checkInterval] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[cachedResource] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[cachedResource] operator[+] literal[String] operator[+] identifier[checkInterval] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[final] Keyword[boolean] identifier[resourceModified] operator[=] Keyword[this] operator[SEP] identifier[checkIfModified] operator[SEP] identifier[cachedResource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[resourceModified] operator[SEP] { identifier[cachedResource] operator[SEP] identifier[setLastCheckTime] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[resourceCache] operator[SEP] identifier[put] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[return] identifier[cachedResource] operator[SEP] } identifier[cachedResource] operator[=] Keyword[this] operator[SEP] identifier[loadResource] operator[SEP] identifier[resource] , identifier[builder] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[resourceCache] operator[SEP] identifier[put] operator[SEP] Keyword[new] identifier[Element] operator[SEP] identifier[resource] , identifier[cachedResource] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[cachedResource] operator[SEP] operator[SEP] } Keyword[return] identifier[cachedResource] operator[SEP] }
@Indexable(type = IndexableType.DELETE) @Override public CPOptionCategory deleteCPOptionCategory(long CPOptionCategoryId) throws PortalException { return cpOptionCategoryPersistence.remove(CPOptionCategoryId); }
class class_name[name] begin[{] method[deleteCPOptionCategory, return_type[type[CPOptionCategory]], modifier[public], parameter[CPOptionCategoryId]] begin[{] return[call[cpOptionCategoryPersistence.remove, parameter[member[.CPOptionCategoryId]]]] end[}] END[}]
annotation[@] identifier[Indexable] operator[SEP] identifier[type] operator[=] identifier[IndexableType] operator[SEP] identifier[DELETE] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[CPOptionCategory] identifier[deleteCPOptionCategory] operator[SEP] Keyword[long] identifier[CPOptionCategoryId] operator[SEP] Keyword[throws] identifier[PortalException] { Keyword[return] identifier[cpOptionCategoryPersistence] operator[SEP] identifier[remove] operator[SEP] identifier[CPOptionCategoryId] operator[SEP] operator[SEP] }
public DOAuth2User findByEmail(java.lang.String email) { return queryUniqueByField(null, DOAuth2UserMapper.Field.EMAIL.getFieldName(), email); }
class class_name[name] begin[{] method[findByEmail, return_type[type[DOAuth2User]], modifier[public], parameter[email]] begin[{] return[call[.queryUniqueByField, parameter[literal[null], call[DOAuth2UserMapper.Field.EMAIL.getFieldName, parameter[]], member[.email]]]] end[}] END[}]
Keyword[public] identifier[DOAuth2User] identifier[findByEmail] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[String] identifier[email] operator[SEP] { Keyword[return] identifier[queryUniqueByField] operator[SEP] Other[null] , identifier[DOAuth2UserMapper] operator[SEP] identifier[Field] operator[SEP] identifier[EMAIL] operator[SEP] identifier[getFieldName] operator[SEP] operator[SEP] , identifier[email] operator[SEP] operator[SEP] }
protected void doAttributes(AttributedCharacterIterator iter) { underline = false; Set set = iter.getAttributes().keySet(); for(Iterator iterator = set.iterator(); iterator.hasNext();) { AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute)iterator.next(); if (!(attribute instanceof TextAttribute)) { continue; } TextAttribute textattribute = (TextAttribute)attribute; if(textattribute.equals(TextAttribute.FONT)) { Font font = (Font)iter.getAttributes().get(textattribute); setFont(font); } else if(textattribute.equals(TextAttribute.UNDERLINE)) { if(TextAttribute.UNDERLINE_ON.equals(iter.getAttributes().get(textattribute))) { underline = true; } } else if(textattribute.equals(TextAttribute.SIZE)) { Object obj = iter.getAttributes().get(textattribute); if(obj instanceof Integer) { int i = ((Integer)obj).intValue(); setFont(getFont().deriveFont(getFont().getStyle(), i)); } else if(obj instanceof Float) { float f = ((Float)obj).floatValue(); setFont(getFont().deriveFont(getFont().getStyle(), f)); } } else if(textattribute.equals(TextAttribute.FOREGROUND)) { setColor((Color) iter.getAttributes().get(textattribute)); } else if(textattribute.equals(TextAttribute.FAMILY)) { Font font = getFont(); Map fontAttributes = font.getAttributes(); fontAttributes.put(TextAttribute.FAMILY, iter.getAttributes().get(textattribute)); setFont(font.deriveFont(fontAttributes)); } else if(textattribute.equals(TextAttribute.POSTURE)) { Font font = getFont(); Map fontAttributes = font.getAttributes(); fontAttributes.put(TextAttribute.POSTURE, iter.getAttributes().get(textattribute)); setFont(font.deriveFont(fontAttributes)); } else if(textattribute.equals(TextAttribute.WEIGHT)) { Font font = getFont(); Map fontAttributes = font.getAttributes(); fontAttributes.put(TextAttribute.WEIGHT, iter.getAttributes().get(textattribute)); setFont(font.deriveFont(fontAttributes)); } } }
class class_name[name] begin[{] method[doAttributes, return_type[void], modifier[protected], parameter[iter]] begin[{] assign[member[.underline], literal[false]] local_variable[type[Set], set] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AttributedCharacterIterator, sub_type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))), name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttributedCharacterIterator, sub_type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TextAttribute, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TextAttribute, sub_type=None)), name=textattribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TextAttribute, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FONT, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=textattribute, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=UNDERLINE, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=textattribute, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=textattribute, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FOREGROUND, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=textattribute, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FAMILY, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=textattribute, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=POSTURE, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=textattribute, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=WEIGHT, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=textattribute, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=font)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Font, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=font, selectors=[], type_arguments=None), name=fontAttributes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WEIGHT, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[]), MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[MethodInvocation(arguments=[MemberReference(member=textattribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=fontAttributes, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fontAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deriveFont, postfix_operators=[], prefix_operators=[], qualifier=font, selectors=[], type_arguments=None)], member=setFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=font)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Font, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=font, selectors=[], type_arguments=None), name=fontAttributes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=POSTURE, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[]), MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[MethodInvocation(arguments=[MemberReference(member=textattribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=fontAttributes, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fontAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deriveFont, postfix_operators=[], prefix_operators=[], qualifier=font, selectors=[], type_arguments=None)], member=setFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=font)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Font, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=font, selectors=[], type_arguments=None), name=fontAttributes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FAMILY, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[]), MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[MethodInvocation(arguments=[MemberReference(member=textattribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=fontAttributes, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fontAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deriveFont, postfix_operators=[], prefix_operators=[], qualifier=font, selectors=[], type_arguments=None)], member=setFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[MethodInvocation(arguments=[MemberReference(member=textattribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Color, sub_type=None))], member=setColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[MethodInvocation(arguments=[MemberReference(member=textattribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), name=f)], modifiers=set(), type=BasicType(dimensions=[], name=float)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getStyle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deriveFont, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getStyle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deriveFont, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[MethodInvocation(arguments=[MemberReference(member=textattribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute.UNDERLINE_ON, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=underline, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[MethodInvocation(arguments=[MemberReference(member=textattribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Font, sub_type=None)), name=font)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Font, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=font, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFont, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), name=iterator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[doAttributes] operator[SEP] identifier[AttributedCharacterIterator] identifier[iter] operator[SEP] { identifier[underline] operator[=] literal[boolean] operator[SEP] identifier[Set] identifier[set] operator[=] identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[iterator] operator[=] identifier[set] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[AttributedCharacterIterator] operator[SEP] identifier[Attribute] identifier[attribute] operator[=] operator[SEP] identifier[AttributedCharacterIterator] operator[SEP] identifier[Attribute] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[attribute] Keyword[instanceof] identifier[TextAttribute] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[TextAttribute] identifier[textattribute] operator[=] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[attribute] operator[SEP] Keyword[if] operator[SEP] identifier[textattribute] operator[SEP] identifier[equals] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[FONT] operator[SEP] operator[SEP] { identifier[Font] identifier[font] operator[=] operator[SEP] identifier[Font] operator[SEP] identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[textattribute] operator[SEP] operator[SEP] identifier[setFont] operator[SEP] identifier[font] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[textattribute] operator[SEP] identifier[equals] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[UNDERLINE] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[UNDERLINE_ON] operator[SEP] identifier[equals] operator[SEP] identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[textattribute] operator[SEP] operator[SEP] operator[SEP] { identifier[underline] operator[=] literal[boolean] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[textattribute] operator[SEP] identifier[equals] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[SIZE] operator[SEP] operator[SEP] { identifier[Object] identifier[obj] operator[=] identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[textattribute] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Integer] operator[SEP] { Keyword[int] identifier[i] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] identifier[setFont] operator[SEP] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] identifier[deriveFont] operator[SEP] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] , identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Float] operator[SEP] { Keyword[float] identifier[f] operator[=] operator[SEP] operator[SEP] identifier[Float] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] identifier[setFont] operator[SEP] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] identifier[deriveFont] operator[SEP] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] , identifier[f] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[textattribute] operator[SEP] identifier[equals] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[FOREGROUND] operator[SEP] operator[SEP] { identifier[setColor] operator[SEP] operator[SEP] identifier[Color] operator[SEP] identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[textattribute] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[textattribute] operator[SEP] identifier[equals] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[FAMILY] operator[SEP] operator[SEP] { identifier[Font] identifier[font] operator[=] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] identifier[Map] identifier[fontAttributes] operator[=] identifier[font] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[fontAttributes] operator[SEP] identifier[put] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[FAMILY] , identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[textattribute] operator[SEP] operator[SEP] operator[SEP] identifier[setFont] operator[SEP] identifier[font] operator[SEP] identifier[deriveFont] operator[SEP] identifier[fontAttributes] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[textattribute] operator[SEP] identifier[equals] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[POSTURE] operator[SEP] operator[SEP] { identifier[Font] identifier[font] operator[=] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] identifier[Map] identifier[fontAttributes] operator[=] identifier[font] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[fontAttributes] operator[SEP] identifier[put] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[POSTURE] , identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[textattribute] operator[SEP] operator[SEP] operator[SEP] identifier[setFont] operator[SEP] identifier[font] operator[SEP] identifier[deriveFont] operator[SEP] identifier[fontAttributes] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[textattribute] operator[SEP] identifier[equals] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[WEIGHT] operator[SEP] operator[SEP] { identifier[Font] identifier[font] operator[=] identifier[getFont] operator[SEP] operator[SEP] operator[SEP] identifier[Map] identifier[fontAttributes] operator[=] identifier[font] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[fontAttributes] operator[SEP] identifier[put] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[WEIGHT] , identifier[iter] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[textattribute] operator[SEP] operator[SEP] operator[SEP] identifier[setFont] operator[SEP] identifier[font] operator[SEP] identifier[deriveFont] operator[SEP] identifier[fontAttributes] operator[SEP] operator[SEP] operator[SEP] } } }
public DescribeWorkspaceBundlesResult withBundles(WorkspaceBundle... bundles) { if (this.bundles == null) { setBundles(new com.amazonaws.internal.SdkInternalList<WorkspaceBundle>(bundles.length)); } for (WorkspaceBundle ele : bundles) { this.bundles.add(ele); } return this; }
class class_name[name] begin[{] method[withBundles, return_type[type[DescribeWorkspaceBundlesResult]], modifier[public], parameter[bundles]] begin[{] if[binary_operation[THIS[member[None.bundles]], ==, literal[null]]] begin[{] call[.setBundles, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bundles, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WorkspaceBundle, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bundles, 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=bundles, 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=WorkspaceBundle, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeWorkspaceBundlesResult] identifier[withBundles] operator[SEP] identifier[WorkspaceBundle] operator[...] identifier[bundles] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[bundles] operator[==] Other[null] operator[SEP] { identifier[setBundles] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[WorkspaceBundle] operator[>] operator[SEP] identifier[bundles] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[WorkspaceBundle] identifier[ele] operator[:] identifier[bundles] operator[SEP] { Keyword[this] operator[SEP] identifier[bundles] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public boolean isBlacklisted( final String url ) throws MalformedURLException { final URL u = new URL( url ); return isBlacklisted( u ); }
class class_name[name] begin[{] method[isBlacklisted, return_type[type[boolean]], modifier[public], parameter[url]] begin[{] local_variable[type[URL], u] return[call[.isBlacklisted, parameter[member[.u]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isBlacklisted] operator[SEP] Keyword[final] identifier[String] identifier[url] operator[SEP] Keyword[throws] identifier[MalformedURLException] { Keyword[final] identifier[URL] identifier[u] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[return] identifier[isBlacklisted] operator[SEP] identifier[u] operator[SEP] operator[SEP] }
protected boolean isEquivalentInTheSet(Node node, boolean direction, Set<Node> set) { for (Node eq : direction == UPWARD ? node.getUpperEquivalent() : node.getLowerEquivalent()) { if (set.contains(eq)) return true; boolean isIn = isEquivalentInTheSet(eq, direction, set); if (isIn) return true; } return false; }
class class_name[name] begin[{] method[isEquivalentInTheSet, return_type[type[boolean]], modifier[protected], parameter[node, direction, set]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=eq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=eq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEquivalentInTheSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=isIn)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=isIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=EnhancedForControl(iterable=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=UPWARD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MethodInvocation(arguments=[], member=getLowerEquivalent, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getUpperEquivalent, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eq)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isEquivalentInTheSet] operator[SEP] identifier[Node] identifier[node] , Keyword[boolean] identifier[direction] , identifier[Set] operator[<] identifier[Node] operator[>] identifier[set] operator[SEP] { Keyword[for] operator[SEP] identifier[Node] identifier[eq] operator[:] identifier[direction] operator[==] identifier[UPWARD] operator[?] identifier[node] operator[SEP] identifier[getUpperEquivalent] operator[SEP] operator[SEP] operator[:] identifier[node] operator[SEP] identifier[getLowerEquivalent] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[set] operator[SEP] identifier[contains] operator[SEP] identifier[eq] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[boolean] identifier[isIn] operator[=] identifier[isEquivalentInTheSet] operator[SEP] identifier[eq] , identifier[direction] , identifier[set] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isIn] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Override public void write(byte[] buffer, int offset, int length) throws IOException { checkWritePrimitiveTypes(); primitiveTypes.write(buffer, offset, length); }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[buffer, offset, length]] begin[{] call[.checkWritePrimitiveTypes, parameter[]] call[primitiveTypes.write, parameter[member[.buffer], member[.offset], member[.length]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] { identifier[checkWritePrimitiveTypes] operator[SEP] operator[SEP] operator[SEP] identifier[primitiveTypes] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , identifier[offset] , identifier[length] operator[SEP] operator[SEP] }
public SagaInstanceInfo createNew(final SagaType type) { Saga newSaga = startNewSaga(type.getSagaClass()); return SagaInstanceInfo.define(newSaga, true); }
class class_name[name] begin[{] method[createNew, return_type[type[SagaInstanceInfo]], modifier[public], parameter[type]] begin[{] local_variable[type[Saga], newSaga] return[call[SagaInstanceInfo.define, parameter[member[.newSaga], literal[true]]]] end[}] END[}]
Keyword[public] identifier[SagaInstanceInfo] identifier[createNew] operator[SEP] Keyword[final] identifier[SagaType] identifier[type] operator[SEP] { identifier[Saga] identifier[newSaga] operator[=] identifier[startNewSaga] operator[SEP] identifier[type] operator[SEP] identifier[getSagaClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[SagaInstanceInfo] operator[SEP] identifier[define] operator[SEP] identifier[newSaga] , literal[boolean] operator[SEP] operator[SEP] }
public boolean createTableIfNotExists(ProvisionedThroughput throughput) { try { createTable(throughput); } catch (final ResourceInUseException e) { if (LOG.isTraceEnabled()) { LOG.trace("Table already exists, no need to create", e); } return false; } return true; }
class class_name[name] begin[{] method[createTableIfNotExists, return_type[type[boolean]], modifier[public], parameter[throughput]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=throughput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Table already exists, no need to create"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ResourceInUseException']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[createTableIfNotExists] operator[SEP] identifier[ProvisionedThroughput] identifier[throughput] operator[SEP] { Keyword[try] { identifier[createTable] operator[SEP] identifier[throughput] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[ResourceInUseException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void triggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetrics checkpointMetrics) throws Exception { throw new UnsupportedOperationException(String.format("triggerCheckpointOnBarrier not supported by %s", this.getClass().getName())); }
class class_name[name] begin[{] method[triggerCheckpointOnBarrier, return_type[void], modifier[public], parameter[checkpointMetaData, checkpointOptions, checkpointMetrics]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="triggerCheckpointOnBarrier not supported by %s"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[triggerCheckpointOnBarrier] operator[SEP] identifier[CheckpointMetaData] identifier[checkpointMetaData] , identifier[CheckpointOptions] identifier[checkpointOptions] , identifier[CheckpointMetrics] identifier[checkpointMetrics] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public ValidDBInstanceModificationsMessage withValidProcessorFeatures(AvailableProcessorFeature... validProcessorFeatures) { if (this.validProcessorFeatures == null) { setValidProcessorFeatures(new com.amazonaws.internal.SdkInternalList<AvailableProcessorFeature>(validProcessorFeatures.length)); } for (AvailableProcessorFeature ele : validProcessorFeatures) { this.validProcessorFeatures.add(ele); } return this; }
class class_name[name] begin[{] method[withValidProcessorFeatures, return_type[type[ValidDBInstanceModificationsMessage]], modifier[public], parameter[validProcessorFeatures]] begin[{] if[binary_operation[THIS[member[None.validProcessorFeatures]], ==, literal[null]]] begin[{] call[.setValidProcessorFeatures, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=validProcessorFeatures, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AvailableProcessorFeature, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=validProcessorFeatures, 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=validProcessorFeatures, 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=AvailableProcessorFeature, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ValidDBInstanceModificationsMessage] identifier[withValidProcessorFeatures] operator[SEP] identifier[AvailableProcessorFeature] operator[...] identifier[validProcessorFeatures] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[validProcessorFeatures] operator[==] Other[null] operator[SEP] { identifier[setValidProcessorFeatures] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[AvailableProcessorFeature] operator[>] operator[SEP] identifier[validProcessorFeatures] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[AvailableProcessorFeature] identifier[ele] operator[:] identifier[validProcessorFeatures] operator[SEP] { Keyword[this] operator[SEP] identifier[validProcessorFeatures] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static String shiftIndent(String str, int indent, int tabWidth) { if (isEmpty(str)) return str; if (indent <= 0) indent = 1; int n = 0; int i = 0; for (; i < str.length(); i++) { if (n > 0 && (n / tabWidth) >= indent) break; char c = str.charAt(i); if (' ' == c) n++; else if ('\t' == c) n += tabWidth; else break; } if (i > 0) return str.substring(i); return str; }
class class_name[name] begin[{] method[shiftIndent, return_type[type[String]], modifier[public static], parameter[str, indent, tabWidth]] begin[{] if[call[.isEmpty, parameter[member[.str]]]] begin[{] return[member[.str]] else begin[{] None end[}] if[binary_operation[member[.indent], <=, literal[0]]] begin[{] assign[member[.indent], literal[1]] else begin[{] None end[}] local_variable[type[int], n] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tabWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=MemberReference(member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=&&), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t'), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BreakStatement(goto=None, label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=tabWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), label=None, then_statement=StatementExpression(expression=MemberReference(member=n, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), 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=str, selectors=[], type_arguments=None), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.i], >, literal[0]]] begin[{] return[call[str.substring, parameter[member[.i]]]] else begin[{] None end[}] return[member[.str]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[shiftIndent] operator[SEP] identifier[String] identifier[str] , Keyword[int] identifier[indent] , Keyword[int] identifier[tabWidth] operator[SEP] { Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[return] identifier[str] operator[SEP] Keyword[if] operator[SEP] identifier[indent] operator[<=] Other[0] operator[SEP] identifier[indent] operator[=] Other[1] operator[SEP] Keyword[int] identifier[n] operator[=] Other[0] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[n] operator[>] Other[0] operator[&&] operator[SEP] identifier[n] operator[/] identifier[tabWidth] operator[SEP] operator[>=] identifier[indent] operator[SEP] Keyword[break] operator[SEP] Keyword[char] identifier[c] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[==] identifier[c] operator[SEP] identifier[n] operator[++] operator[SEP] Keyword[else] Keyword[if] operator[SEP] literal[String] operator[==] identifier[c] operator[SEP] identifier[n] operator[+=] identifier[tabWidth] operator[SEP] Keyword[else] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] Keyword[return] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[return] identifier[str] operator[SEP] }