code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static PrimitiveEvent event(EventType eventType, byte[] value) { return new PrimitiveEvent(EventType.canonical(eventType), value); }
class class_name[name] begin[{] method[event, return_type[type[PrimitiveEvent]], modifier[public static], parameter[eventType, value]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=canonical, postfix_operators=[], prefix_operators=[], qualifier=EventType, selectors=[], type_arguments=None), 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=None, dimensions=None, name=PrimitiveEvent, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[PrimitiveEvent] identifier[event] operator[SEP] identifier[EventType] identifier[eventType] , Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[PrimitiveEvent] operator[SEP] identifier[EventType] operator[SEP] identifier[canonical] operator[SEP] identifier[eventType] operator[SEP] , identifier[value] operator[SEP] operator[SEP] }
protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext) { // This is a bit dangerous, as it means that producer methods can end up // executing on partially constructed instances. Also, it's not required // by the spec... if (getAnnotated().isStatic()) { return null; } else { if (productCreationalContext instanceof WeldCreationalContext<?>) { WeldCreationalContext<?> creationalContextImpl = (WeldCreationalContext<?>) productCreationalContext; final Object incompleteInstance = creationalContextImpl.getIncompleteInstance(getDeclaringBean()); if (incompleteInstance != null) { BeanLogger.LOG.circularCall(getAnnotated(), getDeclaringBean()); return incompleteInstance; } } return getBeanManager().getReference(getDeclaringBean(), null, receiverCreationalContext, true); } }
class class_name[name] begin[{] method[getReceiver, return_type[type[Object]], modifier[protected], parameter[productCreationalContext, receiverCreationalContext]] begin[{] if[call[.getAnnotated, parameter[]]] begin[{] return[literal[null]] else begin[{] if[binary_operation[member[.productCreationalContext], instanceof, type[WeldCreationalContext]]] begin[{] local_variable[type[WeldCreationalContext], creationalContextImpl] local_variable[type[Object], incompleteInstance] if[binary_operation[member[.incompleteInstance], !=, literal[null]]] begin[{] call[BeanLogger.LOG.circularCall, parameter[call[.getAnnotated, parameter[]], call[.getDeclaringBean, parameter[]]]] return[member[.incompleteInstance]] else begin[{] None end[}] else begin[{] None end[}] return[call[.getBeanManager, parameter[]]] end[}] end[}] END[}]
Keyword[protected] identifier[Object] identifier[getReceiver] operator[SEP] identifier[CreationalContext] operator[<] operator[?] operator[>] identifier[productCreationalContext] , identifier[CreationalContext] operator[<] operator[?] operator[>] identifier[receiverCreationalContext] operator[SEP] { Keyword[if] operator[SEP] identifier[getAnnotated] operator[SEP] operator[SEP] operator[SEP] identifier[isStatic] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[productCreationalContext] Keyword[instanceof] identifier[WeldCreationalContext] operator[<] operator[?] operator[>] operator[SEP] { identifier[WeldCreationalContext] operator[<] operator[?] operator[>] identifier[creationalContextImpl] operator[=] operator[SEP] identifier[WeldCreationalContext] operator[<] operator[?] operator[>] operator[SEP] identifier[productCreationalContext] operator[SEP] Keyword[final] identifier[Object] identifier[incompleteInstance] operator[=] identifier[creationalContextImpl] operator[SEP] identifier[getIncompleteInstance] operator[SEP] identifier[getDeclaringBean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[incompleteInstance] operator[!=] Other[null] operator[SEP] { identifier[BeanLogger] operator[SEP] identifier[LOG] operator[SEP] identifier[circularCall] operator[SEP] identifier[getAnnotated] operator[SEP] operator[SEP] , identifier[getDeclaringBean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[incompleteInstance] operator[SEP] } } Keyword[return] identifier[getBeanManager] operator[SEP] operator[SEP] operator[SEP] identifier[getReference] operator[SEP] identifier[getDeclaringBean] operator[SEP] operator[SEP] , Other[null] , identifier[receiverCreationalContext] , literal[boolean] operator[SEP] operator[SEP] } }
public void deleteOperaPrefs() { // Only delete if Opera is currently not running // Don't delete in no-launcher mode if (runner != null && !runner.isOperaRunning()) { // Will only delete profile if it's not a default main profile if (!profileUtils.deleteProfile()) { logger.severe("Could not delete profile"); } } else { logger.warning("Cannot delete profile while Opera is running"); } }
class class_name[name] begin[{] method[deleteOperaPrefs, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[.runner], !=, literal[null]], &&, call[runner.isOperaRunning, parameter[]]]] begin[{] if[call[profileUtils.deleteProfile, parameter[]]] begin[{] call[logger.severe, parameter[literal["Could not delete profile"]]] else begin[{] None end[}] else begin[{] call[logger.warning, parameter[literal["Cannot delete profile while Opera is running"]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteOperaPrefs] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[runner] operator[!=] Other[null] operator[&&] operator[!] identifier[runner] operator[SEP] identifier[isOperaRunning] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[profileUtils] operator[SEP] identifier[deleteProfile] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { identifier[logger] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public String findFilter(String destination) { FindFilterEvent event = new FindFilterEvent(); event.setDestination(destination); try { Object obj = delegate.callManager(event); if (obj != null && obj instanceof String) { return (String) obj; } else { throw new CanalException("No Such Canal by [" + destination + "]"); } } catch (Exception e) { throw new CanalException("call_manager_error", e); } }
class class_name[name] begin[{] method[findFilter, return_type[type[String]], modifier[public], parameter[destination]] begin[{] local_variable[type[FindFilterEvent], event] call[event.setDestination, parameter[member[.destination]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=callManager, postfix_operators=[], prefix_operators=[], qualifier=delegate, selectors=[], type_arguments=None), name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No Such Canal by ["), operandr=MemberReference(member=destination, 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=CanalException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="call_manager_error"), 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=CanalException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[findFilter] operator[SEP] identifier[String] identifier[destination] operator[SEP] { identifier[FindFilterEvent] identifier[event] operator[=] Keyword[new] identifier[FindFilterEvent] operator[SEP] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[setDestination] operator[SEP] identifier[destination] operator[SEP] operator[SEP] Keyword[try] { identifier[Object] identifier[obj] operator[=] identifier[delegate] operator[SEP] identifier[callManager] operator[SEP] identifier[event] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[&&] identifier[obj] Keyword[instanceof] identifier[String] operator[SEP] { Keyword[return] operator[SEP] identifier[String] operator[SEP] identifier[obj] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[CanalException] operator[SEP] literal[String] operator[+] identifier[destination] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CanalException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
@Override public EClass getIfcThermodynamicTemperatureMeasure() { if (ifcThermodynamicTemperatureMeasureEClass == null) { ifcThermodynamicTemperatureMeasureEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(884); } return ifcThermodynamicTemperatureMeasureEClass; }
class class_name[name] begin[{] method[getIfcThermodynamicTemperatureMeasure, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcThermodynamicTemperatureMeasureEClass], ==, literal[null]]] begin[{] assign[member[.ifcThermodynamicTemperatureMeasureEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=884)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcThermodynamicTemperatureMeasureEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcThermodynamicTemperatureMeasure] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcThermodynamicTemperatureMeasureEClass] operator[==] Other[null] operator[SEP] { identifier[ifcThermodynamicTemperatureMeasureEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[884] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcThermodynamicTemperatureMeasureEClass] operator[SEP] }
public InetSocketAddress getRemoteAddressTCP () { SocketChannel socketChannel = tcp.socketChannel; if (socketChannel != null) { Socket socket = tcp.socketChannel.socket(); if (socket != null) { return (InetSocketAddress)socket.getRemoteSocketAddress(); } } return null; }
class class_name[name] begin[{] method[getRemoteAddressTCP, return_type[type[InetSocketAddress]], modifier[public], parameter[]] begin[{] local_variable[type[SocketChannel], socketChannel] if[binary_operation[member[.socketChannel], !=, literal[null]]] begin[{] local_variable[type[Socket], socket] if[binary_operation[member[.socket], !=, literal[null]]] begin[{] return[Cast(expression=MethodInvocation(arguments=[], member=getRemoteSocketAddress, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[InetSocketAddress] identifier[getRemoteAddressTCP] operator[SEP] operator[SEP] { identifier[SocketChannel] identifier[socketChannel] operator[=] identifier[tcp] operator[SEP] identifier[socketChannel] operator[SEP] Keyword[if] operator[SEP] identifier[socketChannel] operator[!=] Other[null] operator[SEP] { identifier[Socket] identifier[socket] operator[=] identifier[tcp] operator[SEP] identifier[socketChannel] operator[SEP] identifier[socket] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[socket] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] identifier[InetSocketAddress] operator[SEP] identifier[socket] operator[SEP] identifier[getRemoteSocketAddress] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public Graph<K, NullValue, EV> intersect(Graph<K, VV, EV> graph, boolean distinctEdges) { DataSet<Edge<K, EV>> intersectEdges; if (distinctEdges) { intersectEdges = getDistinctEdgeIntersection(graph.getEdges()); } else { intersectEdges = getPairwiseEdgeIntersection(graph.getEdges()); } return Graph.fromDataSet(intersectEdges, getContext()); }
class class_name[name] begin[{] method[intersect, return_type[type[Graph]], modifier[public], parameter[graph, distinctEdges]] begin[{] local_variable[type[DataSet], intersectEdges] if[member[.distinctEdges]] begin[{] assign[member[.intersectEdges], call[.getDistinctEdgeIntersection, parameter[call[graph.getEdges, parameter[]]]]] else begin[{] assign[member[.intersectEdges], call[.getPairwiseEdgeIntersection, parameter[call[graph.getEdges, parameter[]]]]] end[}] return[call[Graph.fromDataSet, parameter[member[.intersectEdges], call[.getContext, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[Graph] operator[<] identifier[K] , identifier[NullValue] , identifier[EV] operator[>] identifier[intersect] operator[SEP] identifier[Graph] operator[<] identifier[K] , identifier[VV] , identifier[EV] operator[>] identifier[graph] , Keyword[boolean] identifier[distinctEdges] operator[SEP] { identifier[DataSet] operator[<] identifier[Edge] operator[<] identifier[K] , identifier[EV] operator[>] operator[>] identifier[intersectEdges] operator[SEP] Keyword[if] operator[SEP] identifier[distinctEdges] operator[SEP] { identifier[intersectEdges] operator[=] identifier[getDistinctEdgeIntersection] operator[SEP] identifier[graph] operator[SEP] identifier[getEdges] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[intersectEdges] operator[=] identifier[getPairwiseEdgeIntersection] operator[SEP] identifier[graph] operator[SEP] identifier[getEdges] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Graph] operator[SEP] identifier[fromDataSet] operator[SEP] identifier[intersectEdges] , identifier[getContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void topPosition(BaseCell cell) { if (cell != null) { int pos = mGroupBasicAdapter.getComponents().indexOf(cell); if (pos > 0) { VirtualLayoutManager lm = getLayoutManager(); View view = lm.findViewByPosition(pos); if (view != null) { int top = lm.getDecoratedTop(view); RecyclerView recyclerView = getContentView(); if (recyclerView != null) { recyclerView.scrollBy(0, top); } } else { RecyclerView recyclerView = getContentView(); if (recyclerView != null) { recyclerView.scrollToPosition(pos); } } } } }
class class_name[name] begin[{] method[topPosition, return_type[void], modifier[public], parameter[cell]] begin[{] if[binary_operation[member[.cell], !=, literal[null]]] begin[{] local_variable[type[int], pos] if[binary_operation[member[.pos], >, literal[0]]] begin[{] local_variable[type[VirtualLayoutManager], lm] local_variable[type[View], view] if[binary_operation[member[.view], !=, literal[null]]] begin[{] local_variable[type[int], top] local_variable[type[RecyclerView], recyclerView] if[binary_operation[member[.recyclerView], !=, literal[null]]] begin[{] call[recyclerView.scrollBy, parameter[literal[0], member[.top]]] else begin[{] None end[}] else begin[{] local_variable[type[RecyclerView], recyclerView] if[binary_operation[member[.recyclerView], !=, literal[null]]] begin[{] call[recyclerView.scrollToPosition, parameter[member[.pos]]] else begin[{] None end[}] end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[topPosition] operator[SEP] identifier[BaseCell] identifier[cell] operator[SEP] { Keyword[if] operator[SEP] identifier[cell] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[pos] operator[=] identifier[mGroupBasicAdapter] operator[SEP] identifier[getComponents] operator[SEP] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] identifier[cell] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[>] Other[0] operator[SEP] { identifier[VirtualLayoutManager] identifier[lm] operator[=] identifier[getLayoutManager] operator[SEP] operator[SEP] operator[SEP] identifier[View] identifier[view] operator[=] identifier[lm] operator[SEP] identifier[findViewByPosition] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[view] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[top] operator[=] identifier[lm] operator[SEP] identifier[getDecoratedTop] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[RecyclerView] identifier[recyclerView] operator[=] identifier[getContentView] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recyclerView] operator[!=] Other[null] operator[SEP] { identifier[recyclerView] operator[SEP] identifier[scrollBy] operator[SEP] Other[0] , identifier[top] operator[SEP] operator[SEP] } } Keyword[else] { identifier[RecyclerView] identifier[recyclerView] operator[=] identifier[getContentView] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recyclerView] operator[!=] Other[null] operator[SEP] { identifier[recyclerView] operator[SEP] identifier[scrollToPosition] operator[SEP] identifier[pos] operator[SEP] operator[SEP] } } } } }
public String detectMimeType(String filename, Callable<byte[]> getBytes) throws GetBytesException { Supplier<CompletionStage<byte[]>> supplier = () -> { try { return CompletableFuture.completedFuture(getBytes.call()); } catch (Exception ex) { throw new CompletionException(ex); } }; return unwrapFutureString(detectMimeTypeAsync(filename, supplier)); }
class class_name[name] begin[{] method[detectMimeType, return_type[type[String]], modifier[public], parameter[filename, getBytes]] begin[{] local_variable[type[Supplier], supplier] return[call[.unwrapFutureString, parameter[call[.detectMimeTypeAsync, parameter[member[.filename], member[.supplier]]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[detectMimeType] operator[SEP] identifier[String] identifier[filename] , identifier[Callable] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[getBytes] operator[SEP] Keyword[throws] identifier[GetBytesException] { identifier[Supplier] operator[<] identifier[CompletionStage] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[>] identifier[supplier] operator[=] operator[SEP] operator[SEP] operator[->] { Keyword[try] { Keyword[return] identifier[CompletableFuture] operator[SEP] identifier[completedFuture] operator[SEP] identifier[getBytes] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[CompletionException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } } operator[SEP] Keyword[return] identifier[unwrapFutureString] operator[SEP] identifier[detectMimeTypeAsync] operator[SEP] identifier[filename] , identifier[supplier] operator[SEP] operator[SEP] operator[SEP] }
protected static float costReplace(char x, char y) { int cost = 1; for(char[] xy: repCostChars){ if(xy[0]==x&&xy[1]==y){ cost =2; break; }else if(xy[0]==y&&xy[1]==x){ cost =2; break; } } return cost;//noCostChars.indexOf(c)!=-1?1:0; }
class class_name[name] begin[{] method[costReplace, return_type[type[float]], modifier[static protected], parameter[x, y]] begin[{] local_variable[type[int], cost] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=xy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=xy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=xy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=xy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None), BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=repCostChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=xy)], modifiers=set(), type=BasicType(dimensions=[None], name=char))), label=None) return[member[.cost]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[float] identifier[costReplace] operator[SEP] Keyword[char] identifier[x] , Keyword[char] identifier[y] operator[SEP] { Keyword[int] identifier[cost] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[xy] operator[:] identifier[repCostChars] operator[SEP] { Keyword[if] operator[SEP] identifier[xy] operator[SEP] Other[0] operator[SEP] operator[==] identifier[x] operator[&&] identifier[xy] operator[SEP] Other[1] operator[SEP] operator[==] identifier[y] operator[SEP] { identifier[cost] operator[=] Other[2] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[xy] operator[SEP] Other[0] operator[SEP] operator[==] identifier[y] operator[&&] identifier[xy] operator[SEP] Other[1] operator[SEP] operator[==] identifier[x] operator[SEP] { identifier[cost] operator[=] Other[2] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[cost] operator[SEP] }
@Override public void debug(final MessageItem messageItem) { getLogger().log(messageItem.getMarker(), FQCN, LocationAwareLogger.DEBUG_INT, messageItem.getText(), null, null); }
class class_name[name] begin[{] method[debug, return_type[void], modifier[public], parameter[messageItem]] begin[{] call[.getLogger, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[debug] operator[SEP] Keyword[final] identifier[MessageItem] identifier[messageItem] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[messageItem] operator[SEP] identifier[getMarker] operator[SEP] operator[SEP] , identifier[FQCN] , identifier[LocationAwareLogger] operator[SEP] identifier[DEBUG_INT] , identifier[messageItem] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , Other[null] , Other[null] operator[SEP] operator[SEP] }
public Collection<String> getNames() { Collection<String> names = new HashSet<String>(); for (InitParam initParam : initParams) { names.add(initParam.getName()); } return names; }
class class_name[name] begin[{] method[getNames, return_type[type[Collection]], modifier[public], parameter[]] begin[{] local_variable[type[Collection], names] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=initParam, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=initParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=initParam)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InitParam, sub_type=None))), label=None) return[member[.names]] end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[String] operator[>] identifier[getNames] operator[SEP] operator[SEP] { identifier[Collection] operator[<] identifier[String] operator[>] identifier[names] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[InitParam] identifier[initParam] operator[:] identifier[initParams] operator[SEP] { identifier[names] operator[SEP] identifier[add] operator[SEP] identifier[initParam] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[names] operator[SEP] }
public EObject resolveJavaObject(JvmType rootType, String fragment) throws UnknownNestedTypeException { if (fragment.endsWith("[]")) { return resolveJavaArrayObject(rootType, fragment); } int slash = fragment.indexOf('/'); if (slash != -1) { if (slash == 0) return null; String containerFragment = fragment.substring(0, slash); EObject container = resolveJavaObject(rootType, containerFragment); if (container != null) { String parameterName = fragment.substring(slash + 1); if (container instanceof JvmTypeParameterDeclarator) { JvmTypeParameterDeclarator executable = (JvmTypeParameterDeclarator) container; for(JvmTypeParameter parameter: executable.getTypeParameters()) { if (parameter.getName().equals(parameterName)) return parameter; } } } } else { if (rootType.getIdentifier().equals(fragment)) { return rootType; } if (!fragment.startsWith(rootType.getIdentifier())) { return null; } int rootNameLength = rootType.getIdentifier().length(); char sep = fragment.charAt(rootNameLength); Iterator<String> iter = Splitter.on(sep).split(fragment.substring(rootNameLength+1)).iterator(); JvmDeclaredType current = (JvmDeclaredType) rootType; while (iter.hasNext()) { String segment = iter.next(); Iterator<JvmDeclaredType> members = current.findAllNestedTypesByName(segment).iterator(); if (members.hasNext()) { current = members.next(); } else { throw new UnknownNestedTypeException("Couldn't resolve nested type for "+rootType.getIdentifier()+" and fragment "+fragment); } } return current; } return null; }
class class_name[name] begin[{] method[resolveJavaObject, return_type[type[EObject]], modifier[public], parameter[rootType, fragment]] begin[{] if[call[fragment.endsWith, parameter[literal["[]"]]]] begin[{] return[call[.resolveJavaArrayObject, parameter[member[.rootType], member[.fragment]]]] else begin[{] None end[}] local_variable[type[int], slash] if[binary_operation[member[.slash], !=, literal[1]]] begin[{] if[binary_operation[member[.slash], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], containerFragment] local_variable[type[EObject], container] if[binary_operation[member[.container], !=, literal[null]]] begin[{] local_variable[type[String], parameterName] if[binary_operation[member[.container], instanceof, type[JvmTypeParameterDeclarator]]] begin[{] local_variable[type[JvmTypeParameterDeclarator], executable] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[MethodInvocation(arguments=[MemberReference(member=parameterName, 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=ReturnStatement(expression=MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTypeParameters, postfix_operators=[], prefix_operators=[], qualifier=executable, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JvmTypeParameter, sub_type=None))), label=None) else begin[{] None end[}] else begin[{] None end[}] else begin[{] if[call[rootType.getIdentifier, parameter[]]] begin[{] return[member[.rootType]] else begin[{] None end[}] if[call[fragment.startsWith, parameter[call[rootType.getIdentifier, parameter[]]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], rootNameLength] local_variable[type[char], sep] local_variable[type[Iterator], iter] local_variable[type[JvmDeclaredType], current] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[String], segment] local_variable[type[Iterator], members] if[call[members.hasNext, parameter[]]] begin[{] assign[member[.current], call[members.next, parameter[]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't resolve nested type for "), operandr=MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=rootType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" and fragment "), operator=+), operandr=MemberReference(member=fragment, 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=UnknownNestedTypeException, sub_type=None)), label=None) end[}] end[}] return[member[.current]] end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[EObject] identifier[resolveJavaObject] operator[SEP] identifier[JvmType] identifier[rootType] , identifier[String] identifier[fragment] operator[SEP] Keyword[throws] identifier[UnknownNestedTypeException] { Keyword[if] operator[SEP] identifier[fragment] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[resolveJavaArrayObject] operator[SEP] identifier[rootType] , identifier[fragment] operator[SEP] operator[SEP] } Keyword[int] identifier[slash] operator[=] identifier[fragment] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[slash] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[slash] operator[==] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[String] identifier[containerFragment] operator[=] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[slash] operator[SEP] operator[SEP] identifier[EObject] identifier[container] operator[=] identifier[resolveJavaObject] operator[SEP] identifier[rootType] , identifier[containerFragment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[container] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[parameterName] operator[=] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[slash] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[container] Keyword[instanceof] identifier[JvmTypeParameterDeclarator] operator[SEP] { identifier[JvmTypeParameterDeclarator] identifier[executable] operator[=] operator[SEP] identifier[JvmTypeParameterDeclarator] operator[SEP] identifier[container] operator[SEP] Keyword[for] operator[SEP] identifier[JvmTypeParameter] identifier[parameter] operator[:] identifier[executable] operator[SEP] identifier[getTypeParameters] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[parameter] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[parameterName] operator[SEP] operator[SEP] Keyword[return] identifier[parameter] operator[SEP] } } } } Keyword[else] { Keyword[if] operator[SEP] identifier[rootType] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] { Keyword[return] identifier[rootType] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[fragment] operator[SEP] identifier[startsWith] operator[SEP] identifier[rootType] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[rootNameLength] operator[=] identifier[rootType] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[char] identifier[sep] operator[=] identifier[fragment] operator[SEP] identifier[charAt] operator[SEP] identifier[rootNameLength] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[iter] operator[=] identifier[Splitter] operator[SEP] identifier[on] operator[SEP] identifier[sep] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[rootNameLength] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[JvmDeclaredType] identifier[current] operator[=] operator[SEP] identifier[JvmDeclaredType] operator[SEP] identifier[rootType] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[segment] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[JvmDeclaredType] operator[>] identifier[members] operator[=] identifier[current] operator[SEP] identifier[findAllNestedTypesByName] operator[SEP] identifier[segment] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[members] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[current] operator[=] identifier[members] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UnknownNestedTypeException] operator[SEP] literal[String] operator[+] identifier[rootType] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[fragment] operator[SEP] operator[SEP] } } Keyword[return] identifier[current] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
static DiyFp minus(DiyFp a, DiyFp b) { DiyFp result = new DiyFp(a.f, a.e); result.subtract(b); return result; }
class class_name[name] begin[{] method[minus, return_type[type[DiyFp]], modifier[static], parameter[a, b]] begin[{] local_variable[type[DiyFp], result] call[result.subtract, parameter[member[.b]]] return[member[.result]] end[}] END[}]
Keyword[static] identifier[DiyFp] identifier[minus] operator[SEP] identifier[DiyFp] identifier[a] , identifier[DiyFp] identifier[b] operator[SEP] { identifier[DiyFp] identifier[result] operator[=] Keyword[new] identifier[DiyFp] operator[SEP] identifier[a] operator[SEP] identifier[f] , identifier[a] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[subtract] operator[SEP] identifier[b] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
@Deprecated public static final ParquetMetadata readFooter(Configuration configuration, FileStatus file, MetadataFilter filter) throws IOException { return readFooter(HadoopInputFile.fromStatus(file, configuration), filter); }
class class_name[name] begin[{] method[readFooter, return_type[type[ParquetMetadata]], modifier[final public static], parameter[configuration, file, filter]] begin[{] return[call[.readFooter, parameter[call[HadoopInputFile.fromStatus, parameter[member[.file], member[.configuration]]], member[.filter]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] Keyword[final] identifier[ParquetMetadata] identifier[readFooter] operator[SEP] identifier[Configuration] identifier[configuration] , identifier[FileStatus] identifier[file] , identifier[MetadataFilter] identifier[filter] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[readFooter] operator[SEP] identifier[HadoopInputFile] operator[SEP] identifier[fromStatus] operator[SEP] identifier[file] , identifier[configuration] operator[SEP] , identifier[filter] operator[SEP] operator[SEP] }
public static Collection<HystrixThreadPoolMetrics> getInstances() { List<HystrixThreadPoolMetrics> threadPoolMetrics = new ArrayList<HystrixThreadPoolMetrics>(); for (HystrixThreadPoolMetrics tpm: metrics.values()) { if (hasExecutedCommandsOnThread(tpm)) { threadPoolMetrics.add(tpm); } } return Collections.unmodifiableCollection(threadPoolMetrics); }
class class_name[name] begin[{] method[getInstances, return_type[type[Collection]], modifier[public static], parameter[]] begin[{] local_variable[type[List], threadPoolMetrics] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tpm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasExecutedCommandsOnThread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tpm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=threadPoolMetrics, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=metrics, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tpm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HystrixThreadPoolMetrics, sub_type=None))), label=None) return[call[Collections.unmodifiableCollection, parameter[member[.threadPoolMetrics]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[HystrixThreadPoolMetrics] operator[>] identifier[getInstances] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[HystrixThreadPoolMetrics] operator[>] identifier[threadPoolMetrics] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[HystrixThreadPoolMetrics] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[HystrixThreadPoolMetrics] identifier[tpm] operator[:] identifier[metrics] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[hasExecutedCommandsOnThread] operator[SEP] identifier[tpm] operator[SEP] operator[SEP] { identifier[threadPoolMetrics] operator[SEP] identifier[add] operator[SEP] identifier[tpm] operator[SEP] operator[SEP] } } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableCollection] operator[SEP] identifier[threadPoolMetrics] operator[SEP] operator[SEP] }
@Execute public ActionResponse index() { if (fessLoginAssist.getSavedUserBean().isPresent()) { return redirect(RootAction.class); } final SsoManager ssoManager = ComponentUtil.getSsoManager(); final LoginCredential loginCredential = ssoManager.getLoginCredential(); if (loginCredential == null) { if (logger.isDebugEnabled()) { logger.debug("No user in SSO request."); } if (ssoManager.available()) { saveError(messages -> messages.addErrorsSsoLoginError(GLOBAL)); } return redirect(LoginAction.class); } else if (loginCredential instanceof ActionResponseCredential) { return ((ActionResponseCredential) loginCredential).execute(); } try { return fessLoginAssist.loginRedirect(loginCredential, op -> {}, () -> { activityHelper.login(getUserBean()); userInfoHelper.deleteUserCodeFromCookie(request); return getHtmlResponse(); }); } catch (final LoginFailureException lfe) { if (logger.isDebugEnabled()) { logger.debug("SSO login failure.", lfe); } if (ssoManager.available()) { saveError(messages -> messages.addErrorsSsoLoginError(GLOBAL)); } activityHelper.loginFailure(OptionalThing.of(loginCredential)); return redirect(LoginAction.class); } }
class class_name[name] begin[{] method[index, return_type[type[ActionResponse]], modifier[public], parameter[]] begin[{] if[call[fessLoginAssist.getSavedUserBean, parameter[]]] begin[{] return[call[.redirect, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RootAction, sub_type=None))]]] else begin[{] None end[}] local_variable[type[SsoManager], ssoManager] local_variable[type[LoginCredential], loginCredential] if[binary_operation[member[.loginCredential], ==, literal[null]]] begin[{] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[literal["No user in SSO request."]]] else begin[{] None end[}] if[call[ssoManager.available, parameter[]]] begin[{] call[.saveError, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=GLOBAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addErrorsSsoLoginError, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), parameters=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] else begin[{] None end[}] return[call[.redirect, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LoginAction, sub_type=None))]]] else begin[{] if[binary_operation[member[.loginCredential], instanceof, type[ActionResponseCredential]]] begin[{] return[Cast(expression=MemberReference(member=loginCredential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ActionResponseCredential, sub_type=None))] else begin[{] None end[}] end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=loginCredential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=[], parameters=[MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUserBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=login, postfix_operators=[], prefix_operators=[], qualifier=activityHelper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteUserCodeFromCookie, postfix_operators=[], prefix_operators=[], qualifier=userInfoHelper, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=getHtmlResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], parameters=[])], member=loginRedirect, postfix_operators=[], prefix_operators=[], qualifier=fessLoginAssist, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, 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="SSO login failure."), MemberReference(member=lfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=ssoManager, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=GLOBAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addErrorsSsoLoginError, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), parameters=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=saveError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=loginCredential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=OptionalThing, selectors=[], type_arguments=None)], member=loginFailure, postfix_operators=[], prefix_operators=[], qualifier=activityHelper, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LoginAction, sub_type=None))], member=redirect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=lfe, types=['LoginFailureException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Execute] Keyword[public] identifier[ActionResponse] identifier[index] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[fessLoginAssist] operator[SEP] identifier[getSavedUserBean] operator[SEP] operator[SEP] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[redirect] operator[SEP] identifier[RootAction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[final] identifier[SsoManager] identifier[ssoManager] operator[=] identifier[ComponentUtil] operator[SEP] identifier[getSsoManager] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[LoginCredential] identifier[loginCredential] operator[=] identifier[ssoManager] operator[SEP] identifier[getLoginCredential] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loginCredential] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ssoManager] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] { identifier[saveError] operator[SEP] identifier[messages] operator[->] identifier[messages] operator[SEP] identifier[addErrorsSsoLoginError] operator[SEP] identifier[GLOBAL] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[redirect] operator[SEP] identifier[LoginAction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[loginCredential] Keyword[instanceof] identifier[ActionResponseCredential] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[ActionResponseCredential] operator[SEP] identifier[loginCredential] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] identifier[fessLoginAssist] operator[SEP] identifier[loginRedirect] operator[SEP] identifier[loginCredential] , identifier[op] operator[->] { } , operator[SEP] operator[SEP] operator[->] { identifier[activityHelper] operator[SEP] identifier[login] operator[SEP] identifier[getUserBean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[userInfoHelper] operator[SEP] identifier[deleteUserCodeFromCookie] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[getHtmlResponse] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[LoginFailureException] identifier[lfe] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[lfe] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ssoManager] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] { identifier[saveError] operator[SEP] identifier[messages] operator[->] identifier[messages] operator[SEP] identifier[addErrorsSsoLoginError] operator[SEP] identifier[GLOBAL] operator[SEP] operator[SEP] operator[SEP] } identifier[activityHelper] operator[SEP] identifier[loginFailure] operator[SEP] identifier[OptionalThing] operator[SEP] identifier[of] operator[SEP] identifier[loginCredential] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[redirect] operator[SEP] identifier[LoginAction] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } }
public CmsGallerySearchResultList getResult(CmsGallerySearchParameters params) throws CmsException { CmsGallerySearchResultList result = null; if ((m_cms == null) || (m_index == null)) { throw new CmsException(Messages.get().container(Messages.ERR_SEARCH_NOT_INITIALIZED_0)); } result = m_index.gallerySearch(m_cms, params); if (result.size() > 0) { result.calculatePages(params.getResultPage(), params.getMatchesPerPage()); } else { result = new CmsGallerySearchResultList(); } return result; }
class class_name[name] begin[{] method[getResult, return_type[type[CmsGallerySearchResultList]], modifier[public], parameter[params]] begin[{] local_variable[type[CmsGallerySearchResultList], result] if[binary_operation[binary_operation[member[.m_cms], ==, literal[null]], ||, binary_operation[member[.m_index], ==, literal[null]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_SEARCH_NOT_INITIALIZED_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.result], call[m_index.gallerySearch, parameter[member[.m_cms], member[.params]]]] if[binary_operation[call[result.size, parameter[]], >, literal[0]]] begin[{] call[result.calculatePages, parameter[call[params.getResultPage, parameter[]], call[params.getMatchesPerPage, parameter[]]]] else begin[{] assign[member[.result], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsGallerySearchResultList, sub_type=None))] end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[CmsGallerySearchResultList] identifier[getResult] operator[SEP] identifier[CmsGallerySearchParameters] identifier[params] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[CmsGallerySearchResultList] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[m_cms] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[m_index] operator[==] Other[null] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[CmsException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_SEARCH_NOT_INITIALIZED_0] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[=] identifier[m_index] operator[SEP] identifier[gallerySearch] operator[SEP] identifier[m_cms] , identifier[params] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[calculatePages] operator[SEP] identifier[params] operator[SEP] identifier[getResultPage] operator[SEP] operator[SEP] , identifier[params] operator[SEP] identifier[getMatchesPerPage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[=] Keyword[new] identifier[CmsGallerySearchResultList] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public OvhDeposit deposit_depositId_GET(String depositId) throws IOException { String qPath = "/me/deposit/{depositId}"; StringBuilder sb = path(qPath, depositId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhDeposit.class); }
class class_name[name] begin[{] method[deposit_depositId_GET, return_type[type[OvhDeposit]], modifier[public], parameter[depositId]] 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=OvhDeposit, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhDeposit] identifier[deposit_depositId_GET] operator[SEP] identifier[String] identifier[depositId] 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[depositId] 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[OvhDeposit] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
@SuppressWarnings({"unchecked"}) public <T> T getBean(final Class<T> type) { String name = resolveBeanName(type); return (T) getBean(name); }
class class_name[name] begin[{] method[getBean, return_type[type[T]], modifier[public], parameter[type]] begin[{] local_variable[type[String], name] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] } operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[getBean] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[resolveBeanName] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[getBean] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
@Override public FilterSupportStatus isFilterSupported( FilterAdapterContext context, org.apache.hadoop.hbase.filter.RowFilter filter) { ByteArrayComparable comparator = filter.getComparator(); if (!(comparator instanceof RegexStringComparator) && !(comparator instanceof BinaryComparator)) { return FilterSupportStatus.newNotSupported(comparator.getClass().getName() + " comparator is not supported"); } if (filter.getOperator() != CompareFilter.CompareOp.EQUAL) { return FilterSupportStatus.newNotSupported(filter.getOperator() + " operator is not supported"); } return FilterSupportStatus.SUPPORTED; }
class class_name[name] begin[{] method[isFilterSupported, return_type[type[FilterSupportStatus]], modifier[public], parameter[context, filter]] begin[{] local_variable[type[ByteArrayComparable], comparator] if[binary_operation[binary_operation[member[.comparator], instanceof, type[RegexStringComparator]], &&, binary_operation[member[.comparator], instanceof, type[BinaryComparator]]]] begin[{] return[call[FilterSupportStatus.newNotSupported, parameter[binary_operation[call[comparator.getClass, parameter[]], +, literal[" comparator is not supported"]]]]] else begin[{] None end[}] if[binary_operation[call[filter.getOperator, parameter[]], !=, member[CompareFilter.CompareOp.EQUAL]]] begin[{] return[call[FilterSupportStatus.newNotSupported, parameter[binary_operation[call[filter.getOperator, parameter[]], +, literal[" operator is not supported"]]]]] else begin[{] None end[}] return[member[FilterSupportStatus.SUPPORTED]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[FilterSupportStatus] identifier[isFilterSupported] operator[SEP] identifier[FilterAdapterContext] identifier[context] , identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[hadoop] operator[SEP] identifier[hbase] operator[SEP] identifier[filter] operator[SEP] identifier[RowFilter] identifier[filter] operator[SEP] { identifier[ByteArrayComparable] identifier[comparator] operator[=] identifier[filter] operator[SEP] identifier[getComparator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[comparator] Keyword[instanceof] identifier[RegexStringComparator] operator[SEP] operator[&&] operator[!] operator[SEP] identifier[comparator] Keyword[instanceof] identifier[BinaryComparator] operator[SEP] operator[SEP] { Keyword[return] identifier[FilterSupportStatus] operator[SEP] identifier[newNotSupported] operator[SEP] identifier[comparator] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[!=] identifier[CompareFilter] operator[SEP] identifier[CompareOp] operator[SEP] identifier[EQUAL] operator[SEP] { Keyword[return] identifier[FilterSupportStatus] operator[SEP] identifier[newNotSupported] operator[SEP] identifier[filter] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[FilterSupportStatus] operator[SEP] identifier[SUPPORTED] operator[SEP] }
public Vector3d normalizedPositiveY(Vector3d dest) { dest.x = m01; dest.y = m11; dest.z = m21; return dest; }
class class_name[name] begin[{] method[normalizedPositiveY, return_type[type[Vector3d]], modifier[public], parameter[dest]] begin[{] assign[member[dest.x], member[.m01]] assign[member[dest.y], member[.m11]] assign[member[dest.z], member[.m21]] return[member[.dest]] end[}] END[}]
Keyword[public] identifier[Vector3d] identifier[normalizedPositiveY] operator[SEP] identifier[Vector3d] identifier[dest] operator[SEP] { identifier[dest] operator[SEP] identifier[x] operator[=] identifier[m01] operator[SEP] identifier[dest] operator[SEP] identifier[y] operator[=] identifier[m11] operator[SEP] identifier[dest] operator[SEP] identifier[z] operator[=] identifier[m21] operator[SEP] Keyword[return] identifier[dest] operator[SEP] }
public static SmileParser newSmileParser(InputStream in, byte[] buf, int offset, int limit) throws IOException { return newSmileParser(in, buf, offset, limit, false, new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(), in, false)); }
class class_name[name] begin[{] method[newSmileParser, return_type[type[SmileParser]], modifier[public static], parameter[in, buf, offset, limit]] begin[{] return[call[.newSmileParser, parameter[member[.in], member[.buf], member[.offset], member[.limit], literal[false], ClassCreator(arguments=[MethodInvocation(arguments=[], member=_getBufferRecycler, postfix_operators=[], prefix_operators=[], qualifier=DEFAULT_SMILE_FACTORY, selectors=[], type_arguments=None), MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOContext, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SmileParser] identifier[newSmileParser] operator[SEP] identifier[InputStream] identifier[in] , Keyword[byte] operator[SEP] operator[SEP] identifier[buf] , Keyword[int] identifier[offset] , Keyword[int] identifier[limit] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[newSmileParser] operator[SEP] identifier[in] , identifier[buf] , identifier[offset] , identifier[limit] , literal[boolean] , Keyword[new] identifier[IOContext] operator[SEP] identifier[DEFAULT_SMILE_FACTORY] operator[SEP] identifier[_getBufferRecycler] operator[SEP] operator[SEP] , identifier[in] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] }
private void cacheData(@NonNull final KeyType key, @NonNull final DataType data) { synchronized (cache) { if (useCache) { cache.put(key, data); } } }
class class_name[name] begin[{] method[cacheData, return_type[void], modifier[private], parameter[key, data]] begin[{] SYNCHRONIZED[member[.cache]] BEGIN[{] if[member[.useCache]] begin[{] call[cache.put, parameter[member[.key], member[.data]]] else begin[{] None end[}] END[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[cacheData] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[KeyType] identifier[key] , annotation[@] identifier[NonNull] Keyword[final] identifier[DataType] identifier[data] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[cache] operator[SEP] { Keyword[if] operator[SEP] identifier[useCache] operator[SEP] { identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[data] operator[SEP] operator[SEP] } } }
public Object decode(final Class c, final Object fromDBObject, final MappedField mf) { Class toDecode = c; if (toDecode == null) { toDecode = fromDBObject.getClass(); } return getEncoder(toDecode).decode(toDecode, fromDBObject, mf); }
class class_name[name] begin[{] method[decode, return_type[type[Object]], modifier[public], parameter[c, fromDBObject, mf]] begin[{] local_variable[type[Class], toDecode] if[binary_operation[member[.toDecode], ==, literal[null]]] begin[{] assign[member[.toDecode], call[fromDBObject.getClass, parameter[]]] else begin[{] None end[}] return[call[.getEncoder, parameter[member[.toDecode]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[decode] operator[SEP] Keyword[final] identifier[Class] identifier[c] , Keyword[final] identifier[Object] identifier[fromDBObject] , Keyword[final] identifier[MappedField] identifier[mf] operator[SEP] { identifier[Class] identifier[toDecode] operator[=] identifier[c] operator[SEP] Keyword[if] operator[SEP] identifier[toDecode] operator[==] Other[null] operator[SEP] { identifier[toDecode] operator[=] identifier[fromDBObject] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[getEncoder] operator[SEP] identifier[toDecode] operator[SEP] operator[SEP] identifier[decode] operator[SEP] identifier[toDecode] , identifier[fromDBObject] , identifier[mf] operator[SEP] operator[SEP] }
public static FieldMapping getFieldMapping(IDataType type) { switch (type.getTypeCategory()) { case CLASS: case TRAIT: return ((HierarchicalType)type).fieldMapping(); case STRUCT: return ((StructType)type).fieldMapping(); default: throw new IllegalArgumentException("Type " + type + " doesn't have any fields!"); } }
class class_name[name] begin[{] method[getFieldMapping, return_type[type[FieldMapping]], modifier[public static], parameter[type]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['CLASS', 'TRAIT'], statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HierarchicalType, sub_type=None)), label=None)]), SwitchStatementCase(case=['STRUCT'], statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StructType, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Type "), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" doesn't have any fields!"), 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)])], expression=MethodInvocation(arguments=[], member=getTypeCategory, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[FieldMapping] identifier[getFieldMapping] operator[SEP] identifier[IDataType] identifier[type] operator[SEP] { Keyword[switch] operator[SEP] identifier[type] operator[SEP] identifier[getTypeCategory] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[CLASS] operator[:] Keyword[case] identifier[TRAIT] operator[:] Keyword[return] operator[SEP] operator[SEP] identifier[HierarchicalType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[fieldMapping] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[STRUCT] operator[:] Keyword[return] operator[SEP] operator[SEP] identifier[StructType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[fieldMapping] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[SEP] operator[SEP] } }
public void stopBroadcasting() { if (mBroadcaster.isRecording()) { mBroadcaster.stopRecording(); mBroadcaster.release(); } else { Log.e(TAG, "stopBroadcasting called but mBroadcaster not broadcasting"); } }
class class_name[name] begin[{] method[stopBroadcasting, return_type[void], modifier[public], parameter[]] begin[{] if[call[mBroadcaster.isRecording, parameter[]]] begin[{] call[mBroadcaster.stopRecording, parameter[]] call[mBroadcaster.release, parameter[]] else begin[{] call[Log.e, parameter[member[.TAG], literal["stopBroadcasting called but mBroadcaster not broadcasting"]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[stopBroadcasting] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[mBroadcaster] operator[SEP] identifier[isRecording] operator[SEP] operator[SEP] operator[SEP] { identifier[mBroadcaster] operator[SEP] identifier[stopRecording] operator[SEP] operator[SEP] operator[SEP] identifier[mBroadcaster] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] } }
protected void perform(JSONObject json, Coordinator coordinator, Provider provider) { logger.trace("Extracting event from JSON."); GerritEvent event = GerritJsonEventFactory.getEvent(json); if (event != null) { if (event instanceof GerritTriggeredEvent) { GerritTriggeredEvent gerritTriggeredEvent = (GerritTriggeredEvent)event; gerritTriggeredEvent.setProvider(provider); gerritTriggeredEvent.setReceivedOn(createdOn); } logger.debug("Event is: {}", event); perform(event, coordinator); } else { logger.debug("No event extracted!"); } }
class class_name[name] begin[{] method[perform, return_type[void], modifier[protected], parameter[json, coordinator, provider]] begin[{] call[logger.trace, parameter[literal["Extracting event from JSON."]]] local_variable[type[GerritEvent], event] if[binary_operation[member[.event], !=, literal[null]]] begin[{] if[binary_operation[member[.event], instanceof, type[GerritTriggeredEvent]]] begin[{] local_variable[type[GerritTriggeredEvent], gerritTriggeredEvent] call[gerritTriggeredEvent.setProvider, parameter[member[.provider]]] call[gerritTriggeredEvent.setReceivedOn, parameter[member[.createdOn]]] else begin[{] None end[}] call[logger.debug, parameter[literal["Event is: {}"], member[.event]]] call[.perform, parameter[member[.event], member[.coordinator]]] else begin[{] call[logger.debug, parameter[literal["No event extracted!"]]] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[perform] operator[SEP] identifier[JSONObject] identifier[json] , identifier[Coordinator] identifier[coordinator] , identifier[Provider] identifier[provider] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[GerritEvent] identifier[event] operator[=] identifier[GerritJsonEventFactory] operator[SEP] identifier[getEvent] operator[SEP] identifier[json] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[event] Keyword[instanceof] identifier[GerritTriggeredEvent] operator[SEP] { identifier[GerritTriggeredEvent] identifier[gerritTriggeredEvent] operator[=] operator[SEP] identifier[GerritTriggeredEvent] operator[SEP] identifier[event] operator[SEP] identifier[gerritTriggeredEvent] operator[SEP] identifier[setProvider] operator[SEP] identifier[provider] operator[SEP] operator[SEP] identifier[gerritTriggeredEvent] operator[SEP] identifier[setReceivedOn] operator[SEP] identifier[createdOn] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[event] operator[SEP] operator[SEP] identifier[perform] operator[SEP] identifier[event] , identifier[coordinator] operator[SEP] operator[SEP] } Keyword[else] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
private void _writeString(String text) throws IOException, JsonGenerationException { /* One check first: if String won't fit in the buffer, let's * segment writes. No point in extending buffer to huge sizes * (like if someone wants to include multi-megabyte base64 * encoded stuff or such) */ final int len = text.length(); if (len > _outputEnd) { // Let's reserve space for entity at begin/end _writeLongString(text); return; } // Ok: we know String will fit in buffer ok // But do we need to flush first? if ((_outputTail + len) > _outputEnd) { _flushBuffer(); } text.getChars(0, len, _outputBuffer, _outputTail); if (_maximumNonEscapedChar != 0) { _writeStringASCII(len, _maximumNonEscapedChar); } else { _writeString2(len); } }
class class_name[name] begin[{] method[_writeString, return_type[void], modifier[private], parameter[text]] begin[{] local_variable[type[int], len] if[binary_operation[member[.len], >, member[._outputEnd]]] begin[{] call[._writeLongString, parameter[member[.text]]] return[None] else begin[{] None end[}] if[binary_operation[binary_operation[member[._outputTail], +, member[.len]], >, member[._outputEnd]]] begin[{] call[._flushBuffer, parameter[]] else begin[{] None end[}] call[text.getChars, parameter[literal[0], member[.len], member[._outputBuffer], member[._outputTail]]] if[binary_operation[member[._maximumNonEscapedChar], !=, literal[0]]] begin[{] call[._writeStringASCII, parameter[member[.len], member[._maximumNonEscapedChar]]] else begin[{] call[._writeString2, parameter[member[.len]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[_writeString] operator[SEP] identifier[String] identifier[text] operator[SEP] Keyword[throws] identifier[IOException] , identifier[JsonGenerationException] { Keyword[final] Keyword[int] identifier[len] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] identifier[_outputEnd] operator[SEP] { identifier[_writeLongString] operator[SEP] identifier[text] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[_outputTail] operator[+] identifier[len] operator[SEP] operator[>] identifier[_outputEnd] operator[SEP] { identifier[_flushBuffer] operator[SEP] operator[SEP] operator[SEP] } identifier[text] operator[SEP] identifier[getChars] operator[SEP] Other[0] , identifier[len] , identifier[_outputBuffer] , identifier[_outputTail] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_maximumNonEscapedChar] operator[!=] Other[0] operator[SEP] { identifier[_writeStringASCII] operator[SEP] identifier[len] , identifier[_maximumNonEscapedChar] operator[SEP] operator[SEP] } Keyword[else] { identifier[_writeString2] operator[SEP] identifier[len] operator[SEP] operator[SEP] } }
private boolean previousSegment() { assert(state == State.ITER_CHECK_BWD); // The input text [(iter index)..limit[ passes the FCD check. pos = iter.getIndex(); // Collect the characters being checked, in case they need to be normalized. if(s == null) { s = new StringBuilder(); } else { s.setLength(0); } int nextCC = 0; for(;;) { // Fetch the previous character and its fcd16 value. int c = iter.previousCodePoint(); if(c < 0) { break; } int fcd16 = nfcImpl.getFCD16(c); int trailCC = fcd16 & 0xff; if(trailCC == 0 && s.length() != 0) { // FCD boundary after this character. iter.nextCodePoint(); break; } s.appendCodePoint(c); if(trailCC != 0 && ((nextCC != 0 && trailCC > nextCC) || CollationFCD.isFCD16OfTibetanCompositeVowel(fcd16))) { // Fails FCD check. Find the previous FCD boundary and normalize. while(fcd16 > 0xff) { c = iter.previousCodePoint(); if(c < 0) { break; } fcd16 = nfcImpl.getFCD16(c); if(fcd16 == 0) { iter.nextCodePoint(); break; } s.appendCodePoint(c); } s.reverse(); normalize(s); limit = pos; start = pos - s.length(); state = State.IN_NORM_ITER_AT_START; pos = normalized.length(); return true; } nextCC = fcd16 >> 8; if(nextCC == 0) { // FCD boundary before the following character. break; } } start = pos - s.length(); assert(pos != start); iter.moveIndex(s.length()); state = State.ITER_IN_FCD_SEGMENT; return true; }
class class_name[name] begin[{] method[previousSegment, return_type[type[boolean]], modifier[private], parameter[]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ITER_CHECK_BWD, postfix_operators=[], prefix_operators=[], qualifier=State, selectors=[]), operator===), label=None, value=None) assign[member[.pos], call[iter.getIndex, parameter[]]] if[binary_operation[member[.s], ==, literal[null]]] begin[{] assign[member[.s], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))] else begin[{] call[s.setLength, parameter[literal[0]]] end[}] local_variable[type[int], nextCC] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=previousCodePoint, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFCD16, postfix_operators=[], prefix_operators=[], qualifier=nfcImpl, selectors=[], type_arguments=None), name=fcd16)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=trailCC)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=trailCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=nextCodePoint, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendCodePoint, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=trailCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nextCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=trailCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nextCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isFCD16OfTibetanCompositeVowel, postfix_operators=[], prefix_operators=[], qualifier=CollationFCD, selectors=[], type_arguments=None), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=previousCodePoint, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFCD16, postfix_operators=[], prefix_operators=[], qualifier=nfcImpl, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=nextCodePoint, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendCodePoint, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=>), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=reverse, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=normalize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=-)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=IN_NORM_ITER_AT_START, postfix_operators=[], prefix_operators=[], qualifier=State, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=normalized, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=fcd16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nextCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=None, init=None, update=None), label=None) assign[member[.start], binary_operation[member[.pos], -, call[s.length, parameter[]]]] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), label=None, value=None) call[iter.moveIndex, parameter[call[s.length, parameter[]]]] assign[member[.state], member[State.ITER_IN_FCD_SEGMENT]] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[previousSegment] operator[SEP] operator[SEP] { Keyword[assert] operator[SEP] identifier[state] operator[==] identifier[State] operator[SEP] identifier[ITER_CHECK_BWD] operator[SEP] operator[SEP] identifier[pos] operator[=] identifier[iter] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] { identifier[s] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[s] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[int] identifier[nextCC] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[c] operator[=] identifier[iter] operator[SEP] identifier[previousCodePoint] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] Other[0] operator[SEP] { Keyword[break] operator[SEP] } Keyword[int] identifier[fcd16] operator[=] identifier[nfcImpl] operator[SEP] identifier[getFCD16] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[int] identifier[trailCC] operator[=] identifier[fcd16] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[trailCC] operator[==] Other[0] operator[&&] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[iter] operator[SEP] identifier[nextCodePoint] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[s] operator[SEP] identifier[appendCodePoint] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trailCC] operator[!=] Other[0] operator[&&] operator[SEP] operator[SEP] identifier[nextCC] operator[!=] Other[0] operator[&&] identifier[trailCC] operator[>] identifier[nextCC] operator[SEP] operator[||] identifier[CollationFCD] operator[SEP] identifier[isFCD16OfTibetanCompositeVowel] operator[SEP] identifier[fcd16] operator[SEP] operator[SEP] operator[SEP] { Keyword[while] operator[SEP] identifier[fcd16] operator[>] literal[Integer] operator[SEP] { identifier[c] operator[=] identifier[iter] operator[SEP] identifier[previousCodePoint] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] Other[0] operator[SEP] { Keyword[break] operator[SEP] } identifier[fcd16] operator[=] identifier[nfcImpl] operator[SEP] identifier[getFCD16] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fcd16] operator[==] Other[0] operator[SEP] { identifier[iter] operator[SEP] identifier[nextCodePoint] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[s] operator[SEP] identifier[appendCodePoint] operator[SEP] identifier[c] operator[SEP] operator[SEP] } identifier[s] operator[SEP] identifier[reverse] operator[SEP] operator[SEP] operator[SEP] identifier[normalize] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[limit] operator[=] identifier[pos] operator[SEP] identifier[start] operator[=] identifier[pos] operator[-] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[State] operator[SEP] identifier[IN_NORM_ITER_AT_START] operator[SEP] identifier[pos] operator[=] identifier[normalized] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[nextCC] operator[=] identifier[fcd16] operator[>] operator[>] Other[8] operator[SEP] Keyword[if] operator[SEP] identifier[nextCC] operator[==] Other[0] operator[SEP] { Keyword[break] operator[SEP] } } identifier[start] operator[=] identifier[pos] operator[-] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[pos] operator[!=] identifier[start] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[moveIndex] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[State] operator[SEP] identifier[ITER_IN_FCD_SEGMENT] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public static <T> T checkNotNull(T value, String message) { if (value == null) throw new NullPointerException(message); return value; }
class class_name[name] begin[{] method[checkNotNull, return_type[type[T]], modifier[public static], parameter[value, message]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] 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=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.value]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[checkNotNull] operator[SEP] identifier[T] identifier[value] , identifier[String] identifier[message] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] }
public EnvelopesInformation listStatus(String accountId, EnvelopeIdsRequest envelopeIdsRequest) throws ApiException { return listStatus(accountId, envelopeIdsRequest, null); }
class class_name[name] begin[{] method[listStatus, return_type[type[EnvelopesInformation]], modifier[public], parameter[accountId, envelopeIdsRequest]] begin[{] return[call[.listStatus, parameter[member[.accountId], member[.envelopeIdsRequest], literal[null]]]] end[}] END[}]
Keyword[public] identifier[EnvelopesInformation] identifier[listStatus] operator[SEP] identifier[String] identifier[accountId] , identifier[EnvelopeIdsRequest] identifier[envelopeIdsRequest] operator[SEP] Keyword[throws] identifier[ApiException] { Keyword[return] identifier[listStatus] operator[SEP] identifier[accountId] , identifier[envelopeIdsRequest] , Other[null] operator[SEP] operator[SEP] }
public <T, V extends Comparable<T>> V exclusiveBetween(final T start, final T end, final V value, final String message, final Object... values) { if (value.compareTo(start) <= 0 || value.compareTo(end) >= 0) { fail(String.format(message, values)); } return value; }
class class_name[name] begin[{] method[exclusiveBetween, return_type[type[V]], modifier[public], parameter[start, end, value, message, values]] begin[{] if[binary_operation[binary_operation[call[value.compareTo, parameter[member[.start]]], <=, literal[0]], ||, binary_operation[call[value.compareTo, parameter[member[.end]]], >=, literal[0]]]] begin[{] call[.fail, parameter[call[String.format, parameter[member[.message], member[.values]]]]] else begin[{] None end[}] return[member[.value]] end[}] END[}]
Keyword[public] operator[<] identifier[T] , identifier[V] Keyword[extends] identifier[Comparable] operator[<] identifier[T] operator[>] operator[>] identifier[V] identifier[exclusiveBetween] operator[SEP] Keyword[final] identifier[T] identifier[start] , Keyword[final] identifier[T] identifier[end] , Keyword[final] identifier[V] identifier[value] , Keyword[final] identifier[String] identifier[message] , Keyword[final] identifier[Object] operator[...] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[compareTo] operator[SEP] identifier[start] operator[SEP] operator[<=] Other[0] operator[||] identifier[value] operator[SEP] identifier[compareTo] operator[SEP] identifier[end] operator[SEP] operator[>=] Other[0] operator[SEP] { identifier[fail] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[message] , identifier[values] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
public static Optional<String> trimStart(final String input, String... chars) { return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(v -> { String pattern = String.format("^[%s]+", join(chars, "\\")); return v.replaceAll(pattern, ""); }); }
class class_name[name] begin[{] method[trimStart, return_type[type[Optional]], modifier[public static], parameter[input, chars]] begin[{] return[call[Optional.ofNullable, parameter[member[.input]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[String] operator[>] identifier[trimStart] operator[SEP] Keyword[final] identifier[String] identifier[input] , identifier[String] operator[...] identifier[chars] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[v] operator[->] operator[!] identifier[v] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[v] operator[->] { identifier[String] identifier[pattern] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[join] operator[SEP] identifier[chars] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[v] operator[SEP] identifier[replaceAll] operator[SEP] identifier[pattern] , literal[String] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
public static LinkedBindingBuilder<HttpClientObserver> bindNewObserver(final Binder binder, final Annotation annotation) { return Multibinder.newSetBinder(binder, HttpClientObserver.class, annotation).addBinding(); }
class class_name[name] begin[{] method[bindNewObserver, return_type[type[LinkedBindingBuilder]], modifier[public static], parameter[binder, annotation]] begin[{] return[call[Multibinder.newSetBinder, parameter[member[.binder], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpClientObserver, sub_type=None)), member[.annotation]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[LinkedBindingBuilder] operator[<] identifier[HttpClientObserver] operator[>] identifier[bindNewObserver] operator[SEP] Keyword[final] identifier[Binder] identifier[binder] , Keyword[final] identifier[Annotation] identifier[annotation] operator[SEP] { Keyword[return] identifier[Multibinder] operator[SEP] identifier[newSetBinder] operator[SEP] identifier[binder] , identifier[HttpClientObserver] operator[SEP] Keyword[class] , identifier[annotation] operator[SEP] operator[SEP] identifier[addBinding] operator[SEP] operator[SEP] operator[SEP] }
public static ListeningScheduledExecutorService listeningDecorator( ScheduledExecutorService delegate) { return (delegate instanceof ListeningScheduledExecutorService) ? (ListeningScheduledExecutorService) delegate : new ScheduledListeningDecorator(delegate); }
class class_name[name] begin[{] method[listeningDecorator, return_type[type[ListeningScheduledExecutorService]], modifier[public static], parameter[delegate]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ListeningScheduledExecutorService, sub_type=None), operator=instanceof), if_false=ClassCreator(arguments=[MemberReference(member=delegate, 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=ScheduledListeningDecorator, sub_type=None)), if_true=Cast(expression=MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ListeningScheduledExecutorService, sub_type=None)))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ListeningScheduledExecutorService] identifier[listeningDecorator] operator[SEP] identifier[ScheduledExecutorService] identifier[delegate] operator[SEP] { Keyword[return] operator[SEP] identifier[delegate] Keyword[instanceof] identifier[ListeningScheduledExecutorService] operator[SEP] operator[?] operator[SEP] identifier[ListeningScheduledExecutorService] operator[SEP] identifier[delegate] operator[:] Keyword[new] identifier[ScheduledListeningDecorator] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] }
public static boolean uninstallAddOnFiles( AddOn addOn, AddOnUninstallationProgressCallback callback, Set<AddOn> installedAddOns) { Validate.notNull(addOn, "Parameter addOn must not be null."); validateCallbackNotNull(callback); List<String> fileNames = getFilesSafeForUninstall( addOn, installedAddOns == null ? Collections.emptySet() : installedAddOns); if (fileNames.isEmpty()) { return true; } callback.filesWillBeRemoved(fileNames.size()); boolean uninstalledWithoutErrors = true; for (String name : fileNames) { if (name == null) { continue; } logger.debug("Uninstall file: " + name); File file = new File(Constant.getZapHome(), name); try { File parent = file.getParentFile(); if (file.exists() && !file.delete()) { logger.error("Failed to delete: " + file.getAbsolutePath()); uninstalledWithoutErrors = false; } callback.fileRemoved(); if (parent.isDirectory() && parent.list().length == 0) { logger.debug("Deleting: " + parent.getAbsolutePath()); if (!parent.delete()) { // Ignore - check for <= 2 as on *nix '.' and '..' are returned logger.debug("Failed to delete: " + parent.getAbsolutePath()); } } deleteEmptyDirsCreatedForAddOnFiles(file); } catch (Exception e) { logger.error("Failed to uninstall file " + file.getAbsolutePath(), e); } } Control.getSingleton().getExtensionLoader().addonFilesRemoved(); return uninstalledWithoutErrors; }
class class_name[name] begin[{] method[uninstallAddOnFiles, return_type[type[boolean]], modifier[public static], parameter[addOn, callback, installedAddOns]] begin[{] call[Validate.notNull, parameter[member[.addOn], literal["Parameter addOn must not be null."]]] call[.validateCallbackNotNull, parameter[member[.callback]]] local_variable[type[List], fileNames] if[call[fileNames.isEmpty, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] call[callback.filesWillBeRemoved, parameter[call[fileNames.size, parameter[]]]] local_variable[type[boolean], uninstalledWithoutErrors] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=name, 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=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Uninstall file: "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getZapHome, postfix_operators=[], prefix_operators=[], qualifier=Constant, selectors=[], type_arguments=None), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParentFile, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), name=parent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=['!'], qualifier=file, selectors=[], type_arguments=None), operator=&&), 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="Failed to delete: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=uninstalledWithoutErrors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=fileRemoved, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=list, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deleting: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=['!'], qualifier=parent, 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="Failed to delete: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteEmptyDirsCreatedForAddOnFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to uninstall file "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), 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)]), control=EnhancedForControl(iterable=MemberReference(member=fileNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[Control.getSingleton, parameter[]] return[member[.uninstalledWithoutErrors]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[uninstallAddOnFiles] operator[SEP] identifier[AddOn] identifier[addOn] , identifier[AddOnUninstallationProgressCallback] identifier[callback] , identifier[Set] operator[<] identifier[AddOn] operator[>] identifier[installedAddOns] operator[SEP] { identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[addOn] , literal[String] operator[SEP] operator[SEP] identifier[validateCallbackNotNull] operator[SEP] identifier[callback] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[fileNames] operator[=] identifier[getFilesSafeForUninstall] operator[SEP] identifier[addOn] , identifier[installedAddOns] operator[==] Other[null] operator[?] identifier[Collections] operator[SEP] identifier[emptySet] operator[SEP] operator[SEP] operator[:] identifier[installedAddOns] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileNames] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[callback] operator[SEP] identifier[filesWillBeRemoved] operator[SEP] identifier[fileNames] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[uninstalledWithoutErrors] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[fileNames] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[Constant] operator[SEP] identifier[getZapHome] operator[SEP] operator[SEP] , identifier[name] operator[SEP] operator[SEP] Keyword[try] { identifier[File] identifier[parent] operator[=] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[file] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[uninstalledWithoutErrors] operator[=] literal[boolean] operator[SEP] } identifier[callback] operator[SEP] identifier[fileRemoved] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[&&] identifier[parent] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[parent] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[parent] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[parent] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[deleteEmptyDirsCreatedForAddOnFiles] operator[SEP] identifier[file] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } identifier[Control] operator[SEP] identifier[getSingleton] operator[SEP] operator[SEP] operator[SEP] identifier[getExtensionLoader] operator[SEP] operator[SEP] operator[SEP] identifier[addonFilesRemoved] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[uninstalledWithoutErrors] operator[SEP] }
static void checkCompilePolicy(@Nullable String compilePolicy) { if (compilePolicy == null) { throw new InvalidCommandLineOptionException( "The default compilation policy (by-todo) is not supported by Error Prone," + " pass -XDcompilePolicy=byfile instead"); } switch (compilePolicy) { case "byfile": case "simple": break; default: throw new InvalidCommandLineOptionException( String.format( "-XDcompilePolicy=%s is not supported by Error Prone," + " pass -XDcompilePolicy=byfile instead", compilePolicy)); } }
class class_name[name] begin[{] method[checkCompilePolicy, return_type[void], modifier[static], parameter[compilePolicy]] begin[{] if[binary_operation[member[.compilePolicy], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The default compilation policy (by-todo) is not supported by Error Prone,"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" pass -XDcompilePolicy=byfile instead"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidCommandLineOptionException, sub_type=None)), label=None) else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="byfile"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="simple")], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-XDcompilePolicy=%s is not supported by Error Prone,"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" pass -XDcompilePolicy=byfile instead"), operator=+), MemberReference(member=compilePolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidCommandLineOptionException, sub_type=None)), label=None)])], expression=MemberReference(member=compilePolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[static] Keyword[void] identifier[checkCompilePolicy] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[compilePolicy] operator[SEP] { Keyword[if] operator[SEP] identifier[compilePolicy] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidCommandLineOptionException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[compilePolicy] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[InvalidCommandLineOptionException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , identifier[compilePolicy] operator[SEP] operator[SEP] operator[SEP] } }
public static File createLocalHash(File resource, String remoteLocation) throws ResourceDownloadError { File localHashFile; try { String contents = readFileToString(resource); String hashValue = hasher.hashValue(contents); String absPath = resource.getAbsolutePath(); String localHashPath = absPath + SHA256_EXTENSION; localHashFile = new File(localHashPath); write(localHashFile, hashValue, UTF_8); return localHashFile; } catch (IOException e) { throw new ResourceDownloadError(remoteLocation, e.getMessage()); } }
class class_name[name] begin[{] method[createLocalHash, return_type[type[File]], modifier[public static], parameter[resource, remoteLocation]] begin[{] local_variable[type[File], localHashFile] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFileToString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=contents)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=contents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hashValue, postfix_operators=[], prefix_operators=[], qualifier=hasher, selectors=[], type_arguments=None), name=hashValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), name=absPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=absPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SHA256_EXTENSION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=localHashPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=localHashFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=localHashPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localHashFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hashValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=localHashFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=remoteLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResourceDownloadError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[createLocalHash] operator[SEP] identifier[File] identifier[resource] , identifier[String] identifier[remoteLocation] operator[SEP] Keyword[throws] identifier[ResourceDownloadError] { identifier[File] identifier[localHashFile] operator[SEP] Keyword[try] { identifier[String] identifier[contents] operator[=] identifier[readFileToString] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[String] identifier[hashValue] operator[=] identifier[hasher] operator[SEP] identifier[hashValue] operator[SEP] identifier[contents] operator[SEP] operator[SEP] identifier[String] identifier[absPath] operator[=] identifier[resource] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[localHashPath] operator[=] identifier[absPath] operator[+] identifier[SHA256_EXTENSION] operator[SEP] identifier[localHashFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[localHashPath] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[localHashFile] , identifier[hashValue] , identifier[UTF_8] operator[SEP] operator[SEP] Keyword[return] identifier[localHashFile] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ResourceDownloadError] operator[SEP] identifier[remoteLocation] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public Type getLink() throws CacheReloadException { if (this.link == null) { Attribute.LOG.error("Access on Attribute Link without parent defintion: {}", this); } return Type.get(this.link); }
class class_name[name] begin[{] method[getLink, return_type[type[Type]], modifier[public], parameter[]] begin[{] if[binary_operation[THIS[member[None.link]], ==, literal[null]]] begin[{] call[Attribute.LOG.error, parameter[literal["Access on Attribute Link without parent defintion: {}"], THIS[]]] else begin[{] None end[}] return[call[Type.get, parameter[THIS[member[None.link]]]]] end[}] END[}]
Keyword[public] identifier[Type] identifier[getLink] operator[SEP] operator[SEP] Keyword[throws] identifier[CacheReloadException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[link] operator[==] Other[null] operator[SEP] { identifier[Attribute] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , Keyword[this] operator[SEP] operator[SEP] } Keyword[return] identifier[Type] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] identifier[link] operator[SEP] operator[SEP] }
protected CommsByteBuffer jfapExchange(CommsByteBuffer buffer, int sendSegmentType, int priority, boolean canPoolOnReceive) throws SIConnectionDroppedException, SIConnectionLostException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "jfapExchange", new Object[]{buffer, sendSegmentType, priority, canPoolOnReceive}); boolean success = false; CommsByteBuffer rcvBuffer = null; try { if (buffer == null) { // The data list cannot be null SIErrorException e = new SIErrorException( nls.getFormattedMessage("NULL_DATA_LIST_PASSED_IN_SICO1046", null, null) ); FFDCFilter.processException(e, CLASS_NAME + ".JFAPExchange", CommsConstants.JFAPCOMMUNICATOR_EXCHANGE_01, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e); throw e; } int reqNum = getRequestNumber(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(this, tc, "About to Exchange segment " + "conversation: "+ con + " " + JFapChannelConstants.getSegmentName(sendSegmentType) + " - " + sendSegmentType + " (0x" + Integer.toHexString(sendSegmentType) + ") " + "using request number " + reqNum); SibTr.debug(this, tc, con.getFullSummary()); } ReceivedData rd = con.exchange(buffer, sendSegmentType, reqNum, priority, canPoolOnReceive); rcvBuffer = getCommsByteBuffer(rd); int rcvSegmentType = rcvBuffer.getReceivedDataSegmentType(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Exchange completed successfully. " + "Segment returned " + JFapChannelConstants.getSegmentName(rcvSegmentType) + " - " + rcvSegmentType + " (0x" + Integer.toHexString(rcvSegmentType) + ")"); success = true; } finally { if (!success && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Exchange failed."); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "jfapExchange", rcvBuffer); } return rcvBuffer; }
class class_name[name] begin[{] method[jfapExchange, return_type[type[CommsByteBuffer]], modifier[protected], parameter[buffer, sendSegmentType, priority, canPoolOnReceive]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["jfapExchange"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sendSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=canPoolOnReceive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[boolean], success] local_variable[type[CommsByteBuffer], rcvBuffer] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NULL_DATA_LIST_PASSED_IN_SICO1046"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIErrorException, sub_type=None)), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SIErrorException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".JFAPExchange"), operator=+), MemberReference(member=JFAPCOMMUNICATOR_EXCHANGE_01, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRequestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=reqNum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="About to Exchange segment "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="conversation: "), operator=+), operandr=MemberReference(member=con, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=sendSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSegmentName, postfix_operators=[], prefix_operators=[], qualifier=JFapChannelConstants, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MemberReference(member=sendSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (0x"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=sendSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="using request number "), operator=+), operandr=MemberReference(member=reqNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getFullSummary, postfix_operators=[], prefix_operators=[], qualifier=con, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sendSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reqNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=canPoolOnReceive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exchange, postfix_operators=[], prefix_operators=[], qualifier=con, selectors=[], type_arguments=None), name=rd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ReceivedData, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rcvBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=rd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCommsByteBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getReceivedDataSegmentType, postfix_operators=[], prefix_operators=[], qualifier=rcvBuffer, selectors=[], type_arguments=None), name=rcvSegmentType)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exchange completed successfully. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Segment returned "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=rcvSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSegmentName, postfix_operators=[], prefix_operators=[], qualifier=JFapChannelConstants, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MemberReference(member=rcvSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (0x"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=rcvSegmentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=success, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exchange failed.")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="jfapExchange"), MemberReference(member=rcvBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))], label=None, resources=None) return[member[.rcvBuffer]] end[}] END[}]
Keyword[protected] identifier[CommsByteBuffer] identifier[jfapExchange] operator[SEP] identifier[CommsByteBuffer] identifier[buffer] , Keyword[int] identifier[sendSegmentType] , Keyword[int] identifier[priority] , Keyword[boolean] identifier[canPoolOnReceive] operator[SEP] Keyword[throws] identifier[SIConnectionDroppedException] , identifier[SIConnectionLostException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[buffer] , identifier[sendSegmentType] , identifier[priority] , identifier[canPoolOnReceive] } operator[SEP] operator[SEP] Keyword[boolean] identifier[success] operator[=] literal[boolean] operator[SEP] identifier[CommsByteBuffer] identifier[rcvBuffer] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[buffer] operator[==] Other[null] operator[SEP] { identifier[SIErrorException] identifier[e] operator[=] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[CommsConstants] operator[SEP] identifier[JFAPCOMMUNICATOR_EXCHANGE_01] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[int] identifier[reqNum] operator[=] identifier[getRequestNumber] 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[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] literal[String] operator[+] identifier[con] operator[+] literal[String] operator[+] identifier[JFapChannelConstants] operator[SEP] identifier[getSegmentName] operator[SEP] identifier[sendSegmentType] operator[SEP] operator[+] literal[String] operator[+] identifier[sendSegmentType] operator[+] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[sendSegmentType] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[reqNum] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , identifier[con] operator[SEP] identifier[getFullSummary] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ReceivedData] identifier[rd] operator[=] identifier[con] operator[SEP] identifier[exchange] operator[SEP] identifier[buffer] , identifier[sendSegmentType] , identifier[reqNum] , identifier[priority] , identifier[canPoolOnReceive] operator[SEP] operator[SEP] identifier[rcvBuffer] operator[=] identifier[getCommsByteBuffer] operator[SEP] identifier[rd] operator[SEP] operator[SEP] Keyword[int] identifier[rcvSegmentType] operator[=] identifier[rcvBuffer] operator[SEP] identifier[getReceivedDataSegmentType] 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[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] literal[String] operator[+] identifier[JFapChannelConstants] operator[SEP] identifier[getSegmentName] operator[SEP] identifier[rcvSegmentType] operator[SEP] operator[+] literal[String] operator[+] identifier[rcvSegmentType] operator[+] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[rcvSegmentType] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[success] operator[=] literal[boolean] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] operator[!] identifier[success] operator[&&] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[rcvBuffer] operator[SEP] operator[SEP] } Keyword[return] identifier[rcvBuffer] operator[SEP] }
private void checkDefaults() { Utils.require(m_shards != null || m_shardsRange != null, "shards or range parameter is not set"); Utils.require(m_shards == null || m_shardsRange == null, "shards and range parameters cannot be both set"); Utils.require(m_xshards == null || m_xshardsRange == null, "xshards and xrange parameters cannot be both set"); if(m_xshards == null && m_xshardsRange == null) { m_xshards = m_shards; m_xshardsRange = m_shardsRange; } if (m_query == null) m_query = "*"; if(m_metrics == null) m_metrics = "COUNT(*)"; }
class class_name[name] begin[{] method[checkDefaults, return_type[void], modifier[private], parameter[]] begin[{] call[Utils.require, parameter[binary_operation[binary_operation[member[.m_shards], !=, literal[null]], ||, binary_operation[member[.m_shardsRange], !=, literal[null]]], literal["shards or range parameter is not set"]]] call[Utils.require, parameter[binary_operation[binary_operation[member[.m_shards], ==, literal[null]], ||, binary_operation[member[.m_shardsRange], ==, literal[null]]], literal["shards and range parameters cannot be both set"]]] call[Utils.require, parameter[binary_operation[binary_operation[member[.m_xshards], ==, literal[null]], ||, binary_operation[member[.m_xshardsRange], ==, literal[null]]], literal["xshards and xrange parameters cannot be both set"]]] if[binary_operation[binary_operation[member[.m_xshards], ==, literal[null]], &&, binary_operation[member[.m_xshardsRange], ==, literal[null]]]] begin[{] assign[member[.m_xshards], member[.m_shards]] assign[member[.m_xshardsRange], member[.m_shardsRange]] else begin[{] None end[}] if[binary_operation[member[.m_query], ==, literal[null]]] begin[{] assign[member[.m_query], literal["*"]] else begin[{] None end[}] if[binary_operation[member[.m_metrics], ==, literal[null]]] begin[{] assign[member[.m_metrics], literal["COUNT(*)"]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkDefaults] operator[SEP] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[m_shards] operator[!=] Other[null] operator[||] identifier[m_shardsRange] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[m_shards] operator[==] Other[null] operator[||] identifier[m_shardsRange] operator[==] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[m_xshards] operator[==] Other[null] operator[||] identifier[m_xshardsRange] operator[==] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_xshards] operator[==] Other[null] operator[&&] identifier[m_xshardsRange] operator[==] Other[null] operator[SEP] { identifier[m_xshards] operator[=] identifier[m_shards] operator[SEP] identifier[m_xshardsRange] operator[=] identifier[m_shardsRange] operator[SEP] } Keyword[if] operator[SEP] identifier[m_query] operator[==] Other[null] operator[SEP] identifier[m_query] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[m_metrics] operator[==] Other[null] operator[SEP] identifier[m_metrics] operator[=] literal[String] operator[SEP] }
public void processSkeleton( BinaryFast binary, int[][] kernel ) { int oldForeEdge = 0; int oldBackEdge = 0; while( !(binary.getForegroundEdgePixels().size() == oldForeEdge && binary.getBackgroundEdgePixels().size() == oldBackEdge) ) { oldForeEdge = binary.getForegroundEdgePixels().size(); oldBackEdge = binary.getBackgroundEdgePixels().size(); for( int i = 0; i < kernel.length; ++i ) { binary = thinBinaryRep(binary, kernel[i]); binary.generateBackgroundEdgeFromForegroundEdge(); } } }
class class_name[name] begin[{] method[processSkeleton, return_type[void], modifier[public], parameter[binary, kernel]] begin[{] local_variable[type[int], oldForeEdge] local_variable[type[int], oldBackEdge] while[binary_operation[binary_operation[call[binary.getForegroundEdgePixels, parameter[]], ==, member[.oldForeEdge]], &&, binary_operation[call[binary.getBackgroundEdgePixels, parameter[]], ==, member[.oldBackEdge]]]] begin[{] assign[member[.oldForeEdge], call[binary.getForegroundEdgePixels, parameter[]]] assign[member[.oldBackEdge], call[binary.getBackgroundEdgePixels, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=binary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=binary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=thinBinaryRep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=generateBackgroundEdgeFromForegroundEdge, postfix_operators=[], prefix_operators=[], qualifier=binary, 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=kernel, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[processSkeleton] operator[SEP] identifier[BinaryFast] identifier[binary] , Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[kernel] operator[SEP] { Keyword[int] identifier[oldForeEdge] operator[=] Other[0] operator[SEP] Keyword[int] identifier[oldBackEdge] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[!] operator[SEP] identifier[binary] operator[SEP] identifier[getForegroundEdgePixels] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[oldForeEdge] operator[&&] identifier[binary] operator[SEP] identifier[getBackgroundEdgePixels] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[oldBackEdge] operator[SEP] operator[SEP] { identifier[oldForeEdge] operator[=] identifier[binary] operator[SEP] identifier[getForegroundEdgePixels] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[oldBackEdge] operator[=] identifier[binary] operator[SEP] identifier[getBackgroundEdgePixels] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[kernel] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[binary] operator[=] identifier[thinBinaryRep] operator[SEP] identifier[binary] , identifier[kernel] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[binary] operator[SEP] identifier[generateBackgroundEdgeFromForegroundEdge] operator[SEP] operator[SEP] operator[SEP] } } }
protected void configurePlugins(ProcessEngineConfigurationImpl configuration, ProcessEngineXml processEngineXml, ClassLoader classLoader) { for (ProcessEnginePluginXml pluginXml : processEngineXml.getPlugins()) { // create plugin instance Class<? extends ProcessEnginePlugin> pluginClass = loadClass(pluginXml.getPluginClass(), classLoader, ProcessEnginePlugin.class); ProcessEnginePlugin plugin = createInstance(pluginClass); // apply configured properties Map<String, String> properties = pluginXml.getProperties(); PropertyHelper.applyProperties(plugin, properties); // add to configuration configuration.getProcessEnginePlugins().add(plugin); } }
class class_name[name] begin[{] method[configurePlugins, return_type[void], modifier[protected], parameter[configuration, processEngineXml, classLoader]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPluginClass, postfix_operators=[], prefix_operators=[], qualifier=pluginXml, selectors=[], type_arguments=None), MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProcessEnginePlugin, sub_type=None))], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=pluginClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=ProcessEnginePlugin, sub_type=None))], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pluginClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=plugin)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProcessEnginePlugin, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=pluginXml, selectors=[], type_arguments=None), name=properties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=applyProperties, postfix_operators=[], prefix_operators=[], qualifier=PropertyHelper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getProcessEnginePlugins, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[MethodInvocation(arguments=[MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPlugins, postfix_operators=[], prefix_operators=[], qualifier=processEngineXml, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pluginXml)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProcessEnginePluginXml, sub_type=None))), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[configurePlugins] operator[SEP] identifier[ProcessEngineConfigurationImpl] identifier[configuration] , identifier[ProcessEngineXml] identifier[processEngineXml] , identifier[ClassLoader] identifier[classLoader] operator[SEP] { Keyword[for] operator[SEP] identifier[ProcessEnginePluginXml] identifier[pluginXml] operator[:] identifier[processEngineXml] operator[SEP] identifier[getPlugins] operator[SEP] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ProcessEnginePlugin] operator[>] identifier[pluginClass] operator[=] identifier[loadClass] operator[SEP] identifier[pluginXml] operator[SEP] identifier[getPluginClass] operator[SEP] operator[SEP] , identifier[classLoader] , identifier[ProcessEnginePlugin] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ProcessEnginePlugin] identifier[plugin] operator[=] identifier[createInstance] operator[SEP] identifier[pluginClass] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[properties] operator[=] identifier[pluginXml] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[PropertyHelper] operator[SEP] identifier[applyProperties] operator[SEP] identifier[plugin] , identifier[properties] operator[SEP] operator[SEP] identifier[configuration] operator[SEP] identifier[getProcessEnginePlugins] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[plugin] operator[SEP] operator[SEP] } }
public void setLanguage(String v) { if (Header_Type.featOkTst && ((Header_Type)jcasType).casFeat_language == null) jcasType.jcas.throwFeatMissing("language", "de.julielab.jules.types.Header"); jcasType.ll_cas.ll_setStringValue(addr, ((Header_Type)jcasType).casFeatCode_language, v);}
class class_name[name] begin[{] method[setLanguage, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[Header_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Header_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["language"], literal["de.julielab.jules.types.Header"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Header_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLanguage] operator[SEP] identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[Header_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Header_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_language] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Header_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_language] , identifier[v] operator[SEP] operator[SEP] }
public <T, P1, P2> T getPrototypeBean( final ConstructorWithBeansAnd2Parameters<T, P1, P2> creator, final P1 param1, final P2 param2) { final PrototypeProvider provider = new PrototypeProvider(name, beans -> creator.create(beans, param1, param2)); return provider.getBean(this, dryRun); }
class class_name[name] begin[{] method[getPrototypeBean, return_type[type[T]], modifier[public], parameter[creator, param1, param2]] begin[{] local_variable[type[PrototypeProvider], provider] return[call[provider.getBean, parameter[THIS[], member[.dryRun]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] , identifier[P1] , identifier[P2] operator[>] identifier[T] identifier[getPrototypeBean] operator[SEP] Keyword[final] identifier[ConstructorWithBeansAnd2Parameters] operator[<] identifier[T] , identifier[P1] , identifier[P2] operator[>] identifier[creator] , Keyword[final] identifier[P1] identifier[param1] , Keyword[final] identifier[P2] identifier[param2] operator[SEP] { Keyword[final] identifier[PrototypeProvider] identifier[provider] operator[=] Keyword[new] identifier[PrototypeProvider] operator[SEP] identifier[name] , identifier[beans] operator[->] identifier[creator] operator[SEP] identifier[create] operator[SEP] identifier[beans] , identifier[param1] , identifier[param2] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[provider] operator[SEP] identifier[getBean] operator[SEP] Keyword[this] , identifier[dryRun] operator[SEP] operator[SEP] }
private Set<String> findReachableNodes(CmsAppCategoryNode rootNode, HashSet<String> reachableNodes) { reachableNodes.add(rootNode.getCategory().getId()); for (CmsAppCategoryNode child : rootNode.getChildren()) { findReachableNodes(child, reachableNodes); } return reachableNodes; }
class class_name[name] begin[{] method[findReachableNodes, return_type[type[Set]], modifier[private], parameter[rootNode, reachableNodes]] begin[{] call[reachableNodes.add, parameter[call[rootNode.getCategory, parameter[]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reachableNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findReachableNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=rootNode, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsAppCategoryNode, sub_type=None))), label=None) return[member[.reachableNodes]] end[}] END[}]
Keyword[private] identifier[Set] operator[<] identifier[String] operator[>] identifier[findReachableNodes] operator[SEP] identifier[CmsAppCategoryNode] identifier[rootNode] , identifier[HashSet] operator[<] identifier[String] operator[>] identifier[reachableNodes] operator[SEP] { identifier[reachableNodes] operator[SEP] identifier[add] operator[SEP] identifier[rootNode] operator[SEP] identifier[getCategory] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsAppCategoryNode] identifier[child] operator[:] identifier[rootNode] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] { identifier[findReachableNodes] operator[SEP] identifier[child] , identifier[reachableNodes] operator[SEP] operator[SEP] } Keyword[return] identifier[reachableNodes] operator[SEP] }
private Object extractAsRuntime(Field field, String valueStr) { if (field.getType() == Byte.TYPE || field.getType() == Byte.class || field.getType() == Short.TYPE || field.getType() == Short.class || field.getType() == Integer.TYPE || field.getType() == Integer.class || field.getType() == Long.TYPE || field.getType() == Long.class || field.getType() == Float.TYPE || field.getType() == Float.class || field.getType() == Double.TYPE || field.getType() == Double.class) { return extractAsNumber(field, valueStr); } else if (String.class.isAssignableFrom(field.getType())) { return valueStr; } throw new IllegalArgumentException(Utils.format("Invalid type for RUNTIME type: {}", field.getType())); }
class class_name[name] begin[{] method[extractAsRuntime, return_type[type[Object]], modifier[private], parameter[field, valueStr]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[field.getType, parameter[]], ==, member[Byte.TYPE]], ||, binary_operation[call[field.getType, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))]], ||, binary_operation[call[field.getType, parameter[]], ==, member[Short.TYPE]]], ||, binary_operation[call[field.getType, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))]], ||, binary_operation[call[field.getType, parameter[]], ==, member[Integer.TYPE]]], ||, binary_operation[call[field.getType, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]], ||, binary_operation[call[field.getType, parameter[]], ==, member[Long.TYPE]]], ||, binary_operation[call[field.getType, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]], ||, binary_operation[call[field.getType, parameter[]], ==, member[Float.TYPE]]], ||, binary_operation[call[field.getType, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))]], ||, binary_operation[call[field.getType, parameter[]], ==, member[Double.TYPE]]], ||, binary_operation[call[field.getType, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))]]] begin[{] return[call[.extractAsNumber, parameter[member[.field], member[.valueStr]]]] else begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] begin[{] return[member[.valueStr]] else begin[{] None end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid type for RUNTIME type: {}"), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
Keyword[private] identifier[Object] identifier[extractAsRuntime] operator[SEP] identifier[Field] identifier[field] , identifier[String] identifier[valueStr] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Byte] operator[SEP] identifier[TYPE] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Byte] operator[SEP] Keyword[class] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Short] operator[SEP] identifier[TYPE] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Short] operator[SEP] Keyword[class] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Integer] operator[SEP] identifier[TYPE] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Integer] operator[SEP] Keyword[class] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Long] operator[SEP] identifier[TYPE] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Long] operator[SEP] Keyword[class] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Float] operator[SEP] identifier[TYPE] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Float] operator[SEP] Keyword[class] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Double] operator[SEP] identifier[TYPE] operator[||] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Double] operator[SEP] Keyword[class] operator[SEP] { Keyword[return] identifier[extractAsNumber] operator[SEP] identifier[field] , identifier[valueStr] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[valueStr] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[Utils] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static JsonDocument create(String id, JsonObject content) { return new JsonDocument(id, 0, content, 0, null); }
class class_name[name] begin[{] method[create, return_type[type[JsonDocument]], modifier[public static], parameter[id, content]] begin[{] return[ClassCreator(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), 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=JsonDocument, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[JsonDocument] identifier[create] operator[SEP] identifier[String] identifier[id] , identifier[JsonObject] identifier[content] operator[SEP] { Keyword[return] Keyword[new] identifier[JsonDocument] operator[SEP] identifier[id] , Other[0] , identifier[content] , Other[0] , Other[null] operator[SEP] operator[SEP] }
public static String format(Instant time, DateTimeFormatter format) { if (format == null) { return formatDateTime(time); } Assert.notNull(time, "Missing time!"); return format.format(time); }
class class_name[name] begin[{] method[format, return_type[type[String]], modifier[public static], parameter[time, format]] begin[{] if[binary_operation[member[.format], ==, literal[null]]] begin[{] return[call[.formatDateTime, parameter[member[.time]]]] else begin[{] None end[}] call[Assert.notNull, parameter[member[.time], literal["Missing time!"]]] return[call[format.format, parameter[member[.time]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[format] operator[SEP] identifier[Instant] identifier[time] , identifier[DateTimeFormatter] identifier[format] operator[SEP] { Keyword[if] operator[SEP] identifier[format] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[formatDateTime] operator[SEP] identifier[time] operator[SEP] operator[SEP] } identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[time] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[format] operator[SEP] identifier[format] operator[SEP] identifier[time] operator[SEP] operator[SEP] }
public static final void texture(final Shape shape, Image image, final TexCoordGenerator gen) { Texture t = TextureImpl.getLastBind(); image.getTexture().bind(); final float center[] = shape.getCenter(); fill(shape, new PointCallback() { public float[] preRenderPoint(Shape shape, float x, float y) { Vector2f tex = gen.getCoordFor(x, y); GL.glTexCoord2f(tex.x, tex.y); return new float[] {x,y}; } }); if (t == null) { TextureImpl.bindNone(); } else { t.bind(); } }
class class_name[name] begin[{] method[texture, return_type[void], modifier[final public static], parameter[shape, image, gen]] begin[{] local_variable[type[Texture], t] call[image.getTexture, parameter[]] local_variable[type[float], center] call[.fill, parameter[member[.shape], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCoordFor, postfix_operators=[], prefix_operators=[], qualifier=gen, selectors=[], type_arguments=None), name=tex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vector2f, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=tex, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=tex, selectors=[])], member=glTexCoord2f, postfix_operators=[], prefix_operators=[], qualifier=GL, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=float)), label=None)], documentation=None, modifiers={'public'}, name=preRenderPoint, parameters=[FormalParameter(annotations=[], modifiers=set(), name=shape, type=ReferenceType(arguments=None, dimensions=[], name=Shape, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=x, type=BasicType(dimensions=[], name=float), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=y, type=BasicType(dimensions=[], name=float), varargs=False)], return_type=BasicType(dimensions=[None], name=float), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PointCallback, sub_type=None))]] if[binary_operation[member[.t], ==, literal[null]]] begin[{] call[TextureImpl.bindNone, parameter[]] else begin[{] call[t.bind, parameter[]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[void] identifier[texture] operator[SEP] Keyword[final] identifier[Shape] identifier[shape] , identifier[Image] identifier[image] , Keyword[final] identifier[TexCoordGenerator] identifier[gen] operator[SEP] { identifier[Texture] identifier[t] operator[=] identifier[TextureImpl] operator[SEP] identifier[getLastBind] operator[SEP] operator[SEP] operator[SEP] identifier[image] operator[SEP] identifier[getTexture] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[center] operator[SEP] operator[SEP] operator[=] identifier[shape] operator[SEP] identifier[getCenter] operator[SEP] operator[SEP] operator[SEP] identifier[fill] operator[SEP] identifier[shape] , Keyword[new] identifier[PointCallback] operator[SEP] operator[SEP] { Keyword[public] Keyword[float] operator[SEP] operator[SEP] identifier[preRenderPoint] operator[SEP] identifier[Shape] identifier[shape] , Keyword[float] identifier[x] , Keyword[float] identifier[y] operator[SEP] { identifier[Vector2f] identifier[tex] operator[=] identifier[gen] operator[SEP] identifier[getCoordFor] operator[SEP] identifier[x] , identifier[y] operator[SEP] operator[SEP] identifier[GL] operator[SEP] identifier[glTexCoord2f] operator[SEP] identifier[tex] operator[SEP] identifier[x] , identifier[tex] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[return] Keyword[new] Keyword[float] operator[SEP] operator[SEP] { identifier[x] , identifier[y] } operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[==] Other[null] operator[SEP] { identifier[TextureImpl] operator[SEP] identifier[bindNone] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[t] operator[SEP] identifier[bind] operator[SEP] operator[SEP] operator[SEP] } }
public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); } }
class class_name[name] begin[{] method[updateParamsForAuth, return_type[void], modifier[public], parameter[authNames, queryParams, headerParams]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=authName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=authentications, selectors=[], type_arguments=None), name=auth)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Authentication, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=auth, 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=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Authentication undefined: "), operandr=MemberReference(member=authName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=queryParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headerParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=applyToParams, postfix_operators=[], prefix_operators=[], qualifier=auth, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=authNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=authName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[updateParamsForAuth] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[authNames] , identifier[List] operator[<] identifier[Pair] operator[>] identifier[queryParams] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headerParams] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[authName] operator[:] identifier[authNames] operator[SEP] { identifier[Authentication] identifier[auth] operator[=] identifier[authentications] operator[SEP] identifier[get] operator[SEP] identifier[authName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[auth] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[authName] operator[SEP] operator[SEP] identifier[auth] operator[SEP] identifier[applyToParams] operator[SEP] identifier[queryParams] , identifier[headerParams] operator[SEP] operator[SEP] } }
public static void applyButtonTreeCellRenderer(JTree tree, Function<Object, JButton> buttonFactory, Function<Object, String> textFactory) { TreeCellRenderer treeCellrenderer = new GenericTreeCellRenderer() { @Override protected void prepare(Object nodeObject, JPanel container) { container.setLayout(new BorderLayout(3, 0)); JLabel textLabel = new JLabel(); String text = textFactory.apply(nodeObject); textLabel.setText(text); container.add(textLabel, BorderLayout.CENTER); JButton button = buttonFactory.apply(nodeObject); if (button != null) { container.add(button, BorderLayout.WEST); } } }; tree.setCellRenderer(treeCellrenderer); tree.setEditable(true); DefaultCellEditor editor = new DefaultCellEditor(new JTextField()) { /** * Serial UID */ private static final long serialVersionUID = 1L; @Override public Component getTreeCellEditorComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row) { return treeCellrenderer.getTreeCellRendererComponent( tree, value, selected, expanded, leaf, row, true); } @Override public boolean isCellEditable(EventObject event) { return true; } }; tree.setCellEditor(editor); }
class class_name[name] begin[{] method[applyButtonTreeCellRenderer, return_type[void], modifier[public static], parameter[tree, buttonFactory, textFactory]] begin[{] local_variable[type[TreeCellRenderer], treeCellrenderer] call[tree.setCellRenderer, parameter[member[.treeCellrenderer]]] call[tree.setEditable, parameter[literal[true]]] local_variable[type[DefaultCellEditor], editor] call[tree.setCellEditor, parameter[member[.editor]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[applyButtonTreeCellRenderer] operator[SEP] identifier[JTree] identifier[tree] , identifier[Function] operator[<] identifier[Object] , identifier[JButton] operator[>] identifier[buttonFactory] , identifier[Function] operator[<] identifier[Object] , identifier[String] operator[>] identifier[textFactory] operator[SEP] { identifier[TreeCellRenderer] identifier[treeCellrenderer] operator[=] Keyword[new] identifier[GenericTreeCellRenderer] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[prepare] operator[SEP] identifier[Object] identifier[nodeObject] , identifier[JPanel] identifier[container] operator[SEP] { identifier[container] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[BorderLayout] operator[SEP] Other[3] , Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[JLabel] identifier[textLabel] operator[=] Keyword[new] identifier[JLabel] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[text] operator[=] identifier[textFactory] operator[SEP] identifier[apply] operator[SEP] identifier[nodeObject] operator[SEP] operator[SEP] identifier[textLabel] operator[SEP] identifier[setText] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[add] operator[SEP] identifier[textLabel] , identifier[BorderLayout] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] identifier[JButton] identifier[button] operator[=] identifier[buttonFactory] operator[SEP] identifier[apply] operator[SEP] identifier[nodeObject] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[button] operator[!=] Other[null] operator[SEP] { identifier[container] operator[SEP] identifier[add] operator[SEP] identifier[button] , identifier[BorderLayout] operator[SEP] identifier[WEST] operator[SEP] operator[SEP] } } } operator[SEP] identifier[tree] operator[SEP] identifier[setCellRenderer] operator[SEP] identifier[treeCellrenderer] operator[SEP] operator[SEP] identifier[tree] operator[SEP] identifier[setEditable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[DefaultCellEditor] identifier[editor] operator[=] Keyword[new] identifier[DefaultCellEditor] operator[SEP] Keyword[new] identifier[JTextField] operator[SEP] operator[SEP] operator[SEP] { Keyword[private] Keyword[static] Keyword[final] Keyword[long] identifier[serialVersionUID] operator[=] Other[1L] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Component] identifier[getTreeCellEditorComponent] operator[SEP] identifier[JTree] identifier[tree] , identifier[Object] identifier[value] , Keyword[boolean] identifier[selected] , Keyword[boolean] identifier[expanded] , Keyword[boolean] identifier[leaf] , Keyword[int] identifier[row] operator[SEP] { Keyword[return] identifier[treeCellrenderer] operator[SEP] identifier[getTreeCellRendererComponent] operator[SEP] identifier[tree] , identifier[value] , identifier[selected] , identifier[expanded] , identifier[leaf] , identifier[row] , literal[boolean] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isCellEditable] operator[SEP] identifier[EventObject] identifier[event] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } operator[SEP] identifier[tree] operator[SEP] identifier[setCellEditor] operator[SEP] identifier[editor] operator[SEP] operator[SEP] }
@Override public InputStream openStream() { try { return new BufferedInputStream(url.openStream(), 8192); } catch (Exception e) { throw new RuntimeException("Could not open stream for url " + url.toExternalForm(), e); } }
class class_name[name] begin[{] method[openStream, return_type[type[InputStream]], modifier[public], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=openStream, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8192)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not open stream for url "), operandr=MethodInvocation(arguments=[], member=toExternalForm, postfix_operators=[], prefix_operators=[], qualifier=url, 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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[InputStream] identifier[openStream] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[url] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] , Other[8192] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[url] operator[SEP] identifier[toExternalForm] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override public CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) { final CacheKey parentKey = this.wrappedComponent.getCacheKey(request, response); final CacheKey attributeKey = this.attributeSource.getCacheKey(request, response); return CacheKey.build(this.beanName, parentKey, attributeKey); }
class class_name[name] begin[{] method[getCacheKey, return_type[type[CacheKey]], modifier[public], parameter[request, response]] begin[{] local_variable[type[CacheKey], parentKey] local_variable[type[CacheKey], attributeKey] return[call[CacheKey.build, parameter[THIS[member[None.beanName]], member[.parentKey], member[.attributeKey]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CacheKey] identifier[getCacheKey] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] operator[SEP] { Keyword[final] identifier[CacheKey] identifier[parentKey] operator[=] Keyword[this] operator[SEP] identifier[wrappedComponent] operator[SEP] identifier[getCacheKey] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP] Keyword[final] identifier[CacheKey] identifier[attributeKey] operator[=] Keyword[this] operator[SEP] identifier[attributeSource] operator[SEP] identifier[getCacheKey] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[CacheKey] operator[SEP] identifier[build] operator[SEP] Keyword[this] operator[SEP] identifier[beanName] , identifier[parentKey] , identifier[attributeKey] operator[SEP] operator[SEP] }
public CharacterLocationResponse getCharactersCharacterIdLocation(Integer characterId, String datasource, String ifNoneMatch, String token) throws ApiException { ApiResponse<CharacterLocationResponse> resp = getCharactersCharacterIdLocationWithHttpInfo(characterId, datasource, ifNoneMatch, token); return resp.getData(); }
class class_name[name] begin[{] method[getCharactersCharacterIdLocation, return_type[type[CharacterLocationResponse]], modifier[public], parameter[characterId, datasource, ifNoneMatch, token]] begin[{] local_variable[type[ApiResponse], resp] return[call[resp.getData, parameter[]]] end[}] END[}]
Keyword[public] identifier[CharacterLocationResponse] identifier[getCharactersCharacterIdLocation] operator[SEP] identifier[Integer] identifier[characterId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[ApiResponse] operator[<] identifier[CharacterLocationResponse] operator[>] identifier[resp] operator[=] identifier[getCharactersCharacterIdLocationWithHttpInfo] operator[SEP] identifier[characterId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[token] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] }
private void _writeNodeList (@Nonnull final XMLEmitter aXMLWriter, @Nullable final IMicroNode aParentNode, @Nonnull final List <IMicroNode> aChildren) { final int nLastIndex = aChildren.size () - 1; for (int nIndex = 0; nIndex <= nLastIndex; ++nIndex) { emitNode (aXMLWriter, aParentNode, nIndex == 0 ? null : aChildren.get (nIndex - 1), aChildren.get (nIndex), nIndex == nLastIndex ? null : aChildren.get (nIndex + 1)); } }
class class_name[name] begin[{] method[_writeNodeList, return_type[void], modifier[private], parameter[aXMLWriter, aParentNode, aChildren]] begin[{] local_variable[type[int], nLastIndex] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aXMLWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aParentNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=nIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=nIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=aChildren, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), MethodInvocation(arguments=[MemberReference(member=nIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=aChildren, selectors=[], type_arguments=None), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=nIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nLastIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=nIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=aChildren, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))], member=emitNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=nIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nLastIndex, 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=nIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=nIndex, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[_writeNodeList] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[XMLEmitter] identifier[aXMLWriter] , annotation[@] identifier[Nullable] Keyword[final] identifier[IMicroNode] identifier[aParentNode] , annotation[@] identifier[Nonnull] Keyword[final] identifier[List] operator[<] identifier[IMicroNode] operator[>] identifier[aChildren] operator[SEP] { Keyword[final] Keyword[int] identifier[nLastIndex] operator[=] identifier[aChildren] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[nIndex] operator[=] Other[0] operator[SEP] identifier[nIndex] operator[<=] identifier[nLastIndex] operator[SEP] operator[++] identifier[nIndex] operator[SEP] { identifier[emitNode] operator[SEP] identifier[aXMLWriter] , identifier[aParentNode] , identifier[nIndex] operator[==] Other[0] operator[?] Other[null] operator[:] identifier[aChildren] operator[SEP] identifier[get] operator[SEP] identifier[nIndex] operator[-] Other[1] operator[SEP] , identifier[aChildren] operator[SEP] identifier[get] operator[SEP] identifier[nIndex] operator[SEP] , identifier[nIndex] operator[==] identifier[nLastIndex] operator[?] Other[null] operator[:] identifier[aChildren] operator[SEP] identifier[get] operator[SEP] identifier[nIndex] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } }
public static Map<String, PropertyDescriptor> mapPropertyDescriptors(Class<?> clazz) { PropertyDescriptor[] properties = propertyDescriptors(clazz); Map<String, PropertyDescriptor> mappedProperties = new HashMap<String, PropertyDescriptor>(); for (PropertyDescriptor property : properties) { if ("class".equals(property.getName()) == false) { mappedProperties.put(property.getName(), property); } } return mappedProperties; }
class class_name[name] begin[{] method[mapPropertyDescriptors, return_type[type[Map]], modifier[public static], parameter[clazz]] begin[{] local_variable[type[PropertyDescriptor], properties] local_variable[type[Map], mappedProperties] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="class"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=mappedProperties, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))), label=None) return[member[.mappedProperties]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[PropertyDescriptor] operator[>] identifier[mapPropertyDescriptors] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { identifier[PropertyDescriptor] operator[SEP] operator[SEP] identifier[properties] operator[=] identifier[propertyDescriptors] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[PropertyDescriptor] operator[>] identifier[mappedProperties] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[PropertyDescriptor] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyDescriptor] identifier[property] operator[:] identifier[properties] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] { identifier[mappedProperties] operator[SEP] identifier[put] operator[SEP] identifier[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[property] operator[SEP] operator[SEP] } } Keyword[return] identifier[mappedProperties] operator[SEP] }
public final GetDatabaseDdlResponse getDatabaseDdl(DatabaseName database) { GetDatabaseDdlRequest request = GetDatabaseDdlRequest.newBuilder() .setDatabase(database == null ? null : database.toString()) .build(); return getDatabaseDdl(request); }
class class_name[name] begin[{] method[getDatabaseDdl, return_type[type[GetDatabaseDdlResponse]], modifier[final public], parameter[database]] begin[{] local_variable[type[GetDatabaseDdlRequest], request] return[call[.getDatabaseDdl, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[GetDatabaseDdlResponse] identifier[getDatabaseDdl] operator[SEP] identifier[DatabaseName] identifier[database] operator[SEP] { identifier[GetDatabaseDdlRequest] identifier[request] operator[=] identifier[GetDatabaseDdlRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setDatabase] operator[SEP] identifier[database] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[database] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getDatabaseDdl] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
protected void removeWorkspace(ManageableRepository mr, String workspaceName) throws RepositoryException { boolean isExists = false; for (String wsName : mr.getWorkspaceNames()) if (workspaceName.equals(wsName)) { isExists = true; break; } if (isExists) { if (!mr.canRemoveWorkspace(workspaceName)) { WorkspaceContainerFacade wc = mr.getWorkspaceContainer(workspaceName); SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class); sessionRegistry.closeSessions(workspaceName); } mr.removeWorkspace(workspaceName); } }
class class_name[name] begin[{] method[removeWorkspace, return_type[void], modifier[protected], parameter[mr, workspaceName]] begin[{] local_variable[type[boolean], isExists] ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=wsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=workspaceName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isExists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)])), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getWorkspaceNames, postfix_operators=[], prefix_operators=[], qualifier=mr, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=wsName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[member[.isExists]] begin[{] if[call[mr.canRemoveWorkspace, parameter[member[.workspaceName]]]] begin[{] local_variable[type[WorkspaceContainerFacade], wc] local_variable[type[SessionRegistry], sessionRegistry] call[sessionRegistry.closeSessions, parameter[member[.workspaceName]]] else begin[{] None end[}] call[mr.removeWorkspace, parameter[member[.workspaceName]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[removeWorkspace] operator[SEP] identifier[ManageableRepository] identifier[mr] , identifier[String] identifier[workspaceName] operator[SEP] Keyword[throws] identifier[RepositoryException] { Keyword[boolean] identifier[isExists] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[wsName] operator[:] identifier[mr] operator[SEP] identifier[getWorkspaceNames] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[workspaceName] operator[SEP] identifier[equals] operator[SEP] identifier[wsName] operator[SEP] operator[SEP] { identifier[isExists] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[isExists] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[mr] operator[SEP] identifier[canRemoveWorkspace] operator[SEP] identifier[workspaceName] operator[SEP] operator[SEP] { identifier[WorkspaceContainerFacade] identifier[wc] operator[=] identifier[mr] operator[SEP] identifier[getWorkspaceContainer] operator[SEP] identifier[workspaceName] operator[SEP] operator[SEP] identifier[SessionRegistry] identifier[sessionRegistry] operator[=] operator[SEP] identifier[SessionRegistry] operator[SEP] identifier[wc] operator[SEP] identifier[getComponent] operator[SEP] identifier[SessionRegistry] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[sessionRegistry] operator[SEP] identifier[closeSessions] operator[SEP] identifier[workspaceName] operator[SEP] operator[SEP] } identifier[mr] operator[SEP] identifier[removeWorkspace] operator[SEP] identifier[workspaceName] operator[SEP] operator[SEP] } }
private void onRecord(Record message, ActorRef self, ActorRef sender) { if (is(inProgress)) { // Forward to media server controller this.recording = true; this.msController.tell(message, sender); } }
class class_name[name] begin[{] method[onRecord, return_type[void], modifier[private], parameter[message, self, sender]] begin[{] if[call[.is, parameter[member[.inProgress]]]] begin[{] assign[THIS[member[None.recording]], literal[true]] THIS[member[None.msController]call[None.tell, parameter[member[.message], member[.sender]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[onRecord] operator[SEP] identifier[Record] identifier[message] , identifier[ActorRef] identifier[self] , identifier[ActorRef] identifier[sender] operator[SEP] { Keyword[if] operator[SEP] identifier[is] operator[SEP] identifier[inProgress] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[recording] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[msController] operator[SEP] identifier[tell] operator[SEP] identifier[message] , identifier[sender] operator[SEP] operator[SEP] } }
public Expiring<T> withDefault(long expireTime, TimeUnit expireUnit) { checkArgument(expireTime > 0); this.defaultExpireTime = Optional.of(expireTime); this.defaultExpireUnit = Optional.of(expireUnit); return this; }
class class_name[name] begin[{] method[withDefault, return_type[type[Expiring]], modifier[public], parameter[expireTime, expireUnit]] begin[{] call[.checkArgument, parameter[binary_operation[member[.expireTime], >, literal[0]]]] assign[THIS[member[None.defaultExpireTime]], call[Optional.of, parameter[member[.expireTime]]]] assign[THIS[member[None.defaultExpireUnit]], call[Optional.of, parameter[member[.expireUnit]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Expiring] operator[<] identifier[T] operator[>] identifier[withDefault] operator[SEP] Keyword[long] identifier[expireTime] , identifier[TimeUnit] identifier[expireUnit] operator[SEP] { identifier[checkArgument] operator[SEP] identifier[expireTime] operator[>] Other[0] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[defaultExpireTime] operator[=] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[expireTime] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[defaultExpireUnit] operator[=] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[expireUnit] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public void setup(Context context) throws IOException ,InterruptedException { this.context = context; inputLabels = context.getConfiguration().getStrings(SimpleJob.BEFORE_SUMMARIZER_OUTPUT_LABELS); boolean label = context.getConfiguration().getStrings(SimpleJob.FILETER_OUTPUT_LABELS) == null ? true : false; try { if (context.getCombinerClass() != null) { writer = new CombineWriter(context.getCombinerClass(), getIntParameter(SimpleJob.COMBINE_CACHE)); } else { writer = new BasicWriter(label); } } catch (Exception e) { writer = new BasicWriter(label); } filterSetup(); }
class class_name[name] begin[{] method[setup, return_type[void], modifier[public], parameter[context]] begin[{] assign[THIS[member[None.context]], member[.context]] assign[member[.inputLabels], call[context.getConfiguration, parameter[]]] local_variable[type[boolean], label] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCombinerClass, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=label, 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=BasicWriter, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getCombinerClass, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=COMBINE_CACHE, postfix_operators=[], prefix_operators=[], qualifier=SimpleJob, selectors=[])], member=getIntParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CombineWriter, sub_type=None))), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=label, 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=BasicWriter, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[.filterSetup, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setup] operator[SEP] identifier[Context] identifier[context] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { Keyword[this] operator[SEP] identifier[context] operator[=] identifier[context] operator[SEP] identifier[inputLabels] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getStrings] operator[SEP] identifier[SimpleJob] operator[SEP] identifier[BEFORE_SUMMARIZER_OUTPUT_LABELS] operator[SEP] operator[SEP] Keyword[boolean] identifier[label] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getStrings] operator[SEP] identifier[SimpleJob] operator[SEP] identifier[FILETER_OUTPUT_LABELS] operator[SEP] operator[==] Other[null] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getCombinerClass] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[writer] operator[=] Keyword[new] identifier[CombineWriter] operator[SEP] identifier[context] operator[SEP] identifier[getCombinerClass] operator[SEP] operator[SEP] , identifier[getIntParameter] operator[SEP] identifier[SimpleJob] operator[SEP] identifier[COMBINE_CACHE] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[writer] operator[=] Keyword[new] identifier[BasicWriter] operator[SEP] identifier[label] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[writer] operator[=] Keyword[new] identifier[BasicWriter] operator[SEP] identifier[label] operator[SEP] operator[SEP] } identifier[filterSetup] operator[SEP] operator[SEP] operator[SEP] }
public CommandInvocation withCommandPlugins(CommandPlugin... commandPlugins) { if (this.commandPlugins == null) { setCommandPlugins(new com.amazonaws.internal.SdkInternalList<CommandPlugin>(commandPlugins.length)); } for (CommandPlugin ele : commandPlugins) { this.commandPlugins.add(ele); } return this; }
class class_name[name] begin[{] method[withCommandPlugins, return_type[type[CommandInvocation]], modifier[public], parameter[commandPlugins]] begin[{] if[binary_operation[THIS[member[None.commandPlugins]], ==, literal[null]]] begin[{] call[.setCommandPlugins, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=commandPlugins, 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=CommandPlugin, 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=commandPlugins, 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=commandPlugins, 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=CommandPlugin, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[CommandInvocation] identifier[withCommandPlugins] operator[SEP] identifier[CommandPlugin] operator[...] identifier[commandPlugins] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[commandPlugins] operator[==] Other[null] operator[SEP] { identifier[setCommandPlugins] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[CommandPlugin] operator[>] operator[SEP] identifier[commandPlugins] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[CommandPlugin] identifier[ele] operator[:] identifier[commandPlugins] operator[SEP] { Keyword[this] operator[SEP] identifier[commandPlugins] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public GetMaintenanceWindowExecutionResult withTaskIds(String... taskIds) { if (this.taskIds == null) { setTaskIds(new com.amazonaws.internal.SdkInternalList<String>(taskIds.length)); } for (String ele : taskIds) { this.taskIds.add(ele); } return this; }
class class_name[name] begin[{] method[withTaskIds, return_type[type[GetMaintenanceWindowExecutionResult]], modifier[public], parameter[taskIds]] begin[{] if[binary_operation[THIS[member[None.taskIds]], ==, literal[null]]] begin[{] call[.setTaskIds, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=taskIds, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=taskIds, 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=taskIds, 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[GetMaintenanceWindowExecutionResult] identifier[withTaskIds] operator[SEP] identifier[String] operator[...] identifier[taskIds] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[taskIds] operator[==] Other[null] operator[SEP] { identifier[setTaskIds] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[taskIds] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[taskIds] operator[SEP] { Keyword[this] operator[SEP] identifier[taskIds] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void configureWebApp () throws Exception { //cannot configure if the _context is already started if (_context.isStarted()) { if (log.isDebugEnabled()){log.debug("Cannot configure webapp after it is started");}; return; } if(log.isDebugEnabled()) log.debug("Configuring web-jetty.xml"); Resource webInf=getWebApplicationContext().getWebInf(); // handle any WEB-INF descriptors if(webInf!=null&&webInf.isDirectory()) { // do jetty.xml file Resource jetty=webInf.addPath("web-jetty.xml"); if(!jetty.exists()) jetty=webInf.addPath("jetty-web.xml"); if(!getWebApplicationContext().isIgnoreWebJetty()&&jetty.exists()) { // Give permission to see Jetty classes String[] old_server_classes = _context.getServerClasses(); String[] server_classes = new String[1+(old_server_classes==null?0:old_server_classes.length)]; server_classes[0]="-org.browsermob.proxy.jetty."; if (server_classes!=null) System.arraycopy(old_server_classes, 0, server_classes, 1, old_server_classes.length); try { _context.setServerClasses(server_classes); if(log.isDebugEnabled()) log.debug("Configure: "+jetty); XmlConfiguration jetty_config=new XmlConfiguration(jetty.getURL()); jetty_config.configure(getWebApplicationContext()); } finally { if (_context.getServerClasses()==server_classes) _context.setServerClasses(old_server_classes); } } } }
class class_name[name] begin[{] method[configureWebApp, return_type[void], modifier[public], parameter[]] begin[{] if[call[_context.isStarted, parameter[]]] begin[{] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[literal["Cannot configure webapp after it is started"]]] else begin[{] None end[}] Statement(label=None) return[None] else begin[{] None end[}] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[literal["Configuring web-jetty.xml"]]] else begin[{] None end[}] local_variable[type[Resource], webInf] if[binary_operation[binary_operation[member[.webInf], !=, literal[null]], &&, call[webInf.isDirectory, parameter[]]]] begin[{] local_variable[type[Resource], jetty] if[call[jetty.exists, parameter[]]] begin[{] assign[member[.jetty], call[webInf.addPath, parameter[literal["jetty-web.xml"]]]] else begin[{] None end[}] if[binary_operation[call[.getWebApplicationContext, parameter[]], &&, call[jetty.exists, parameter[]]]] begin[{] local_variable[type[String], old_server_classes] local_variable[type[String], server_classes] assign[member[.server_classes], literal["-org.browsermob.proxy.jetty."]] if[binary_operation[member[.server_classes], !=, literal[null]]] begin[{] call[System.arraycopy, parameter[member[.old_server_classes], literal[0], member[.server_classes], literal[1], member[old_server_classes.length]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=server_classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setServerClasses, postfix_operators=[], prefix_operators=[], qualifier=_context, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Configure: "), operandr=MemberReference(member=jetty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getURL, postfix_operators=[], prefix_operators=[], qualifier=jetty, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XmlConfiguration, sub_type=None)), name=jetty_config)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XmlConfiguration, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWebApplicationContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=configure, postfix_operators=[], prefix_operators=[], qualifier=jetty_config, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getServerClasses, postfix_operators=[], prefix_operators=[], qualifier=_context, selectors=[], type_arguments=None), operandr=MemberReference(member=server_classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=old_server_classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setServerClasses, postfix_operators=[], prefix_operators=[], qualifier=_context, selectors=[], type_arguments=None), label=None))], label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[configureWebApp] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[_context] operator[SEP] identifier[isStarted] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Resource] identifier[webInf] operator[=] identifier[getWebApplicationContext] operator[SEP] operator[SEP] operator[SEP] identifier[getWebInf] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[webInf] operator[!=] Other[null] operator[&&] identifier[webInf] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[Resource] identifier[jetty] operator[=] identifier[webInf] operator[SEP] identifier[addPath] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[jetty] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[jetty] operator[=] identifier[webInf] operator[SEP] identifier[addPath] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[getWebApplicationContext] operator[SEP] operator[SEP] operator[SEP] identifier[isIgnoreWebJetty] operator[SEP] operator[SEP] operator[&&] identifier[jetty] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[old_server_classes] operator[=] identifier[_context] operator[SEP] identifier[getServerClasses] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[server_classes] operator[=] Keyword[new] identifier[String] operator[SEP] Other[1] operator[+] operator[SEP] identifier[old_server_classes] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[old_server_classes] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[server_classes] operator[SEP] Other[0] operator[SEP] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[server_classes] operator[!=] Other[null] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[old_server_classes] , Other[0] , identifier[server_classes] , Other[1] , identifier[old_server_classes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[try] { identifier[_context] operator[SEP] identifier[setServerClasses] operator[SEP] identifier[server_classes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[jetty] operator[SEP] operator[SEP] identifier[XmlConfiguration] identifier[jetty_config] operator[=] Keyword[new] identifier[XmlConfiguration] operator[SEP] identifier[jetty] operator[SEP] identifier[getURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[jetty_config] operator[SEP] identifier[configure] operator[SEP] identifier[getWebApplicationContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[_context] operator[SEP] identifier[getServerClasses] operator[SEP] operator[SEP] operator[==] identifier[server_classes] operator[SEP] identifier[_context] operator[SEP] identifier[setServerClasses] operator[SEP] identifier[old_server_classes] operator[SEP] operator[SEP] } } } }
public int getTypeIdFor(String slashname, boolean allocateIfNotFound) { if (allocateIfNotFound) { return NameRegistry.getIdOrAllocateFor(slashname); } else { return NameRegistry.getIdFor(slashname); } }
class class_name[name] begin[{] method[getTypeIdFor, return_type[type[int]], modifier[public], parameter[slashname, allocateIfNotFound]] begin[{] if[member[.allocateIfNotFound]] begin[{] return[call[NameRegistry.getIdOrAllocateFor, parameter[member[.slashname]]]] else begin[{] return[call[NameRegistry.getIdFor, parameter[member[.slashname]]]] end[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[getTypeIdFor] operator[SEP] identifier[String] identifier[slashname] , Keyword[boolean] identifier[allocateIfNotFound] operator[SEP] { Keyword[if] operator[SEP] identifier[allocateIfNotFound] operator[SEP] { Keyword[return] identifier[NameRegistry] operator[SEP] identifier[getIdOrAllocateFor] operator[SEP] identifier[slashname] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[NameRegistry] operator[SEP] identifier[getIdFor] operator[SEP] identifier[slashname] operator[SEP] operator[SEP] } }
private DefaultFeatureCollection sharedCreateFeatures( final LabelPositionCollector labels, final SimpleFeatureBuilder featureBuilder, final GridParam layerData, final MapfishMapContext mapContext, final double xSpace, final double ySpace, final double minX, final double minY) { // CSON: ParameterNumber GeometryFactory geometryFactory = new GeometryFactory(); ReferencedEnvelope bounds = mapContext.toReferencedEnvelope(); CoordinateReferenceSystem mapCrs = bounds.getCoordinateReferenceSystem(); String unit = layerData.calculateLabelUnit(mapCrs); MathTransform labelTransform = layerData.calculateLabelTransform(mapCrs); final AxisDirection direction = bounds.getCoordinateReferenceSystem().getCoordinateSystem().getAxis(0).getDirection(); int numDimensions = bounds.getCoordinateReferenceSystem().getCoordinateSystem().getDimension(); Polygon rotatedBounds = GridUtils.calculateBounds(mapContext); AffineTransform worldToScreenTransform = GridUtils.getWorldToScreenTransform(mapContext); DefaultFeatureCollection features = new DefaultFeatureCollection(); double pointSpacing = bounds.getSpan(1) / layerData.pointsInLine; int i = 0; for (double x = minX; x < bounds.getMaxX(); x += xSpace) { i++; final SimpleFeature feature = createFeature(featureBuilder, geometryFactory, layerData, direction, numDimensions, pointSpacing, x, bounds.getMinimum(1), i, 1); features.add(feature); GridUtils.topBorderLabel(labels, geometryFactory, rotatedBounds, unit, x, worldToScreenTransform, labelTransform, layerData.getGridLabelFormat()); GridUtils.bottomBorderLabel(labels, geometryFactory, rotatedBounds, unit, x, worldToScreenTransform, labelTransform, layerData.getGridLabelFormat()); } pointSpacing = bounds.getSpan(0) / layerData.pointsInLine; int j = 0; for (double y = minY; y < bounds.getMaxY(); y += ySpace) { j++; final SimpleFeature feature = createFeature(featureBuilder, geometryFactory, layerData, direction, numDimensions, pointSpacing, bounds.getMinimum(0), y, j, 0); features.add(feature); GridUtils.rightBorderLabel(labels, geometryFactory, rotatedBounds, unit, y, worldToScreenTransform, labelTransform, layerData.getGridLabelFormat()); GridUtils.leftBorderLabel(labels, geometryFactory, rotatedBounds, unit, y, worldToScreenTransform, labelTransform, layerData.getGridLabelFormat()); } return features; }
class class_name[name] begin[{] method[sharedCreateFeatures, return_type[type[DefaultFeatureCollection]], modifier[private], parameter[labels, featureBuilder, layerData, mapContext, xSpace, ySpace, minX, minY]] begin[{] local_variable[type[GeometryFactory], geometryFactory] local_variable[type[ReferencedEnvelope], bounds] local_variable[type[CoordinateReferenceSystem], mapCrs] local_variable[type[String], unit] local_variable[type[MathTransform], labelTransform] local_variable[type[AxisDirection], direction] local_variable[type[int], numDimensions] local_variable[type[Polygon], rotatedBounds] local_variable[type[AffineTransform], worldToScreenTransform] local_variable[type[DefaultFeatureCollection], features] local_variable[type[double], pointSpacing] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=featureBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=geometryFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=layerData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numDimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pointSpacing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getMinimum, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[], type_arguments=None), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=createFeature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=feature)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SimpleFeature, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=geometryFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rotatedBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=worldToScreenTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=labelTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getGridLabelFormat, postfix_operators=[], prefix_operators=[], qualifier=layerData, selectors=[], type_arguments=None)], member=topBorderLabel, postfix_operators=[], prefix_operators=[], qualifier=GridUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=geometryFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rotatedBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=worldToScreenTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=labelTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getGridLabelFormat, postfix_operators=[], prefix_operators=[], qualifier=layerData, selectors=[], type_arguments=None)], member=bottomBorderLabel, postfix_operators=[], prefix_operators=[], qualifier=GridUtils, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMaxX, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=minX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=double)), update=[Assignment(expressionl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=xSpace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None) assign[member[.pointSpacing], binary_operation[call[bounds.getSpan, parameter[literal[0]]], /, member[layerData.pointsInLine]]] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=featureBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=geometryFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=layerData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numDimensions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pointSpacing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getMinimum, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[], type_arguments=None), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=createFeature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=feature)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SimpleFeature, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=geometryFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rotatedBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=worldToScreenTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=labelTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getGridLabelFormat, postfix_operators=[], prefix_operators=[], qualifier=layerData, selectors=[], type_arguments=None)], member=rightBorderLabel, postfix_operators=[], prefix_operators=[], qualifier=GridUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=geometryFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rotatedBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=worldToScreenTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=labelTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getGridLabelFormat, postfix_operators=[], prefix_operators=[], qualifier=layerData, selectors=[], type_arguments=None)], member=leftBorderLabel, postfix_operators=[], prefix_operators=[], qualifier=GridUtils, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMaxY, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=minY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=double)), update=[Assignment(expressionl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=ySpace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None) return[member[.features]] end[}] END[}]
Keyword[private] identifier[DefaultFeatureCollection] identifier[sharedCreateFeatures] operator[SEP] Keyword[final] identifier[LabelPositionCollector] identifier[labels] , Keyword[final] identifier[SimpleFeatureBuilder] identifier[featureBuilder] , Keyword[final] identifier[GridParam] identifier[layerData] , Keyword[final] identifier[MapfishMapContext] identifier[mapContext] , Keyword[final] Keyword[double] identifier[xSpace] , Keyword[final] Keyword[double] identifier[ySpace] , Keyword[final] Keyword[double] identifier[minX] , Keyword[final] Keyword[double] identifier[minY] operator[SEP] { identifier[GeometryFactory] identifier[geometryFactory] operator[=] Keyword[new] identifier[GeometryFactory] operator[SEP] operator[SEP] operator[SEP] identifier[ReferencedEnvelope] identifier[bounds] operator[=] identifier[mapContext] operator[SEP] identifier[toReferencedEnvelope] operator[SEP] operator[SEP] operator[SEP] identifier[CoordinateReferenceSystem] identifier[mapCrs] operator[=] identifier[bounds] operator[SEP] identifier[getCoordinateReferenceSystem] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[unit] operator[=] identifier[layerData] operator[SEP] identifier[calculateLabelUnit] operator[SEP] identifier[mapCrs] operator[SEP] operator[SEP] identifier[MathTransform] identifier[labelTransform] operator[=] identifier[layerData] operator[SEP] identifier[calculateLabelTransform] operator[SEP] identifier[mapCrs] operator[SEP] operator[SEP] Keyword[final] identifier[AxisDirection] identifier[direction] operator[=] identifier[bounds] operator[SEP] identifier[getCoordinateReferenceSystem] operator[SEP] operator[SEP] operator[SEP] identifier[getCoordinateSystem] operator[SEP] operator[SEP] operator[SEP] identifier[getAxis] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getDirection] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numDimensions] operator[=] identifier[bounds] operator[SEP] identifier[getCoordinateReferenceSystem] operator[SEP] operator[SEP] operator[SEP] identifier[getCoordinateSystem] operator[SEP] operator[SEP] operator[SEP] identifier[getDimension] operator[SEP] operator[SEP] operator[SEP] identifier[Polygon] identifier[rotatedBounds] operator[=] identifier[GridUtils] operator[SEP] identifier[calculateBounds] operator[SEP] identifier[mapContext] operator[SEP] operator[SEP] identifier[AffineTransform] identifier[worldToScreenTransform] operator[=] identifier[GridUtils] operator[SEP] identifier[getWorldToScreenTransform] operator[SEP] identifier[mapContext] operator[SEP] operator[SEP] identifier[DefaultFeatureCollection] identifier[features] operator[=] Keyword[new] identifier[DefaultFeatureCollection] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[pointSpacing] operator[=] identifier[bounds] operator[SEP] identifier[getSpan] operator[SEP] Other[1] operator[SEP] operator[/] identifier[layerData] operator[SEP] identifier[pointsInLine] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[double] identifier[x] operator[=] identifier[minX] operator[SEP] identifier[x] operator[<] identifier[bounds] operator[SEP] identifier[getMaxX] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[+=] identifier[xSpace] operator[SEP] { identifier[i] operator[++] operator[SEP] Keyword[final] identifier[SimpleFeature] identifier[feature] operator[=] identifier[createFeature] operator[SEP] identifier[featureBuilder] , identifier[geometryFactory] , identifier[layerData] , identifier[direction] , identifier[numDimensions] , identifier[pointSpacing] , identifier[x] , identifier[bounds] operator[SEP] identifier[getMinimum] operator[SEP] Other[1] operator[SEP] , identifier[i] , Other[1] operator[SEP] operator[SEP] identifier[features] operator[SEP] identifier[add] operator[SEP] identifier[feature] operator[SEP] operator[SEP] identifier[GridUtils] operator[SEP] identifier[topBorderLabel] operator[SEP] identifier[labels] , identifier[geometryFactory] , identifier[rotatedBounds] , identifier[unit] , identifier[x] , identifier[worldToScreenTransform] , identifier[labelTransform] , identifier[layerData] operator[SEP] identifier[getGridLabelFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[GridUtils] operator[SEP] identifier[bottomBorderLabel] operator[SEP] identifier[labels] , identifier[geometryFactory] , identifier[rotatedBounds] , identifier[unit] , identifier[x] , identifier[worldToScreenTransform] , identifier[labelTransform] , identifier[layerData] operator[SEP] identifier[getGridLabelFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pointSpacing] operator[=] identifier[bounds] operator[SEP] identifier[getSpan] operator[SEP] Other[0] operator[SEP] operator[/] identifier[layerData] operator[SEP] identifier[pointsInLine] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[double] identifier[y] operator[=] identifier[minY] operator[SEP] identifier[y] operator[<] identifier[bounds] operator[SEP] identifier[getMaxY] operator[SEP] operator[SEP] operator[SEP] identifier[y] operator[+=] identifier[ySpace] operator[SEP] { identifier[j] operator[++] operator[SEP] Keyword[final] identifier[SimpleFeature] identifier[feature] operator[=] identifier[createFeature] operator[SEP] identifier[featureBuilder] , identifier[geometryFactory] , identifier[layerData] , identifier[direction] , identifier[numDimensions] , identifier[pointSpacing] , identifier[bounds] operator[SEP] identifier[getMinimum] operator[SEP] Other[0] operator[SEP] , identifier[y] , identifier[j] , Other[0] operator[SEP] operator[SEP] identifier[features] operator[SEP] identifier[add] operator[SEP] identifier[feature] operator[SEP] operator[SEP] identifier[GridUtils] operator[SEP] identifier[rightBorderLabel] operator[SEP] identifier[labels] , identifier[geometryFactory] , identifier[rotatedBounds] , identifier[unit] , identifier[y] , identifier[worldToScreenTransform] , identifier[labelTransform] , identifier[layerData] operator[SEP] identifier[getGridLabelFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[GridUtils] operator[SEP] identifier[leftBorderLabel] operator[SEP] identifier[labels] , identifier[geometryFactory] , identifier[rotatedBounds] , identifier[unit] , identifier[y] , identifier[worldToScreenTransform] , identifier[labelTransform] , identifier[layerData] operator[SEP] identifier[getGridLabelFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[features] operator[SEP] }
public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) { if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey) || TextUtils.isEmpty(signature)) { Log.e(TAG, "Purchase verification failed: missing data."); return false; } PublicKey key = Security.generatePublicKey(base64PublicKey); return Security.verify(key, signedData, signature); }
class class_name[name] begin[{] method[verifyPurchase, return_type[type[boolean]], modifier[public static], parameter[base64PublicKey, signedData, signature]] begin[{] if[binary_operation[binary_operation[call[TextUtils.isEmpty, parameter[member[.signedData]]], ||, call[TextUtils.isEmpty, parameter[member[.base64PublicKey]]]], ||, call[TextUtils.isEmpty, parameter[member[.signature]]]]] begin[{] call[Log.e, parameter[member[.TAG], literal["Purchase verification failed: missing data."]]] return[literal[false]] else begin[{] None end[}] local_variable[type[PublicKey], key] return[call[Security.verify, parameter[member[.key], member[.signedData], member[.signature]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[verifyPurchase] operator[SEP] identifier[String] identifier[base64PublicKey] , identifier[String] identifier[signedData] , identifier[String] identifier[signature] operator[SEP] { Keyword[if] operator[SEP] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[signedData] operator[SEP] operator[||] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[base64PublicKey] operator[SEP] operator[||] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[signature] operator[SEP] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[PublicKey] identifier[key] operator[=] identifier[Security] operator[SEP] identifier[generatePublicKey] operator[SEP] identifier[base64PublicKey] operator[SEP] operator[SEP] Keyword[return] identifier[Security] operator[SEP] identifier[verify] operator[SEP] identifier[key] , identifier[signedData] , identifier[signature] operator[SEP] operator[SEP] }
public void setBaseTempDir(final File tmp) { if (!tmp.isAbsolute()) { throw new IllegalArgumentException("Temporary directory must be absolute"); } args.put("base.temp.dir", tmp.getAbsolutePath()); }
class class_name[name] begin[{] method[setBaseTempDir, return_type[void], modifier[public], parameter[tmp]] begin[{] if[call[tmp.isAbsolute, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Temporary directory must be absolute")], 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[args.put, parameter[literal["base.temp.dir"], call[tmp.getAbsolutePath, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBaseTempDir] operator[SEP] Keyword[final] identifier[File] identifier[tmp] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[tmp] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[args] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[tmp] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void addReactant(IAtomContainer reactant, Double coefficient) { reactants.addAtomContainer(reactant, coefficient); notifyChanged(); }
class class_name[name] begin[{] method[addReactant, return_type[void], modifier[public], parameter[reactant, coefficient]] begin[{] call[reactants.addAtomContainer, parameter[member[.reactant], member[.coefficient]]] call[.notifyChanged, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addReactant] operator[SEP] identifier[IAtomContainer] identifier[reactant] , identifier[Double] identifier[coefficient] operator[SEP] { identifier[reactants] operator[SEP] identifier[addAtomContainer] operator[SEP] identifier[reactant] , identifier[coefficient] operator[SEP] operator[SEP] identifier[notifyChanged] operator[SEP] operator[SEP] operator[SEP] }
public void ready(VirtualConnection inVC) { // This should not be called because the TCPConnLink is always // ready since it is the first in the chain. if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Invalid call to ready: " + inVC); } }
class class_name[name] begin[{] method[ready, return_type[void], modifier[public], parameter[inVC]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{] call[Tr.event, parameter[member[.tc], binary_operation[literal["Invalid call to ready: "], +, member[.inVC]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[ready] operator[SEP] identifier[VirtualConnection] identifier[inVC] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[inVC] operator[SEP] operator[SEP] } }
public com.google.api.ads.adwords.axis.v201809.cm.Image getExpandedImage() { return expandedImage; }
class class_name[name] begin[{] method[getExpandedImage, return_type[type[com]], modifier[public], parameter[]] begin[{] return[member[.expandedImage]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[cm] operator[SEP] identifier[Image] identifier[getExpandedImage] operator[SEP] operator[SEP] { Keyword[return] identifier[expandedImage] operator[SEP] }
@Action(name = "Create Virtual Machine", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = Outputs.FAILURE, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> createVM(@Param(value = HOST, required = true) String host, @Param(value = PORT) String port, @Param(value = PROTOCOL) String protocol, @Param(value = USERNAME, required = true) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = TRUST_EVERYONE) String trustEveryone, @Param(value = CLOSE_SESSION) String closeSession, @Param(value = DATA_CENTER_NAME, required = true) String dataCenterName, @Param(value = HOSTNAME, required = true) String hostname, @Param(value = VM_NAME, required = true) String virtualMachineName, @Param(value = DATA_STORE, required = true) String dataStore, @Param(value = GUEST_OS_ID, required = true) String guestOsId, @Param(value = FOLDER_NAME) String folderName, @Param(value = RESOURCE_POOL) String resourcePool, @Param(value = VM_DESCRIPTION) String description, @Param(value = VM_CPU_COUNT) String numCPUs, @Param(value = VM_DISK_SIZE) String vmDiskSize, @Param(value = VM_MEMORY_SIZE) String vmMemorySize, @Param(value = VMWARE_GLOBAL_SESSION_OBJECT) GlobalSessionObject<Map<String, Connection>> globalSessionObject) { try { final HttpInputs httpInputs = new HttpInputs.HttpInputsBuilder() .withHost(host) .withPort(port) .withProtocol(protocol) .withUsername(username) .withPassword(password) .withTrustEveryone(defaultIfEmpty(trustEveryone, FALSE)) .withCloseSession(defaultIfEmpty(closeSession, TRUE)) .withGlobalSessionObject(globalSessionObject) .build(); final VmInputs vmInputs = new VmInputs.VmInputsBuilder() .withDataCenterName(dataCenterName) .withHostname(hostname) .withVirtualMachineName(virtualMachineName) .withDescription(description) .withDataStore(dataStore) .withGuestOsId(guestOsId) .withFolderName(folderName) .withResourcePool(resourcePool) .withDescription(description) .withGuestOsId(guestOsId) .withDescription(description) .withIntNumCPUs(numCPUs) .withLongVmDiskSize(vmDiskSize) .withLongVmMemorySize(vmMemorySize) .build(); return new VmService().createVM(httpInputs, vmInputs); } catch (Exception ex) { return OutputUtilities.getFailureResultsMap(ex); } }
class class_name[name] begin[{] method[createVM, return_type[type[Map]], modifier[public], parameter[host, port, protocol, username, password, trustEveryone, closeSession, dataCenterName, hostname, virtualMachineName, dataStore, guestOsId, folderName, resourcePool, description, numCPUs, vmDiskSize, vmMemorySize, globalSessionObject]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withHost, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withPort, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=protocol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withProtocol, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withUsername, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=password, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withPassword, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=trustEveryone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FALSE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=defaultIfEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=withTrustEveryone, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TRUE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=defaultIfEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=withCloseSession, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=globalSessionObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withGlobalSessionObject, 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=ReferenceType(arguments=None, dimensions=None, name=HttpInputs, sub_type=ReferenceType(arguments=None, dimensions=None, name=HttpInputsBuilder, sub_type=None))), name=httpInputs)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=HttpInputs, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=dataCenterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withDataCenterName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withHostname, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=virtualMachineName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withVirtualMachineName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withDescription, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=dataStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withDataStore, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=guestOsId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withGuestOsId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=folderName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withFolderName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=resourcePool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withResourcePool, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withDescription, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=guestOsId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withGuestOsId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withDescription, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=numCPUs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withIntNumCPUs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=vmDiskSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withLongVmDiskSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=vmMemorySize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withLongVmMemorySize, 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=ReferenceType(arguments=None, dimensions=None, name=VmInputs, sub_type=ReferenceType(arguments=None, dimensions=None, name=VmInputsBuilder, sub_type=None))), name=vmInputs)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=VmInputs, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=httpInputs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vmInputs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createVM, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=VmService, sub_type=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFailureResultsMap, postfix_operators=[], prefix_operators=[], qualifier=OutputUtilities, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Action] operator[SEP] identifier[name] operator[=] literal[String] , identifier[outputs] operator[=] { annotation[@] identifier[Output] operator[SEP] identifier[Outputs] operator[SEP] identifier[RETURN_CODE] operator[SEP] , annotation[@] identifier[Output] operator[SEP] identifier[Outputs] operator[SEP] identifier[RETURN_RESULT] operator[SEP] , annotation[@] identifier[Output] operator[SEP] identifier[Outputs] operator[SEP] identifier[EXCEPTION] operator[SEP] } , identifier[responses] operator[=] { annotation[@] identifier[Response] operator[SEP] identifier[text] operator[=] identifier[Outputs] operator[SEP] identifier[SUCCESS] , identifier[field] operator[=] identifier[Outputs] operator[SEP] identifier[RETURN_CODE] , identifier[value] operator[=] identifier[Outputs] operator[SEP] identifier[RETURN_CODE_SUCCESS] , identifier[matchType] operator[=] identifier[MatchType] operator[SEP] identifier[COMPARE_EQUAL] , identifier[responseType] operator[=] identifier[ResponseType] operator[SEP] identifier[RESOLVED] operator[SEP] , annotation[@] identifier[Response] operator[SEP] identifier[text] operator[=] identifier[Outputs] operator[SEP] identifier[FAILURE] , identifier[field] operator[=] identifier[Outputs] operator[SEP] identifier[RETURN_CODE] , identifier[value] operator[=] identifier[Outputs] operator[SEP] identifier[RETURN_CODE_FAILURE] , identifier[matchType] operator[=] identifier[MatchType] operator[SEP] identifier[COMPARE_EQUAL] , identifier[responseType] operator[=] identifier[ResponseType] operator[SEP] identifier[ERROR] , identifier[isOnFail] operator[=] literal[boolean] operator[SEP] } operator[SEP] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[createVM] operator[SEP] annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[HOST] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[host] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[PORT] operator[SEP] identifier[String] identifier[port] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[PROTOCOL] operator[SEP] identifier[String] identifier[protocol] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[USERNAME] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[username] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[PASSWORD] , identifier[encrypted] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[password] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[TRUST_EVERYONE] operator[SEP] identifier[String] identifier[trustEveryone] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[CLOSE_SESSION] operator[SEP] identifier[String] identifier[closeSession] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[DATA_CENTER_NAME] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[dataCenterName] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[HOSTNAME] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[hostname] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[VM_NAME] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[virtualMachineName] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[DATA_STORE] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[dataStore] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[GUEST_OS_ID] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[guestOsId] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[FOLDER_NAME] operator[SEP] identifier[String] identifier[folderName] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[RESOURCE_POOL] operator[SEP] identifier[String] identifier[resourcePool] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[VM_DESCRIPTION] operator[SEP] identifier[String] identifier[description] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[VM_CPU_COUNT] operator[SEP] identifier[String] identifier[numCPUs] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[VM_DISK_SIZE] operator[SEP] identifier[String] identifier[vmDiskSize] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[VM_MEMORY_SIZE] operator[SEP] identifier[String] identifier[vmMemorySize] , annotation[@] identifier[Param] operator[SEP] identifier[value] operator[=] identifier[VMWARE_GLOBAL_SESSION_OBJECT] operator[SEP] identifier[GlobalSessionObject] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Connection] operator[>] operator[>] identifier[globalSessionObject] operator[SEP] { Keyword[try] { Keyword[final] identifier[HttpInputs] identifier[httpInputs] operator[=] Keyword[new] identifier[HttpInputs] operator[SEP] identifier[HttpInputsBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[withHost] operator[SEP] identifier[host] operator[SEP] operator[SEP] identifier[withPort] operator[SEP] identifier[port] operator[SEP] operator[SEP] identifier[withProtocol] operator[SEP] identifier[protocol] operator[SEP] operator[SEP] identifier[withUsername] operator[SEP] identifier[username] operator[SEP] operator[SEP] identifier[withPassword] operator[SEP] identifier[password] operator[SEP] operator[SEP] identifier[withTrustEveryone] operator[SEP] identifier[defaultIfEmpty] operator[SEP] identifier[trustEveryone] , identifier[FALSE] operator[SEP] operator[SEP] operator[SEP] identifier[withCloseSession] operator[SEP] identifier[defaultIfEmpty] operator[SEP] identifier[closeSession] , identifier[TRUE] operator[SEP] operator[SEP] operator[SEP] identifier[withGlobalSessionObject] operator[SEP] identifier[globalSessionObject] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[VmInputs] identifier[vmInputs] operator[=] Keyword[new] identifier[VmInputs] operator[SEP] identifier[VmInputsBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[withDataCenterName] operator[SEP] identifier[dataCenterName] operator[SEP] operator[SEP] identifier[withHostname] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] identifier[withVirtualMachineName] operator[SEP] identifier[virtualMachineName] operator[SEP] operator[SEP] identifier[withDescription] operator[SEP] identifier[description] operator[SEP] operator[SEP] identifier[withDataStore] operator[SEP] identifier[dataStore] operator[SEP] operator[SEP] identifier[withGuestOsId] operator[SEP] identifier[guestOsId] operator[SEP] operator[SEP] identifier[withFolderName] operator[SEP] identifier[folderName] operator[SEP] operator[SEP] identifier[withResourcePool] operator[SEP] identifier[resourcePool] operator[SEP] operator[SEP] identifier[withDescription] operator[SEP] identifier[description] operator[SEP] operator[SEP] identifier[withGuestOsId] operator[SEP] identifier[guestOsId] operator[SEP] operator[SEP] identifier[withDescription] operator[SEP] identifier[description] operator[SEP] operator[SEP] identifier[withIntNumCPUs] operator[SEP] identifier[numCPUs] operator[SEP] operator[SEP] identifier[withLongVmDiskSize] operator[SEP] identifier[vmDiskSize] operator[SEP] operator[SEP] identifier[withLongVmMemorySize] operator[SEP] identifier[vmMemorySize] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[VmService] operator[SEP] operator[SEP] operator[SEP] identifier[createVM] operator[SEP] identifier[httpInputs] , identifier[vmInputs] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[return] identifier[OutputUtilities] operator[SEP] identifier[getFailureResultsMap] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public static void setVerbose(java.util.logging.Level verbose) { if(verbose.intValue() <= Level.VERBOSE.intValue()) { // decrease to VERBOSE if it was higher, otherwise further to // VERYVERBOSE if(LOGGER_GLOBAL_TOP.getLevel() == null || LOGGER_GLOBAL_TOP.getLevel().intValue() > verbose.intValue()) { LOGGER_GLOBAL_TOP.setLevel(verbose); } if(LOGGER_ELKI_TOP.getLevel() == null || LOGGER_ELKI_TOP.getLevel().intValue() > verbose.intValue()) { LOGGER_ELKI_TOP.setLevel(verbose); } } else { // re-increase to given level if it was verbose or "very verbose". if(LOGGER_GLOBAL_TOP.getLevel() != null && (// Level.VERBOSE.equals(LOGGER_GLOBAL_TOP.getLevel()) || // Level.VERYVERBOSE.equals(LOGGER_GLOBAL_TOP.getLevel()) // )) { LOGGER_GLOBAL_TOP.setLevel(verbose); } if(LOGGER_ELKI_TOP.getLevel() != null && (// Level.VERBOSE.equals(LOGGER_ELKI_TOP.getLevel()) || // Level.VERYVERBOSE.equals(LOGGER_ELKI_TOP.getLevel()) // )) { LOGGER_ELKI_TOP.setLevel(verbose); } } }
class class_name[name] begin[{] method[setVerbose, return_type[void], modifier[public static], parameter[verbose]] begin[{] if[binary_operation[call[verbose.intValue, parameter[]], <=, call[Level.VERBOSE.intValue, parameter[]]]] begin[{] if[binary_operation[binary_operation[call[LOGGER_GLOBAL_TOP.getLevel, parameter[]], ==, literal[null]], ||, binary_operation[call[LOGGER_GLOBAL_TOP.getLevel, parameter[]], >, call[verbose.intValue, parameter[]]]]] begin[{] call[LOGGER_GLOBAL_TOP.setLevel, parameter[member[.verbose]]] else begin[{] None end[}] if[binary_operation[binary_operation[call[LOGGER_ELKI_TOP.getLevel, parameter[]], ==, literal[null]], ||, binary_operation[call[LOGGER_ELKI_TOP.getLevel, parameter[]], >, call[verbose.intValue, parameter[]]]]] begin[{] call[LOGGER_ELKI_TOP.setLevel, parameter[member[.verbose]]] else begin[{] None end[}] else begin[{] if[binary_operation[binary_operation[call[LOGGER_GLOBAL_TOP.getLevel, parameter[]], !=, literal[null]], &&, binary_operation[call[Level.VERBOSE.equals, parameter[call[LOGGER_GLOBAL_TOP.getLevel, parameter[]]]], ||, call[Level.VERYVERBOSE.equals, parameter[call[LOGGER_GLOBAL_TOP.getLevel, parameter[]]]]]]] begin[{] call[LOGGER_GLOBAL_TOP.setLevel, parameter[member[.verbose]]] else begin[{] None end[}] if[binary_operation[binary_operation[call[LOGGER_ELKI_TOP.getLevel, parameter[]], !=, literal[null]], &&, binary_operation[call[Level.VERBOSE.equals, parameter[call[LOGGER_ELKI_TOP.getLevel, parameter[]]]], ||, call[Level.VERYVERBOSE.equals, parameter[call[LOGGER_ELKI_TOP.getLevel, parameter[]]]]]]] begin[{] call[LOGGER_ELKI_TOP.setLevel, parameter[member[.verbose]]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setVerbose] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[logging] operator[SEP] identifier[Level] identifier[verbose] operator[SEP] { Keyword[if] operator[SEP] identifier[verbose] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[<=] identifier[Level] operator[SEP] identifier[VERBOSE] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[LOGGER_GLOBAL_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[LOGGER_GLOBAL_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[>] identifier[verbose] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER_GLOBAL_TOP] operator[SEP] identifier[setLevel] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[LOGGER_ELKI_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[LOGGER_ELKI_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[>] identifier[verbose] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER_ELKI_TOP] operator[SEP] identifier[setLevel] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[LOGGER_GLOBAL_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[SEP] identifier[Level] operator[SEP] identifier[VERBOSE] operator[SEP] identifier[equals] operator[SEP] identifier[LOGGER_GLOBAL_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[Level] operator[SEP] identifier[VERYVERBOSE] operator[SEP] identifier[equals] operator[SEP] identifier[LOGGER_GLOBAL_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER_GLOBAL_TOP] operator[SEP] identifier[setLevel] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[LOGGER_ELKI_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[SEP] identifier[Level] operator[SEP] identifier[VERBOSE] operator[SEP] identifier[equals] operator[SEP] identifier[LOGGER_ELKI_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[Level] operator[SEP] identifier[VERYVERBOSE] operator[SEP] identifier[equals] operator[SEP] identifier[LOGGER_ELKI_TOP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER_ELKI_TOP] operator[SEP] identifier[setLevel] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] } } }
@Override protected void perform(final Wave wave) throws CommandException { this.stackName = wave.get(UndoRedoWaves.STACK_NAME); final UndoRedoService service = getService(UndoRedoService.class, this.stackName); this.undoableCommand = wave.get(UndoRedoWaves.UNDOABLE_COMMAND); service.stackUp(this.undoableCommand); }
class class_name[name] begin[{] method[perform, return_type[void], modifier[protected], parameter[wave]] begin[{] assign[THIS[member[None.stackName]], call[wave.get, parameter[member[UndoRedoWaves.STACK_NAME]]]] local_variable[type[UndoRedoService], service] assign[THIS[member[None.undoableCommand]], call[wave.get, parameter[member[UndoRedoWaves.UNDOABLE_COMMAND]]]] call[service.stackUp, parameter[THIS[member[None.undoableCommand]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[perform] operator[SEP] Keyword[final] identifier[Wave] identifier[wave] operator[SEP] Keyword[throws] identifier[CommandException] { Keyword[this] operator[SEP] identifier[stackName] operator[=] identifier[wave] operator[SEP] identifier[get] operator[SEP] identifier[UndoRedoWaves] operator[SEP] identifier[STACK_NAME] operator[SEP] operator[SEP] Keyword[final] identifier[UndoRedoService] identifier[service] operator[=] identifier[getService] operator[SEP] identifier[UndoRedoService] operator[SEP] Keyword[class] , Keyword[this] operator[SEP] identifier[stackName] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[undoableCommand] operator[=] identifier[wave] operator[SEP] identifier[get] operator[SEP] identifier[UndoRedoWaves] operator[SEP] identifier[UNDOABLE_COMMAND] operator[SEP] operator[SEP] identifier[service] operator[SEP] identifier[stackUp] operator[SEP] Keyword[this] operator[SEP] identifier[undoableCommand] operator[SEP] operator[SEP] }
public InternetGateway withAttachments(InternetGatewayAttachment... attachments) { if (this.attachments == null) { setAttachments(new com.amazonaws.internal.SdkInternalList<InternetGatewayAttachment>(attachments.length)); } for (InternetGatewayAttachment ele : attachments) { this.attachments.add(ele); } return this; }
class class_name[name] begin[{] method[withAttachments, return_type[type[InternetGateway]], modifier[public], parameter[attachments]] begin[{] if[binary_operation[THIS[member[None.attachments]], ==, literal[null]]] begin[{] call[.setAttachments, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attachments, 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=InternetGatewayAttachment, 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=attachments, 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=attachments, 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=InternetGatewayAttachment, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[InternetGateway] identifier[withAttachments] operator[SEP] identifier[InternetGatewayAttachment] operator[...] identifier[attachments] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[attachments] operator[==] Other[null] operator[SEP] { identifier[setAttachments] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[InternetGatewayAttachment] operator[>] operator[SEP] identifier[attachments] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[InternetGatewayAttachment] identifier[ele] operator[:] identifier[attachments] operator[SEP] { Keyword[this] operator[SEP] identifier[attachments] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public final <V> Mono<V> thenReturn(V value) { return then(Mono.just(value)); }
class class_name[name] begin[{] method[thenReturn, return_type[type[Mono]], modifier[final public], parameter[value]] begin[{] return[call[.then, parameter[call[Mono.just, parameter[member[.value]]]]]] end[}] END[}]
Keyword[public] Keyword[final] operator[<] identifier[V] operator[>] identifier[Mono] operator[<] identifier[V] operator[>] identifier[thenReturn] operator[SEP] identifier[V] identifier[value] operator[SEP] { Keyword[return] identifier[then] operator[SEP] identifier[Mono] operator[SEP] identifier[just] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] }
@Override @SuppressWarnings("unchecked") public void decorate(Map<String, Object> result) throws Exception { try { ServiceReference<ConfigurationAdmin> cmRef = bundleContext.getServiceReference(ConfigurationAdmin.class); ServiceReference<JMXSecurityMBean> jmxSecRef = bundleContext.getServiceReference(JMXSecurityMBean.class); if (cmRef == null || jmxSecRef == null) { return; } ConfigurationAdmin configAdmin = bundleContext.getService(cmRef); JMXSecurityMBean jmxSec = bundleContext.getService(jmxSecRef); if (configAdmin == null || jmxSec == null) { return; } // 1. each pair of MBean/operation has to be marked with RBAC flag (can/can't invoke) // 2. the information is provided by org.apache.karaf.management.JMXSecurityMBean.canInvoke(java.util.Map) // 3. we'll peek into available configadmin jmx.acl* configs, to see which MBeans/operations have to // be examined and which will produce same results // 4. only then we'll prepare Map as parameter for canInvoke() Configuration[] configurations = configAdmin.listConfigurations("(service.pid=jmx.acl*)"); if (configurations == null) { return; } List<String> allJmxAclPids = Arrays.stream(configurations) .map(Configuration::getPid) .collect(Collectors.toCollection(LinkedList::new)); if (allJmxAclPids.isEmpty()) { return; } Map<String, Map<String, Object>> domains = (Map<String, Map<String, Object>>) result.get("domains"); // cache contains MBeanInfos for different MBeans/ObjectNames Map<String, Map<String, Object>> cache = (Map<String, Map<String, Object>>) result.get("cache"); // new cache will contain MBeanInfos + RBAC info Map<String, Map<String, Object>> rbacCache = new HashMap<>(); // the fact that some MBeans share JSON MBeanInfo doesn't mean that they can share RBAC info // - each MBean's name may have RBAC information configured in different PIDs. // when iterating through all repeating MBeans that share MBeanInfo (that doesn't have RBAC info // yet), we have to decide if it'll use shared info after RBAC check or will switch to dedicated // info. we have to be careful not to end with most MBeans *not* sharing MBeanInfo (in case if // somehow the shared info will be "special case" from RBAC point of view) Map<String, List<String>> queryForMBeans = new HashMap<>(); Map<String, List<String>> queryForMBeanOperations = new HashMap<>(); constructQueries(allJmxAclPids, domains, cache, rbacCache, queryForMBeans, queryForMBeanOperations); // RBAC per MBeans (can invoke *any* operation or attribute?) doQueryForMBeans(jmxSec, domains, rbacCache, queryForMBeans); // RBAC per { MBean,operation } (can invoke status for each operation) doQueryForMBeanOperations(jmxSec, domains, rbacCache, queryForMBeanOperations); result.remove("cache"); result.put("cache", rbacCache); if (verify) { verify(result); } } catch (Exception e) { LOG.error(e.getMessage(), e); // simply do not decorate } }
class class_name[name] begin[{] method[decorate, return_type[void], modifier[public], parameter[result]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigurationAdmin, sub_type=None))], member=getServiceReference, postfix_operators=[], prefix_operators=[], qualifier=bundleContext, selectors=[], type_arguments=None), name=cmRef)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationAdmin, sub_type=None))], dimensions=[], name=ServiceReference, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JMXSecurityMBean, sub_type=None))], member=getServiceReference, postfix_operators=[], prefix_operators=[], qualifier=bundleContext, selectors=[], type_arguments=None), name=jmxSecRef)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JMXSecurityMBean, sub_type=None))], dimensions=[], name=ServiceReference, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cmRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=jmxSecRef, 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=[ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cmRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getService, postfix_operators=[], prefix_operators=[], qualifier=bundleContext, selectors=[], type_arguments=None), name=configAdmin)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationAdmin, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=jmxSecRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getService, postfix_operators=[], prefix_operators=[], qualifier=bundleContext, selectors=[], type_arguments=None), name=jmxSec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JMXSecurityMBean, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=configAdmin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=jmxSec, 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=[ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(service.pid=jmx.acl*)")], member=listConfigurations, postfix_operators=[], prefix_operators=[], qualifier=configAdmin, selectors=[], type_arguments=None), name=configurations)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Configuration, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=configurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=configurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stream, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=Configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=LinkedList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=new, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), type_arguments=[])], member=toCollection, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=allJmxAclPids)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=allJmxAclPids, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="domains")], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=[], name=Map, sub_type=None)), name=domains)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cache")], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=[], name=Map, sub_type=None)), name=cache)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), name=rbacCache)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), name=queryForMBeans)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), name=queryForMBeanOperations)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=allJmxAclPids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=domains, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rbacCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryForMBeans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryForMBeanOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=constructQueries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jmxSec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=domains, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rbacCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryForMBeans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doQueryForMBeans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jmxSec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=domains, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rbacCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryForMBeanOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doQueryForMBeanOperations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cache")], member=remove, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cache"), MemberReference(member=rbacCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=verify, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=verify, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[decorate] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[result] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[try] { identifier[ServiceReference] operator[<] identifier[ConfigurationAdmin] operator[>] identifier[cmRef] operator[=] identifier[bundleContext] operator[SEP] identifier[getServiceReference] operator[SEP] identifier[ConfigurationAdmin] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ServiceReference] operator[<] identifier[JMXSecurityMBean] operator[>] identifier[jmxSecRef] operator[=] identifier[bundleContext] operator[SEP] identifier[getServiceReference] operator[SEP] identifier[JMXSecurityMBean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmRef] operator[==] Other[null] operator[||] identifier[jmxSecRef] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[ConfigurationAdmin] identifier[configAdmin] operator[=] identifier[bundleContext] operator[SEP] identifier[getService] operator[SEP] identifier[cmRef] operator[SEP] operator[SEP] identifier[JMXSecurityMBean] identifier[jmxSec] operator[=] identifier[bundleContext] operator[SEP] identifier[getService] operator[SEP] identifier[jmxSecRef] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configAdmin] operator[==] Other[null] operator[||] identifier[jmxSec] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[Configuration] operator[SEP] operator[SEP] identifier[configurations] operator[=] identifier[configAdmin] operator[SEP] identifier[listConfigurations] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configurations] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[allJmxAclPids] operator[=] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[configurations] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Configuration] operator[::] identifier[getPid] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toCollection] operator[SEP] identifier[LinkedList] operator[::] Keyword[new] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[allJmxAclPids] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[domains] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] identifier[result] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[cache] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] identifier[result] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[rbacCache] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[queryForMBeans] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[queryForMBeanOperations] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[constructQueries] operator[SEP] identifier[allJmxAclPids] , identifier[domains] , identifier[cache] , identifier[rbacCache] , identifier[queryForMBeans] , identifier[queryForMBeanOperations] operator[SEP] operator[SEP] identifier[doQueryForMBeans] operator[SEP] identifier[jmxSec] , identifier[domains] , identifier[rbacCache] , identifier[queryForMBeans] operator[SEP] operator[SEP] identifier[doQueryForMBeanOperations] operator[SEP] identifier[jmxSec] , identifier[domains] , identifier[rbacCache] , identifier[queryForMBeanOperations] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rbacCache] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[verify] operator[SEP] { identifier[verify] operator[SEP] identifier[result] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static byte min(final byte... array) { // Validates input validateArray(array); // Finds and returns min byte min = array[0]; for (int i = 1; i < array.length; i++) { if (array[i] < min) { min = array[i]; } } return min; }
class class_name[name] begin[{] method[min, return_type[type[byte]], modifier[public static], parameter[array]] begin[{] call[.validateArray, parameter[member[.array]]] local_variable[type[byte], min] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=array, 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=array, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.min]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] identifier[min] operator[SEP] Keyword[final] Keyword[byte] operator[...] identifier[array] operator[SEP] { identifier[validateArray] operator[SEP] identifier[array] operator[SEP] operator[SEP] Keyword[byte] identifier[min] operator[=] identifier[array] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[array] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[min] operator[SEP] { identifier[min] operator[=] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[return] identifier[min] operator[SEP] }
private Object readNewLongString(boolean unshared) throws IOException { long length = input.readLong(); Object result = input.decodeUTF((int) length); if (enableResolve) { result = resolveObject(result); } registerObjectRead(result, nextHandle(), unshared); return result; }
class class_name[name] begin[{] method[readNewLongString, return_type[type[Object]], modifier[private], parameter[unshared]] begin[{] local_variable[type[long], length] local_variable[type[Object], result] if[member[.enableResolve]] begin[{] assign[member[.result], call[.resolveObject, parameter[member[.result]]]] else begin[{] None end[}] call[.registerObjectRead, parameter[member[.result], call[.nextHandle, parameter[]], member[.unshared]]] return[member[.result]] end[}] END[}]
Keyword[private] identifier[Object] identifier[readNewLongString] operator[SEP] Keyword[boolean] identifier[unshared] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[long] identifier[length] operator[=] identifier[input] operator[SEP] identifier[readLong] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[result] operator[=] identifier[input] operator[SEP] identifier[decodeUTF] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enableResolve] operator[SEP] { identifier[result] operator[=] identifier[resolveObject] operator[SEP] identifier[result] operator[SEP] operator[SEP] } identifier[registerObjectRead] operator[SEP] identifier[result] , identifier[nextHandle] operator[SEP] operator[SEP] , identifier[unshared] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public void queryError(OutputStream os, HeadersAmp headers, String address, long qId, Throwable exn) throws IOException { init(os); OutH3 out = _out; if (out == null) return; if (log.isLoggable(_level)) { log.log(_level, "query-error " + exn + " (in " + this + ")" + " {to:" + address + ", " + headers + "}"); if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, exn.toString(), exn); } } try { out.writeLong(MessageTypeHamp.QUERY_ERROR.ordinal()); writeHeaders(out, headers); writeToAddress(out, address); out.writeLong(qId); ErrorAmp error = ErrorAmp.create(exn); out.writeString(error.getCode().toString()); out.writeString(error.getMessage()); out.writeObject(error.getDetail()); // XXX: out.flushBuffer(); } catch (Throwable e) { log.log(Level.WARNING, e.toString(), e); throw e; } }
class class_name[name] begin[{] method[queryError, return_type[void], modifier[public], parameter[os, headers, address, qId, exn]] begin[{] call[.init, parameter[member[.os]]] local_variable[type[OutH3], out] if[binary_operation[member[.out], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[call[log.isLoggable, parameter[member[._level]]]] begin[{] call[log.log, parameter[member[._level], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["query-error "], +, member[.exn]], +, literal[" (in "]], +, THIS[]], +, literal[")"]], +, literal[" {to:"]], +, member[.address]], +, literal[", "]], +, member[.headers]], +, literal["}"]]]] if[call[log.isLoggable, parameter[member[Level.FINEST]]]] begin[{] call[log.log, parameter[member[Level.FINEST], call[exn.toString, parameter[]], member[.exn]]] else begin[{] None end[}] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=MessageTypeHamp.QUERY_ERROR, selectors=[], type_arguments=None)], member=writeLong, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeHeaders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeToAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=qId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeLong, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=exn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=ErrorAmp, selectors=[], type_arguments=None), name=error)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ErrorAmp, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCode, postfix_operators=[], prefix_operators=[], qualifier=error, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=writeString, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=error, selectors=[], type_arguments=None)], member=writeString, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDetail, postfix_operators=[], prefix_operators=[], qualifier=error, selectors=[], type_arguments=None)], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[queryError] operator[SEP] identifier[OutputStream] identifier[os] , identifier[HeadersAmp] identifier[headers] , identifier[String] identifier[address] , Keyword[long] identifier[qId] , identifier[Throwable] identifier[exn] operator[SEP] Keyword[throws] identifier[IOException] { identifier[init] operator[SEP] identifier[os] operator[SEP] operator[SEP] identifier[OutH3] identifier[out] operator[=] identifier[_out] operator[SEP] Keyword[if] operator[SEP] identifier[out] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[_level] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[_level] , literal[String] operator[+] identifier[exn] operator[+] literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[address] operator[+] literal[String] operator[+] identifier[headers] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , identifier[exn] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[exn] operator[SEP] operator[SEP] } } Keyword[try] { identifier[out] operator[SEP] identifier[writeLong] operator[SEP] identifier[MessageTypeHamp] operator[SEP] identifier[QUERY_ERROR] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writeHeaders] operator[SEP] identifier[out] , identifier[headers] operator[SEP] operator[SEP] identifier[writeToAddress] operator[SEP] identifier[out] , identifier[address] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeLong] operator[SEP] identifier[qId] operator[SEP] operator[SEP] identifier[ErrorAmp] identifier[error] operator[=] identifier[ErrorAmp] operator[SEP] identifier[create] operator[SEP] identifier[exn] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeString] operator[SEP] identifier[error] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeString] operator[SEP] identifier[error] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeObject] operator[SEP] identifier[error] operator[SEP] identifier[getDetail] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
public void update() { if (done) { return; } int processed = AL10.alGetSourcei(source, AL10.AL_BUFFERS_PROCESSED); while (processed > 0) { unqueued.clear(); AL10.alSourceUnqueueBuffers(source, unqueued); if (stream(unqueued.get(0))) { AL10.alSourceQueueBuffers(source, unqueued); } else { remainingBufferCount--; if (remainingBufferCount == 0) { done = true; } } processed--; } int state = AL10.alGetSourcei(source, AL10.AL_SOURCE_STATE); if (state != AL10.AL_PLAYING) { AL10.alSourcePlay(source); } }
class class_name[name] begin[{] method[update, return_type[void], modifier[public], parameter[]] begin[{] if[member[.done]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], processed] while[binary_operation[member[.processed], >, literal[0]]] begin[{] call[unqueued.clear, parameter[]] call[AL10.alSourceUnqueueBuffers, parameter[member[.source], member[.unqueued]]] if[call[.stream, parameter[call[unqueued.get, parameter[literal[0]]]]]] begin[{] call[AL10.alSourceQueueBuffers, parameter[member[.source], member[.unqueued]]] else begin[{] member[.remainingBufferCount] if[binary_operation[member[.remainingBufferCount], ==, literal[0]]] begin[{] assign[member[.done], literal[true]] else begin[{] None end[}] end[}] member[.processed] end[}] local_variable[type[int], state] if[binary_operation[member[.state], !=, member[AL10.AL_PLAYING]]] begin[{] call[AL10.alSourcePlay, parameter[member[.source]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[update] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[done] operator[SEP] { Keyword[return] operator[SEP] } Keyword[int] identifier[processed] operator[=] identifier[AL10] operator[SEP] identifier[alGetSourcei] operator[SEP] identifier[source] , identifier[AL10] operator[SEP] identifier[AL_BUFFERS_PROCESSED] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[processed] operator[>] Other[0] operator[SEP] { identifier[unqueued] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[AL10] operator[SEP] identifier[alSourceUnqueueBuffers] operator[SEP] identifier[source] , identifier[unqueued] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stream] operator[SEP] identifier[unqueued] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { identifier[AL10] operator[SEP] identifier[alSourceQueueBuffers] operator[SEP] identifier[source] , identifier[unqueued] operator[SEP] operator[SEP] } Keyword[else] { identifier[remainingBufferCount] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[remainingBufferCount] operator[==] Other[0] operator[SEP] { identifier[done] operator[=] literal[boolean] operator[SEP] } } identifier[processed] operator[--] operator[SEP] } Keyword[int] identifier[state] operator[=] identifier[AL10] operator[SEP] identifier[alGetSourcei] operator[SEP] identifier[source] , identifier[AL10] operator[SEP] identifier[AL_SOURCE_STATE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[!=] identifier[AL10] operator[SEP] identifier[AL_PLAYING] operator[SEP] { identifier[AL10] operator[SEP] identifier[alSourcePlay] operator[SEP] identifier[source] operator[SEP] operator[SEP] } }
public void add(String applicationName, String url, Class<?> robotContext, boolean verbose) { logger.info("Add a new application named [{}] with this url: [{}]", applicationName, url); addApplicationPages(applicationName, robotContext.getSimpleName().replaceAll("Context", ""), robotContext, verbose); addApplicationSteps(applicationName, robotContext.getSimpleName().replaceAll("Context", ""), robotContext, verbose); addApplicationContext(applicationName, robotContext, verbose); addApplicationSelector(applicationName, verbose); addApplicationInPropertiesFile(applicationName, robotContext.getSimpleName().replaceAll("Context", ""), verbose); addApplicationInEnvPropertiesFile(applicationName, url, "ci", verbose); addApplicationInEnvPropertiesFile(applicationName, url, "dev", verbose); addApplicationInEnvPropertiesFile(applicationName, url, "prod", verbose); }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[applicationName, url, robotContext, verbose]] begin[{] call[logger.info, parameter[literal["Add a new application named [{}] with this url: [{}]"], member[.applicationName], member[.url]]] call[.addApplicationPages, parameter[member[.applicationName], call[robotContext.getSimpleName, parameter[]], member[.robotContext], member[.verbose]]] call[.addApplicationSteps, parameter[member[.applicationName], call[robotContext.getSimpleName, parameter[]], member[.robotContext], member[.verbose]]] call[.addApplicationContext, parameter[member[.applicationName], member[.robotContext], member[.verbose]]] call[.addApplicationSelector, parameter[member[.applicationName], member[.verbose]]] call[.addApplicationInPropertiesFile, parameter[member[.applicationName], call[robotContext.getSimpleName, parameter[]], member[.verbose]]] call[.addApplicationInEnvPropertiesFile, parameter[member[.applicationName], member[.url], literal["ci"], member[.verbose]]] call[.addApplicationInEnvPropertiesFile, parameter[member[.applicationName], member[.url], literal["dev"], member[.verbose]]] call[.addApplicationInEnvPropertiesFile, parameter[member[.applicationName], member[.url], literal["prod"], member[.verbose]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[String] identifier[applicationName] , identifier[String] identifier[url] , identifier[Class] operator[<] operator[?] operator[>] identifier[robotContext] , Keyword[boolean] identifier[verbose] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[applicationName] , identifier[url] operator[SEP] operator[SEP] identifier[addApplicationPages] operator[SEP] identifier[applicationName] , identifier[robotContext] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] , identifier[robotContext] , identifier[verbose] operator[SEP] operator[SEP] identifier[addApplicationSteps] operator[SEP] identifier[applicationName] , identifier[robotContext] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] , identifier[robotContext] , identifier[verbose] operator[SEP] operator[SEP] identifier[addApplicationContext] operator[SEP] identifier[applicationName] , identifier[robotContext] , identifier[verbose] operator[SEP] operator[SEP] identifier[addApplicationSelector] operator[SEP] identifier[applicationName] , identifier[verbose] operator[SEP] operator[SEP] identifier[addApplicationInPropertiesFile] operator[SEP] identifier[applicationName] , identifier[robotContext] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] , identifier[verbose] operator[SEP] operator[SEP] identifier[addApplicationInEnvPropertiesFile] operator[SEP] identifier[applicationName] , identifier[url] , literal[String] , identifier[verbose] operator[SEP] operator[SEP] identifier[addApplicationInEnvPropertiesFile] operator[SEP] identifier[applicationName] , identifier[url] , literal[String] , identifier[verbose] operator[SEP] operator[SEP] identifier[addApplicationInEnvPropertiesFile] operator[SEP] identifier[applicationName] , identifier[url] , literal[String] , identifier[verbose] operator[SEP] operator[SEP] }
public void addImage(Image image, float a, float b, float c, float d, float e, float f) throws DocumentException { throwError(); }
class class_name[name] begin[{] method[addImage, return_type[void], modifier[public], parameter[image, a, b, c, d, e, f]] begin[{] call[.throwError, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addImage] operator[SEP] identifier[Image] identifier[image] , Keyword[float] identifier[a] , Keyword[float] identifier[b] , Keyword[float] identifier[c] , Keyword[float] identifier[d] , Keyword[float] identifier[e] , Keyword[float] identifier[f] operator[SEP] Keyword[throws] identifier[DocumentException] { identifier[throwError] operator[SEP] operator[SEP] operator[SEP] }
@Override public void close() throws IOException { Socket s = _s; _s = null; if (s != null) { try { s.close(); } catch (Exception e) { } } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Socket], s] assign[member[._s], literal[null]] if[binary_operation[member[.s], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Socket] identifier[s] operator[=] identifier[_s] operator[SEP] identifier[_s] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[s] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } } }
@Override public java.util.concurrent.Future<ListAccountAliasesResult> listAccountAliasesAsync( com.amazonaws.handlers.AsyncHandler<ListAccountAliasesRequest, ListAccountAliasesResult> asyncHandler) { return listAccountAliasesAsync(new ListAccountAliasesRequest(), asyncHandler); }
class class_name[name] begin[{] method[listAccountAliasesAsync, return_type[type[java]], modifier[public], parameter[asyncHandler]] begin[{] return[call[.listAccountAliasesAsync, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ListAccountAliasesRequest, sub_type=None)), member[.asyncHandler]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[concurrent] operator[SEP] identifier[Future] operator[<] identifier[ListAccountAliasesResult] operator[>] identifier[listAccountAliasesAsync] operator[SEP] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[handlers] operator[SEP] identifier[AsyncHandler] operator[<] identifier[ListAccountAliasesRequest] , identifier[ListAccountAliasesResult] operator[>] identifier[asyncHandler] operator[SEP] { Keyword[return] identifier[listAccountAliasesAsync] operator[SEP] Keyword[new] identifier[ListAccountAliasesRequest] operator[SEP] operator[SEP] , identifier[asyncHandler] operator[SEP] operator[SEP] }
private static synchronized void start() throws IOException { if (s_tracer == null) { final VoltTrace tracer = new VoltTrace(); final Thread thread = new Thread(tracer); thread.setDaemon(true); thread.start(); s_tracer = tracer; } }
class class_name[name] begin[{] method[start, return_type[void], modifier[synchronized private static], parameter[]] begin[{] if[binary_operation[member[.s_tracer], ==, literal[null]]] begin[{] local_variable[type[VoltTrace], tracer] local_variable[type[Thread], thread] call[thread.setDaemon, parameter[literal[true]]] call[thread.start, parameter[]] assign[member[.s_tracer], member[.tracer]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[synchronized] Keyword[void] identifier[start] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[s_tracer] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[VoltTrace] identifier[tracer] operator[=] Keyword[new] identifier[VoltTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Thread] identifier[thread] operator[=] Keyword[new] identifier[Thread] operator[SEP] identifier[tracer] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[setDaemon] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[s_tracer] operator[=] identifier[tracer] operator[SEP] } }
void gatherMessageProtocol(int maxPos) throws IOException { try { while(this.bufferPosition < maxPos) { byte b = this.buffer[this.bufferPosition]; this.bufferPosition++; if (gotCR) { if (b == NatsConnection.LF) { this.mode = Mode.PARSE_PROTO; this.gotCR = false; break; } else { throw new IllegalStateException("Bad socket data, no LF after CR"); } } else if (b == NatsConnection.CR) { this.gotCR = true; } else { if (this.msgLinePosition >= this.msgLineChars.length) { throw new IllegalStateException("Protocol line is too long"); } this.msgLineChars[this.msgLinePosition] = (char) b; // Assumes ascii, as per protocol doc this.msgLinePosition++; } } } catch (IllegalStateException | NumberFormatException | NullPointerException ex) { this.encounteredProtocolError(ex); } }
class class_name[name] begin[{] method[gatherMessageProtocol, return_type[void], modifier[default], parameter[maxPos]] begin[{] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=buffer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bufferPosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=This(postfix_operators=['++'], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bufferPosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None), IfStatement(condition=MemberReference(member=gotCR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CR, postfix_operators=[], prefix_operators=[], qualifier=NatsConnection, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=msgLinePosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=msgLineChars, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Protocol line is too long")], 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)])), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=msgLineChars, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=msgLinePosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), type==, value=Cast(expression=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))), label=None), StatementExpression(expression=This(postfix_operators=['++'], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=msgLinePosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=gotCR, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LF, postfix_operators=[], prefix_operators=[], qualifier=NatsConnection, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bad socket data, no LF after CR")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=PARSE_PROTO, postfix_operators=[], prefix_operators=[], qualifier=Mode, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=gotCR, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]))]), condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bufferPosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=maxPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None)], catches=[CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encounteredProtocolError, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalStateException', 'NumberFormatException', 'NullPointerException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[void] identifier[gatherMessageProtocol] operator[SEP] Keyword[int] identifier[maxPos] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { Keyword[while] operator[SEP] Keyword[this] operator[SEP] identifier[bufferPosition] operator[<] identifier[maxPos] operator[SEP] { Keyword[byte] identifier[b] operator[=] Keyword[this] operator[SEP] identifier[buffer] operator[SEP] Keyword[this] operator[SEP] identifier[bufferPosition] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[bufferPosition] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[gotCR] operator[SEP] { Keyword[if] operator[SEP] identifier[b] operator[==] identifier[NatsConnection] operator[SEP] identifier[LF] operator[SEP] { Keyword[this] operator[SEP] identifier[mode] operator[=] identifier[Mode] operator[SEP] identifier[PARSE_PROTO] operator[SEP] Keyword[this] operator[SEP] identifier[gotCR] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[b] operator[==] identifier[NatsConnection] operator[SEP] identifier[CR] operator[SEP] { Keyword[this] operator[SEP] identifier[gotCR] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[msgLinePosition] operator[>=] Keyword[this] operator[SEP] identifier[msgLineChars] operator[SEP] identifier[length] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[msgLineChars] operator[SEP] Keyword[this] operator[SEP] identifier[msgLinePosition] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[b] operator[SEP] Keyword[this] operator[SEP] identifier[msgLinePosition] operator[++] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[IllegalStateException] operator[|] identifier[NumberFormatException] operator[|] identifier[NullPointerException] identifier[ex] operator[SEP] { Keyword[this] operator[SEP] identifier[encounteredProtocolError] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public void stopAllThreads() { if (tc.isEntryEnabled()) SibTr.entry(tc, "stopAllThreads"); synchronized (this) { Iterator iterator = ((ArrayList)_threadCache.clone()).iterator(); while (iterator.hasNext()) { StoppableThread thread = (StoppableThread)iterator.next(); if (tc.isDebugEnabled()) SibTr.debug(tc, "Attempting to stop thread " + thread); // Stop the thread thread.stopThread(this); // Remove from the iterator iterator.remove(); // Remove from the cache _threadCache.remove(thread); } } if (tc.isEntryEnabled()) SibTr.exit(tc, "stopAllThreads"); }
class class_name[name] begin[{] method[stopAllThreads, return_type[void], modifier[public], parameter[]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["stopAllThreads"]]] else begin[{] None end[}] SYNCHRONIZED[THIS[]] BEGIN[{] local_variable[type[Iterator], iterator] while[call[iterator.hasNext, parameter[]]] begin[{] local_variable[type[StoppableThread], thread] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[SibTr.debug, parameter[member[.tc], binary_operation[literal["Attempting to stop thread "], +, member[.thread]]]] else begin[{] None end[}] call[thread.stopThread, parameter[THIS[]]] call[iterator.remove, parameter[]] call[_threadCache.remove, parameter[member[.thread]]] end[}] END[}] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["stopAllThreads"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[stopAllThreads] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[Iterator] identifier[iterator] operator[=] operator[SEP] operator[SEP] identifier[ArrayList] operator[SEP] identifier[_threadCache] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[StoppableThread] identifier[thread] operator[=] operator[SEP] identifier[StoppableThread] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[thread] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[stopThread] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[_threadCache] operator[SEP] identifier[remove] operator[SEP] identifier[thread] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
protected final Runnable pollScheduledTask(long nanoTime) { assert inEventLoop(); Queue<ScheduledFutureTask<?>> scheduledTaskQueue = this.scheduledTaskQueue; ScheduledFutureTask<?> scheduledTask = scheduledTaskQueue == null ? null : scheduledTaskQueue.peek(); if (scheduledTask == null) { return null; } if (scheduledTask.deadlineNanos() <= nanoTime) { scheduledTaskQueue.remove(); return scheduledTask; } return null; }
class class_name[name] begin[{] method[pollScheduledTask, return_type[type[Runnable]], modifier[final protected], parameter[nanoTime]] begin[{] AssertStatement(condition=MethodInvocation(arguments=[], member=inEventLoop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None, value=None) local_variable[type[Queue], scheduledTaskQueue] local_variable[type[ScheduledFutureTask], scheduledTask] if[binary_operation[member[.scheduledTask], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[call[scheduledTask.deadlineNanos, parameter[]], <=, member[.nanoTime]]] begin[{] call[scheduledTaskQueue.remove, parameter[]] return[member[.scheduledTask]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[Runnable] identifier[pollScheduledTask] operator[SEP] Keyword[long] identifier[nanoTime] operator[SEP] { Keyword[assert] identifier[inEventLoop] operator[SEP] operator[SEP] operator[SEP] identifier[Queue] operator[<] identifier[ScheduledFutureTask] operator[<] operator[?] operator[>] operator[>] identifier[scheduledTaskQueue] operator[=] Keyword[this] operator[SEP] identifier[scheduledTaskQueue] operator[SEP] identifier[ScheduledFutureTask] operator[<] operator[?] operator[>] identifier[scheduledTask] operator[=] identifier[scheduledTaskQueue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[scheduledTaskQueue] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scheduledTask] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[scheduledTask] operator[SEP] identifier[deadlineNanos] operator[SEP] operator[SEP] operator[<=] identifier[nanoTime] operator[SEP] { identifier[scheduledTaskQueue] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[scheduledTask] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public thredds.catalog.InvDatasetImpl findDatasetByName(java.lang.String p0) { return !useProxy ? super.findDatasetByName(p0) : proxy.findDatasetByName(p0); }
class class_name[name] begin[{] method[findDatasetByName, return_type[type[thredds]], modifier[public], parameter[p0]] begin[{] return[TernaryExpression(condition=MemberReference(member=useProxy, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MemberReference(member=p0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findDatasetByName, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None), if_true=SuperMethodInvocation(arguments=[MemberReference(member=p0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findDatasetByName, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[thredds] operator[SEP] identifier[catalog] operator[SEP] identifier[InvDatasetImpl] identifier[findDatasetByName] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[String] identifier[p0] operator[SEP] { Keyword[return] operator[!] identifier[useProxy] operator[?] Keyword[super] operator[SEP] identifier[findDatasetByName] operator[SEP] identifier[p0] operator[SEP] operator[:] identifier[proxy] operator[SEP] identifier[findDatasetByName] operator[SEP] identifier[p0] operator[SEP] operator[SEP] }
private boolean parseHeaderValueNonExtract(WsByteBuffer buff) throws MalformedMessageException { if (0 == this.parsedTokenLength) { // save the start position when we first start parsing the value if (!skipWhiteSpace(buff)) { return false; } int start = findCurrentBufferPosition(buff); this.currentElem.setParseInformation(this.parseIndex, start); } // if we ran out of data, then return false from here if (TokenCodes.TOKEN_RC_MOREDATA.equals(findCRLFTokenLength(buff))) { return false; } this.currentElem.setValueLength(this.parsedTokenLength); addHeader(this.currentElem, FILTER_YES); this.parsedTokenLength = 0; this.currentElem = null; this.stateOfParsing = PARSING_CRLF; return true; }
class class_name[name] begin[{] method[parseHeaderValueNonExtract, return_type[type[boolean]], modifier[private], parameter[buff]] begin[{] if[binary_operation[literal[0], ==, THIS[member[None.parsedTokenLength]]]] begin[{] if[call[.skipWhiteSpace, parameter[member[.buff]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], start] THIS[member[None.currentElem]call[None.setParseInformation, parameter[THIS[member[None.parseIndex]], member[.start]]]] else begin[{] None end[}] if[call[TokenCodes.TOKEN_RC_MOREDATA.equals, parameter[call[.findCRLFTokenLength, parameter[member[.buff]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] THIS[member[None.currentElem]call[None.setValueLength, parameter[THIS[member[None.parsedTokenLength]]]]] call[.addHeader, parameter[THIS[member[None.currentElem]], member[.FILTER_YES]]] assign[THIS[member[None.parsedTokenLength]], literal[0]] assign[THIS[member[None.currentElem]], literal[null]] assign[THIS[member[None.stateOfParsing]], member[.PARSING_CRLF]] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[parseHeaderValueNonExtract] operator[SEP] identifier[WsByteBuffer] identifier[buff] operator[SEP] Keyword[throws] identifier[MalformedMessageException] { Keyword[if] operator[SEP] Other[0] operator[==] Keyword[this] operator[SEP] identifier[parsedTokenLength] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[skipWhiteSpace] operator[SEP] identifier[buff] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[int] identifier[start] operator[=] identifier[findCurrentBufferPosition] operator[SEP] identifier[buff] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[currentElem] operator[SEP] identifier[setParseInformation] operator[SEP] Keyword[this] operator[SEP] identifier[parseIndex] , identifier[start] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TokenCodes] operator[SEP] identifier[TOKEN_RC_MOREDATA] operator[SEP] identifier[equals] operator[SEP] identifier[findCRLFTokenLength] operator[SEP] identifier[buff] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[this] operator[SEP] identifier[currentElem] operator[SEP] identifier[setValueLength] operator[SEP] Keyword[this] operator[SEP] identifier[parsedTokenLength] operator[SEP] operator[SEP] identifier[addHeader] operator[SEP] Keyword[this] operator[SEP] identifier[currentElem] , identifier[FILTER_YES] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parsedTokenLength] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[currentElem] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[stateOfParsing] operator[=] identifier[PARSING_CRLF] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public GetPatchBaselineResult withRejectedPatches(String... rejectedPatches) { if (this.rejectedPatches == null) { setRejectedPatches(new com.amazonaws.internal.SdkInternalList<String>(rejectedPatches.length)); } for (String ele : rejectedPatches) { this.rejectedPatches.add(ele); } return this; }
class class_name[name] begin[{] method[withRejectedPatches, return_type[type[GetPatchBaselineResult]], modifier[public], parameter[rejectedPatches]] begin[{] if[binary_operation[THIS[member[None.rejectedPatches]], ==, literal[null]]] begin[{] call[.setRejectedPatches, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=rejectedPatches, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=rejectedPatches, 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=rejectedPatches, 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[GetPatchBaselineResult] identifier[withRejectedPatches] operator[SEP] identifier[String] operator[...] identifier[rejectedPatches] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[rejectedPatches] operator[==] Other[null] operator[SEP] { identifier[setRejectedPatches] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[rejectedPatches] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[rejectedPatches] operator[SEP] { Keyword[this] operator[SEP] identifier[rejectedPatches] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected Column column( String nameExpression ) { String[] parts = nameExpression.split("(?<!\\\\)\\."); // a . not preceded by an escaping slash for (int i = 0; i != parts.length; ++i) { parts[i] = parts[i].trim(); } SelectorName name = null; String propertyName = null; String columnName = null; if (parts.length == 2) { name = selector(parts[0]); propertyName = parts[1]; columnName = parts[1]; } else { if (source instanceof Selector) { Selector selector = (Selector)source; name = selector.hasAlias() ? selector.alias() : selector.name(); propertyName = parts[0]; columnName = parts[0]; } else { throw new IllegalArgumentException(GraphI18n.columnMustBeScoped.text(parts[0])); } } return new Column(name, propertyName, columnName); }
class class_name[name] begin[{] method[column, return_type[type[Column]], modifier[protected], parameter[nameExpression]] begin[{] local_variable[type[String], parts] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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=parts, selectors=[]), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[SelectorName], name] local_variable[type[String], propertyName] local_variable[type[String], columnName] if[binary_operation[member[parts.length], ==, literal[2]]] begin[{] assign[member[.name], call[.selector, parameter[member[.parts]]]] assign[member[.propertyName], member[.parts]] assign[member[.columnName], member[.parts]] else begin[{] if[binary_operation[member[.source], instanceof, type[Selector]]] begin[{] local_variable[type[Selector], selector] assign[member[.name], TernaryExpression(condition=MethodInvocation(arguments=[], member=hasAlias, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=alias, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None))] assign[member[.propertyName], member[.parts]] assign[member[.columnName], member[.parts]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=text, postfix_operators=[], prefix_operators=[], qualifier=GraphI18n.columnMustBeScoped, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] return[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnName, 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=Column, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[Column] identifier[column] operator[SEP] identifier[String] identifier[nameExpression] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[nameExpression] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[!=] identifier[parts] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } identifier[SelectorName] identifier[name] operator[=] Other[null] operator[SEP] identifier[String] identifier[propertyName] operator[=] Other[null] operator[SEP] identifier[String] identifier[columnName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { identifier[name] operator[=] identifier[selector] operator[SEP] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[propertyName] operator[=] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[columnName] operator[=] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[source] Keyword[instanceof] identifier[Selector] operator[SEP] { identifier[Selector] identifier[selector] operator[=] operator[SEP] identifier[Selector] operator[SEP] identifier[source] operator[SEP] identifier[name] operator[=] identifier[selector] operator[SEP] identifier[hasAlias] operator[SEP] operator[SEP] operator[?] identifier[selector] operator[SEP] identifier[alias] operator[SEP] operator[SEP] operator[:] identifier[selector] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[propertyName] operator[=] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[columnName] operator[=] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[GraphI18n] operator[SEP] identifier[columnMustBeScoped] operator[SEP] identifier[text] operator[SEP] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[Column] operator[SEP] identifier[name] , identifier[propertyName] , identifier[columnName] operator[SEP] operator[SEP] }
public Iterable<Tuple2<String, Obj>> asKeyObjSeq(final @Nullable Obj obj) { return new Iterable<Tuple2<String, Obj>>() { @Override public Iterator<Tuple2<String, Obj>> iterator() { if (obj != null) { final Iterator<Entry<String, Object>> i = obj.iterator(); return new Iterator<Tuple2<String, Obj>>() { @Override public boolean hasNext() { return i.hasNext(); } @Override public Tuple2<String, Obj> next() { Entry<String, Object> entry = i.next(); return new Tuple2<String, Obj>(entry.getKey(), (Obj) entry.getValue()); } @Override public void remove() { Check.unsupportedoperation.fail(); } }; } return java.util.Collections.emptyIterator(); } }; }
class class_name[name] begin[{] method[asKeyObjSeq, return_type[type[Iterable]], modifier[public], parameter[obj]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), name=i)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Entry, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Entry, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Obj, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Obj, sub_type=None))], dimensions=None, name=Tuple2, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Obj, sub_type=None))], dimensions=[], name=Tuple2, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=fail, postfix_operators=[], prefix_operators=[], qualifier=Check.unsupportedoperation, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=remove, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Obj, sub_type=None))], dimensions=[], name=Tuple2, sub_type=None))], dimensions=None, name=Iterator, sub_type=None)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=emptyIterator, postfix_operators=[], prefix_operators=[], qualifier=java.util.Collections, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=iterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Obj, sub_type=None))], dimensions=[], name=Tuple2, sub_type=None))], dimensions=[], name=Iterator, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Obj, sub_type=None))], dimensions=[], name=Tuple2, sub_type=None))], dimensions=None, name=Iterable, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Iterable] operator[<] identifier[Tuple2] operator[<] identifier[String] , identifier[Obj] operator[>] operator[>] identifier[asKeyObjSeq] operator[SEP] Keyword[final] annotation[@] identifier[Nullable] identifier[Obj] identifier[obj] operator[SEP] { Keyword[return] Keyword[new] identifier[Iterable] operator[<] identifier[Tuple2] operator[<] identifier[String] , identifier[Obj] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[Tuple2] operator[<] identifier[String] , identifier[Obj] operator[>] operator[>] identifier[iterator] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[Iterator] operator[<] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[i] operator[=] identifier[obj] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[Tuple2] operator[<] identifier[String] , identifier[Obj] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Tuple2] operator[<] identifier[String] , identifier[Obj] operator[>] identifier[next] operator[SEP] operator[SEP] { identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Tuple2] operator[<] identifier[String] , identifier[Obj] operator[>] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , operator[SEP] identifier[Obj] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] { identifier[Check] operator[SEP] identifier[unsupportedoperation] operator[SEP] identifier[fail] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] } Keyword[return] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collections] operator[SEP] identifier[emptyIterator] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public String getMemoryUsageAsString() { long len = weights.length; return ((8L + 4L + 4L) * len + changedNodes.getCapacity() * 4L + heap.getCapacity() * (4L + 4L)) / Helper.MB + "MB"; }
class class_name[name] begin[{] method[getMemoryUsageAsString, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[long], len] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal[8L], +, literal[4L]], +, literal[4L]], *, member[.len]], +, binary_operation[call[changedNodes.getCapacity, parameter[]], *, literal[4L]]], +, binary_operation[call[heap.getCapacity, parameter[]], *, binary_operation[literal[4L], +, literal[4L]]]], /, member[Helper.MB]], +, literal["MB"]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getMemoryUsageAsString] operator[SEP] operator[SEP] { Keyword[long] identifier[len] operator[=] identifier[weights] operator[SEP] identifier[length] operator[SEP] Keyword[return] operator[SEP] operator[SEP] Other[8L] operator[+] Other[4L] operator[+] Other[4L] operator[SEP] operator[*] identifier[len] operator[+] identifier[changedNodes] operator[SEP] identifier[getCapacity] operator[SEP] operator[SEP] operator[*] Other[4L] operator[+] identifier[heap] operator[SEP] identifier[getCapacity] operator[SEP] operator[SEP] operator[*] operator[SEP] Other[4L] operator[+] Other[4L] operator[SEP] operator[SEP] operator[/] identifier[Helper] operator[SEP] identifier[MB] operator[+] literal[String] operator[SEP] }
public final void deleteProduct(String name) { DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); deleteProduct(request); }
class class_name[name] begin[{] method[deleteProduct, return_type[void], modifier[final public], parameter[name]] begin[{] local_variable[type[DeleteProductRequest], request] call[.deleteProduct, parameter[member[.request]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[deleteProduct] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[DeleteProductRequest] identifier[request] operator[=] identifier[DeleteProductRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[deleteProduct] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
private String getDatatypeLabel(DatatypeIdValue datatype) { if (datatype.getIri() == null) { // TODO should be redundant once the // JSON parsing works return "Unknown"; } switch (datatype.getIri()) { case DatatypeIdValue.DT_COMMONS_MEDIA: return "Commons media"; case DatatypeIdValue.DT_GLOBE_COORDINATES: return "Globe coordinates"; case DatatypeIdValue.DT_ITEM: return "Item"; case DatatypeIdValue.DT_QUANTITY: return "Quantity"; case DatatypeIdValue.DT_STRING: return "String"; case DatatypeIdValue.DT_TIME: return "Time"; case DatatypeIdValue.DT_URL: return "URL"; case DatatypeIdValue.DT_PROPERTY: return "Property"; case DatatypeIdValue.DT_EXTERNAL_ID: return "External identifier"; case DatatypeIdValue.DT_MATH: return "Math"; case DatatypeIdValue.DT_MONOLINGUAL_TEXT: return "Monolingual Text"; default: throw new RuntimeException("Unknown datatype " + datatype.getIri()); } }
class class_name[name] begin[{] method[getDatatypeLabel, return_type[type[String]], modifier[private], parameter[datatype]] begin[{] if[binary_operation[call[datatype.getIri, parameter[]], ==, literal[null]]] begin[{] return[literal["Unknown"]] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=DT_COMMONS_MEDIA, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Commons media"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_GLOBE_COORDINATES, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Globe coordinates"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_ITEM, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Item"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_QUANTITY, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Quantity"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_STRING, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="String"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_TIME, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Time"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_URL, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="URL"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Property"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_EXTERNAL_ID, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="External identifier"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_MATH, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Math"), label=None)]), SwitchStatementCase(case=[MemberReference(member=DT_MONOLINGUAL_TEXT, postfix_operators=[], prefix_operators=[], qualifier=DatatypeIdValue, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Monolingual Text"), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown datatype "), operandr=MethodInvocation(arguments=[], member=getIri, postfix_operators=[], prefix_operators=[], qualifier=datatype, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getIri, postfix_operators=[], prefix_operators=[], qualifier=datatype, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[private] identifier[String] identifier[getDatatypeLabel] operator[SEP] identifier[DatatypeIdValue] identifier[datatype] operator[SEP] { Keyword[if] operator[SEP] identifier[datatype] operator[SEP] identifier[getIri] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[switch] operator[SEP] identifier[datatype] operator[SEP] identifier[getIri] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_COMMONS_MEDIA] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_GLOBE_COORDINATES] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_ITEM] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_QUANTITY] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_STRING] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_TIME] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_URL] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_PROPERTY] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_EXTERNAL_ID] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_MATH] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[DatatypeIdValue] operator[SEP] identifier[DT_MONOLINGUAL_TEXT] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[datatype] operator[SEP] identifier[getIri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public Map<String, TriggerRange> getTriggerRange(String[] instruments, String transactionType) throws KiteException, JSONException, IOException { String url = routes.get("market.trigger_range").replace(":transaction_type", transactionType.toLowerCase()); JSONObject response = new KiteRequestHandler(proxy).getRequest(url, "i", instruments, apiKey, accessToken); Type type = new TypeToken<Map<String, TriggerRange>>(){}.getType(); return gson.fromJson(String.valueOf(response.get("data")), type); }
class class_name[name] begin[{] method[getTriggerRange, return_type[type[Map]], modifier[public], parameter[instruments, transactionType]] begin[{] local_variable[type[String], url] local_variable[type[JSONObject], response] local_variable[type[Type], type] return[call[gson.fromJson, parameter[call[String.valueOf, parameter[call[response.get, parameter[literal["data"]]]]], member[.type]]]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[TriggerRange] operator[>] identifier[getTriggerRange] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[instruments] , identifier[String] identifier[transactionType] operator[SEP] Keyword[throws] identifier[KiteException] , identifier[JSONException] , identifier[IOException] { identifier[String] identifier[url] operator[=] identifier[routes] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[transactionType] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JSONObject] identifier[response] operator[=] Keyword[new] identifier[KiteRequestHandler] operator[SEP] identifier[proxy] operator[SEP] operator[SEP] identifier[getRequest] operator[SEP] identifier[url] , literal[String] , identifier[instruments] , identifier[apiKey] , identifier[accessToken] operator[SEP] operator[SEP] identifier[Type] identifier[type] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[Map] operator[<] identifier[String] , identifier[TriggerRange] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[gson] operator[SEP] identifier[fromJson] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[response] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] , identifier[type] operator[SEP] operator[SEP] }