code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public Vector4d set(int index, DoubleBuffer buffer) { MemUtil.INSTANCE.get(this, index, buffer); return this; }
class class_name[name] begin[{] method[set, return_type[type[Vector4d]], modifier[public], parameter[index, buffer]] begin[{] call[MemUtil.INSTANCE.get, parameter[THIS[], member[.index], member[.buffer]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Vector4d] identifier[set] operator[SEP] Keyword[int] identifier[index] , identifier[DoubleBuffer] identifier[buffer] operator[SEP] { identifier[MemUtil] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[get] operator[SEP] Keyword[this] , identifier[index] , identifier[buffer] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private void parseORBInitializersConfig(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException { // parse the initializers config attributes. EnumSet<Attribute> attributes = EnumSet.of(Attribute.ORB_INIT_SECURITY, Attribute.ORB_INIT_TRANSACTIONS); this.parseAttributes(reader, node, attributes, null); // the initializers element doesn't have child elements. requireNoContent(reader); //if security="on" change it to security="identity" if(node.has(SECURITY) && node.get(SECURITY).asString().equals(JacORBSubsystemConstants.ON)) { node.get(SECURITY).set(SecurityAllowedValues.IDENTITY.toString()); } }
class class_name[name] begin[{] method[parseORBInitializersConfig, return_type[void], modifier[private], parameter[reader, node]] begin[{] local_variable[type[EnumSet], attributes] THIS[call[None.parseAttributes, parameter[member[.reader], member[.node], member[.attributes], literal[null]]]] call[.requireNoContent, parameter[member[.reader]]] if[binary_operation[call[node.has, parameter[member[.SECURITY]]], &&, call[node.get, parameter[member[.SECURITY]]]]] begin[{] call[node.get, parameter[member[.SECURITY]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseORBInitializersConfig] operator[SEP] identifier[XMLExtendedStreamReader] identifier[reader] , identifier[ModelNode] identifier[node] operator[SEP] Keyword[throws] identifier[XMLStreamException] { identifier[EnumSet] operator[<] identifier[Attribute] operator[>] identifier[attributes] operator[=] identifier[EnumSet] operator[SEP] identifier[of] operator[SEP] identifier[Attribute] operator[SEP] identifier[ORB_INIT_SECURITY] , identifier[Attribute] operator[SEP] identifier[ORB_INIT_TRANSACTIONS] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parseAttributes] operator[SEP] identifier[reader] , identifier[node] , identifier[attributes] , Other[null] operator[SEP] operator[SEP] identifier[requireNoContent] operator[SEP] identifier[reader] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[has] operator[SEP] identifier[SECURITY] operator[SEP] operator[&&] identifier[node] operator[SEP] identifier[get] operator[SEP] identifier[SECURITY] operator[SEP] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[JacORBSubsystemConstants] operator[SEP] identifier[ON] operator[SEP] operator[SEP] { identifier[node] operator[SEP] identifier[get] operator[SEP] identifier[SECURITY] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[SecurityAllowedValues] operator[SEP] identifier[IDENTITY] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override protected Map<String, Resource.Factory> getRegistrations() { if (registrations == null) { super.getRegistrations(); registrations.put(XML_EXTENSION, new ColorResourceFactoryImpl()); registrations.put(STAR_EXTENSION, new ColorResourceFactoryImpl()); } return registrations; }
class class_name[name] begin[{] method[getRegistrations, return_type[type[Map]], modifier[protected], parameter[]] begin[{] if[binary_operation[member[.registrations], ==, literal[null]]] begin[{] SuperMethodInvocation(arguments=[], member=getRegistrations, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[registrations.put, parameter[member[.XML_EXTENSION], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ColorResourceFactoryImpl, sub_type=None))]] call[registrations.put, parameter[member[.STAR_EXTENSION], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ColorResourceFactoryImpl, sub_type=None))]] else begin[{] None end[}] return[member[.registrations]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Map] operator[<] identifier[String] , identifier[Resource] operator[SEP] identifier[Factory] operator[>] identifier[getRegistrations] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[registrations] operator[==] Other[null] operator[SEP] { Keyword[super] operator[SEP] identifier[getRegistrations] operator[SEP] operator[SEP] operator[SEP] identifier[registrations] operator[SEP] identifier[put] operator[SEP] identifier[XML_EXTENSION] , Keyword[new] identifier[ColorResourceFactoryImpl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[registrations] operator[SEP] identifier[put] operator[SEP] identifier[STAR_EXTENSION] , Keyword[new] identifier[ColorResourceFactoryImpl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[registrations] operator[SEP] }
public static <T> SimpleTemplate<T> simpleTemplate(Class<? extends T> cl, String template, Object... args) { return simpleTemplate(cl, createTemplate(template), ImmutableList.copyOf(args)); }
class class_name[name] begin[{] method[simpleTemplate, return_type[type[SimpleTemplate]], modifier[public static], parameter[cl, template, args]] begin[{] return[call[.simpleTemplate, parameter[member[.cl], call[.createTemplate, parameter[member[.template]]], call[ImmutableList.copyOf, parameter[member[.args]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[SimpleTemplate] operator[<] identifier[T] operator[>] identifier[simpleTemplate] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[cl] , identifier[String] identifier[template] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[simpleTemplate] operator[SEP] identifier[cl] , identifier[createTemplate] operator[SEP] identifier[template] operator[SEP] , identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] }
public void dontNotifyRequestListenersForRequest(final CachedSpiceRequest<?> request, final Collection<RequestListener<?>> listRequestListener) { final Set<RequestListener<?>> setRequestListener = mapRequestToRequestListener.get(request); requestListenerNotifier.clearNotificationsForRequest(request, setRequestListener); if (setRequestListener != null && listRequestListener != null) { Ln.d("Removing listeners of request : " + request.toString() + " : " + setRequestListener.size()); setRequestListener.removeAll(listRequestListener); } }
class class_name[name] begin[{] method[dontNotifyRequestListenersForRequest, return_type[void], modifier[public], parameter[request, listRequestListener]] begin[{] local_variable[type[Set], setRequestListener] call[requestListenerNotifier.clearNotificationsForRequest, parameter[member[.request], member[.setRequestListener]]] if[binary_operation[binary_operation[member[.setRequestListener], !=, literal[null]], &&, binary_operation[member[.listRequestListener], !=, literal[null]]]] begin[{] call[Ln.d, parameter[binary_operation[binary_operation[binary_operation[literal["Removing listeners of request : "], +, call[request.toString, parameter[]]], +, literal[" : "]], +, call[setRequestListener.size, parameter[]]]]] call[setRequestListener.removeAll, parameter[member[.listRequestListener]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[dontNotifyRequestListenersForRequest] operator[SEP] Keyword[final] identifier[CachedSpiceRequest] operator[<] operator[?] operator[>] identifier[request] , Keyword[final] identifier[Collection] operator[<] identifier[RequestListener] operator[<] operator[?] operator[>] operator[>] identifier[listRequestListener] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[RequestListener] operator[<] operator[?] operator[>] operator[>] identifier[setRequestListener] operator[=] identifier[mapRequestToRequestListener] operator[SEP] identifier[get] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[requestListenerNotifier] operator[SEP] identifier[clearNotificationsForRequest] operator[SEP] identifier[request] , identifier[setRequestListener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[setRequestListener] operator[!=] Other[null] operator[&&] identifier[listRequestListener] operator[!=] Other[null] operator[SEP] { identifier[Ln] operator[SEP] identifier[d] operator[SEP] literal[String] operator[+] identifier[request] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[setRequestListener] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setRequestListener] operator[SEP] identifier[removeAll] operator[SEP] identifier[listRequestListener] operator[SEP] operator[SEP] } }
public static DataAccessException newDataAccessException(String message, Object... args) { return newDataAccessException(null, message, args); }
class class_name[name] begin[{] method[newDataAccessException, return_type[type[DataAccessException]], modifier[public static], parameter[message, args]] begin[{] return[call[.newDataAccessException, parameter[literal[null], member[.message], member[.args]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DataAccessException] identifier[newDataAccessException] operator[SEP] identifier[String] identifier[message] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[newDataAccessException] operator[SEP] Other[null] , identifier[message] , identifier[args] operator[SEP] operator[SEP] }
public void updateRegisters(WAMMemoryLayout layout) { List<PropertyChangeEvent> changes = delta(this, layout); regBase = layout.regBase; regSize = layout.regSize; heapBase = layout.heapBase; heapSize = layout.heapSize; stackBase = layout.stackBase; stackSize = layout.stackSize; trailBase = layout.trailBase; trailSize = layout.trailSize; pdlBase = layout.pdlBase; pdlSize = layout.pdlSize; notifyChanges(changes); }
class class_name[name] begin[{] method[updateRegisters, return_type[void], modifier[public], parameter[layout]] begin[{] local_variable[type[List], changes] assign[member[.regBase], member[layout.regBase]] assign[member[.regSize], member[layout.regSize]] assign[member[.heapBase], member[layout.heapBase]] assign[member[.heapSize], member[layout.heapSize]] assign[member[.stackBase], member[layout.stackBase]] assign[member[.stackSize], member[layout.stackSize]] assign[member[.trailBase], member[layout.trailBase]] assign[member[.trailSize], member[layout.trailSize]] assign[member[.pdlBase], member[layout.pdlBase]] assign[member[.pdlSize], member[layout.pdlSize]] call[.notifyChanges, parameter[member[.changes]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[updateRegisters] operator[SEP] identifier[WAMMemoryLayout] identifier[layout] operator[SEP] { identifier[List] operator[<] identifier[PropertyChangeEvent] operator[>] identifier[changes] operator[=] identifier[delta] operator[SEP] Keyword[this] , identifier[layout] operator[SEP] operator[SEP] identifier[regBase] operator[=] identifier[layout] operator[SEP] identifier[regBase] operator[SEP] identifier[regSize] operator[=] identifier[layout] operator[SEP] identifier[regSize] operator[SEP] identifier[heapBase] operator[=] identifier[layout] operator[SEP] identifier[heapBase] operator[SEP] identifier[heapSize] operator[=] identifier[layout] operator[SEP] identifier[heapSize] operator[SEP] identifier[stackBase] operator[=] identifier[layout] operator[SEP] identifier[stackBase] operator[SEP] identifier[stackSize] operator[=] identifier[layout] operator[SEP] identifier[stackSize] operator[SEP] identifier[trailBase] operator[=] identifier[layout] operator[SEP] identifier[trailBase] operator[SEP] identifier[trailSize] operator[=] identifier[layout] operator[SEP] identifier[trailSize] operator[SEP] identifier[pdlBase] operator[=] identifier[layout] operator[SEP] identifier[pdlBase] operator[SEP] identifier[pdlSize] operator[=] identifier[layout] operator[SEP] identifier[pdlSize] operator[SEP] identifier[notifyChanges] operator[SEP] identifier[changes] operator[SEP] operator[SEP] }
public <T, T1, T2> FutureValue<T> futureCall(Job2<T, T1, T2> jobInstance, Value<? extends T1> v1, Value<? extends T2> v2, JobSetting... settings) { return futureCallUnchecked(settings, jobInstance, v1, v2); }
class class_name[name] begin[{] method[futureCall, return_type[type[FutureValue]], modifier[public], parameter[jobInstance, v1, v2, settings]] begin[{] return[call[.futureCallUnchecked, parameter[member[.settings], member[.jobInstance], member[.v1], member[.v2]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] , identifier[T1] , identifier[T2] operator[>] identifier[FutureValue] operator[<] identifier[T] operator[>] identifier[futureCall] operator[SEP] identifier[Job2] operator[<] identifier[T] , identifier[T1] , identifier[T2] operator[>] identifier[jobInstance] , identifier[Value] operator[<] operator[?] Keyword[extends] identifier[T1] operator[>] identifier[v1] , identifier[Value] operator[<] operator[?] Keyword[extends] identifier[T2] operator[>] identifier[v2] , identifier[JobSetting] operator[...] identifier[settings] operator[SEP] { Keyword[return] identifier[futureCallUnchecked] operator[SEP] identifier[settings] , identifier[jobInstance] , identifier[v1] , identifier[v2] operator[SEP] operator[SEP] }
private static boolean propertyFilter(final Triple t, final IRI ixnModel) { return typeMap.getOrDefault(ixnModel, LdpConstraints::basicConstraints).test(t); }
class class_name[name] begin[{] method[propertyFilter, return_type[type[boolean]], modifier[private static], parameter[t, ixnModel]] begin[{] return[call[typeMap.getOrDefault, parameter[member[.ixnModel], MethodReference(expression=MemberReference(member=LdpConstraints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=basicConstraints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[propertyFilter] operator[SEP] Keyword[final] identifier[Triple] identifier[t] , Keyword[final] identifier[IRI] identifier[ixnModel] operator[SEP] { Keyword[return] identifier[typeMap] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[ixnModel] , identifier[LdpConstraints] operator[::] identifier[basicConstraints] operator[SEP] operator[SEP] identifier[test] operator[SEP] identifier[t] operator[SEP] operator[SEP] }
@Override public QueryImpl<T> offset(int value) { QueryImpl<T> q = createQuery(); q.setOffset(value); return q; }
class class_name[name] begin[{] method[offset, return_type[type[QueryImpl]], modifier[public], parameter[value]] begin[{] local_variable[type[QueryImpl], q] call[q.setOffset, parameter[member[.value]]] return[member[.q]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[QueryImpl] operator[<] identifier[T] operator[>] identifier[offset] operator[SEP] Keyword[int] identifier[value] operator[SEP] { identifier[QueryImpl] operator[<] identifier[T] operator[>] identifier[q] operator[=] identifier[createQuery] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[setOffset] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[q] operator[SEP] }
private void performInitialCleanup() { listeEinsortieren.removeIf(f -> !f.arr[DatenFilm.FILM_URL].toLowerCase().startsWith("http")); listeEinsortieren.removeIf(f -> { String groesse = f.arr[DatenFilm.FILM_GROESSE]; if (groesse.isEmpty()) return false; else { return Long.parseLong(groesse) < MIN_SIZE_ADD_OLD; } }); }
class class_name[name] begin[{] method[performInitialCleanup, return_type[void], modifier[private], parameter[]] begin[{] call[listeEinsortieren.removeIf, parameter[LambdaExpression(body=MemberReference(member=arr, postfix_operators=[], prefix_operators=['!'], qualifier=f, selectors=[ArraySelector(index=MemberReference(member=FILM_URL, postfix_operators=[], prefix_operators=[], qualifier=DatenFilm, selectors=[])), MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="http")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), parameters=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] call[listeEinsortieren.removeIf, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[ArraySelector(index=MemberReference(member=FILM_GROESSE, postfix_operators=[], prefix_operators=[], qualifier=DatenFilm, selectors=[]))]), name=groesse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=groesse, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=groesse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), operandr=MemberReference(member=MIN_SIZE_ADD_OLD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None)]), label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))], parameters=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] end[}] END[}]
Keyword[private] Keyword[void] identifier[performInitialCleanup] operator[SEP] operator[SEP] { identifier[listeEinsortieren] operator[SEP] identifier[removeIf] operator[SEP] identifier[f] operator[->] operator[!] identifier[f] operator[SEP] identifier[arr] operator[SEP] identifier[DatenFilm] operator[SEP] identifier[FILM_URL] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[listeEinsortieren] operator[SEP] identifier[removeIf] operator[SEP] identifier[f] operator[->] { identifier[String] identifier[groesse] operator[=] identifier[f] operator[SEP] identifier[arr] operator[SEP] identifier[DatenFilm] operator[SEP] identifier[FILM_GROESSE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groesse] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[else] { Keyword[return] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[groesse] operator[SEP] operator[<] identifier[MIN_SIZE_ADD_OLD] operator[SEP] } } operator[SEP] operator[SEP] }
public void setActiveProfile(IProfile profile, boolean fireOnProfileChanged) { final boolean isCurrentSelectedProfile = mAccountHeaderBuilder.switchProfiles(profile); //if the selectionList is shown we should also update the current selected profile in the list if (mAccountHeaderBuilder.mDrawer != null && isSelectionListShown()) { mAccountHeaderBuilder.mDrawer.setSelection(profile.getIdentifier(), false); } //fire the event if enabled and a listener is set if (fireOnProfileChanged && mAccountHeaderBuilder.mOnAccountHeaderListener != null) { mAccountHeaderBuilder.mOnAccountHeaderListener.onProfileChanged(null, profile, isCurrentSelectedProfile); } }
class class_name[name] begin[{] method[setActiveProfile, return_type[void], modifier[public], parameter[profile, fireOnProfileChanged]] begin[{] local_variable[type[boolean], isCurrentSelectedProfile] if[binary_operation[binary_operation[member[mAccountHeaderBuilder.mDrawer], !=, literal[null]], &&, call[.isSelectionListShown, parameter[]]]] begin[{] call[mAccountHeaderBuilder.mDrawer.setSelection, parameter[call[profile.getIdentifier, parameter[]], literal[false]]] else begin[{] None end[}] if[binary_operation[member[.fireOnProfileChanged], &&, binary_operation[member[mAccountHeaderBuilder.mOnAccountHeaderListener], !=, literal[null]]]] begin[{] call[mAccountHeaderBuilder.mOnAccountHeaderListener.onProfileChanged, parameter[literal[null], member[.profile], member[.isCurrentSelectedProfile]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setActiveProfile] operator[SEP] identifier[IProfile] identifier[profile] , Keyword[boolean] identifier[fireOnProfileChanged] operator[SEP] { Keyword[final] Keyword[boolean] identifier[isCurrentSelectedProfile] operator[=] identifier[mAccountHeaderBuilder] operator[SEP] identifier[switchProfiles] operator[SEP] identifier[profile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mAccountHeaderBuilder] operator[SEP] identifier[mDrawer] operator[!=] Other[null] operator[&&] identifier[isSelectionListShown] operator[SEP] operator[SEP] operator[SEP] { identifier[mAccountHeaderBuilder] operator[SEP] identifier[mDrawer] operator[SEP] identifier[setSelection] operator[SEP] identifier[profile] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fireOnProfileChanged] operator[&&] identifier[mAccountHeaderBuilder] operator[SEP] identifier[mOnAccountHeaderListener] operator[!=] Other[null] operator[SEP] { identifier[mAccountHeaderBuilder] operator[SEP] identifier[mOnAccountHeaderListener] operator[SEP] identifier[onProfileChanged] operator[SEP] Other[null] , identifier[profile] , identifier[isCurrentSelectedProfile] operator[SEP] operator[SEP] } }
protected Object doInvoke(Object... args) throws Exception { ReflectionUtils.makeAccessible(getBridgedMethod()); try { return getBridgedMethod().invoke(getBean(), args); } catch (IllegalArgumentException ex) { assertTargetBean(getBridgedMethod(), getBean(), args); throw new IllegalStateException( getInvocationErrorMessage(ex.getMessage(), args), ex); } catch (InvocationTargetException ex) { // Unwrap for HandlerExceptionResolvers ... Throwable targetException = ex.getTargetException(); if (targetException instanceof RuntimeException) { throw (RuntimeException) targetException; } else if (targetException instanceof Error) { throw (Error) targetException; } else if (targetException instanceof Exception) { throw (Exception) targetException; } else { String msg = getInvocationErrorMessage( "Failed to invoke controller method", args); throw new IllegalStateException(msg, targetException); } } }
class class_name[name] begin[{] method[doInvoke, return_type[type[Object]], modifier[protected], parameter[args]] begin[{] call[ReflectionUtils.makeAccessible, parameter[call[.getBridgedMethod, parameter[]]]] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getBridgedMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBridgedMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assertTargetBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInvocationErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalArgumentException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTargetException, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), name=targetException)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Exception, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to invoke controller method"), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInvocationErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=targetException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Exception, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=targetException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=targetException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeException, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[Object] identifier[doInvoke] operator[SEP] identifier[Object] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[ReflectionUtils] operator[SEP] identifier[makeAccessible] operator[SEP] identifier[getBridgedMethod] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[getBridgedMethod] operator[SEP] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[getBean] operator[SEP] operator[SEP] , identifier[args] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ex] operator[SEP] { identifier[assertTargetBean] operator[SEP] identifier[getBridgedMethod] operator[SEP] operator[SEP] , identifier[getBean] operator[SEP] operator[SEP] , identifier[args] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[getInvocationErrorMessage] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[args] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[ex] operator[SEP] { identifier[Throwable] identifier[targetException] operator[=] identifier[ex] operator[SEP] identifier[getTargetException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetException] Keyword[instanceof] identifier[RuntimeException] operator[SEP] { Keyword[throw] operator[SEP] identifier[RuntimeException] operator[SEP] identifier[targetException] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[targetException] Keyword[instanceof] identifier[Error] operator[SEP] { Keyword[throw] operator[SEP] identifier[Error] operator[SEP] identifier[targetException] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[targetException] Keyword[instanceof] identifier[Exception] operator[SEP] { Keyword[throw] operator[SEP] identifier[Exception] operator[SEP] identifier[targetException] operator[SEP] } Keyword[else] { identifier[String] identifier[msg] operator[=] identifier[getInvocationErrorMessage] operator[SEP] literal[String] , identifier[args] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] , identifier[targetException] operator[SEP] operator[SEP] } } }
private void addQueryParams(final Request request) { if (areaCode != null) { request.addQueryParam("AreaCode", areaCode.toString()); } if (contains != null) { request.addQueryParam("Contains", contains); } if (smsEnabled != null) { request.addQueryParam("SmsEnabled", smsEnabled.toString()); } if (mmsEnabled != null) { request.addQueryParam("MmsEnabled", mmsEnabled.toString()); } if (voiceEnabled != null) { request.addQueryParam("VoiceEnabled", voiceEnabled.toString()); } if (excludeAllAddressRequired != null) { request.addQueryParam("ExcludeAllAddressRequired", excludeAllAddressRequired.toString()); } if (excludeLocalAddressRequired != null) { request.addQueryParam("ExcludeLocalAddressRequired", excludeLocalAddressRequired.toString()); } if (excludeForeignAddressRequired != null) { request.addQueryParam("ExcludeForeignAddressRequired", excludeForeignAddressRequired.toString()); } if (beta != null) { request.addQueryParam("Beta", beta.toString()); } if (nearNumber != null) { request.addQueryParam("NearNumber", nearNumber.toString()); } if (nearLatLong != null) { request.addQueryParam("NearLatLong", nearLatLong); } if (distance != null) { request.addQueryParam("Distance", distance.toString()); } if (inPostalCode != null) { request.addQueryParam("InPostalCode", inPostalCode); } if (inRegion != null) { request.addQueryParam("InRegion", inRegion); } if (inRateCenter != null) { request.addQueryParam("InRateCenter", inRateCenter); } if (inLata != null) { request.addQueryParam("InLata", inLata); } if (inLocality != null) { request.addQueryParam("InLocality", inLocality); } if (faxEnabled != null) { request.addQueryParam("FaxEnabled", faxEnabled.toString()); } if (getPageSize() != null) { request.addQueryParam("PageSize", Integer.toString(getPageSize())); } }
class class_name[name] begin[{] method[addQueryParams, return_type[void], modifier[private], parameter[request]] begin[{] if[binary_operation[member[.areaCode], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["AreaCode"], call[areaCode.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.contains], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["Contains"], member[.contains]]] else begin[{] None end[}] if[binary_operation[member[.smsEnabled], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["SmsEnabled"], call[smsEnabled.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.mmsEnabled], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["MmsEnabled"], call[mmsEnabled.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.voiceEnabled], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["VoiceEnabled"], call[voiceEnabled.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.excludeAllAddressRequired], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["ExcludeAllAddressRequired"], call[excludeAllAddressRequired.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.excludeLocalAddressRequired], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["ExcludeLocalAddressRequired"], call[excludeLocalAddressRequired.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.excludeForeignAddressRequired], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["ExcludeForeignAddressRequired"], call[excludeForeignAddressRequired.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.beta], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["Beta"], call[beta.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.nearNumber], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["NearNumber"], call[nearNumber.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.nearLatLong], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["NearLatLong"], member[.nearLatLong]]] else begin[{] None end[}] if[binary_operation[member[.distance], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["Distance"], call[distance.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.inPostalCode], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["InPostalCode"], member[.inPostalCode]]] else begin[{] None end[}] if[binary_operation[member[.inRegion], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["InRegion"], member[.inRegion]]] else begin[{] None end[}] if[binary_operation[member[.inRateCenter], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["InRateCenter"], member[.inRateCenter]]] else begin[{] None end[}] if[binary_operation[member[.inLata], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["InLata"], member[.inLata]]] else begin[{] None end[}] if[binary_operation[member[.inLocality], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["InLocality"], member[.inLocality]]] else begin[{] None end[}] if[binary_operation[member[.faxEnabled], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["FaxEnabled"], call[faxEnabled.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[.getPageSize, parameter[]], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["PageSize"], call[Integer.toString, parameter[call[.getPageSize, parameter[]]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addQueryParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { Keyword[if] operator[SEP] identifier[areaCode] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[areaCode] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contains] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[contains] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[smsEnabled] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[smsEnabled] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mmsEnabled] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[mmsEnabled] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[voiceEnabled] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[voiceEnabled] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[excludeAllAddressRequired] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[excludeAllAddressRequired] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[excludeLocalAddressRequired] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[excludeLocalAddressRequired] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[excludeForeignAddressRequired] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[excludeForeignAddressRequired] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[beta] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[beta] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[nearNumber] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[nearNumber] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[nearLatLong] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[nearLatLong] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[distance] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[distance] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inPostalCode] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[inPostalCode] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inRegion] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[inRegion] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inRateCenter] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[inRateCenter] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inLata] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[inLata] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inLocality] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[inLocality] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[faxEnabled] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[faxEnabled] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[getPageSize] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[getPageSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private HashSet<String> get(String id) throws IOException { if (collectionCachePath != null) { Date date = clear(); if (idToVersion.containsKey(id)) { String version = idToVersion.get(id); expirationVersion.put(version, date.getTime() + (1000 * lifeTime)); MtasSolrCollectionCacheItem newItem = read(version, date.getTime()); if (newItem != null && newItem.id.equals(id)) { return newItem.data; } else { log.error("couldn't get " + version); // delete file and remove from index if (!collectionCachePath.resolve(version).toFile().delete()) { log.debug("couldn't delete " + version); } idToVersion.remove(id); expirationVersion.remove(version); versionToItem.remove(version); } } else { log.error("doesn't exist anymore"); } return null; } else { throw new IOException("no cachePath available, can't get data"); } }
class class_name[name] begin[{] method[get, return_type[type[HashSet]], modifier[private], parameter[id]] begin[{] if[binary_operation[member[.collectionCachePath], !=, literal[null]]] begin[{] local_variable[type[Date], date] if[call[idToVersion.containsKey, parameter[member[.id]]]] begin[{] local_variable[type[String], version] call[expirationVersion.put, parameter[member[.version], binary_operation[call[date.getTime, parameter[]], +, binary_operation[literal[1000], *, member[.lifeTime]]]]] local_variable[type[MtasSolrCollectionCacheItem], newItem] if[binary_operation[binary_operation[member[.newItem], !=, literal[null]], &&, call[newItem.id.equals, parameter[member[.id]]]]] begin[{] return[member[newItem.data]] else begin[{] call[log.error, parameter[binary_operation[literal["couldn't get "], +, member[.version]]]] if[call[collectionCachePath.resolve, parameter[member[.version]]]] begin[{] call[log.debug, parameter[binary_operation[literal["couldn't delete "], +, member[.version]]]] else begin[{] None end[}] call[idToVersion.remove, parameter[member[.id]]] call[expirationVersion.remove, parameter[member[.version]]] call[versionToItem.remove, parameter[member[.version]]] end[}] else begin[{] call[log.error, parameter[literal["doesn't exist anymore"]]] end[}] return[literal[null]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no cachePath available, can't get data")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[private] identifier[HashSet] operator[<] identifier[String] operator[>] identifier[get] operator[SEP] identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[collectionCachePath] operator[!=] Other[null] operator[SEP] { identifier[Date] identifier[date] operator[=] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idToVersion] operator[SEP] identifier[containsKey] operator[SEP] identifier[id] operator[SEP] operator[SEP] { identifier[String] identifier[version] operator[=] identifier[idToVersion] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[expirationVersion] operator[SEP] identifier[put] operator[SEP] identifier[version] , identifier[date] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[+] operator[SEP] Other[1000] operator[*] identifier[lifeTime] operator[SEP] operator[SEP] operator[SEP] identifier[MtasSolrCollectionCacheItem] identifier[newItem] operator[=] identifier[read] operator[SEP] identifier[version] , identifier[date] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newItem] operator[!=] Other[null] operator[&&] identifier[newItem] operator[SEP] identifier[id] operator[SEP] identifier[equals] operator[SEP] identifier[id] operator[SEP] operator[SEP] { Keyword[return] identifier[newItem] operator[SEP] identifier[data] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[version] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[collectionCachePath] operator[SEP] identifier[resolve] operator[SEP] identifier[version] operator[SEP] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[version] operator[SEP] operator[SEP] } identifier[idToVersion] operator[SEP] identifier[remove] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[expirationVersion] operator[SEP] identifier[remove] operator[SEP] identifier[version] operator[SEP] operator[SEP] identifier[versionToItem] operator[SEP] identifier[remove] operator[SEP] identifier[version] operator[SEP] operator[SEP] } } Keyword[else] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
@Override public StringValue getParameterValue(final String _name) { final List<StringValue> values = this.parameters.get(_name); return (values != null && !values.isEmpty()) ? values.get(0) : StringValue.valueOf((String) null); }
class class_name[name] begin[{] method[getParameterValue, return_type[type[StringValue]], modifier[public], parameter[_name]] begin[{] local_variable[type[List], values] return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=values, selectors=[], type_arguments=None), operator=&&), if_false=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=StringValue, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[StringValue] identifier[getParameterValue] operator[SEP] Keyword[final] identifier[String] identifier[_name] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[StringValue] operator[>] identifier[values] operator[=] Keyword[this] operator[SEP] identifier[parameters] operator[SEP] identifier[get] operator[SEP] identifier[_name] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[values] operator[!=] Other[null] operator[&&] operator[!] identifier[values] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[values] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[:] identifier[StringValue] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[String] operator[SEP] Other[null] operator[SEP] operator[SEP] }
public static void cursorFillWindow(final Cursor cursor, int position, final CursorWindow window) { if (position < 0 || position >= cursor.getCount()) { return; } final int oldPos = cursor.getPosition(); final int numColumns = cursor.getColumnCount(); window.clear(); window.setStartPosition(position); window.setNumColumns(numColumns); if (cursor.moveToPosition(position)) { rowloop: do { if (!window.allocRow()) { break; } for (int i = 0; i < numColumns; i++) { final int type = cursor.getType(i); final boolean success; switch (type) { case Cursor.FIELD_TYPE_NULL: success = window.putNull(position, i); break; case Cursor.FIELD_TYPE_INTEGER: success = window.putLong(cursor.getLong(i), position, i); break; case Cursor.FIELD_TYPE_FLOAT: success = window.putDouble(cursor.getDouble(i), position, i); break; case Cursor.FIELD_TYPE_BLOB: { final byte[] value = cursor.getBlob(i); success = value != null ? window.putBlob(value, position, i) : window.putNull(position, i); break; } default: // assume value is convertible to String case Cursor.FIELD_TYPE_STRING: { final String value = cursor.getString(i); success = value != null ? window.putString(value, position, i) : window.putNull(position, i); break; } } if (!success) { window.freeLastRow(); break rowloop; } } position += 1; } while (cursor.moveToNext()); } cursor.moveToPosition(oldPos); }
class class_name[name] begin[{] method[cursorFillWindow, return_type[void], modifier[public static], parameter[cursor, position, window]] begin[{] if[binary_operation[binary_operation[member[.position], <, literal[0]], ||, binary_operation[member[.position], >=, call[cursor.getCount, parameter[]]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], oldPos] local_variable[type[int], numColumns] call[window.clear, parameter[]] call[window.setStartPosition, parameter[member[.position]]] call[window.setNumColumns, parameter[member[.numColumns]]] if[call[cursor.moveToPosition, parameter[member[.position]]]] begin[{] do[call[cursor.moveToNext, parameter[]]] begin[{] if[call[window.allocRow, parameter[]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getType, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), name=type)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=success)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=FIELD_TYPE_NULL, postfix_operators=[], prefix_operators=[], qualifier=Cursor, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putNull, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=FIELD_TYPE_INTEGER, postfix_operators=[], prefix_operators=[], qualifier=Cursor, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putLong, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=FIELD_TYPE_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=Cursor, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putDouble, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=FIELD_TYPE_BLOB, postfix_operators=[], prefix_operators=[], qualifier=Cursor, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBlob, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), name=value)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putNull, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putBlob, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None))), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=FIELD_TYPE_STRING, postfix_operators=[], prefix_operators=[], qualifier=Cursor, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), name=value)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putNull, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putString, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None))), label=None), BreakStatement(goto=None, label=None)])])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=MemberReference(member=success, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=freeLastRow, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None), label=None), BreakStatement(goto=rowloop, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.position], literal[1]] end[}] else begin[{] None end[}] call[cursor.moveToPosition, parameter[member[.oldPos]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cursorFillWindow] operator[SEP] Keyword[final] identifier[Cursor] identifier[cursor] , Keyword[int] identifier[position] , Keyword[final] identifier[CursorWindow] identifier[window] operator[SEP] { Keyword[if] operator[SEP] identifier[position] operator[<] Other[0] operator[||] identifier[position] operator[>=] identifier[cursor] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] Keyword[int] identifier[oldPos] operator[=] identifier[cursor] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[numColumns] operator[=] identifier[cursor] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[setStartPosition] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[setNumColumns] operator[SEP] identifier[numColumns] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cursor] operator[SEP] identifier[moveToPosition] operator[SEP] identifier[position] operator[SEP] operator[SEP] { identifier[rowloop] operator[:] Keyword[do] { Keyword[if] operator[SEP] operator[!] identifier[window] operator[SEP] identifier[allocRow] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numColumns] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] Keyword[int] identifier[type] operator[=] identifier[cursor] operator[SEP] identifier[getType] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[success] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[Cursor] operator[SEP] identifier[FIELD_TYPE_NULL] operator[:] identifier[success] operator[=] identifier[window] operator[SEP] identifier[putNull] operator[SEP] identifier[position] , identifier[i] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Cursor] operator[SEP] identifier[FIELD_TYPE_INTEGER] operator[:] identifier[success] operator[=] identifier[window] operator[SEP] identifier[putLong] operator[SEP] identifier[cursor] operator[SEP] identifier[getLong] operator[SEP] identifier[i] operator[SEP] , identifier[position] , identifier[i] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Cursor] operator[SEP] identifier[FIELD_TYPE_FLOAT] operator[:] identifier[success] operator[=] identifier[window] operator[SEP] identifier[putDouble] operator[SEP] identifier[cursor] operator[SEP] identifier[getDouble] operator[SEP] identifier[i] operator[SEP] , identifier[position] , identifier[i] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Cursor] operator[SEP] identifier[FIELD_TYPE_BLOB] operator[:] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[cursor] operator[SEP] identifier[getBlob] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[success] operator[=] identifier[value] operator[!=] Other[null] operator[?] identifier[window] operator[SEP] identifier[putBlob] operator[SEP] identifier[value] , identifier[position] , identifier[i] operator[SEP] operator[:] identifier[window] operator[SEP] identifier[putNull] operator[SEP] identifier[position] , identifier[i] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[default] operator[:] Keyword[case] identifier[Cursor] operator[SEP] identifier[FIELD_TYPE_STRING] operator[:] { Keyword[final] identifier[String] identifier[value] operator[=] identifier[cursor] operator[SEP] identifier[getString] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[success] operator[=] identifier[value] operator[!=] Other[null] operator[?] identifier[window] operator[SEP] identifier[putString] operator[SEP] identifier[value] , identifier[position] , identifier[i] operator[SEP] operator[:] identifier[window] operator[SEP] identifier[putNull] operator[SEP] identifier[position] , identifier[i] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[success] operator[SEP] { identifier[window] operator[SEP] identifier[freeLastRow] operator[SEP] operator[SEP] operator[SEP] Keyword[break] identifier[rowloop] operator[SEP] } } identifier[position] operator[+=] Other[1] operator[SEP] } Keyword[while] operator[SEP] identifier[cursor] operator[SEP] identifier[moveToNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[cursor] operator[SEP] identifier[moveToPosition] operator[SEP] identifier[oldPos] operator[SEP] operator[SEP] }
public void setAdUnitView(com.google.api.ads.admanager.axis.v201808.ReportQueryAdUnitView adUnitView) { this.adUnitView = adUnitView; }
class class_name[name] begin[{] method[setAdUnitView, return_type[void], modifier[public], parameter[adUnitView]] begin[{] assign[THIS[member[None.adUnitView]], member[.adUnitView]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAdUnitView] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[ReportQueryAdUnitView] identifier[adUnitView] operator[SEP] { Keyword[this] operator[SEP] identifier[adUnitView] operator[=] identifier[adUnitView] operator[SEP] }
public Observable<Page<JobStreamInner>> listByJobNextAsync(final String nextPageLink) { return listByJobNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<JobStreamInner>>, Page<JobStreamInner>>() { @Override public Page<JobStreamInner> call(ServiceResponse<Page<JobStreamInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listByJobNextAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] return[call[.listByJobNextWithServiceResponseAsync, parameter[member[.nextPageLink]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[JobStreamInner] operator[>] operator[>] identifier[listByJobNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listByJobNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobStreamInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[JobStreamInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[JobStreamInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobStreamInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void parseQuery() throws TTXPathException { // get first token, ignore all white spaces do { mToken = mScanner.nextToken(); } while (mToken.getType() == TokenType.SPACE); // parse the query according to the rules specified in the XPath 2.0 REC parseExpression(); // after the parsing of the expression no token must be left if (mToken.getType() != TokenType.END) { throw new IllegalStateException("The query has not been processed completely."); } }
class class_name[name] begin[{] method[parseQuery, return_type[void], modifier[public], parameter[]] begin[{] do[binary_operation[call[mToken.getType, parameter[]], ==, member[TokenType.SPACE]]] begin[{] assign[member[.mToken], call[mScanner.nextToken, parameter[]]] end[}] call[.parseExpression, parameter[]] if[binary_operation[call[mToken.getType, parameter[]], !=, member[TokenType.END]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The query has not been processed completely.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[parseQuery] operator[SEP] operator[SEP] Keyword[throws] identifier[TTXPathException] { Keyword[do] { identifier[mToken] operator[=] identifier[mScanner] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[mToken] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TokenType] operator[SEP] identifier[SPACE] operator[SEP] operator[SEP] identifier[parseExpression] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mToken] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[!=] identifier[TokenType] operator[SEP] identifier[END] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
void setBlock(final int index, final Block b) { blockList[index2BlockId(index)] = b.getBlockId(); blockList[index2BlockLen(index)] = b.getNumBytes(); blockList[index2BlockGenStamp(index)] = b.getGenerationStamp(); }
class class_name[name] begin[{] method[setBlock, return_type[void], modifier[default], parameter[index, b]] begin[{] assign[member[.blockList], call[b.getBlockId, parameter[]]] assign[member[.blockList], call[b.getNumBytes, parameter[]]] assign[member[.blockList], call[b.getGenerationStamp, parameter[]]] end[}] END[}]
Keyword[void] identifier[setBlock] operator[SEP] Keyword[final] Keyword[int] identifier[index] , Keyword[final] identifier[Block] identifier[b] operator[SEP] { identifier[blockList] operator[SEP] identifier[index2BlockId] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[=] identifier[b] operator[SEP] identifier[getBlockId] operator[SEP] operator[SEP] operator[SEP] identifier[blockList] operator[SEP] identifier[index2BlockLen] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[=] identifier[b] operator[SEP] identifier[getNumBytes] operator[SEP] operator[SEP] operator[SEP] identifier[blockList] operator[SEP] identifier[index2BlockGenStamp] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[=] identifier[b] operator[SEP] identifier[getGenerationStamp] operator[SEP] operator[SEP] operator[SEP] }
public AppIdentity getAppIdentity(final String applicationName) { if (isCached(applicationName)) { return applicationIdentityCache.get(applicationName).getAppIdentity(); } else { // Update environment detail with new configured application name final EnvironmentDetail updatedEnvDetail = updateEnvironmentDetail(defaultApiConfig.getEnvDetail(), applicationName); // use existing apiConfig, with new application name final ApiConfiguration updatedApiConfig = defaultApiConfig.toBuilder() .application(applicationName) .envDetail(updatedEnvDetail) .build(); return getAppIdentity(updatedApiConfig); } }
class class_name[name] begin[{] method[getAppIdentity, return_type[type[AppIdentity]], modifier[public], parameter[applicationName]] begin[{] if[call[.isCached, parameter[member[.applicationName]]]] begin[{] return[call[applicationIdentityCache.get, parameter[member[.applicationName]]]] else begin[{] local_variable[type[EnvironmentDetail], updatedEnvDetail] local_variable[type[ApiConfiguration], updatedApiConfig] return[call[.getAppIdentity, parameter[member[.updatedApiConfig]]]] end[}] end[}] END[}]
Keyword[public] identifier[AppIdentity] identifier[getAppIdentity] operator[SEP] Keyword[final] identifier[String] identifier[applicationName] operator[SEP] { Keyword[if] operator[SEP] identifier[isCached] operator[SEP] identifier[applicationName] operator[SEP] operator[SEP] { Keyword[return] identifier[applicationIdentityCache] operator[SEP] identifier[get] operator[SEP] identifier[applicationName] operator[SEP] operator[SEP] identifier[getAppIdentity] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[EnvironmentDetail] identifier[updatedEnvDetail] operator[=] identifier[updateEnvironmentDetail] operator[SEP] identifier[defaultApiConfig] operator[SEP] identifier[getEnvDetail] operator[SEP] operator[SEP] , identifier[applicationName] operator[SEP] operator[SEP] Keyword[final] identifier[ApiConfiguration] identifier[updatedApiConfig] operator[=] identifier[defaultApiConfig] operator[SEP] identifier[toBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[application] operator[SEP] identifier[applicationName] operator[SEP] operator[SEP] identifier[envDetail] operator[SEP] identifier[updatedEnvDetail] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getAppIdentity] operator[SEP] identifier[updatedApiConfig] operator[SEP] operator[SEP] } }
public void close() { LOGGER.debug("Closing connection to Bugsnag"); if (config.delivery != null) { config.delivery.close(); } ExceptionHandler.disable(this); }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] call[LOGGER.debug, parameter[literal["Closing connection to Bugsnag"]]] if[binary_operation[member[config.delivery], !=, literal[null]]] begin[{] call[config.delivery.close, parameter[]] else begin[{] None end[}] call[ExceptionHandler.disable, parameter[THIS[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[delivery] operator[!=] Other[null] operator[SEP] { identifier[config] operator[SEP] identifier[delivery] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } identifier[ExceptionHandler] operator[SEP] identifier[disable] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
@RequestMapping(value = "/listPriceByPeriod", method = RequestMethod.GET) public @ResponseBody JsonNode listPriceByPeriod( @RequestParam(value = "stockName", required = true) String stockName, @RequestParam(value = "period", required = true) PERIOD period) { logger.debug("Received request to list gedik stocks"); JsonNode priceList = myNetFinansService.getPricesByPeriod(stockName, period); return priceList; }
class class_name[name] begin[{] method[listPriceByPeriod, return_type[type[JsonNode]], modifier[public], parameter[stockName, period]] begin[{] call[logger.debug, parameter[literal["Received request to list gedik stocks"]]] local_variable[type[JsonNode], priceList] return[member[.priceList]] end[}] END[}]
annotation[@] identifier[RequestMapping] operator[SEP] identifier[value] operator[=] literal[String] , identifier[method] operator[=] identifier[RequestMethod] operator[SEP] identifier[GET] operator[SEP] Keyword[public] annotation[@] identifier[ResponseBody] identifier[JsonNode] identifier[listPriceByPeriod] operator[SEP] annotation[@] identifier[RequestParam] operator[SEP] identifier[value] operator[=] literal[String] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[stockName] , annotation[@] identifier[RequestParam] operator[SEP] identifier[value] operator[=] literal[String] , identifier[required] operator[=] literal[boolean] operator[SEP] identifier[PERIOD] identifier[period] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[JsonNode] identifier[priceList] operator[=] identifier[myNetFinansService] operator[SEP] identifier[getPricesByPeriod] operator[SEP] identifier[stockName] , identifier[period] operator[SEP] operator[SEP] Keyword[return] identifier[priceList] operator[SEP] }
public String senSegment(String text){ //text normalization text = text.replaceAll("([\t \n])+", "$1"); //System.out.println(text); //generate context predicates List markList = new ArrayList(); List data = FeatureGenerator.doFeatureGen(new HashMap(), text, markList, false); if (markList.isEmpty()) return text + "\n"; //classify List labels = classifier.classify(data); String result = text.substring(0, ((Integer)markList.get(0)).intValue()); for (int i =0; i < markList.size(); ++i){ int curPos = ((Integer) markList.get(i)).intValue(); if ( ((String)labels.get(i)).equals(positiveLabel)){ result += " " + text.charAt(curPos) + "\n"; } else result += text.charAt(curPos); if (i < markList.size() - 1){ int nexPos = ((Integer) markList.get(i + 1)).intValue(); result += text.substring(curPos + 1, nexPos); } } int finalMarkPos = ((Integer) markList.get(markList.size() - 1)).intValue(); result += text.substring(finalMarkPos + 1, text.length()); //System.out.println(result); result = result.replaceAll("\n ", "\n"); result = result.replaceAll("\n\n", "\n"); result = result.replaceAll("\\.\\. \\.", "..."); return result; }
class class_name[name] begin[{] method[senSegment, return_type[type[String]], modifier[public], parameter[text]] begin[{] assign[member[.text], call[text.replaceAll, parameter[literal["([\t \n])+"], literal["$1"]]]] local_variable[type[List], markList] local_variable[type[List], data] if[call[markList.isEmpty, parameter[]]] begin[{] return[binary_operation[member[.text], +, literal["\n"]]] else begin[{] None end[}] local_variable[type[List], labels] local_variable[type[String], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=markList, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=curPos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=labels, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=curPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operandr=MethodInvocation(arguments=[MemberReference(member=curPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=markList, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=markList, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=nexPos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=curPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=nexPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=markList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[int], finalMarkPos] assign[member[.result], call[text.substring, parameter[binary_operation[member[.finalMarkPos], +, literal[1]], call[text.length, parameter[]]]]] assign[member[.result], call[result.replaceAll, parameter[literal["\n "], literal["\n"]]]] assign[member[.result], call[result.replaceAll, parameter[literal["\n\n"], literal["\n"]]]] assign[member[.result], call[result.replaceAll, parameter[literal["\\.\\. \\."], literal["..."]]]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[String] identifier[senSegment] operator[SEP] identifier[String] identifier[text] operator[SEP] { identifier[text] operator[=] identifier[text] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[List] identifier[markList] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[List] identifier[data] operator[=] identifier[FeatureGenerator] operator[SEP] identifier[doFeatureGen] operator[SEP] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] , identifier[text] , identifier[markList] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[markList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[text] operator[+] literal[String] operator[SEP] identifier[List] identifier[labels] operator[=] identifier[classifier] operator[SEP] identifier[classify] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[String] identifier[result] operator[=] identifier[text] operator[SEP] identifier[substring] operator[SEP] Other[0] , operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[markList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[markList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[int] identifier[curPos] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[markList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[labels] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[positiveLabel] operator[SEP] operator[SEP] { identifier[result] operator[+=] literal[String] operator[+] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[curPos] operator[SEP] operator[+] literal[String] operator[SEP] } Keyword[else] identifier[result] operator[+=] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[curPos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[markList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] { Keyword[int] identifier[nexPos] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[markList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[+=] identifier[text] operator[SEP] identifier[substring] operator[SEP] identifier[curPos] operator[+] Other[1] , identifier[nexPos] operator[SEP] operator[SEP] } } Keyword[int] identifier[finalMarkPos] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[markList] operator[SEP] identifier[get] operator[SEP] identifier[markList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[+=] identifier[text] operator[SEP] identifier[substring] operator[SEP] identifier[finalMarkPos] operator[+] Other[1] , identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[result] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[result] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[result] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public boolean containsLogEntry(long entryIndex) { long sequence = toSequence(entryIndex); return sequence >= logs.headSequence() && sequence <= logs.tailSequence(); }
class class_name[name] begin[{] method[containsLogEntry, return_type[type[boolean]], modifier[public], parameter[entryIndex]] begin[{] local_variable[type[long], sequence] return[binary_operation[binary_operation[member[.sequence], >=, call[logs.headSequence, parameter[]]], &&, binary_operation[member[.sequence], <=, call[logs.tailSequence, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[containsLogEntry] operator[SEP] Keyword[long] identifier[entryIndex] operator[SEP] { Keyword[long] identifier[sequence] operator[=] identifier[toSequence] operator[SEP] identifier[entryIndex] operator[SEP] operator[SEP] Keyword[return] identifier[sequence] operator[>=] identifier[logs] operator[SEP] identifier[headSequence] operator[SEP] operator[SEP] operator[&&] identifier[sequence] operator[<=] identifier[logs] operator[SEP] identifier[tailSequence] operator[SEP] operator[SEP] operator[SEP] }
public List<Statement> getAllStatements() { final List<Statement> ret = new LinkedList<Statement>(); for (final StatementGroup sg : statementGroups) { ret.addAll(sg.getAllStatements()); } return ret; }
class class_name[name] begin[{] method[getAllStatements, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], ret] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAllStatements, postfix_operators=[], prefix_operators=[], qualifier=sg, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=statementGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StatementGroup, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Statement] operator[>] identifier[getAllStatements] operator[SEP] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[Statement] operator[>] identifier[ret] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[Statement] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[StatementGroup] identifier[sg] operator[:] identifier[statementGroups] operator[SEP] { identifier[ret] operator[SEP] identifier[addAll] operator[SEP] identifier[sg] operator[SEP] identifier[getAllStatements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
@Override protected String doBuildColumnString(String dm) { StringBuilder sb = new StringBuilder(); sb.append(dm).append(createdAt); sb.append(dm).append(updatedAt); if (sb.length() > dm.length()) { sb.delete(0, dm.length()); } sb.insert(0, "{").append("}"); return sb.toString(); }
class class_name[name] begin[{] method[doBuildColumnString, return_type[type[String]], modifier[protected], parameter[dm]] begin[{] local_variable[type[StringBuilder], sb] call[sb.append, parameter[member[.dm]]] call[sb.append, parameter[member[.dm]]] if[binary_operation[call[sb.length, parameter[]], >, call[dm.length, parameter[]]]] begin[{] call[sb.delete, parameter[literal[0], call[dm.length, parameter[]]]] else begin[{] None end[}] call[sb.insert, parameter[literal[0], literal["{"]]] return[call[sb.toString, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[String] identifier[doBuildColumnString] operator[SEP] identifier[String] identifier[dm] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[createdAt] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[updatedAt] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[dm] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[delete] operator[SEP] Other[0] , identifier[dm] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[insert] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { fsb().sendSAXComment(lh, m_start, m_length); }
class class_name[name] begin[{] method[dispatchAsComment, return_type[void], modifier[public], parameter[lh]] begin[{] call[.fsb, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[dispatchAsComment] operator[SEP] identifier[org] operator[SEP] identifier[xml] operator[SEP] identifier[sax] operator[SEP] identifier[ext] operator[SEP] identifier[LexicalHandler] identifier[lh] operator[SEP] Keyword[throws] identifier[org] operator[SEP] identifier[xml] operator[SEP] identifier[sax] operator[SEP] identifier[SAXException] { identifier[fsb] operator[SEP] operator[SEP] operator[SEP] identifier[sendSAXComment] operator[SEP] identifier[lh] , identifier[m_start] , identifier[m_length] operator[SEP] operator[SEP] }
private void notifyListeners(TLSClientConnection client) { for (INetworkConnectionListener listener : this.listeners) { try { listener.newNetworkConnection(client); } catch (Exception e) { logger.debug("Connection listener threw exception!", e); } } }
class class_name[name] begin[{] method[notifyListeners, return_type[void], modifier[private], parameter[client]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newNetworkConnection, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connection listener threw exception!"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, 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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=listeners, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=INetworkConnectionListener, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[notifyListeners] operator[SEP] identifier[TLSClientConnection] identifier[client] operator[SEP] { Keyword[for] operator[SEP] identifier[INetworkConnectionListener] identifier[listener] operator[:] Keyword[this] operator[SEP] identifier[listeners] operator[SEP] { Keyword[try] { identifier[listener] operator[SEP] identifier[newNetworkConnection] operator[SEP] identifier[client] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
@EventListener public void handleCasAuthenticationPolicyFailureEvent(final CasAuthenticationPolicyFailureEvent event) { if (this.casEventRepository != null) { val dto = prepareCasEvent(event); dto.setPrincipalId(event.getAuthentication().getPrincipal().getId()); dto.putEventId(CasAuthenticationPolicyFailureEvent.class.getSimpleName()); this.casEventRepository.save(dto); } }
class class_name[name] begin[{] method[handleCasAuthenticationPolicyFailureEvent, return_type[void], modifier[public], parameter[event]] begin[{] if[binary_operation[THIS[member[None.casEventRepository]], !=, literal[null]]] begin[{] local_variable[type[val], dto] call[dto.setPrincipalId, parameter[call[event.getAuthentication, parameter[]]]] call[dto.putEventId, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CasAuthenticationPolicyFailureEvent, sub_type=None))]] THIS[member[None.casEventRepository]call[None.save, parameter[member[.dto]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[EventListener] Keyword[public] Keyword[void] identifier[handleCasAuthenticationPolicyFailureEvent] operator[SEP] Keyword[final] identifier[CasAuthenticationPolicyFailureEvent] identifier[event] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[casEventRepository] operator[!=] Other[null] operator[SEP] { identifier[val] identifier[dto] operator[=] identifier[prepareCasEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[dto] operator[SEP] identifier[setPrincipalId] operator[SEP] identifier[event] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] identifier[getPrincipal] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dto] operator[SEP] identifier[putEventId] operator[SEP] identifier[CasAuthenticationPolicyFailureEvent] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[casEventRepository] operator[SEP] identifier[save] operator[SEP] identifier[dto] operator[SEP] operator[SEP] } }
private byte[] renameNestedContainers( CmsFile targetContainerPage, CmsResource layoutResource, String oldName, String newName) throws Exception { byte[] contents = targetContainerPage.getContents(); Set<String> replaceElementIds = new HashSet<String>(); try { CmsXmlContainerPage page = CmsXmlContainerPageFactory.unmarshal(getCms(), targetContainerPage); for (CmsContainerElementBean element : page.getContainerPage(getCms()).getElements()) { if (element.getId().equals(layoutResource.getStructureId()) && (element.getInstanceId() != null)) { replaceElementIds.add(element.getInstanceId()); } } if (replaceElementIds.size() > 0) { String encoding = CmsLocaleManager.getResourceEncoding(getCms(), targetContainerPage); String content = new String(contents, encoding); for (String instanceId : replaceElementIds) { Pattern patt = Pattern.compile( CmsJspTagContainer.getNestedContainerName(oldName, instanceId, null)); Matcher m = patt.matcher(content); StringBuffer sb = new StringBuffer(content.length()); while (m.find()) { m.appendReplacement( sb, Matcher.quoteReplacement( CmsJspTagContainer.getNestedContainerName(newName, instanceId, null))); } m.appendTail(sb); content = sb.toString(); } contents = content.getBytes(encoding); } } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); throw e; } return contents; }
class class_name[name] begin[{] method[renameNestedContainers, return_type[type[byte]], modifier[private], parameter[targetContainerPage, layoutResource, oldName, newName]] begin[{] local_variable[type[byte], contents] local_variable[type[Set], replaceElementIds] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=targetContainerPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmarshal, postfix_operators=[], prefix_operators=[], qualifier=CmsXmlContainerPageFactory, selectors=[], type_arguments=None), name=page)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsXmlContainerPage, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=layoutResource, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getInstanceId, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInstanceId, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=replaceElementIds, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getContainerPage, postfix_operators=[], prefix_operators=[], qualifier=page, selectors=[MethodInvocation(arguments=[], member=getElements, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsContainerElementBean, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=replaceElementIds, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=targetContainerPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResourceEncoding, postfix_operators=[], prefix_operators=[], qualifier=CmsLocaleManager, selectors=[], type_arguments=None), name=encoding)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=contents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=content)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=oldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=instanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getNestedContainerName, postfix_operators=[], prefix_operators=[], qualifier=CmsJspTagContainer, selectors=[], type_arguments=None)], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), name=patt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=patt, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuffer, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=newName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=instanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getNestedContainerName, postfix_operators=[], prefix_operators=[], qualifier=CmsJspTagContainer, selectors=[], type_arguments=None)], member=quoteReplacement, postfix_operators=[], prefix_operators=[], qualifier=Matcher, selectors=[], type_arguments=None)], member=appendReplacement, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendTail, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=replaceElementIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=instanceId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=contents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.contents]] end[}] END[}]
Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[renameNestedContainers] operator[SEP] identifier[CmsFile] identifier[targetContainerPage] , identifier[CmsResource] identifier[layoutResource] , identifier[String] identifier[oldName] , identifier[String] identifier[newName] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[byte] operator[SEP] operator[SEP] identifier[contents] operator[=] identifier[targetContainerPage] operator[SEP] identifier[getContents] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[replaceElementIds] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[CmsXmlContainerPage] identifier[page] operator[=] identifier[CmsXmlContainerPageFactory] operator[SEP] identifier[unmarshal] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] , identifier[targetContainerPage] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsContainerElementBean] identifier[element] operator[:] identifier[page] operator[SEP] identifier[getContainerPage] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getElements] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[element] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[layoutResource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[element] operator[SEP] identifier[getInstanceId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] { identifier[replaceElementIds] operator[SEP] identifier[add] operator[SEP] identifier[element] operator[SEP] identifier[getInstanceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[replaceElementIds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[String] identifier[encoding] operator[=] identifier[CmsLocaleManager] operator[SEP] identifier[getResourceEncoding] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] , identifier[targetContainerPage] operator[SEP] operator[SEP] identifier[String] identifier[content] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[contents] , identifier[encoding] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[instanceId] operator[:] identifier[replaceElementIds] operator[SEP] { identifier[Pattern] identifier[patt] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[CmsJspTagContainer] operator[SEP] identifier[getNestedContainerName] operator[SEP] identifier[oldName] , identifier[instanceId] , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[Matcher] identifier[m] operator[=] identifier[patt] operator[SEP] identifier[matcher] operator[SEP] identifier[content] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[content] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[m] operator[SEP] identifier[appendReplacement] operator[SEP] identifier[sb] , identifier[Matcher] operator[SEP] identifier[quoteReplacement] operator[SEP] identifier[CmsJspTagContainer] operator[SEP] identifier[getNestedContainerName] operator[SEP] identifier[newName] , identifier[instanceId] , Other[null] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[m] operator[SEP] identifier[appendTail] operator[SEP] identifier[sb] operator[SEP] operator[SEP] identifier[content] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[contents] operator[=] identifier[content] operator[SEP] identifier[getBytes] operator[SEP] identifier[encoding] 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[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[return] identifier[contents] operator[SEP] }
public <T> Tuple<T> giveTuple(TypeTag tag) { realizeCacheFor(tag, emptyStack()); return cache.getTuple(tag); }
class class_name[name] begin[{] method[giveTuple, return_type[type[Tuple]], modifier[public], parameter[tag]] begin[{] call[.realizeCacheFor, parameter[member[.tag], call[.emptyStack, parameter[]]]] return[call[cache.getTuple, parameter[member[.tag]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Tuple] operator[<] identifier[T] operator[>] identifier[giveTuple] operator[SEP] identifier[TypeTag] identifier[tag] operator[SEP] { identifier[realizeCacheFor] operator[SEP] identifier[tag] , identifier[emptyStack] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cache] operator[SEP] identifier[getTuple] operator[SEP] identifier[tag] operator[SEP] operator[SEP] }
@Override String getFieldPath(String columnName, Map<String, String> columnsToField, int op) { if (op == OperationType.DELETE_CODE){ String fieldPath = columnsToField.get(columnName); if (fieldPath == null){ LOG.error("Column name {} is not defined in column-filed mapping", columnName); return null; } return fieldPath.replace("/Data", "/OldData"); } // For insert and update, ok to use the field name set by column-field mapping return columnsToField.get(columnName); }
class class_name[name] begin[{] method[getFieldPath, return_type[type[String]], modifier[default], parameter[columnName, columnsToField, op]] begin[{] if[binary_operation[member[.op], ==, member[OperationType.DELETE_CODE]]] begin[{] local_variable[type[String], fieldPath] if[binary_operation[member[.fieldPath], ==, literal[null]]] begin[{] call[LOG.error, parameter[literal["Column name {} is not defined in column-filed mapping"], member[.columnName]]] return[literal[null]] else begin[{] None end[}] return[call[fieldPath.replace, parameter[literal["/Data"], literal["/OldData"]]]] else begin[{] None end[}] return[call[columnsToField.get, parameter[member[.columnName]]]] end[}] END[}]
annotation[@] identifier[Override] identifier[String] identifier[getFieldPath] operator[SEP] identifier[String] identifier[columnName] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[columnsToField] , Keyword[int] identifier[op] operator[SEP] { Keyword[if] operator[SEP] identifier[op] operator[==] identifier[OperationType] operator[SEP] identifier[DELETE_CODE] operator[SEP] { identifier[String] identifier[fieldPath] operator[=] identifier[columnsToField] operator[SEP] identifier[get] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldPath] operator[==] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[columnName] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[fieldPath] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[columnsToField] operator[SEP] identifier[get] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] }
@Override protected List<String> findAvailableLocales(String resource) { Set<String> result = new HashSet<String>(); String[] msgBundleArray = resource .split(RESOURCE_BUNDLE_SEPARATOR); for (String msgResource : msgBundleArray) { List<String> availableLocales = GrailsLocaleUtils .getAvailableLocaleSuffixesForBundle(msgResource, rsHandler); result.addAll(availableLocales); } LOGGER.debug("Available locales for "+resource+" : "+result); return new ArrayList<String>(result); }
class class_name[name] begin[{] method[findAvailableLocales, return_type[type[List]], modifier[protected], parameter[resource]] begin[{] local_variable[type[Set], result] local_variable[type[String], msgBundleArray] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=msgResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rsHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAvailableLocaleSuffixesForBundle, postfix_operators=[], prefix_operators=[], qualifier=GrailsLocaleUtils, selectors=[], type_arguments=None), name=availableLocales)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=availableLocales, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=msgBundleArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=msgResource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[LOGGER.debug, parameter[binary_operation[binary_operation[binary_operation[literal["Available locales for "], +, member[.resource]], +, literal[" : "]], +, member[.result]]]] return[ClassCreator(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[List] operator[<] identifier[String] operator[>] identifier[findAvailableLocales] operator[SEP] identifier[String] identifier[resource] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[msgBundleArray] operator[=] identifier[resource] operator[SEP] identifier[split] operator[SEP] identifier[RESOURCE_BUNDLE_SEPARATOR] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[msgResource] operator[:] identifier[msgBundleArray] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[availableLocales] operator[=] identifier[GrailsLocaleUtils] operator[SEP] identifier[getAvailableLocaleSuffixesForBundle] operator[SEP] identifier[msgResource] , identifier[rsHandler] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[availableLocales] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[resource] operator[+] literal[String] operator[+] identifier[result] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
public void setPixelPerUnit(double pixelPerUnit) { if (pixelPerUnit < MINIMUM_PIXEL_PER_UNIT) { pixelPerUnit = MINIMUM_PIXEL_PER_UNIT; } if (pixelPerUnit > MAXIMUM_PIXEL_PER_UNIT) { pixelPerUnit = MAXIMUM_PIXEL_PER_UNIT; } this.pixelPerUnit = pixelPerUnit; setPixelPerUnitBased(true); postConstruct(); }
class class_name[name] begin[{] method[setPixelPerUnit, return_type[void], modifier[public], parameter[pixelPerUnit]] begin[{] if[binary_operation[member[.pixelPerUnit], <, member[.MINIMUM_PIXEL_PER_UNIT]]] begin[{] assign[member[.pixelPerUnit], member[.MINIMUM_PIXEL_PER_UNIT]] else begin[{] None end[}] if[binary_operation[member[.pixelPerUnit], >, member[.MAXIMUM_PIXEL_PER_UNIT]]] begin[{] assign[member[.pixelPerUnit], member[.MAXIMUM_PIXEL_PER_UNIT]] else begin[{] None end[}] assign[THIS[member[None.pixelPerUnit]], member[.pixelPerUnit]] call[.setPixelPerUnitBased, parameter[literal[true]]] call[.postConstruct, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPixelPerUnit] operator[SEP] Keyword[double] identifier[pixelPerUnit] operator[SEP] { Keyword[if] operator[SEP] identifier[pixelPerUnit] operator[<] identifier[MINIMUM_PIXEL_PER_UNIT] operator[SEP] { identifier[pixelPerUnit] operator[=] identifier[MINIMUM_PIXEL_PER_UNIT] operator[SEP] } Keyword[if] operator[SEP] identifier[pixelPerUnit] operator[>] identifier[MAXIMUM_PIXEL_PER_UNIT] operator[SEP] { identifier[pixelPerUnit] operator[=] identifier[MAXIMUM_PIXEL_PER_UNIT] operator[SEP] } Keyword[this] operator[SEP] identifier[pixelPerUnit] operator[=] identifier[pixelPerUnit] operator[SEP] identifier[setPixelPerUnitBased] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[postConstruct] operator[SEP] operator[SEP] operator[SEP] }
@Override public DescribeEntitiesDetectionJobResult describeEntitiesDetectionJob(DescribeEntitiesDetectionJobRequest request) { request = beforeClientExecution(request); return executeDescribeEntitiesDetectionJob(request); }
class class_name[name] begin[{] method[describeEntitiesDetectionJob, return_type[type[DescribeEntitiesDetectionJobResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDescribeEntitiesDetectionJob, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescribeEntitiesDetectionJobResult] identifier[describeEntitiesDetectionJob] operator[SEP] identifier[DescribeEntitiesDetectionJobRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeEntitiesDetectionJob] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void setWorldPositions(float[] positions) { if (positions.length != mBones.length * 3) { throw new IllegalArgumentException("Destination array is the wrong size"); } mNeedSync = true; for (int i = 0; i < mBones.length; ++i) { Bone bone = mBones[i]; int t = i * 3; bone.setWorldPosition(positions[t], positions[t + 1], positions[t + 2]); bone.Changed = WORLD_POS; if (sDebug) { Log.d("BONE", "setWorldPosition: %s %s", mSkeleton.getBoneName(i), bone.toString()); } } sync(); }
class class_name[name] begin[{] method[setWorldPositions, return_type[void], modifier[public], parameter[positions]] begin[{] if[binary_operation[member[positions.length], !=, binary_operation[member[mBones.length], *, literal[3]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination array is the wrong size")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.mNeedSync], literal[true]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=mBones, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=bone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Bone, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), name=t)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=positions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=positions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), MemberReference(member=positions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))])], member=setWorldPosition, postfix_operators=[], prefix_operators=[], qualifier=bone, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=Changed, postfix_operators=[], prefix_operators=[], qualifier=bone, selectors=[]), type==, value=MemberReference(member=WORLD_POS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=MemberReference(member=sDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BONE"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setWorldPosition: %s %s"), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBoneName, postfix_operators=[], prefix_operators=[], qualifier=mSkeleton, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=bone, selectors=[], type_arguments=None)], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, 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=mBones, 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) call[.sync, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setWorldPositions] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[positions] operator[SEP] { Keyword[if] operator[SEP] identifier[positions] operator[SEP] identifier[length] operator[!=] identifier[mBones] operator[SEP] identifier[length] operator[*] Other[3] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[mNeedSync] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[mBones] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[Bone] identifier[bone] operator[=] identifier[mBones] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[t] operator[=] identifier[i] operator[*] Other[3] operator[SEP] identifier[bone] operator[SEP] identifier[setWorldPosition] operator[SEP] identifier[positions] operator[SEP] identifier[t] operator[SEP] , identifier[positions] operator[SEP] identifier[t] operator[+] Other[1] operator[SEP] , identifier[positions] operator[SEP] identifier[t] operator[+] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[bone] operator[SEP] identifier[Changed] operator[=] identifier[WORLD_POS] operator[SEP] Keyword[if] operator[SEP] identifier[sDebug] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] literal[String] , literal[String] , identifier[mSkeleton] operator[SEP] identifier[getBoneName] operator[SEP] identifier[i] operator[SEP] , identifier[bone] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[sync] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.ATTRIBUTE_VALUE__RESERVED0: return RESERVED0_EDEFAULT == null ? reserved0 != null : !RESERVED0_EDEFAULT.equals(reserved0); case AfplibPackage.ATTRIBUTE_VALUE__ATT_VAL: return ATT_VAL_EDEFAULT == null ? attVal != null : !ATT_VAL_EDEFAULT.equals(attVal); } return super.eIsSet(featureID); }
class class_name[name] begin[{] method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ATTRIBUTE_VALUE__RESERVED0, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=RESERVED0_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=reserved0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=RESERVED0_EDEFAULT, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=reserved0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)), label=None)]), SwitchStatementCase(case=[MemberReference(member=ATTRIBUTE_VALUE__ATT_VAL, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ATT_VAL_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=attVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=ATT_VAL_EDEFAULT, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=attVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[ATTRIBUTE_VALUE__RESERVED0] operator[:] Keyword[return] identifier[RESERVED0_EDEFAULT] operator[==] Other[null] operator[?] identifier[reserved0] operator[!=] Other[null] operator[:] operator[!] identifier[RESERVED0_EDEFAULT] operator[SEP] identifier[equals] operator[SEP] identifier[reserved0] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[ATTRIBUTE_VALUE__ATT_VAL] operator[:] Keyword[return] identifier[ATT_VAL_EDEFAULT] operator[==] Other[null] operator[?] identifier[attVal] operator[!=] Other[null] operator[:] operator[!] identifier[ATT_VAL_EDEFAULT] operator[SEP] identifier[equals] operator[SEP] identifier[attVal] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
public byte[] getEncodedKeyIdentifier() throws IOException { if (id != null) { DerOutputStream derOut = new DerOutputStream(); id.encode(derOut); return derOut.toByteArray(); } return null; }
class class_name[name] begin[{] method[getEncodedKeyIdentifier, return_type[type[byte]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.id], !=, literal[null]]] begin[{] local_variable[type[DerOutputStream], derOut] call[id.encode, parameter[member[.derOut]]] return[call[derOut.toByteArray, parameter[]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getEncodedKeyIdentifier] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[SEP] { identifier[DerOutputStream] identifier[derOut] operator[=] Keyword[new] identifier[DerOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] identifier[encode] operator[SEP] identifier[derOut] operator[SEP] operator[SEP] Keyword[return] identifier[derOut] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public void setUseContextPathOverrideInDebugMode(boolean useContextPathOverrideInDebugMode) { configProperties.setProperty(JawrConfig.JAWR_USE_URL_CONTEXTPATH_OVERRIDE_IN_DEBUG_MODE, Boolean.toString(useContextPathOverrideInDebugMode)); }
class class_name[name] begin[{] method[setUseContextPathOverrideInDebugMode, return_type[void], modifier[public], parameter[useContextPathOverrideInDebugMode]] begin[{] call[configProperties.setProperty, parameter[member[JawrConfig.JAWR_USE_URL_CONTEXTPATH_OVERRIDE_IN_DEBUG_MODE], call[Boolean.toString, parameter[member[.useContextPathOverrideInDebugMode]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setUseContextPathOverrideInDebugMode] operator[SEP] Keyword[boolean] identifier[useContextPathOverrideInDebugMode] operator[SEP] { identifier[configProperties] operator[SEP] identifier[setProperty] operator[SEP] identifier[JawrConfig] operator[SEP] identifier[JAWR_USE_URL_CONTEXTPATH_OVERRIDE_IN_DEBUG_MODE] , identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] identifier[useContextPathOverrideInDebugMode] operator[SEP] operator[SEP] operator[SEP] }
public void sendMessagesToPushNetwork(@Observes @Dequeue MessageHolderWithTokens msg) { final Variant variant = msg.getVariant(); final UnifiedPushMessage unifiedPushMessage = msg.getUnifiedPushMessage(); final Collection<String> deviceTokens = msg.getDeviceTokens(); logger.info("Received UnifiedPushMessage from JMS queue, will now trigger the Push Notification delivery for the %s variant ({})", variant.getType().getTypeName(), variant.getVariantID()); senders.select(new SenderTypeLiteral(variant.getType())).get() .sendPushMessage(variant, deviceTokens, unifiedPushMessage, msg.getPushMessageInformation().getId(), new SenderServiceCallback( variant, deviceTokens.size(), msg.getPushMessageInformation() ) ); }
class class_name[name] begin[{] method[sendMessagesToPushNetwork, return_type[void], modifier[public], parameter[msg]] begin[{] local_variable[type[Variant], variant] local_variable[type[UnifiedPushMessage], unifiedPushMessage] local_variable[type[Collection], deviceTokens] call[logger.info, parameter[literal["Received UnifiedPushMessage from JMS queue, will now trigger the Push Notification delivery for the %s variant ({})"], call[variant.getType, parameter[]], call[variant.getVariantID, parameter[]]]] call[senders.select, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=variant, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SenderTypeLiteral, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[sendMessagesToPushNetwork] operator[SEP] annotation[@] identifier[Observes] annotation[@] identifier[Dequeue] identifier[MessageHolderWithTokens] identifier[msg] operator[SEP] { Keyword[final] identifier[Variant] identifier[variant] operator[=] identifier[msg] operator[SEP] identifier[getVariant] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[UnifiedPushMessage] identifier[unifiedPushMessage] operator[=] identifier[msg] operator[SEP] identifier[getUnifiedPushMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[deviceTokens] operator[=] identifier[msg] operator[SEP] identifier[getDeviceTokens] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[variant] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] , identifier[variant] operator[SEP] identifier[getVariantID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[senders] operator[SEP] identifier[select] operator[SEP] Keyword[new] identifier[SenderTypeLiteral] operator[SEP] identifier[variant] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[sendPushMessage] operator[SEP] identifier[variant] , identifier[deviceTokens] , identifier[unifiedPushMessage] , identifier[msg] operator[SEP] identifier[getPushMessageInformation] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , Keyword[new] identifier[SenderServiceCallback] operator[SEP] identifier[variant] , identifier[deviceTokens] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] identifier[getPushMessageInformation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public FluoKeyValue[] getKeyValues() { FluoKeyValue kv = keyVals[0]; kv.setKey(new Key(row, fam, qual, vis, ColumnType.WRITE.encode(1))); kv.getValue().set(WriteValue.encode(0, false, false)); kv = keyVals[1]; kv.setKey(new Key(row, fam, qual, vis, ColumnType.DATA.encode(0))); kv.getValue().set(val); return keyVals; }
class class_name[name] begin[{] method[getKeyValues, return_type[type[FluoKeyValue]], modifier[public], parameter[]] begin[{] local_variable[type[FluoKeyValue], kv] call[kv.setKey, parameter[ClassCreator(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=qual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=encode, postfix_operators=[], prefix_operators=[], qualifier=ColumnType.WRITE, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Key, sub_type=None))]] call[kv.getValue, parameter[]] assign[member[.kv], member[.keyVals]] call[kv.setKey, parameter[ClassCreator(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=qual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=encode, postfix_operators=[], prefix_operators=[], qualifier=ColumnType.DATA, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Key, sub_type=None))]] call[kv.getValue, parameter[]] return[member[.keyVals]] end[}] END[}]
Keyword[public] identifier[FluoKeyValue] operator[SEP] operator[SEP] identifier[getKeyValues] operator[SEP] operator[SEP] { identifier[FluoKeyValue] identifier[kv] operator[=] identifier[keyVals] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[kv] operator[SEP] identifier[setKey] operator[SEP] Keyword[new] identifier[Key] operator[SEP] identifier[row] , identifier[fam] , identifier[qual] , identifier[vis] , identifier[ColumnType] operator[SEP] identifier[WRITE] operator[SEP] identifier[encode] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[kv] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[WriteValue] operator[SEP] identifier[encode] operator[SEP] Other[0] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[kv] operator[=] identifier[keyVals] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[kv] operator[SEP] identifier[setKey] operator[SEP] Keyword[new] identifier[Key] operator[SEP] identifier[row] , identifier[fam] , identifier[qual] , identifier[vis] , identifier[ColumnType] operator[SEP] identifier[DATA] operator[SEP] identifier[encode] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[kv] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[val] operator[SEP] operator[SEP] Keyword[return] identifier[keyVals] operator[SEP] }
public static boolean implementsInterfaceWithSameName(Class<?> clazz, Class<?> iface) { Class<?>[] interfaces = getAllInterfaces(clazz); for (Class implementedInterface : interfaces) { if (implementedInterface.getName().equals(iface.getName())) { return true; } } return false; }
class class_name[name] begin[{] method[implementsInterfaceWithSameName, return_type[type[boolean]], modifier[public static], parameter[clazz, iface]] begin[{] local_variable[type[Class], interfaces] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=implementedInterface, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=iface, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=interfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=implementedInterface)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[implementsInterfaceWithSameName] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Class] operator[<] operator[?] operator[>] identifier[iface] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[interfaces] operator[=] identifier[getAllInterfaces] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] identifier[implementedInterface] operator[:] identifier[interfaces] operator[SEP] { Keyword[if] operator[SEP] identifier[implementedInterface] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[iface] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBtnActionPerformed DefaultTableModel model = (DefaultTableModel)rules.getModel(); model.addRow(new Object[]{"", 1, "", "Low", "Certain"}); }
class class_name[name] begin[{] method[addBtnActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{] local_variable[type[DefaultTableModel], model] call[model.addRow, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Low"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Certain")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addBtnActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { identifier[DefaultTableModel] identifier[model] operator[=] operator[SEP] identifier[DefaultTableModel] operator[SEP] identifier[rules] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] identifier[model] operator[SEP] identifier[addRow] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , Other[1] , literal[String] , literal[String] , literal[String] } operator[SEP] operator[SEP] }
public UpdateLinkAttributesRequest withAttributeUpdates(LinkAttributeUpdate... attributeUpdates) { if (this.attributeUpdates == null) { setAttributeUpdates(new java.util.ArrayList<LinkAttributeUpdate>(attributeUpdates.length)); } for (LinkAttributeUpdate ele : attributeUpdates) { this.attributeUpdates.add(ele); } return this; }
class class_name[name] begin[{] method[withAttributeUpdates, return_type[type[UpdateLinkAttributesRequest]], modifier[public], parameter[attributeUpdates]] begin[{] if[binary_operation[THIS[member[None.attributeUpdates]], ==, literal[null]]] begin[{] call[.setAttributeUpdates, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributeUpdates, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LinkAttributeUpdate, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=attributeUpdates, 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=attributeUpdates, 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=LinkAttributeUpdate, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[UpdateLinkAttributesRequest] identifier[withAttributeUpdates] operator[SEP] identifier[LinkAttributeUpdate] operator[...] identifier[attributeUpdates] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[attributeUpdates] operator[==] Other[null] operator[SEP] { identifier[setAttributeUpdates] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[LinkAttributeUpdate] operator[>] operator[SEP] identifier[attributeUpdates] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[LinkAttributeUpdate] identifier[ele] operator[:] identifier[attributeUpdates] operator[SEP] { Keyword[this] operator[SEP] identifier[attributeUpdates] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private boolean isConstrainedByInterface(FQMethod fqMethod) { try { JavaClass fqCls = Repository.lookupClass(fqMethod.getClassName()); if (fqCls.isInterface()) { return true; } for (JavaClass inf : fqCls.getAllInterfaces()) { for (Method infMethod : inf.getMethods()) { if (infMethod.getName().equals(fqMethod.getMethodName())) { String infMethodSig = infMethod.getSignature(); String fqMethodSig = fqMethod.getSignature(); if (infMethodSig.equals(fqMethodSig)) { return true; } List<String> infTypes = SignatureUtils.getParameterSignatures(infMethodSig); List<String> fqTypes = SignatureUtils.getParameterSignatures(fqMethodSig); if (infTypes.size() == fqTypes.size()) { boolean matches = true; for (int i = 0; i < infTypes.size(); i++) { String infParmType = infTypes.get(i); String fqParmType = fqTypes.get(i); if (infParmType.equals(fqParmType)) { if ((infParmType.charAt(0) != 'L') || (fqParmType.charAt(0) != 'L')) { matches = false; break; } JavaClass infParmClass = Repository.lookupClass(SignatureUtils.stripSignature(infParmType)); JavaClass fqParmClass = Repository.lookupClass(SignatureUtils.stripSignature(fqParmType)); if (!fqParmClass.instanceOf(infParmClass)) { matches = false; break; } } } if (matches) { return true; } } } } } return false; } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); return true; } }
class class_name[name] begin[{] method[isConstrainedByInterface, return_type[type[boolean]], modifier[private], parameter[fqMethod]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=fqMethod, selectors=[], type_arguments=None)], member=lookupClass, postfix_operators=[], prefix_operators=[], qualifier=Repository, selectors=[], type_arguments=None), name=fqCls)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isInterface, postfix_operators=[], prefix_operators=[], qualifier=fqCls, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=infMethod, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMethodName, postfix_operators=[], prefix_operators=[], qualifier=fqMethod, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSignature, postfix_operators=[], prefix_operators=[], qualifier=infMethod, selectors=[], type_arguments=None), name=infMethodSig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSignature, postfix_operators=[], prefix_operators=[], qualifier=fqMethod, selectors=[], type_arguments=None), name=fqMethodSig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=fqMethodSig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=infMethodSig, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=infMethodSig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameterSignatures, postfix_operators=[], prefix_operators=[], qualifier=SignatureUtils, selectors=[], type_arguments=None), name=infTypes)], 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)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fqMethodSig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameterSignatures, postfix_operators=[], prefix_operators=[], qualifier=SignatureUtils, selectors=[], type_arguments=None), name=fqTypes)], 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=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=infTypes, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fqTypes, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=matches)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=infTypes, selectors=[], type_arguments=None), name=infParmType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=fqTypes, selectors=[], type_arguments=None), name=fqParmType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=fqParmType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=infParmType, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=infParmType, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='L'), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=fqParmType, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='L'), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=infParmType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stripSignature, postfix_operators=[], prefix_operators=[], qualifier=SignatureUtils, selectors=[], type_arguments=None)], member=lookupClass, postfix_operators=[], prefix_operators=[], qualifier=Repository, selectors=[], type_arguments=None), name=infParmClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fqParmType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stripSignature, postfix_operators=[], prefix_operators=[], qualifier=SignatureUtils, selectors=[], type_arguments=None)], member=lookupClass, postfix_operators=[], prefix_operators=[], qualifier=Repository, selectors=[], type_arguments=None), name=fqParmClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=infParmClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=instanceOf, postfix_operators=[], prefix_operators=['!'], qualifier=fqParmClass, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=infTypes, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=MemberReference(member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMethods, postfix_operators=[], prefix_operators=[], qualifier=inf, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=infMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAllInterfaces, postfix_operators=[], prefix_operators=[], qualifier=fqCls, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=inf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None))), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cnfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportMissingClass, postfix_operators=[], prefix_operators=[], qualifier=bugReporter, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isConstrainedByInterface] operator[SEP] identifier[FQMethod] identifier[fqMethod] operator[SEP] { Keyword[try] { identifier[JavaClass] identifier[fqCls] operator[=] identifier[Repository] operator[SEP] identifier[lookupClass] operator[SEP] identifier[fqMethod] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fqCls] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[JavaClass] identifier[inf] operator[:] identifier[fqCls] operator[SEP] identifier[getAllInterfaces] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Method] identifier[infMethod] operator[:] identifier[inf] operator[SEP] identifier[getMethods] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[infMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[fqMethod] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[infMethodSig] operator[=] identifier[infMethod] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[fqMethodSig] operator[=] identifier[fqMethod] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[infMethodSig] operator[SEP] identifier[equals] operator[SEP] identifier[fqMethodSig] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[infTypes] operator[=] identifier[SignatureUtils] operator[SEP] identifier[getParameterSignatures] operator[SEP] identifier[infMethodSig] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[fqTypes] operator[=] identifier[SignatureUtils] operator[SEP] identifier[getParameterSignatures] operator[SEP] identifier[fqMethodSig] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[infTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[fqTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[matches] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[infTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[infParmType] operator[=] identifier[infTypes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[fqParmType] operator[=] identifier[fqTypes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[infParmType] operator[SEP] identifier[equals] operator[SEP] identifier[fqParmType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[infParmType] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[!=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[fqParmType] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[!=] literal[String] operator[SEP] operator[SEP] { identifier[matches] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } identifier[JavaClass] identifier[infParmClass] operator[=] identifier[Repository] operator[SEP] identifier[lookupClass] operator[SEP] identifier[SignatureUtils] operator[SEP] identifier[stripSignature] operator[SEP] identifier[infParmType] operator[SEP] operator[SEP] operator[SEP] identifier[JavaClass] identifier[fqParmClass] operator[=] identifier[Repository] operator[SEP] identifier[lookupClass] operator[SEP] identifier[SignatureUtils] operator[SEP] identifier[stripSignature] operator[SEP] identifier[fqParmType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[fqParmClass] operator[SEP] identifier[instanceOf] operator[SEP] identifier[infParmClass] operator[SEP] operator[SEP] { identifier[matches] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[if] operator[SEP] identifier[matches] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } } } Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] { identifier[bugReporter] operator[SEP] identifier[reportMissingClass] operator[SEP] identifier[cnfe] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
@Override public List<CommerceNotificationTemplate> filterFindByGroupId( long groupId, int start, int end) { return filterFindByGroupId(groupId, start, end, null); }
class class_name[name] begin[{] method[filterFindByGroupId, return_type[type[List]], modifier[public], parameter[groupId, start, end]] begin[{] return[call[.filterFindByGroupId, parameter[member[.groupId], member[.start], member[.end], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceNotificationTemplate] operator[>] identifier[filterFindByGroupId] operator[SEP] Keyword[long] identifier[groupId] , Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] { Keyword[return] identifier[filterFindByGroupId] operator[SEP] identifier[groupId] , identifier[start] , identifier[end] , Other[null] operator[SEP] operator[SEP] }
@Override public String getLayoutContent(LayoutIdentifier layout) { return propertyService.getValue(getPropertyName(layout.shared), layout.name); }
class class_name[name] begin[{] method[getLayoutContent, return_type[type[String]], modifier[public], parameter[layout]] begin[{] return[call[propertyService.getValue, parameter[call[.getPropertyName, parameter[member[layout.shared]]], member[layout.name]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getLayoutContent] operator[SEP] identifier[LayoutIdentifier] identifier[layout] operator[SEP] { Keyword[return] identifier[propertyService] operator[SEP] identifier[getValue] operator[SEP] identifier[getPropertyName] operator[SEP] identifier[layout] operator[SEP] identifier[shared] operator[SEP] , identifier[layout] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
void setFinal(boolean isFinal) throws IOException { if (isFinal != m_isFinal) { if (PBDSegment.setFinal(m_file, isFinal)) { if (!isFinal) { // It is dangerous to leave final on a segment so make sure the metadata is flushed m_fc.force(true); } } else if (PBDSegment.isFinal(m_file) && !isFinal) { throw new IOException("Could not remove the final attribute from " + m_file.getName()); } // It is OK for m_isFinal to be true when isFinal(File) returns false but not the other way m_isFinal = isFinal; } }
class class_name[name] begin[{] method[setFinal, return_type[void], modifier[default], parameter[isFinal]] begin[{] if[binary_operation[member[.isFinal], !=, member[.m_isFinal]]] begin[{] if[call[PBDSegment.setFinal, parameter[member[.m_file], member[.isFinal]]]] begin[{] if[member[.isFinal]] begin[{] call[m_fc.force, parameter[literal[true]]] else begin[{] None end[}] else begin[{] if[binary_operation[call[PBDSegment.isFinal, parameter[member[.m_file]]], &&, member[.isFinal]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not remove the final attribute from "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m_file, 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=IOException, sub_type=None)), label=None) else begin[{] None end[}] end[}] assign[member[.m_isFinal], member[.isFinal]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[setFinal] operator[SEP] Keyword[boolean] identifier[isFinal] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[isFinal] operator[!=] identifier[m_isFinal] operator[SEP] { Keyword[if] operator[SEP] identifier[PBDSegment] operator[SEP] identifier[setFinal] operator[SEP] identifier[m_file] , identifier[isFinal] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isFinal] operator[SEP] { identifier[m_fc] operator[SEP] identifier[force] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[PBDSegment] operator[SEP] identifier[isFinal] operator[SEP] identifier[m_file] operator[SEP] operator[&&] operator[!] identifier[isFinal] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[m_file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[m_isFinal] operator[=] identifier[isFinal] operator[SEP] } }
public V setValue(final V value) { V oldValue = this.getValue(); this.values[tree.pageIndex] = value; return oldValue; }
class class_name[name] begin[{] method[setValue, return_type[type[V]], modifier[public], parameter[value]] begin[{] local_variable[type[V], oldValue] assign[THIS[member[None.values]ArraySelector(index=MemberReference(member=pageIndex, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[]))], member[.value]] return[member[.oldValue]] end[}] END[}]
Keyword[public] identifier[V] identifier[setValue] operator[SEP] Keyword[final] identifier[V] identifier[value] operator[SEP] { identifier[V] identifier[oldValue] operator[=] Keyword[this] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[values] operator[SEP] identifier[tree] operator[SEP] identifier[pageIndex] operator[SEP] operator[=] identifier[value] operator[SEP] Keyword[return] identifier[oldValue] operator[SEP] }
public String waitForTask(int runningDelayInMillSecond, int queuedDelayInMillSecond) throws RuntimeFault, RemoteException, InterruptedException { TaskInfoState tState = null; int tries = 0; int maxTries = 3; Exception getInfoException = null; while ((tState == null) || tState.equals(TaskInfoState.running) || tState.equals(TaskInfoState.queued)) { tState = null; getInfoException = null; tries = 0; // under load getTaskInfo may return null when there really is valid task info, so we try 3 times to get it. while (tState == null) { tries++; if (tries > maxTries) { if (getInfoException == null) { throw new NullPointerException(); } else if (getInfoException instanceof RuntimeFault) { throw (RuntimeFault) getInfoException; } else if (getInfoException instanceof RemoteException) { throw (RemoteException) getInfoException; } else { throw new RuntimeException(getInfoException); } } try { tState = getTaskInfo().getState(); } catch (Exception e) { //silently catch 3 exceptions getInfoException = e; } } // sleep for a specified time based on task state. if (tState.equals(TaskInfoState.running)) { Thread.sleep(runningDelayInMillSecond); } else { Thread.sleep(queuedDelayInMillSecond); } } return tState.toString(); }
class class_name[name] begin[{] method[waitForTask, return_type[type[String]], modifier[public], parameter[runningDelayInMillSecond, queuedDelayInMillSecond]] begin[{] local_variable[type[TaskInfoState], tState] local_variable[type[int], tries] local_variable[type[int], maxTries] local_variable[type[Exception], getInfoException] while[binary_operation[binary_operation[binary_operation[member[.tState], ==, literal[null]], ||, call[tState.equals, parameter[member[TaskInfoState.running]]]], ||, call[tState.equals, parameter[member[TaskInfoState.queued]]]]] begin[{] assign[member[.tState], literal[null]] assign[member[.getInfoException], literal[null]] assign[member[.tries], literal[0]] while[binary_operation[member[.tState], ==, literal[null]]] begin[{] member[.tries] if[binary_operation[member[.tries], >, member[.maxTries]]] begin[{] if[binary_operation[member[.getInfoException], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] if[binary_operation[member[.getInfoException], instanceof, type[RuntimeFault]]] begin[{] ThrowStatement(expression=Cast(expression=MemberReference(member=getInfoException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeFault, sub_type=None)), label=None) else begin[{] if[binary_operation[member[.getInfoException], instanceof, type[RemoteException]]] begin[{] ThrowStatement(expression=Cast(expression=MemberReference(member=getInfoException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RemoteException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=getInfoException, 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) end[}] end[}] end[}] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTaskInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getState, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=getInfoException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] if[call[tState.equals, parameter[member[TaskInfoState.running]]]] begin[{] call[Thread.sleep, parameter[member[.runningDelayInMillSecond]]] else begin[{] call[Thread.sleep, parameter[member[.queuedDelayInMillSecond]]] end[}] end[}] return[call[tState.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[waitForTask] operator[SEP] Keyword[int] identifier[runningDelayInMillSecond] , Keyword[int] identifier[queuedDelayInMillSecond] operator[SEP] Keyword[throws] identifier[RuntimeFault] , identifier[RemoteException] , identifier[InterruptedException] { identifier[TaskInfoState] identifier[tState] operator[=] Other[null] operator[SEP] Keyword[int] identifier[tries] operator[=] Other[0] operator[SEP] Keyword[int] identifier[maxTries] operator[=] Other[3] operator[SEP] identifier[Exception] identifier[getInfoException] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[tState] operator[==] Other[null] operator[SEP] operator[||] identifier[tState] operator[SEP] identifier[equals] operator[SEP] identifier[TaskInfoState] operator[SEP] identifier[running] operator[SEP] operator[||] identifier[tState] operator[SEP] identifier[equals] operator[SEP] identifier[TaskInfoState] operator[SEP] identifier[queued] operator[SEP] operator[SEP] { identifier[tState] operator[=] Other[null] operator[SEP] identifier[getInfoException] operator[=] Other[null] operator[SEP] identifier[tries] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[tState] operator[==] Other[null] operator[SEP] { identifier[tries] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[tries] operator[>] identifier[maxTries] operator[SEP] { Keyword[if] operator[SEP] identifier[getInfoException] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getInfoException] Keyword[instanceof] identifier[RuntimeFault] operator[SEP] { Keyword[throw] operator[SEP] identifier[RuntimeFault] operator[SEP] identifier[getInfoException] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getInfoException] Keyword[instanceof] identifier[RemoteException] operator[SEP] { Keyword[throw] operator[SEP] identifier[RemoteException] operator[SEP] identifier[getInfoException] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[getInfoException] operator[SEP] operator[SEP] } } Keyword[try] { identifier[tState] operator[=] identifier[getTaskInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[getInfoException] operator[=] identifier[e] operator[SEP] } } Keyword[if] operator[SEP] identifier[tState] operator[SEP] identifier[equals] operator[SEP] identifier[TaskInfoState] operator[SEP] identifier[running] operator[SEP] operator[SEP] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] identifier[runningDelayInMillSecond] operator[SEP] operator[SEP] } Keyword[else] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] identifier[queuedDelayInMillSecond] operator[SEP] operator[SEP] } } Keyword[return] identifier[tState] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected static String getRemainingPath(List<String> tokens, int i, int end) { if (tokens == null) { throw MESSAGES.nullArgument("tokens"); } if (i < 0 || i >= end) { throw new IllegalArgumentException("i is not in the range of tokens: 0-" + (end - 1)); } if (i == end - 1) { return tokens.get(end - 1); } StringBuilder buffer = new StringBuilder(); for (; i < end - 1; ++i) { buffer.append(tokens.get(i)); buffer.append("/"); } buffer.append(tokens.get(end - 1)); return buffer.toString(); }
class class_name[name] begin[{] method[getRemainingPath, return_type[type[String]], modifier[static protected], parameter[tokens, i, end]] begin[{] if[binary_operation[member[.tokens], ==, literal[null]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="tokens")], member=nullArgument, postfix_operators=[], prefix_operators=[], qualifier=MESSAGES, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.i], <, literal[0]], ||, binary_operation[member[.i], >=, member[.end]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="i is not in the range of tokens: 0-"), operandr=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.i], ==, binary_operation[member[.end], -, literal[1]]]] begin[{] return[call[tokens.get, parameter[binary_operation[member[.end], -, literal[1]]]]] else begin[{] None end[}] local_variable[type[StringBuilder], buffer] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) call[buffer.append, parameter[call[tokens.get, parameter[binary_operation[member[.end], -, literal[1]]]]]] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[String] identifier[getRemainingPath] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[tokens] , Keyword[int] identifier[i] , Keyword[int] identifier[end] operator[SEP] { Keyword[if] operator[SEP] identifier[tokens] operator[==] Other[null] operator[SEP] { Keyword[throw] identifier[MESSAGES] operator[SEP] identifier[nullArgument] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[<] Other[0] operator[||] identifier[i] operator[>=] identifier[end] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[end] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[==] identifier[end] operator[-] Other[1] operator[SEP] { Keyword[return] identifier[tokens] operator[SEP] identifier[get] operator[SEP] identifier[end] operator[-] Other[1] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[end] operator[-] Other[1] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[tokens] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[tokens] operator[SEP] identifier[get] operator[SEP] identifier[end] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public int readNBit(int n) throws IOException { if (n > 32) throw new IllegalArgumentException("Can not read more then 32 bit"); int val = 0; for (int i = 0; i < n; i++) { val <<= 1; val |= read1BitInt(); } return val; }
class class_name[name] begin[{] method[readNBit, return_type[type[int]], modifier[public], parameter[n]] begin[{] if[binary_operation[member[.n], >, literal[32]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not read more then 32 bit")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], val] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=<<=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MethodInvocation(arguments=[], member=read1BitInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.val]] end[}] END[}]
Keyword[public] Keyword[int] identifier[readNBit] operator[SEP] Keyword[int] identifier[n] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[n] operator[>] Other[32] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[val] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[val] operator[<<=] Other[1] operator[SEP] identifier[val] operator[|=] identifier[read1BitInt] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[val] operator[SEP] }
public String relativeArtifactPath(char separator) { String artifactId1 = getArtifactId(); String version1 = getVersion(); StringBuilder builder = new StringBuilder(getGroupId().replace('.', separator)); builder.append(separator).append(artifactId1).append(separator); String pathVersion; final Matcher versionMatcher = snapshotPattern.matcher(version1); if (versionMatcher.find()) { // it's really a snapshot pathVersion = version1.substring(0, versionMatcher.start()) + "-SNAPSHOT"; } else { pathVersion = version1; } builder.append(pathVersion).append(separator).append(artifactId1).append('-').append(version1); return builder.toString(); }
class class_name[name] begin[{] method[relativeArtifactPath, return_type[type[String]], modifier[public], parameter[separator]] begin[{] local_variable[type[String], artifactId1] local_variable[type[String], version1] local_variable[type[StringBuilder], builder] call[builder.append, parameter[member[.separator]]] local_variable[type[String], pathVersion] local_variable[type[Matcher], versionMatcher] if[call[versionMatcher.find, parameter[]]] begin[{] assign[member[.pathVersion], binary_operation[call[version1.substring, parameter[literal[0], call[versionMatcher.start, parameter[]]]], +, literal["-SNAPSHOT"]]] else begin[{] assign[member[.pathVersion], member[.version1]] end[}] call[builder.append, parameter[member[.pathVersion]]] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[relativeArtifactPath] operator[SEP] Keyword[char] identifier[separator] operator[SEP] { identifier[String] identifier[artifactId1] operator[=] identifier[getArtifactId] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[version1] operator[=] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[getGroupId] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[separator] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[separator] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[artifactId1] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[separator] operator[SEP] operator[SEP] identifier[String] identifier[pathVersion] operator[SEP] Keyword[final] identifier[Matcher] identifier[versionMatcher] operator[=] identifier[snapshotPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[version1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[versionMatcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[pathVersion] operator[=] identifier[version1] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[versionMatcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] } Keyword[else] { identifier[pathVersion] operator[=] identifier[version1] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[pathVersion] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[separator] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[artifactId1] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[version1] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(OutputDescription outputDescription, ProtocolMarshaller protocolMarshaller) { if (outputDescription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(outputDescription.getOutputId(), OUTPUTID_BINDING); protocolMarshaller.marshall(outputDescription.getName(), NAME_BINDING); protocolMarshaller.marshall(outputDescription.getKinesisStreamsOutputDescription(), KINESISSTREAMSOUTPUTDESCRIPTION_BINDING); protocolMarshaller.marshall(outputDescription.getKinesisFirehoseOutputDescription(), KINESISFIREHOSEOUTPUTDESCRIPTION_BINDING); protocolMarshaller.marshall(outputDescription.getLambdaOutputDescription(), LAMBDAOUTPUTDESCRIPTION_BINDING); protocolMarshaller.marshall(outputDescription.getDestinationSchema(), DESTINATIONSCHEMA_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[outputDescription, protocolMarshaller]] begin[{] if[binary_operation[member[.outputDescription], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOutputId, postfix_operators=[], prefix_operators=[], qualifier=outputDescription, selectors=[], type_arguments=None), MemberReference(member=OUTPUTID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=outputDescription, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKinesisStreamsOutputDescription, postfix_operators=[], prefix_operators=[], qualifier=outputDescription, selectors=[], type_arguments=None), MemberReference(member=KINESISSTREAMSOUTPUTDESCRIPTION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKinesisFirehoseOutputDescription, postfix_operators=[], prefix_operators=[], qualifier=outputDescription, selectors=[], type_arguments=None), MemberReference(member=KINESISFIREHOSEOUTPUTDESCRIPTION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLambdaOutputDescription, postfix_operators=[], prefix_operators=[], qualifier=outputDescription, selectors=[], type_arguments=None), MemberReference(member=LAMBDAOUTPUTDESCRIPTION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDestinationSchema, postfix_operators=[], prefix_operators=[], qualifier=outputDescription, selectors=[], type_arguments=None), MemberReference(member=DESTINATIONSCHEMA_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[OutputDescription] identifier[outputDescription] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[outputDescription] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDescription] operator[SEP] identifier[getOutputId] operator[SEP] operator[SEP] , identifier[OUTPUTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDescription] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDescription] operator[SEP] identifier[getKinesisStreamsOutputDescription] operator[SEP] operator[SEP] , identifier[KINESISSTREAMSOUTPUTDESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDescription] operator[SEP] identifier[getKinesisFirehoseOutputDescription] operator[SEP] operator[SEP] , identifier[KINESISFIREHOSEOUTPUTDESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDescription] operator[SEP] identifier[getLambdaOutputDescription] operator[SEP] operator[SEP] , identifier[LAMBDAOUTPUTDESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDescription] operator[SEP] identifier[getDestinationSchema] operator[SEP] operator[SEP] , identifier[DESTINATIONSCHEMA_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private Calendar cleanHistCalendar(Calendar cal) { cal.set(Calendar.MILLISECOND, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.HOUR, 0); return cal; }
class class_name[name] begin[{] method[cleanHistCalendar, return_type[type[Calendar]], modifier[private], parameter[cal]] begin[{] call[cal.set, parameter[member[Calendar.MILLISECOND], literal[0]]] call[cal.set, parameter[member[Calendar.SECOND], literal[0]]] call[cal.set, parameter[member[Calendar.MINUTE], literal[0]]] call[cal.set, parameter[member[Calendar.HOUR], literal[0]]] return[member[.cal]] end[}] END[}]
Keyword[private] identifier[Calendar] identifier[cleanHistCalendar] operator[SEP] identifier[Calendar] identifier[cal] operator[SEP] { identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] , Other[0] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] , Other[0] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] , Other[0] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR] , Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[cal] operator[SEP] }
private void checkDependencies(SleeComponent sleeComponent, DeployableUnitImpl deployableUnit) throws DependencyException { for (ComponentID componentID : sleeComponent.getDependenciesSet()) { if (componentID instanceof EventTypeID) { if (deployableUnit.getDeployableUnitRepository() .getComponentByID((EventTypeID) componentID) == null) { throw new DependencyException( "Component " + sleeComponent.getComponentID() + " depends on " + componentID + " which is not available in the component repository or in the deployable unit"); } } else if (componentID instanceof LibraryID) { if (deployableUnit.getDeployableUnitRepository() .getComponentByID((LibraryID) componentID) == null) { throw new DependencyException( "Component " + sleeComponent.getComponentID() + " depends on " + componentID + " which is not available in the component repository or in the deployable unit"); } } else if (componentID instanceof ProfileSpecificationID) { if (deployableUnit.getDeployableUnitRepository() .getComponentByID((ProfileSpecificationID) componentID) == null) { throw new DependencyException( "Component " + sleeComponent.getComponentID() + " depends on " + componentID + " which is not available in the component repository or in the deployable unit"); } } else if (componentID instanceof ResourceAdaptorID) { if (deployableUnit.getDeployableUnitRepository() .getComponentByID((ResourceAdaptorID) componentID) == null) { throw new DependencyException( "Component " + sleeComponent.getComponentID() + " depends on " + componentID + " which is not available in the component repository or in the deployable unit"); } } else if (componentID instanceof ResourceAdaptorTypeID) { if (deployableUnit.getDeployableUnitRepository() .getComponentByID((ResourceAdaptorTypeID) componentID) == null) { throw new DependencyException( "Component " + sleeComponent.getComponentID() + " depends on " + componentID + " which is not available in the component repository or in the deployable unit"); } } else if (componentID instanceof SbbID) { if (deployableUnit.getDeployableUnitRepository() .getComponentByID((SbbID) componentID) == null) { throw new DependencyException( "Component " + sleeComponent.getComponentID() + " depends on " + componentID + " which is not available in the component repository or in the deployable unit"); } } else if (componentID instanceof ServiceID) { throw new SLEEException( "Component " + sleeComponent.getComponentID() + " depends on a service component " + componentID + " which is not available in the component repository or in the deployable unit"); } } }
class class_name[name] begin[{] method[checkDependencies, return_type[void], modifier[private], parameter[sleeComponent, deployableUnit]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=EventTypeID, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=LibraryID, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ProfileSpecificationID, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ResourceAdaptorID, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ResourceAdaptorTypeID, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SbbID, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ServiceID, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" depends on a service component "), operator=+), operandr=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which is not available in the component repository or in the deployable unit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SLEEException, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeployableUnitRepository, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SbbID, sub_type=None))], member=getComponentByID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" depends on "), operator=+), operandr=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which is not available in the component repository or in the deployable unit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyException, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeployableUnitRepository, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ResourceAdaptorTypeID, sub_type=None))], member=getComponentByID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" depends on "), operator=+), operandr=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which is not available in the component repository or in the deployable unit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyException, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeployableUnitRepository, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ResourceAdaptorID, sub_type=None))], member=getComponentByID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" depends on "), operator=+), operandr=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which is not available in the component repository or in the deployable unit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyException, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeployableUnitRepository, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ProfileSpecificationID, sub_type=None))], member=getComponentByID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" depends on "), operator=+), operandr=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which is not available in the component repository or in the deployable unit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyException, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeployableUnitRepository, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LibraryID, sub_type=None))], member=getComponentByID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" depends on "), operator=+), operandr=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which is not available in the component repository or in the deployable unit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyException, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeployableUnitRepository, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EventTypeID, sub_type=None))], member=getComponentByID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" depends on "), operator=+), operandr=MemberReference(member=componentID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which is not available in the component repository or in the deployable unit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DependencyException, sub_type=None)), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDependenciesSet, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=componentID)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ComponentID, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[checkDependencies] operator[SEP] identifier[SleeComponent] identifier[sleeComponent] , identifier[DeployableUnitImpl] identifier[deployableUnit] operator[SEP] Keyword[throws] identifier[DependencyException] { Keyword[for] operator[SEP] identifier[ComponentID] identifier[componentID] operator[:] identifier[sleeComponent] operator[SEP] identifier[getDependenciesSet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[componentID] Keyword[instanceof] identifier[EventTypeID] operator[SEP] { Keyword[if] operator[SEP] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentByID] operator[SEP] operator[SEP] identifier[EventTypeID] operator[SEP] identifier[componentID] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DependencyException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[componentID] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[componentID] Keyword[instanceof] identifier[LibraryID] operator[SEP] { Keyword[if] operator[SEP] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentByID] operator[SEP] operator[SEP] identifier[LibraryID] operator[SEP] identifier[componentID] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DependencyException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[componentID] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[componentID] Keyword[instanceof] identifier[ProfileSpecificationID] operator[SEP] { Keyword[if] operator[SEP] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentByID] operator[SEP] operator[SEP] identifier[ProfileSpecificationID] operator[SEP] identifier[componentID] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DependencyException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[componentID] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[componentID] Keyword[instanceof] identifier[ResourceAdaptorID] operator[SEP] { Keyword[if] operator[SEP] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentByID] operator[SEP] operator[SEP] identifier[ResourceAdaptorID] operator[SEP] identifier[componentID] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DependencyException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[componentID] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[componentID] Keyword[instanceof] identifier[ResourceAdaptorTypeID] operator[SEP] { Keyword[if] operator[SEP] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentByID] operator[SEP] operator[SEP] identifier[ResourceAdaptorTypeID] operator[SEP] identifier[componentID] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DependencyException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[componentID] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[componentID] Keyword[instanceof] identifier[SbbID] operator[SEP] { Keyword[if] operator[SEP] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentByID] operator[SEP] operator[SEP] identifier[SbbID] operator[SEP] identifier[componentID] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DependencyException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[componentID] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[componentID] Keyword[instanceof] identifier[ServiceID] operator[SEP] { Keyword[throw] Keyword[new] identifier[SLEEException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[componentID] operator[+] literal[String] operator[SEP] operator[SEP] } } }
public static CommerceShipmentItem[] findByCommerceShipment_PrevAndNext( long commerceShipmentItemId, long commerceShipmentId, OrderByComparator<CommerceShipmentItem> orderByComparator) throws com.liferay.commerce.exception.NoSuchShipmentItemException { return getPersistence() .findByCommerceShipment_PrevAndNext(commerceShipmentItemId, commerceShipmentId, orderByComparator); }
class class_name[name] begin[{] method[findByCommerceShipment_PrevAndNext, return_type[type[CommerceShipmentItem]], modifier[public static], parameter[commerceShipmentItemId, commerceShipmentId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceShipmentItem] operator[SEP] operator[SEP] identifier[findByCommerceShipment_PrevAndNext] operator[SEP] Keyword[long] identifier[commerceShipmentItemId] , Keyword[long] identifier[commerceShipmentId] , identifier[OrderByComparator] operator[<] identifier[CommerceShipmentItem] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchShipmentItemException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByCommerceShipment_PrevAndNext] operator[SEP] identifier[commerceShipmentItemId] , identifier[commerceShipmentId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public String print( ChronoPrinter<T> printer, BracketPolicy policy ) { try { StringBuilder sb = new StringBuilder(64); this.print(printer, '/', printer, policy, InfinityStyle.SYMBOL, sb); return sb.toString(); } catch (IOException ioe) { throw new AssertionError(ioe); } }
class class_name[name] begin[{] method[print, return_type[type[String]], modifier[public], parameter[printer, policy]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=printer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), MemberReference(member=printer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=policy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SYMBOL, postfix_operators=[], prefix_operators=[], qualifier=InfinityStyle, selectors=[]), MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ioe, 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=AssertionError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[print] operator[SEP] identifier[ChronoPrinter] operator[<] identifier[T] operator[>] identifier[printer] , identifier[BracketPolicy] identifier[policy] operator[SEP] { Keyword[try] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[64] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[print] operator[SEP] identifier[printer] , literal[String] , identifier[printer] , identifier[policy] , identifier[InfinityStyle] operator[SEP] identifier[SYMBOL] , identifier[sb] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] identifier[ioe] operator[SEP] operator[SEP] } }
private static boolean addCausalChain(Set<Throwable> seen, Throwable t) { for (; t != null; t = t.getCause()) { boolean firstTimeSeen = seen.add(t); if (!firstTimeSeen) { /* * We've seen this, so we've seen its causes, too. No need to re-add them. (There's one case * where this isn't true, but we ignore it: If we record an exception, then someone calls * initCause() on it, and then we examine it again, we'll conclude that we've seen the whole * chain before when it fact we haven't. But this should be rare.) */ return false; } } return true; }
class class_name[name] begin[{] method[addCausalChain, return_type[type[boolean]], modifier[private static], parameter[seen, t]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=seen, selectors=[], type_arguments=None), name=firstTimeSeen)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=firstTimeSeen, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=None, update=[Assignment(expressionl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None))]), label=None) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[addCausalChain] operator[SEP] identifier[Set] operator[<] identifier[Throwable] operator[>] identifier[seen] , identifier[Throwable] identifier[t] operator[SEP] { Keyword[for] operator[SEP] operator[SEP] identifier[t] operator[!=] Other[null] operator[SEP] identifier[t] operator[=] identifier[t] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[firstTimeSeen] operator[=] identifier[seen] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[firstTimeSeen] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static <T> Source<T> empty() { return new AbstractSource<T>() { @Override public T computeNext() { return endOfData(); } }; }
class class_name[name] begin[{] method[empty, return_type[type[Source]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=endOfData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=computeNext, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=AbstractSource, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Source] operator[<] identifier[T] operator[>] identifier[empty] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractSource] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[computeNext] operator[SEP] operator[SEP] { Keyword[return] identifier[endOfData] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public void addVirtualHost(String hostname) { // Note that null hosts are also added. if (!_vhosts.contains(hostname)) { _vhosts.add(hostname); _contextName=null; if (_httpServer!=null) { if (_vhosts.size()==1) _httpServer.removeMapping(null,this); _httpServer.addMapping(hostname,this); } _vhostsArray=null; } }
class class_name[name] begin[{] method[addVirtualHost, return_type[void], modifier[public], parameter[hostname]] begin[{] if[call[_vhosts.contains, parameter[member[.hostname]]]] begin[{] call[_vhosts.add, parameter[member[.hostname]]] assign[member[._contextName], literal[null]] if[binary_operation[member[._httpServer], !=, literal[null]]] begin[{] if[binary_operation[call[_vhosts.size, parameter[]], ==, literal[1]]] begin[{] call[_httpServer.removeMapping, parameter[literal[null], THIS[]]] else begin[{] None end[}] call[_httpServer.addMapping, parameter[member[.hostname], THIS[]]] else begin[{] None end[}] assign[member[._vhostsArray], literal[null]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addVirtualHost] operator[SEP] identifier[String] identifier[hostname] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[_vhosts] operator[SEP] identifier[contains] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] { identifier[_vhosts] operator[SEP] identifier[add] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] identifier[_contextName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[_httpServer] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[_vhosts] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] identifier[_httpServer] operator[SEP] identifier[removeMapping] operator[SEP] Other[null] , Keyword[this] operator[SEP] operator[SEP] identifier[_httpServer] operator[SEP] identifier[addMapping] operator[SEP] identifier[hostname] , Keyword[this] operator[SEP] operator[SEP] } identifier[_vhostsArray] operator[=] Other[null] operator[SEP] } }
@Override public void update(ChannelData inputData) { this.handshakeErrorTracker = createSSLHandshakeErrorTracker(inputData); this.sslConfig.updateChannelData(inputData); }
class class_name[name] begin[{] method[update, return_type[void], modifier[public], parameter[inputData]] begin[{] assign[THIS[member[None.handshakeErrorTracker]], call[.createSSLHandshakeErrorTracker, parameter[member[.inputData]]]] THIS[member[None.sslConfig]call[None.updateChannelData, parameter[member[.inputData]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[update] operator[SEP] identifier[ChannelData] identifier[inputData] operator[SEP] { Keyword[this] operator[SEP] identifier[handshakeErrorTracker] operator[=] identifier[createSSLHandshakeErrorTracker] operator[SEP] identifier[inputData] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[sslConfig] operator[SEP] identifier[updateChannelData] operator[SEP] identifier[inputData] operator[SEP] operator[SEP] }
void popNamespaces(int elemDepth, ContentHandler saxHandler) { while (true) { if (m_nodeStack.isEmpty()) return; MappingRecord map = (MappingRecord) (m_nodeStack.peek()); int depth = map.m_declarationDepth; if (elemDepth < 1 || map.m_declarationDepth < elemDepth) break; /* the depth of the declared mapping is elemDepth or deeper * so get rid of it */ MappingRecord nm1 = (MappingRecord) m_nodeStack.pop(); // pop the node from the stack String prefix = map.m_prefix; Stack prefixStack = getPrefixStack(prefix); MappingRecord nm2 = (MappingRecord) prefixStack.peek(); if (nm1 == nm2) { // It would be nice to always pop() but we // need to check that the prefix stack still has // the node we want to get rid of. This is because // the optimization of essentially this situation: // <a xmlns:x="abc"><b xmlns:x="" xmlns:x="abc" /></a> // will remove both mappings in <b> because the // new mapping is the same as the masked one and we get // <a xmlns:x="abc"><b/></a> // So we are only removing xmlns:x="" or // xmlns:x="abc" from the depth of element <b> // when going back to <a> if in fact they have // not been optimized away. // prefixStack.pop(); if (saxHandler != null) { try { saxHandler.endPrefixMapping(prefix); } catch (SAXException e) { // not much we can do if they aren't willing to listen } } } } }
class class_name[name] begin[{] method[popNamespaces, return_type[void], modifier[default], parameter[elemDepth, saxHandler]] begin[{] while[literal[true]] begin[{] if[call[m_nodeStack.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[MappingRecord], map] local_variable[type[int], depth] if[binary_operation[binary_operation[member[.elemDepth], <, literal[1]], ||, binary_operation[member[map.m_declarationDepth], <, member[.elemDepth]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[MappingRecord], nm1] local_variable[type[String], prefix] local_variable[type[Stack], prefixStack] local_variable[type[MappingRecord], nm2] if[binary_operation[member[.nm1], ==, member[.nm2]]] begin[{] call[prefixStack.pop, parameter[]] if[binary_operation[member[.saxHandler], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endPrefixMapping, postfix_operators=[], prefix_operators=[], qualifier=saxHandler, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SAXException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[void] identifier[popNamespaces] operator[SEP] Keyword[int] identifier[elemDepth] , identifier[ContentHandler] identifier[saxHandler] operator[SEP] { Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[m_nodeStack] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[MappingRecord] identifier[map] operator[=] operator[SEP] identifier[MappingRecord] operator[SEP] operator[SEP] identifier[m_nodeStack] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[depth] operator[=] identifier[map] operator[SEP] identifier[m_declarationDepth] operator[SEP] Keyword[if] operator[SEP] identifier[elemDepth] operator[<] Other[1] operator[||] identifier[map] operator[SEP] identifier[m_declarationDepth] operator[<] identifier[elemDepth] operator[SEP] Keyword[break] operator[SEP] identifier[MappingRecord] identifier[nm1] operator[=] operator[SEP] identifier[MappingRecord] operator[SEP] identifier[m_nodeStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[prefix] operator[=] identifier[map] operator[SEP] identifier[m_prefix] operator[SEP] identifier[Stack] identifier[prefixStack] operator[=] identifier[getPrefixStack] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] identifier[MappingRecord] identifier[nm2] operator[=] operator[SEP] identifier[MappingRecord] operator[SEP] identifier[prefixStack] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nm1] operator[==] identifier[nm2] operator[SEP] { identifier[prefixStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[saxHandler] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[saxHandler] operator[SEP] identifier[endPrefixMapping] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SAXException] identifier[e] operator[SEP] { } } } } }
public void remove(SchemaObject object, Right right) { if (right.isFull) { clear(); return; } if (isFull) { isFull = false; isFullSelect = isFullInsert = isFullUpdate = isFullReferences = isFullDelete = true; } if (right.isFullDelete) { isFullDelete = false; } if (!isFullSelect && selectColumnSet == null) {} else if (right.isFullSelect) { isFullSelect = false; selectColumnSet = null; } else if (right.selectColumnSet != null) { if (isFullSelect) { isFullSelect = false; selectColumnSet = ((Table) object).getColumnNameSet(); } selectColumnSet.removeAll(right.selectColumnSet); if (selectColumnSet.isEmpty()) { selectColumnSet = null; } } if (!isFullInsert && insertColumnSet == null) {} else if (right.isFullInsert) { isFullInsert = false; insertColumnSet = null; } else if (right.insertColumnSet != null) { if (isFullInsert) { isFullInsert = false; insertColumnSet = ((Table) object).getColumnNameSet(); } insertColumnSet.removeAll(right.insertColumnSet); if (insertColumnSet.isEmpty()) { insertColumnSet = null; } } if (!isFullUpdate && updateColumnSet == null) {} else if (right.isFullUpdate) { isFullUpdate = false; updateColumnSet = null; } else if (right.updateColumnSet != null) { if (isFullUpdate) { isFullUpdate = false; updateColumnSet = ((Table) object).getColumnNameSet(); } updateColumnSet.removeAll(right.updateColumnSet); if (updateColumnSet.isEmpty()) { updateColumnSet = null; } } if (!isFullReferences && referencesColumnSet == null) {} else if (right.isFullReferences) { isFullReferences = false; referencesColumnSet = null; } else if (right.referencesColumnSet != null) { if (isFullReferences) { isFullReferences = false; referencesColumnSet = ((Table) object).getColumnNameSet(); } referencesColumnSet.removeAll(right.referencesColumnSet); if (referencesColumnSet.isEmpty()) { referencesColumnSet = null; } } if (!isFullTrigger && triggerColumnSet == null) {} else if (right.isFullTrigger) { isFullTrigger = false; triggerColumnSet = null; } else if (right.triggerColumnSet != null) { if (isFullTrigger) { isFullTrigger = false; triggerColumnSet = ((Table) object).getColumnNameSet(); } triggerColumnSet.removeAll(right.triggerColumnSet); if (triggerColumnSet.isEmpty()) { triggerColumnSet = null; } } }
class class_name[name] begin[{] method[remove, return_type[void], modifier[public], parameter[object, right]] begin[{] if[member[right.isFull]] begin[{] call[.clear, parameter[]] return[None] else begin[{] None end[}] if[member[.isFull]] begin[{] assign[member[.isFull], literal[false]] assign[member[.isFullSelect], assign[member[.isFullInsert], assign[member[.isFullUpdate], assign[member[.isFullReferences], assign[member[.isFullDelete], literal[true]]]]]] else begin[{] None end[}] if[member[right.isFullDelete]] begin[{] assign[member[.isFullDelete], literal[false]] else begin[{] None end[}] if[binary_operation[member[.isFullSelect], &&, binary_operation[member[.selectColumnSet], ==, literal[null]]]] begin[{] else begin[{] if[member[right.isFullSelect]] begin[{] assign[member[.isFullSelect], literal[false]] assign[member[.selectColumnSet], literal[null]] else begin[{] if[binary_operation[member[right.selectColumnSet], !=, literal[null]]] begin[{] if[member[.isFullSelect]] begin[{] assign[member[.isFullSelect], literal[false]] assign[member[.selectColumnSet], Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))] else begin[{] None end[}] call[selectColumnSet.removeAll, parameter[member[right.selectColumnSet]]] if[call[selectColumnSet.isEmpty, parameter[]]] begin[{] assign[member[.selectColumnSet], literal[null]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] if[binary_operation[member[.isFullInsert], &&, binary_operation[member[.insertColumnSet], ==, literal[null]]]] begin[{] else begin[{] if[member[right.isFullInsert]] begin[{] assign[member[.isFullInsert], literal[false]] assign[member[.insertColumnSet], literal[null]] else begin[{] if[binary_operation[member[right.insertColumnSet], !=, literal[null]]] begin[{] if[member[.isFullInsert]] begin[{] assign[member[.isFullInsert], literal[false]] assign[member[.insertColumnSet], Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))] else begin[{] None end[}] call[insertColumnSet.removeAll, parameter[member[right.insertColumnSet]]] if[call[insertColumnSet.isEmpty, parameter[]]] begin[{] assign[member[.insertColumnSet], literal[null]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] if[binary_operation[member[.isFullUpdate], &&, binary_operation[member[.updateColumnSet], ==, literal[null]]]] begin[{] else begin[{] if[member[right.isFullUpdate]] begin[{] assign[member[.isFullUpdate], literal[false]] assign[member[.updateColumnSet], literal[null]] else begin[{] if[binary_operation[member[right.updateColumnSet], !=, literal[null]]] begin[{] if[member[.isFullUpdate]] begin[{] assign[member[.isFullUpdate], literal[false]] assign[member[.updateColumnSet], Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))] else begin[{] None end[}] call[updateColumnSet.removeAll, parameter[member[right.updateColumnSet]]] if[call[updateColumnSet.isEmpty, parameter[]]] begin[{] assign[member[.updateColumnSet], literal[null]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] if[binary_operation[member[.isFullReferences], &&, binary_operation[member[.referencesColumnSet], ==, literal[null]]]] begin[{] else begin[{] if[member[right.isFullReferences]] begin[{] assign[member[.isFullReferences], literal[false]] assign[member[.referencesColumnSet], literal[null]] else begin[{] if[binary_operation[member[right.referencesColumnSet], !=, literal[null]]] begin[{] if[member[.isFullReferences]] begin[{] assign[member[.isFullReferences], literal[false]] assign[member[.referencesColumnSet], Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))] else begin[{] None end[}] call[referencesColumnSet.removeAll, parameter[member[right.referencesColumnSet]]] if[call[referencesColumnSet.isEmpty, parameter[]]] begin[{] assign[member[.referencesColumnSet], literal[null]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] if[binary_operation[member[.isFullTrigger], &&, binary_operation[member[.triggerColumnSet], ==, literal[null]]]] begin[{] else begin[{] if[member[right.isFullTrigger]] begin[{] assign[member[.isFullTrigger], literal[false]] assign[member[.triggerColumnSet], literal[null]] else begin[{] if[binary_operation[member[right.triggerColumnSet], !=, literal[null]]] begin[{] if[member[.isFullTrigger]] begin[{] assign[member[.isFullTrigger], literal[false]] assign[member[.triggerColumnSet], Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))] else begin[{] None end[}] call[triggerColumnSet.removeAll, parameter[member[right.triggerColumnSet]]] if[call[triggerColumnSet.isEmpty, parameter[]]] begin[{] assign[member[.triggerColumnSet], literal[null]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[remove] operator[SEP] identifier[SchemaObject] identifier[object] , identifier[Right] identifier[right] operator[SEP] { Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[isFull] operator[SEP] { identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[isFull] operator[SEP] { identifier[isFull] operator[=] literal[boolean] operator[SEP] identifier[isFullSelect] operator[=] identifier[isFullInsert] operator[=] identifier[isFullUpdate] operator[=] identifier[isFullReferences] operator[=] identifier[isFullDelete] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[isFullDelete] operator[SEP] { identifier[isFullDelete] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isFullSelect] operator[&&] identifier[selectColumnSet] operator[==] Other[null] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[isFullSelect] operator[SEP] { identifier[isFullSelect] operator[=] literal[boolean] operator[SEP] identifier[selectColumnSet] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[selectColumnSet] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isFullSelect] operator[SEP] { identifier[isFullSelect] operator[=] literal[boolean] operator[SEP] identifier[selectColumnSet] operator[=] operator[SEP] operator[SEP] identifier[Table] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[getColumnNameSet] operator[SEP] operator[SEP] operator[SEP] } identifier[selectColumnSet] operator[SEP] identifier[removeAll] operator[SEP] identifier[right] operator[SEP] identifier[selectColumnSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selectColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[selectColumnSet] operator[=] Other[null] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isFullInsert] operator[&&] identifier[insertColumnSet] operator[==] Other[null] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[isFullInsert] operator[SEP] { identifier[isFullInsert] operator[=] literal[boolean] operator[SEP] identifier[insertColumnSet] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[insertColumnSet] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isFullInsert] operator[SEP] { identifier[isFullInsert] operator[=] literal[boolean] operator[SEP] identifier[insertColumnSet] operator[=] operator[SEP] operator[SEP] identifier[Table] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[getColumnNameSet] operator[SEP] operator[SEP] operator[SEP] } identifier[insertColumnSet] operator[SEP] identifier[removeAll] operator[SEP] identifier[right] operator[SEP] identifier[insertColumnSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[insertColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[insertColumnSet] operator[=] Other[null] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isFullUpdate] operator[&&] identifier[updateColumnSet] operator[==] Other[null] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[isFullUpdate] operator[SEP] { identifier[isFullUpdate] operator[=] literal[boolean] operator[SEP] identifier[updateColumnSet] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[updateColumnSet] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isFullUpdate] operator[SEP] { identifier[isFullUpdate] operator[=] literal[boolean] operator[SEP] identifier[updateColumnSet] operator[=] operator[SEP] operator[SEP] identifier[Table] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[getColumnNameSet] operator[SEP] operator[SEP] operator[SEP] } identifier[updateColumnSet] operator[SEP] identifier[removeAll] operator[SEP] identifier[right] operator[SEP] identifier[updateColumnSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[updateColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[updateColumnSet] operator[=] Other[null] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isFullReferences] operator[&&] identifier[referencesColumnSet] operator[==] Other[null] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[isFullReferences] operator[SEP] { identifier[isFullReferences] operator[=] literal[boolean] operator[SEP] identifier[referencesColumnSet] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[referencesColumnSet] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isFullReferences] operator[SEP] { identifier[isFullReferences] operator[=] literal[boolean] operator[SEP] identifier[referencesColumnSet] operator[=] operator[SEP] operator[SEP] identifier[Table] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[getColumnNameSet] operator[SEP] operator[SEP] operator[SEP] } identifier[referencesColumnSet] operator[SEP] identifier[removeAll] operator[SEP] identifier[right] operator[SEP] identifier[referencesColumnSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[referencesColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[referencesColumnSet] operator[=] Other[null] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isFullTrigger] operator[&&] identifier[triggerColumnSet] operator[==] Other[null] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[isFullTrigger] operator[SEP] { identifier[isFullTrigger] operator[=] literal[boolean] operator[SEP] identifier[triggerColumnSet] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[triggerColumnSet] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isFullTrigger] operator[SEP] { identifier[isFullTrigger] operator[=] literal[boolean] operator[SEP] identifier[triggerColumnSet] operator[=] operator[SEP] operator[SEP] identifier[Table] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[getColumnNameSet] operator[SEP] operator[SEP] operator[SEP] } identifier[triggerColumnSet] operator[SEP] identifier[removeAll] operator[SEP] identifier[right] operator[SEP] identifier[triggerColumnSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[triggerColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[triggerColumnSet] operator[=] Other[null] operator[SEP] } } }
public static TileColumn createTileRowColumn(int index) { return new TileColumn(index, TileTable.COLUMN_TILE_ROW, GeoPackageDataType.INTEGER, null, true, 0, false); }
class class_name[name] begin[{] method[createTileRowColumn, return_type[type[TileColumn]], modifier[public static], parameter[index]] begin[{] return[ClassCreator(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=COLUMN_TILE_ROW, postfix_operators=[], prefix_operators=[], qualifier=TileTable, selectors=[]), MemberReference(member=INTEGER, postfix_operators=[], prefix_operators=[], qualifier=GeoPackageDataType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), 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=TileColumn, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[TileColumn] identifier[createTileRowColumn] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[return] Keyword[new] identifier[TileColumn] operator[SEP] identifier[index] , identifier[TileTable] operator[SEP] identifier[COLUMN_TILE_ROW] , identifier[GeoPackageDataType] operator[SEP] identifier[INTEGER] , Other[null] , literal[boolean] , Other[0] , literal[boolean] operator[SEP] operator[SEP] }
protected void addSchemaPropertiesHelper(Path path, HiveRegistrationUnit hiveUnit) throws IOException { TypeInfo schema = getSchemaFromLatestFile(path, this.fs); if (schema instanceof StructTypeInfo) { StructTypeInfo structTypeInfo = (StructTypeInfo) schema; hiveUnit.setSerDeProp(SCHEMA_LITERAL, schema); hiveUnit.setSerDeProp(serdeConstants.LIST_COLUMNS, Joiner.on(",").join(structTypeInfo.getAllStructFieldNames())); hiveUnit.setSerDeProp(serdeConstants.LIST_COLUMN_TYPES, Joiner.on(",").join( structTypeInfo.getAllStructFieldTypeInfos().stream().map(x -> x.getTypeName()) .collect(Collectors.toList()))); } else { // Hive always uses a struct with a field for each of the top-level columns as the root object type. // So for here we assume to-be-registered ORC files follow this pattern. throw new IllegalStateException("A valid ORC schema should be an instance of struct"); } }
class class_name[name] begin[{] method[addSchemaPropertiesHelper, return_type[void], modifier[protected], parameter[path, hiveUnit]] begin[{] local_variable[type[TypeInfo], schema] if[binary_operation[member[.schema], instanceof, type[StructTypeInfo]]] begin[{] local_variable[type[StructTypeInfo], structTypeInfo] call[hiveUnit.setSerDeProp, parameter[member[.SCHEMA_LITERAL], member[.schema]]] call[hiveUnit.setSerDeProp, parameter[member[serdeConstants.LIST_COLUMNS], call[Joiner.on, parameter[literal[","]]]]] call[hiveUnit.setSerDeProp, parameter[member[serdeConstants.LIST_COLUMN_TYPES], call[Joiner.on, parameter[literal[","]]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A valid ORC schema should be an instance of struct")], 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) end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[addSchemaPropertiesHelper] operator[SEP] identifier[Path] identifier[path] , identifier[HiveRegistrationUnit] identifier[hiveUnit] operator[SEP] Keyword[throws] identifier[IOException] { identifier[TypeInfo] identifier[schema] operator[=] identifier[getSchemaFromLatestFile] operator[SEP] identifier[path] , Keyword[this] operator[SEP] identifier[fs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[schema] Keyword[instanceof] identifier[StructTypeInfo] operator[SEP] { identifier[StructTypeInfo] identifier[structTypeInfo] operator[=] operator[SEP] identifier[StructTypeInfo] operator[SEP] identifier[schema] operator[SEP] identifier[hiveUnit] operator[SEP] identifier[setSerDeProp] operator[SEP] identifier[SCHEMA_LITERAL] , identifier[schema] operator[SEP] operator[SEP] identifier[hiveUnit] operator[SEP] identifier[setSerDeProp] operator[SEP] identifier[serdeConstants] operator[SEP] identifier[LIST_COLUMNS] , identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[structTypeInfo] operator[SEP] identifier[getAllStructFieldNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[hiveUnit] operator[SEP] identifier[setSerDeProp] operator[SEP] identifier[serdeConstants] operator[SEP] identifier[LIST_COLUMN_TYPES] , identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[structTypeInfo] operator[SEP] identifier[getAllStructFieldTypeInfos] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[x] operator[->] identifier[x] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
protected void init(String init) { String[] pcs = StrUtil.split(init, StrUtil.U, 4); id = StrUtil.toInt(pcs[0]); serverCaps.domainName = pcs[1]; serverCaps.siteName = pcs[2]; userId = StrUtil.toInt(pcs[3]); }
class class_name[name] begin[{] method[init, return_type[void], modifier[protected], parameter[init]] begin[{] local_variable[type[String], pcs] assign[member[.id], call[StrUtil.toInt, parameter[member[.pcs]]]] assign[member[serverCaps.domainName], member[.pcs]] assign[member[serverCaps.siteName], member[.pcs]] assign[member[.userId], call[StrUtil.toInt, parameter[member[.pcs]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[init] operator[SEP] identifier[String] identifier[init] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[pcs] operator[=] identifier[StrUtil] operator[SEP] identifier[split] operator[SEP] identifier[init] , identifier[StrUtil] operator[SEP] identifier[U] , Other[4] operator[SEP] operator[SEP] identifier[id] operator[=] identifier[StrUtil] operator[SEP] identifier[toInt] operator[SEP] identifier[pcs] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[serverCaps] operator[SEP] identifier[domainName] operator[=] identifier[pcs] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[serverCaps] operator[SEP] identifier[siteName] operator[=] identifier[pcs] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[userId] operator[=] identifier[StrUtil] operator[SEP] identifier[toInt] operator[SEP] identifier[pcs] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] }
public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachWithError( final Stream<T> stream, final Consumer<? super T> consumerElement, final Consumer<? super Throwable> consumerError) { return forEachEvent(stream, consumerElement, consumerError, () -> { }); }
class class_name[name] begin[{] method[forEachWithError, return_type[type[Tuple3]], modifier[public static], parameter[stream, consumerElement, consumerError]] begin[{] return[call[.forEachEvent, parameter[member[.stream], member[.consumerElement], member[.consumerError], LambdaExpression(body=[], parameters=[])]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[X] Keyword[extends] identifier[Throwable] operator[>] identifier[Tuple3] operator[<] identifier[CompletableFuture] operator[<] identifier[Subscription] operator[>] , identifier[Runnable] , identifier[CompletableFuture] operator[<] identifier[Boolean] operator[>] operator[>] identifier[forEachWithError] operator[SEP] Keyword[final] identifier[Stream] operator[<] identifier[T] operator[>] identifier[stream] , Keyword[final] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[consumerElement] , Keyword[final] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[Throwable] operator[>] identifier[consumerError] operator[SEP] { Keyword[return] identifier[forEachEvent] operator[SEP] identifier[stream] , identifier[consumerElement] , identifier[consumerError] , operator[SEP] operator[SEP] operator[->] { } operator[SEP] operator[SEP] }
public static ICompletableFuture<Object> invokeOnStableClusterSerial(NodeEngine nodeEngine, Supplier<? extends Operation> operationSupplier, int maxRetries) { ClusterService clusterService = nodeEngine.getClusterService(); if (!clusterService.isJoined()) { return new CompletedFuture<Object>(null, null, new CallerRunsExecutor()); } RestartingMemberIterator memberIterator = new RestartingMemberIterator(clusterService, maxRetries); // we are going to iterate over all members and invoke an operation on each of them InvokeOnMemberFunction invokeOnMemberFunction = new InvokeOnMemberFunction(operationSupplier, nodeEngine, memberIterator); Iterator<ICompletableFuture<Object>> invocationIterator = map(memberIterator, invokeOnMemberFunction); ILogger logger = nodeEngine.getLogger(ChainingFuture.class); ExecutionService executionService = nodeEngine.getExecutionService(); ManagedExecutorService executor = executionService.getExecutor(ExecutionService.ASYNC_EXECUTOR); // ChainingFuture uses the iterator to start invocations // it invokes on another member only when the previous invocation is completed (so invocations are serial) // the future itself completes only when the last invocation completes (or if there is an error) return new ChainingFuture<Object>(invocationIterator, executor, memberIterator, logger); }
class class_name[name] begin[{] method[invokeOnStableClusterSerial, return_type[type[ICompletableFuture]], modifier[public static], parameter[nodeEngine, operationSupplier, maxRetries]] begin[{] local_variable[type[ClusterService], clusterService] if[call[clusterService.isJoined, parameter[]]] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CallerRunsExecutor, 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=Object, sub_type=None))], dimensions=None, name=CompletedFuture, sub_type=None))] else begin[{] None end[}] local_variable[type[RestartingMemberIterator], memberIterator] local_variable[type[InvokeOnMemberFunction], invokeOnMemberFunction] local_variable[type[Iterator], invocationIterator] local_variable[type[ILogger], logger] local_variable[type[ExecutionService], executionService] local_variable[type[ManagedExecutorService], executor] return[ClassCreator(arguments=[MemberReference(member=invocationIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=executor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=memberIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=ChainingFuture, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ICompletableFuture] operator[<] identifier[Object] operator[>] identifier[invokeOnStableClusterSerial] operator[SEP] identifier[NodeEngine] identifier[nodeEngine] , identifier[Supplier] operator[<] operator[?] Keyword[extends] identifier[Operation] operator[>] identifier[operationSupplier] , Keyword[int] identifier[maxRetries] operator[SEP] { identifier[ClusterService] identifier[clusterService] operator[=] identifier[nodeEngine] operator[SEP] identifier[getClusterService] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[clusterService] operator[SEP] identifier[isJoined] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[CompletedFuture] operator[<] identifier[Object] operator[>] operator[SEP] Other[null] , Other[null] , Keyword[new] identifier[CallerRunsExecutor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[RestartingMemberIterator] identifier[memberIterator] operator[=] Keyword[new] identifier[RestartingMemberIterator] operator[SEP] identifier[clusterService] , identifier[maxRetries] operator[SEP] operator[SEP] identifier[InvokeOnMemberFunction] identifier[invokeOnMemberFunction] operator[=] Keyword[new] identifier[InvokeOnMemberFunction] operator[SEP] identifier[operationSupplier] , identifier[nodeEngine] , identifier[memberIterator] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[ICompletableFuture] operator[<] identifier[Object] operator[>] operator[>] identifier[invocationIterator] operator[=] identifier[map] operator[SEP] identifier[memberIterator] , identifier[invokeOnMemberFunction] operator[SEP] operator[SEP] identifier[ILogger] identifier[logger] operator[=] identifier[nodeEngine] operator[SEP] identifier[getLogger] operator[SEP] identifier[ChainingFuture] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ExecutionService] identifier[executionService] operator[=] identifier[nodeEngine] operator[SEP] identifier[getExecutionService] operator[SEP] operator[SEP] operator[SEP] identifier[ManagedExecutorService] identifier[executor] operator[=] identifier[executionService] operator[SEP] identifier[getExecutor] operator[SEP] identifier[ExecutionService] operator[SEP] identifier[ASYNC_EXECUTOR] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ChainingFuture] operator[<] identifier[Object] operator[>] operator[SEP] identifier[invocationIterator] , identifier[executor] , identifier[memberIterator] , identifier[logger] operator[SEP] operator[SEP] }
public double getElevationAt( Direction direction ) { switch( direction ) { case E: return eElev; case W: return wElev; case N: return nElev; case S: return sElev; case EN: return enElev; case NW: return nwElev; case WS: return wsElev; case SE: return seElev; default: throw new IllegalArgumentException(); } }
class class_name[name] begin[{] method[getElevationAt, return_type[type[double]], modifier[public], parameter[direction]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['E'], statements=[ReturnStatement(expression=MemberReference(member=eElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['W'], statements=[ReturnStatement(expression=MemberReference(member=wElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['N'], statements=[ReturnStatement(expression=MemberReference(member=nElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['S'], statements=[ReturnStatement(expression=MemberReference(member=sElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['EN'], statements=[ReturnStatement(expression=MemberReference(member=enElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['NW'], statements=[ReturnStatement(expression=MemberReference(member=nwElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['WS'], statements=[ReturnStatement(expression=MemberReference(member=wsElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['SE'], statements=[ReturnStatement(expression=MemberReference(member=seElev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])], expression=MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[double] identifier[getElevationAt] operator[SEP] identifier[Direction] identifier[direction] operator[SEP] { Keyword[switch] operator[SEP] identifier[direction] operator[SEP] { Keyword[case] identifier[E] operator[:] Keyword[return] identifier[eElev] operator[SEP] Keyword[case] identifier[W] operator[:] Keyword[return] identifier[wElev] operator[SEP] Keyword[case] identifier[N] operator[:] Keyword[return] identifier[nElev] operator[SEP] Keyword[case] identifier[S] operator[:] Keyword[return] identifier[sElev] operator[SEP] Keyword[case] identifier[EN] operator[:] Keyword[return] identifier[enElev] operator[SEP] Keyword[case] identifier[NW] operator[:] Keyword[return] identifier[nwElev] operator[SEP] Keyword[case] identifier[WS] operator[:] Keyword[return] identifier[wsElev] operator[SEP] Keyword[case] identifier[SE] operator[:] Keyword[return] identifier[seElev] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } }
public JWSHeader setAlgorithm(String algorithm) { this.algorithm = algorithm; this.put(HeaderConstants.ALGORITHM, algorithm); return this; }
class class_name[name] begin[{] method[setAlgorithm, return_type[type[JWSHeader]], modifier[public], parameter[algorithm]] begin[{] assign[THIS[member[None.algorithm]], member[.algorithm]] THIS[call[None.put, parameter[member[HeaderConstants.ALGORITHM], member[.algorithm]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JWSHeader] identifier[setAlgorithm] operator[SEP] identifier[String] identifier[algorithm] operator[SEP] { Keyword[this] operator[SEP] identifier[algorithm] operator[=] identifier[algorithm] operator[SEP] Keyword[this] operator[SEP] identifier[put] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[ALGORITHM] , identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private static void setUsersInfo(Catalog catalog, UsersType users) throws RuntimeException { if (users == null) { return; } // The database name is not available in deployment.xml (it is defined // in project.xml). However, it must always be named "database", so // I've temporarily hardcoded it here until a more robust solution is // available. Database db = catalog.getClusters().get("cluster").getDatabases().get("database"); SecureRandom sr = new SecureRandom(); for (UsersType.User user : users.getUser()) { Set<String> roles = extractUserRoles(user); String sha1hex = user.getPassword(); String sha256hex = user.getPassword(); if (user.isPlaintext()) { sha1hex = extractPassword(user.getPassword(), ClientAuthScheme.HASH_SHA1); sha256hex = extractPassword(user.getPassword(), ClientAuthScheme.HASH_SHA256); } else if (user.getPassword().length() == 104) { int sha1len = ClientAuthScheme.getHexencodedDigestLength(ClientAuthScheme.HASH_SHA1); sha1hex = sha1hex.substring(0, sha1len); sha256hex = sha256hex.substring(sha1len); } else { // if one user has invalid password, give a warn. hostLog.warn("User \"" + user.getName() + "\" has invalid masked password in deployment file."); // throw exception disable user with invalid masked password throw new RuntimeException("User \"" + user.getName() + "\" has invalid masked password in deployment file"); } org.voltdb.catalog.User catUser = db.getUsers().get(user.getName()); if (catUser == null) { catUser = db.getUsers().add(user.getName()); } // generate salt only once for sha1 and sha256 String saltGen = BCrypt.gensalt(BCrypt.GENSALT_DEFAULT_LOG2_ROUNDS,sr); String hashedPW = BCrypt.hashpw( sha1hex, saltGen); String hashedPW256 = BCrypt.hashpw( sha256hex, saltGen); catUser.setShadowpassword(hashedPW); catUser.setSha256shadowpassword(hashedPW256); //use fixed seed for comparison catUser.setPassword( BCrypt.hashpw(sha256hex, "$2a$10$pWO/a/OQkFyQWQDpchZdEe")); // process the @groups and @roles comma separated list for (final String role : roles) { final Group catalogGroup = db.getGroups().get(role); // if the role doesn't exist, ignore it. if (catalogGroup != null) { GroupRef groupRef = catUser.getGroups().get(role); if (groupRef == null) { groupRef = catUser.getGroups().add(role); } groupRef.setGroup(catalogGroup); } else { hostLog.warn("User \"" + user.getName() + "\" is assigned to non-existent role \"" + role + "\" " + "and may not have the expected database permissions."); } } } }
class class_name[name] begin[{] method[setUsersInfo, return_type[void], modifier[private static], parameter[catalog, users]] begin[{] if[binary_operation[member[.users], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Database], db] local_variable[type[SecureRandom], sr] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractUserRoles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=roles)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), name=sha1hex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), name=sha256hex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isPlaintext, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=104), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User \""), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" has invalid masked password in deployment file."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=hostLog, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User \""), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" has invalid masked password in deployment file"), 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)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=HASH_SHA1, postfix_operators=[], prefix_operators=[], qualifier=ClientAuthScheme, selectors=[])], member=getHexencodedDigestLength, postfix_operators=[], prefix_operators=[], qualifier=ClientAuthScheme, selectors=[], type_arguments=None), name=sha1len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sha1hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=sha1len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=sha1hex, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sha256hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=sha1len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=sha256hex, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sha1hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), MemberReference(member=HASH_SHA1, postfix_operators=[], prefix_operators=[], qualifier=ClientAuthScheme, selectors=[])], member=extractPassword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sha256hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), MemberReference(member=HASH_SHA256, postfix_operators=[], prefix_operators=[], qualifier=ClientAuthScheme, selectors=[])], member=extractPassword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUsers, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=catUser)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=voltdb, sub_type=ReferenceType(arguments=None, dimensions=None, name=catalog, sub_type=ReferenceType(arguments=None, dimensions=None, name=User, sub_type=None))))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=catUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=catUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getUsers, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=GENSALT_DEFAULT_LOG2_ROUNDS, postfix_operators=[], prefix_operators=[], qualifier=BCrypt, selectors=[]), MemberReference(member=sr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=gensalt, postfix_operators=[], prefix_operators=[], qualifier=BCrypt, selectors=[], type_arguments=None), name=saltGen)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sha1hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=saltGen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hashpw, postfix_operators=[], prefix_operators=[], qualifier=BCrypt, selectors=[], type_arguments=None), name=hashedPW)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sha256hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=saltGen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hashpw, postfix_operators=[], prefix_operators=[], qualifier=BCrypt, selectors=[], type_arguments=None), name=hashedPW256)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hashedPW, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setShadowpassword, postfix_operators=[], prefix_operators=[], qualifier=catUser, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hashedPW256, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSha256shadowpassword, postfix_operators=[], prefix_operators=[], qualifier=catUser, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=sha256hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$2a$10$pWO/a/OQkFyQWQDpchZdEe")], member=hashpw, postfix_operators=[], prefix_operators=[], qualifier=BCrypt, selectors=[], type_arguments=None)], member=setPassword, postfix_operators=[], prefix_operators=[], qualifier=catUser, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGroups, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[MethodInvocation(arguments=[MemberReference(member=role, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=catalogGroup)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=catalogGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User \""), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" is assigned to non-existent role \""), operator=+), operandr=MemberReference(member=role, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="and may not have the expected database permissions."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=hostLog, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGroups, postfix_operators=[], prefix_operators=[], qualifier=catUser, selectors=[MethodInvocation(arguments=[MemberReference(member=role, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=groupRef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GroupRef, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=groupRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=groupRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getGroups, postfix_operators=[], prefix_operators=[], qualifier=catUser, selectors=[MethodInvocation(arguments=[MemberReference(member=role, 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)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=catalogGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setGroup, postfix_operators=[], prefix_operators=[], qualifier=groupRef, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=roles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=role)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getUser, postfix_operators=[], prefix_operators=[], qualifier=users, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=user)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UsersType, sub_type=ReferenceType(arguments=None, dimensions=None, name=User, sub_type=None)))), label=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[setUsersInfo] operator[SEP] identifier[Catalog] identifier[catalog] , identifier[UsersType] identifier[users] operator[SEP] Keyword[throws] identifier[RuntimeException] { Keyword[if] operator[SEP] identifier[users] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[Database] identifier[db] operator[=] identifier[catalog] operator[SEP] identifier[getClusters] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getDatabases] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[SecureRandom] identifier[sr] operator[=] Keyword[new] identifier[SecureRandom] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[UsersType] operator[SEP] identifier[User] identifier[user] operator[:] identifier[users] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[roles] operator[=] identifier[extractUserRoles] operator[SEP] identifier[user] operator[SEP] operator[SEP] identifier[String] identifier[sha1hex] operator[=] identifier[user] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[sha256hex] operator[=] identifier[user] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[SEP] identifier[isPlaintext] operator[SEP] operator[SEP] operator[SEP] { identifier[sha1hex] operator[=] identifier[extractPassword] operator[SEP] identifier[user] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] , identifier[ClientAuthScheme] operator[SEP] identifier[HASH_SHA1] operator[SEP] operator[SEP] identifier[sha256hex] operator[=] identifier[extractPassword] operator[SEP] identifier[user] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] , identifier[ClientAuthScheme] operator[SEP] identifier[HASH_SHA256] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[user] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[104] operator[SEP] { Keyword[int] identifier[sha1len] operator[=] identifier[ClientAuthScheme] operator[SEP] identifier[getHexencodedDigestLength] operator[SEP] identifier[ClientAuthScheme] operator[SEP] identifier[HASH_SHA1] operator[SEP] operator[SEP] identifier[sha1hex] operator[=] identifier[sha1hex] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[sha1len] operator[SEP] operator[SEP] identifier[sha256hex] operator[=] identifier[sha256hex] operator[SEP] identifier[substring] operator[SEP] identifier[sha1len] operator[SEP] operator[SEP] } Keyword[else] { identifier[hostLog] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[org] operator[SEP] identifier[voltdb] operator[SEP] identifier[catalog] operator[SEP] identifier[User] identifier[catUser] operator[=] identifier[db] operator[SEP] identifier[getUsers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[catUser] operator[==] Other[null] operator[SEP] { identifier[catUser] operator[=] identifier[db] operator[SEP] identifier[getUsers] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[saltGen] operator[=] identifier[BCrypt] operator[SEP] identifier[gensalt] operator[SEP] identifier[BCrypt] operator[SEP] identifier[GENSALT_DEFAULT_LOG2_ROUNDS] , identifier[sr] operator[SEP] operator[SEP] identifier[String] identifier[hashedPW] operator[=] identifier[BCrypt] operator[SEP] identifier[hashpw] operator[SEP] identifier[sha1hex] , identifier[saltGen] operator[SEP] operator[SEP] identifier[String] identifier[hashedPW256] operator[=] identifier[BCrypt] operator[SEP] identifier[hashpw] operator[SEP] identifier[sha256hex] , identifier[saltGen] operator[SEP] operator[SEP] identifier[catUser] operator[SEP] identifier[setShadowpassword] operator[SEP] identifier[hashedPW] operator[SEP] operator[SEP] identifier[catUser] operator[SEP] identifier[setSha256shadowpassword] operator[SEP] identifier[hashedPW256] operator[SEP] operator[SEP] identifier[catUser] operator[SEP] identifier[setPassword] operator[SEP] identifier[BCrypt] operator[SEP] identifier[hashpw] operator[SEP] identifier[sha256hex] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[role] operator[:] identifier[roles] operator[SEP] { Keyword[final] identifier[Group] identifier[catalogGroup] operator[=] identifier[db] operator[SEP] identifier[getGroups] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[role] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[catalogGroup] operator[!=] Other[null] operator[SEP] { identifier[GroupRef] identifier[groupRef] operator[=] identifier[catUser] operator[SEP] identifier[getGroups] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[role] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groupRef] operator[==] Other[null] operator[SEP] { identifier[groupRef] operator[=] identifier[catUser] operator[SEP] identifier[getGroups] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[role] operator[SEP] operator[SEP] } identifier[groupRef] operator[SEP] identifier[setGroup] operator[SEP] identifier[catalogGroup] operator[SEP] operator[SEP] } Keyword[else] { identifier[hostLog] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[role] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } } } }
public long getElapsedMilliseconds() { long elapsed; if (running) { elapsed = (System.nanoTime() - startTime); } else { elapsed = (stopTime - startTime); } return elapsed / nsPerMs; }
class class_name[name] begin[{] method[getElapsedMilliseconds, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[long], elapsed] if[member[.running]] begin[{] assign[member[.elapsed], binary_operation[call[System.nanoTime, parameter[]], -, member[.startTime]]] else begin[{] assign[member[.elapsed], binary_operation[member[.stopTime], -, member[.startTime]]] end[}] return[binary_operation[member[.elapsed], /, member[.nsPerMs]]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getElapsedMilliseconds] operator[SEP] operator[SEP] { Keyword[long] identifier[elapsed] operator[SEP] Keyword[if] operator[SEP] identifier[running] operator[SEP] { identifier[elapsed] operator[=] operator[SEP] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[-] identifier[startTime] operator[SEP] operator[SEP] } Keyword[else] { identifier[elapsed] operator[=] operator[SEP] identifier[stopTime] operator[-] identifier[startTime] operator[SEP] operator[SEP] } Keyword[return] identifier[elapsed] operator[/] identifier[nsPerMs] operator[SEP] }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> retry(long times, Predicate<? super Throwable> predicate) { if (times < 0) { throw new IllegalArgumentException("times >= 0 required but it was " + times); } ObjectHelper.requireNonNull(predicate, "predicate is null"); return RxJavaPlugins.onAssembly(new ObservableRetryPredicate<T>(this, times, predicate)); }
class class_name[name] begin[{] method[retry, return_type[type[Observable]], modifier[final public], parameter[times, predicate]] begin[{] if[binary_operation[member[.times], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="times >= 0 required but it was "), operandr=MemberReference(member=times, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[ObjectHelper.requireNonNull, parameter[member[.predicate], literal["predicate is null"]]] return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=times, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=predicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ObservableRetryPredicate, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[final] identifier[Observable] operator[<] identifier[T] operator[>] identifier[retry] operator[SEP] Keyword[long] identifier[times] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[Throwable] operator[>] identifier[predicate] operator[SEP] { Keyword[if] operator[SEP] identifier[times] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[times] operator[SEP] operator[SEP] } identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[predicate] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ObservableRetryPredicate] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[times] , identifier[predicate] operator[SEP] operator[SEP] operator[SEP] }
public String convertIfcBuildingElementProxyTypeEnumToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertIfcBuildingElementProxyTypeEnumToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertIfcBuildingElementProxyTypeEnumToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static byte requiredByteAttribute(final XMLStreamReader reader, final String localName) throws XMLStreamException { return requiredByteAttribute(reader, null, localName); }
class class_name[name] begin[{] method[requiredByteAttribute, return_type[type[byte]], modifier[public static], parameter[reader, localName]] begin[{] return[call[.requiredByteAttribute, parameter[member[.reader], literal[null], member[.localName]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] identifier[requiredByteAttribute] operator[SEP] Keyword[final] identifier[XMLStreamReader] identifier[reader] , Keyword[final] identifier[String] identifier[localName] operator[SEP] Keyword[throws] identifier[XMLStreamException] { Keyword[return] identifier[requiredByteAttribute] operator[SEP] identifier[reader] , Other[null] , identifier[localName] operator[SEP] operator[SEP] }
public static <K, V, A> A ifPresentApply( Map<K, V> map, K key, Function<? super V, ? extends A> function) { if (map instanceof UnsortedMapIterable) { return ((MapIterable<K, V>) map).ifPresentApply(key, function); } V result = map.get(key); return MapIterate.isAbsent(result, map, key) ? null : function.valueOf(result); }
class class_name[name] begin[{] method[ifPresentApply, return_type[type[A]], modifier[public static], parameter[map, key, function]] begin[{] if[binary_operation[member[.map], instanceof, type[UnsortedMapIterable]]] begin[{] return[Cast(expression=MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=MapIterable, sub_type=None))] else begin[{] None end[}] local_variable[type[V], result] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAbsent, postfix_operators=[], prefix_operators=[], qualifier=MapIterate, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=function, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] , identifier[A] operator[>] identifier[A] identifier[ifPresentApply] operator[SEP] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] , identifier[K] identifier[key] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[V] , operator[?] Keyword[extends] identifier[A] operator[>] identifier[function] operator[SEP] { Keyword[if] operator[SEP] identifier[map] Keyword[instanceof] identifier[UnsortedMapIterable] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[MapIterable] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[map] operator[SEP] operator[SEP] identifier[ifPresentApply] operator[SEP] identifier[key] , identifier[function] operator[SEP] operator[SEP] } identifier[V] identifier[result] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] identifier[MapIterate] operator[SEP] identifier[isAbsent] operator[SEP] identifier[result] , identifier[map] , identifier[key] operator[SEP] operator[?] Other[null] operator[:] identifier[function] operator[SEP] identifier[valueOf] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
public static Object readDeclaredStaticField(final Class<?> cls, final String fieldName) throws IllegalAccessException { return readDeclaredStaticField(cls, fieldName, false); }
class class_name[name] begin[{] method[readDeclaredStaticField, return_type[type[Object]], modifier[public static], parameter[cls, fieldName]] begin[{] return[call[.readDeclaredStaticField, parameter[member[.cls], member[.fieldName], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[readDeclaredStaticField] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] , Keyword[final] identifier[String] identifier[fieldName] operator[SEP] Keyword[throws] identifier[IllegalAccessException] { Keyword[return] identifier[readDeclaredStaticField] operator[SEP] identifier[cls] , identifier[fieldName] , literal[boolean] operator[SEP] operator[SEP] }
public long resample(final long samples, final Timebase oldRate, boolean failOnPrecisionLoss) throws ResamplingException { final double resampled = resample((double) samples, oldRate); final double rounded = Math.round(resampled); // Warn about significant loss of precision if (resampled != rounded && Math.abs(rounded - resampled) > 0.000001) { if (failOnPrecisionLoss) { throw new ResamplingException("Resample " + samples + " from " + oldRate + " to " + this + " would lose precision by rounding " + resampled); } else { if (WARN_ON_PRECISION_LOSS) log.warn("Resample operation lost precision: " + samples + " from " + oldRate + " to " + this + " produced " + resampled + " which will be rounded to " + rounded); } } return (long) rounded; }
class class_name[name] begin[{] method[resample, return_type[type[long]], modifier[public], parameter[samples, oldRate, failOnPrecisionLoss]] begin[{] local_variable[type[double], resampled] local_variable[type[double], rounded] if[binary_operation[binary_operation[member[.resampled], !=, member[.rounded]], &&, binary_operation[call[Math.abs, parameter[binary_operation[member[.rounded], -, member[.resampled]]]], >, literal[0.000001]]]] begin[{] if[member[.failOnPrecisionLoss]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Resample "), operandr=MemberReference(member=samples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from "), operator=+), operandr=MemberReference(member=oldRate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" would lose precision by rounding "), operator=+), operandr=MemberReference(member=resampled, 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=ResamplingException, sub_type=None)), label=None) else begin[{] if[member[.WARN_ON_PRECISION_LOSS]] begin[{] call[log.warn, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Resample operation lost precision: "], +, member[.samples]], +, literal[" from "]], +, member[.oldRate]], +, literal[" to "]], +, THIS[]], +, literal[" produced "]], +, member[.resampled]], +, literal[" which will be rounded to "]], +, member[.rounded]]]] else begin[{] None end[}] end[}] else begin[{] None end[}] return[Cast(expression=MemberReference(member=rounded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=long))] end[}] END[}]
Keyword[public] Keyword[long] identifier[resample] operator[SEP] Keyword[final] Keyword[long] identifier[samples] , Keyword[final] identifier[Timebase] identifier[oldRate] , Keyword[boolean] identifier[failOnPrecisionLoss] operator[SEP] Keyword[throws] identifier[ResamplingException] { Keyword[final] Keyword[double] identifier[resampled] operator[=] identifier[resample] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[samples] , identifier[oldRate] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[rounded] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[resampled] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resampled] operator[!=] identifier[rounded] operator[&&] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[rounded] operator[-] identifier[resampled] operator[SEP] operator[>] literal[Float] operator[SEP] { Keyword[if] operator[SEP] identifier[failOnPrecisionLoss] operator[SEP] { Keyword[throw] Keyword[new] identifier[ResamplingException] operator[SEP] literal[String] operator[+] identifier[samples] operator[+] literal[String] operator[+] identifier[oldRate] operator[+] literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[+] identifier[resampled] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[WARN_ON_PRECISION_LOSS] operator[SEP] identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[samples] operator[+] literal[String] operator[+] identifier[oldRate] operator[+] literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[+] identifier[resampled] operator[+] literal[String] operator[+] identifier[rounded] operator[SEP] operator[SEP] } } Keyword[return] operator[SEP] Keyword[long] operator[SEP] identifier[rounded] operator[SEP] }
public int getIDFromCode(String strCode) { int iID = 0; try { iID = Integer.parseInt(strCode); // Special case - if an integer, just convert it. } catch (NumberFormatException ex) { iID = 0; } if (iID == 0) { int iTargetKeyArea = this.getCodeKeyArea(); // Key 0 cannot be the code key if (iTargetKeyArea != 0) { KeyArea keyArea = this.getKeyArea(iTargetKeyArea); int iOldKeyArea = this.getDefaultOrder(); this.setKeyArea(iTargetKeyArea); BaseField field = keyArea.getField(0); field.setString(strCode); try { if (this.seek(null)) { iID = (int)this.getField(DBConstants.MAIN_FIELD).getValue(); } } catch (DBException ex) { ex.printStackTrace(); } finally { this.setKeyArea(iOldKeyArea); } } } return iID; }
class class_name[name] begin[{] method[getIDFromCode, return_type[type[int]], modifier[public], parameter[strCode]] begin[{] local_variable[type[int], iID] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=strCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.iID], ==, literal[0]]] begin[{] local_variable[type[int], iTargetKeyArea] if[binary_operation[member[.iTargetKeyArea], !=, literal[0]]] begin[{] local_variable[type[KeyArea], keyArea] local_variable[type[int], iOldKeyArea] THIS[call[None.setKeyArea, parameter[member[.iTargetKeyArea]]]] local_variable[type[BaseField], field] call[field.setString, parameter[member[.strCode]]] TryStatement(block=[IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=seek, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=MAIN_FIELD, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[])], member=getField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=BasicType(dimensions=[], name=int))), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['DBException']))], finally_block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=iOldKeyArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setKeyArea, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] return[member[.iID]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getIDFromCode] operator[SEP] identifier[String] identifier[strCode] operator[SEP] { Keyword[int] identifier[iID] operator[=] Other[0] operator[SEP] Keyword[try] { identifier[iID] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[strCode] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[ex] operator[SEP] { identifier[iID] operator[=] Other[0] operator[SEP] } Keyword[if] operator[SEP] identifier[iID] operator[==] Other[0] operator[SEP] { Keyword[int] identifier[iTargetKeyArea] operator[=] Keyword[this] operator[SEP] identifier[getCodeKeyArea] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iTargetKeyArea] operator[!=] Other[0] operator[SEP] { identifier[KeyArea] identifier[keyArea] operator[=] Keyword[this] operator[SEP] identifier[getKeyArea] operator[SEP] identifier[iTargetKeyArea] operator[SEP] operator[SEP] Keyword[int] identifier[iOldKeyArea] operator[=] Keyword[this] operator[SEP] identifier[getDefaultOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[iTargetKeyArea] operator[SEP] operator[SEP] identifier[BaseField] identifier[field] operator[=] identifier[keyArea] operator[SEP] identifier[getField] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setString] operator[SEP] identifier[strCode] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[seek] operator[SEP] Other[null] operator[SEP] operator[SEP] { identifier[iID] operator[=] operator[SEP] Keyword[int] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[DBConstants] operator[SEP] identifier[MAIN_FIELD] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[DBException] identifier[ex] operator[SEP] { identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[this] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[iOldKeyArea] operator[SEP] operator[SEP] } } } Keyword[return] identifier[iID] operator[SEP] }
@Override public void set(T value) { if (scope == null) { throw new IllegalStateException("Value can not be set, instance has no Scope defined: " + value); } manager.bindAndFire(scope, type, value); }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[value]] begin[{] if[binary_operation[member[.scope], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Value can not be set, instance has no Scope defined: "), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] call[manager.bindAndFire, parameter[member[.scope], member[.type], member[.value]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[T] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[scope] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP] } identifier[manager] operator[SEP] identifier[bindAndFire] operator[SEP] identifier[scope] , identifier[type] , identifier[value] operator[SEP] operator[SEP] }
public List<T> toList() { final List<T> results = new ArrayList<T>(); try { while (wrapped.hasNext()) { results.add(next()); } } finally { wrapped.close(); } return results; }
class class_name[name] begin[{] method[toList, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], results] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=wrapped, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=wrapped, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[member[.results]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[T] operator[>] identifier[toList] operator[SEP] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[T] operator[>] identifier[results] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] identifier[wrapped] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[wrapped] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[results] operator[SEP] }
public AwsSecurityFindingFilters withProcessParentPid(NumberFilter... processParentPid) { if (this.processParentPid == null) { setProcessParentPid(new java.util.ArrayList<NumberFilter>(processParentPid.length)); } for (NumberFilter ele : processParentPid) { this.processParentPid.add(ele); } return this; }
class class_name[name] begin[{] method[withProcessParentPid, return_type[type[AwsSecurityFindingFilters]], modifier[public], parameter[processParentPid]] begin[{] if[binary_operation[THIS[member[None.processParentPid]], ==, literal[null]]] begin[{] call[.setProcessParentPid, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=processParentPid, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NumberFilter, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=processParentPid, 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=processParentPid, 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=NumberFilter, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[AwsSecurityFindingFilters] identifier[withProcessParentPid] operator[SEP] identifier[NumberFilter] operator[...] identifier[processParentPid] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[processParentPid] operator[==] Other[null] operator[SEP] { identifier[setProcessParentPid] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[NumberFilter] operator[>] operator[SEP] identifier[processParentPid] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[NumberFilter] identifier[ele] operator[:] identifier[processParentPid] operator[SEP] { Keyword[this] operator[SEP] identifier[processParentPid] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private Node getPreviousSibling(Node node) { if (node == null || node == root) return null; Node newNode = node.getPreviousSibling(); if (newNode == null) { newNode = node.getParentNode(); if (newNode == null || node == root) return null; int parentAccept = acceptNode(newNode); if (parentAccept == NodeFilter.FILTER_SKIP) return getPreviousSibling(newNode); return null; } int accept = acceptNode(newNode); if (accept == NodeFilter.FILTER_ACCEPT) return newNode; else if (accept == NodeFilter.FILTER_SKIP) { Node fChild = getLastChild(newNode); if (fChild == null) return getPreviousSibling(newNode); return fChild; } else // if (accept == NodeFilter.REJECT_NODE) return getPreviousSibling(newNode); }
class class_name[name] begin[{] method[getPreviousSibling, return_type[type[Node]], modifier[private], parameter[node]] begin[{] if[binary_operation[binary_operation[member[.node], ==, literal[null]], ||, binary_operation[member[.node], ==, member[.root]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Node], newNode] if[binary_operation[member[.newNode], ==, literal[null]]] begin[{] assign[member[.newNode], call[node.getParentNode, parameter[]]] if[binary_operation[binary_operation[member[.newNode], ==, literal[null]], ||, binary_operation[member[.node], ==, member[.root]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], parentAccept] if[binary_operation[member[.parentAccept], ==, member[NodeFilter.FILTER_SKIP]]] begin[{] return[call[.getPreviousSibling, parameter[member[.newNode]]]] else begin[{] None end[}] return[literal[null]] else begin[{] None end[}] local_variable[type[int], accept] if[binary_operation[member[.accept], ==, member[NodeFilter.FILTER_ACCEPT]]] begin[{] return[member[.newNode]] else begin[{] if[binary_operation[member[.accept], ==, member[NodeFilter.FILTER_SKIP]]] begin[{] local_variable[type[Node], fChild] if[binary_operation[member[.fChild], ==, literal[null]]] begin[{] return[call[.getPreviousSibling, parameter[member[.newNode]]]] else begin[{] None end[}] return[member[.fChild]] else begin[{] return[call[.getPreviousSibling, parameter[member[.newNode]]]] end[}] end[}] end[}] END[}]
Keyword[private] identifier[Node] identifier[getPreviousSibling] operator[SEP] identifier[Node] identifier[node] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[||] identifier[node] operator[==] identifier[root] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[Node] identifier[newNode] operator[=] identifier[node] operator[SEP] identifier[getPreviousSibling] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newNode] operator[==] Other[null] operator[SEP] { identifier[newNode] operator[=] identifier[node] operator[SEP] identifier[getParentNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newNode] operator[==] Other[null] operator[||] identifier[node] operator[==] identifier[root] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[int] identifier[parentAccept] operator[=] identifier[acceptNode] operator[SEP] identifier[newNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parentAccept] operator[==] identifier[NodeFilter] operator[SEP] identifier[FILTER_SKIP] operator[SEP] Keyword[return] identifier[getPreviousSibling] operator[SEP] identifier[newNode] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[accept] operator[=] identifier[acceptNode] operator[SEP] identifier[newNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[accept] operator[==] identifier[NodeFilter] operator[SEP] identifier[FILTER_ACCEPT] operator[SEP] Keyword[return] identifier[newNode] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[accept] operator[==] identifier[NodeFilter] operator[SEP] identifier[FILTER_SKIP] operator[SEP] { identifier[Node] identifier[fChild] operator[=] identifier[getLastChild] operator[SEP] identifier[newNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fChild] operator[==] Other[null] operator[SEP] Keyword[return] identifier[getPreviousSibling] operator[SEP] identifier[newNode] operator[SEP] operator[SEP] Keyword[return] identifier[fChild] operator[SEP] } Keyword[else] Keyword[return] identifier[getPreviousSibling] operator[SEP] identifier[newNode] operator[SEP] operator[SEP] }
private Object internal_call(String method, String actual_objectId, int flags, boolean checkMethodName, Object... parameters) throws PickleException, PyroException, IOException { if(actual_objectId==null) actual_objectId=this.objectid; synchronized (this) { connect(); sequenceNr=(sequenceNr+1)&0xffff; // stay within an unsigned short 0-65535 } if(pyroAttrs.contains(method)) { throw new PyroException("cannot call an attribute"); } if(pyroOneway.contains(method)) { flags |= Message.FLAGS_ONEWAY; } if(checkMethodName && Config.METADATA && !pyroMethods.contains(method)) { throw new PyroException(String.format("remote object '%s' has no exposed attribute or method '%s'", actual_objectId, method)); } if (parameters == null) parameters = new Object[] {}; PyroSerializer ser = PyroSerializer.getFor(Config.SERIALIZER); byte[] pickle = ser.serializeCall(actual_objectId, method, parameters, Collections.emptyMap()); Message msg = new Message(Message.MSG_INVOKE, pickle, ser.getSerializerId(), flags, sequenceNr, annotations(), pyroHmacKey); Message resultmsg; synchronized (this.sock) { IOUtil.send(sock_out, msg.to_bytes()); if(Config.MSG_TRACE_DIR!=null) { Message.TraceMessageSend(sequenceNr, msg.get_header_bytes(), msg.get_annotations_bytes(), msg.data); } pickle = null; if ((flags & Message.FLAGS_ONEWAY) != 0) return null; resultmsg = Message.recv(sock_in, new int[]{Message.MSG_RESULT}, pyroHmacKey); } if (resultmsg.seq != sequenceNr) { throw new PyroException("result msg out of sync"); } responseAnnotations(resultmsg.annotations, resultmsg.type); if ((resultmsg.flags & Message.FLAGS_COMPRESSED) != 0) { _decompressMessageData(resultmsg); } if ((resultmsg.flags & Message.FLAGS_ITEMSTREAMRESULT) != 0) { byte[] streamId = resultmsg.annotations.get("STRM"); if(streamId==null) throw new PyroException("result of call is an iterator, but the server is not configured to allow streaming"); return new PyroProxy.StreamResultIterable(new String(streamId), this); } if ((resultmsg.flags & Message.FLAGS_EXCEPTION) != 0) { Throwable rx = (Throwable) ser.deserializeData(resultmsg.data); if (rx instanceof PyroException) { throw (PyroException) rx; } else { PyroException px; // if the source was a PythonException, copy its message and python exception type if(rx instanceof PythonException) { PythonException rxp = (PythonException)rx; px = new PyroException(rxp.getMessage(), rxp); px.pythonExceptionType = rxp.pythonExceptionType; } else { px = new PyroException(null, rx); } try { Field remotetbField = rx.getClass().getDeclaredField("_pyroTraceback"); String remotetb = (String) remotetbField.get(rx); px._pyroTraceback = remotetb; } catch (Exception e) { // exception didn't provide a pyro remote traceback } throw px; } } return ser.deserializeData(resultmsg.data); }
class class_name[name] begin[{] method[internal_call, return_type[type[Object]], modifier[private], parameter[method, actual_objectId, flags, checkMethodName, parameters]] begin[{] if[binary_operation[member[.actual_objectId], ==, literal[null]]] begin[{] assign[member[.actual_objectId], THIS[member[None.objectid]]] else begin[{] None end[}] SYNCHRONIZED[THIS[]] BEGIN[{] call[.connect, parameter[]] assign[member[.sequenceNr], binary_operation[binary_operation[member[.sequenceNr], +, literal[1]], &, literal[0xffff]]] END[}] if[call[pyroAttrs.contains, parameter[member[.method]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot call an attribute")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PyroException, sub_type=None)), label=None) else begin[{] None end[}] if[call[pyroOneway.contains, parameter[member[.method]]]] begin[{] assign[member[.flags], member[Message.FLAGS_ONEWAY]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.checkMethodName], &&, member[Config.METADATA]], &&, call[pyroMethods.contains, parameter[member[.method]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="remote object '%s' has no exposed attribute or method '%s'"), MemberReference(member=actual_objectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, 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=PyroException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.parameters], ==, literal[null]]] begin[{] assign[member[.parameters], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), 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[PyroSerializer], ser] local_variable[type[byte], pickle] local_variable[type[Message], msg] local_variable[type[Message], resultmsg] SYNCHRONIZED[THIS[member[None.sock]]] BEGIN[{] call[IOUtil.send, parameter[member[.sock_out], call[msg.to_bytes, parameter[]]]] if[binary_operation[member[Config.MSG_TRACE_DIR], !=, literal[null]]] begin[{] call[Message.TraceMessageSend, parameter[member[.sequenceNr], call[msg.get_header_bytes, parameter[]], call[msg.get_annotations_bytes, parameter[]], member[msg.data]]] else begin[{] None end[}] assign[member[.pickle], literal[null]] if[binary_operation[binary_operation[member[.flags], &, member[Message.FLAGS_ONEWAY]], !=, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] assign[member[.resultmsg], call[Message.recv, parameter[member[.sock_in], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=MSG_RESULT, postfix_operators=[], prefix_operators=[], qualifier=Message, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), member[.pyroHmacKey]]]] END[}] if[binary_operation[member[resultmsg.seq], !=, member[.sequenceNr]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="result msg out of sync")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PyroException, sub_type=None)), label=None) else begin[{] None end[}] call[.responseAnnotations, parameter[member[resultmsg.annotations], member[resultmsg.type]]] if[binary_operation[binary_operation[member[resultmsg.flags], &, member[Message.FLAGS_COMPRESSED]], !=, literal[0]]] begin[{] call[._decompressMessageData, parameter[member[.resultmsg]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[resultmsg.flags], &, member[Message.FLAGS_ITEMSTREAMRESULT]], !=, literal[0]]] begin[{] local_variable[type[byte], streamId] if[binary_operation[member[.streamId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="result of call is an iterator, but the server is not configured to allow streaming")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PyroException, sub_type=None)), label=None) else begin[{] None end[}] return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=streamId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PyroProxy, sub_type=ReferenceType(arguments=None, dimensions=None, name=StreamResultIterable, sub_type=None)))] else begin[{] None end[}] if[binary_operation[binary_operation[member[resultmsg.flags], &, member[Message.FLAGS_EXCEPTION]], !=, literal[0]]] begin[{] local_variable[type[Throwable], rx] if[binary_operation[member[.rx], instanceof, type[PyroException]]] begin[{] ThrowStatement(expression=Cast(expression=MemberReference(member=rx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PyroException, sub_type=None)), label=None) else begin[{] local_variable[type[PyroException], px] if[binary_operation[member[.rx], instanceof, type[PythonException]]] begin[{] local_variable[type[PythonException], rxp] assign[member[.px], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=rxp, selectors=[], type_arguments=None), MemberReference(member=rxp, 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=PyroException, sub_type=None))] assign[member[px.pythonExceptionType], member[rxp.pythonExceptionType]] else begin[{] assign[member[.px], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=rx, 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=PyroException, sub_type=None))] end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=rx, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_pyroTraceback")], member=getDeclaredField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=remotetbField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=rx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=remotetbField, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=remotetb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_pyroTraceback, postfix_operators=[], prefix_operators=[], qualifier=px, selectors=[]), type==, value=MemberReference(member=remotetb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) ThrowStatement(expression=MemberReference(member=px, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] else begin[{] None end[}] return[call[ser.deserializeData, parameter[member[resultmsg.data]]]] end[}] END[}]
Keyword[private] identifier[Object] identifier[internal_call] operator[SEP] identifier[String] identifier[method] , identifier[String] identifier[actual_objectId] , Keyword[int] identifier[flags] , Keyword[boolean] identifier[checkMethodName] , identifier[Object] operator[...] identifier[parameters] operator[SEP] Keyword[throws] identifier[PickleException] , identifier[PyroException] , identifier[IOException] { Keyword[if] operator[SEP] identifier[actual_objectId] operator[==] Other[null] operator[SEP] identifier[actual_objectId] operator[=] Keyword[this] operator[SEP] identifier[objectid] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[connect] operator[SEP] operator[SEP] operator[SEP] identifier[sequenceNr] operator[=] operator[SEP] identifier[sequenceNr] operator[+] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] } Keyword[if] operator[SEP] identifier[pyroAttrs] operator[SEP] identifier[contains] operator[SEP] identifier[method] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[PyroException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[pyroOneway] operator[SEP] identifier[contains] operator[SEP] identifier[method] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[Message] operator[SEP] identifier[FLAGS_ONEWAY] operator[SEP] } Keyword[if] operator[SEP] identifier[checkMethodName] operator[&&] identifier[Config] operator[SEP] identifier[METADATA] operator[&&] operator[!] identifier[pyroMethods] operator[SEP] identifier[contains] operator[SEP] identifier[method] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[PyroException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[actual_objectId] , identifier[method] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] identifier[parameters] operator[=] Keyword[new] identifier[Object] operator[SEP] operator[SEP] { } operator[SEP] identifier[PyroSerializer] identifier[ser] operator[=] identifier[PyroSerializer] operator[SEP] identifier[getFor] operator[SEP] identifier[Config] operator[SEP] identifier[SERIALIZER] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[pickle] operator[=] identifier[ser] operator[SEP] identifier[serializeCall] operator[SEP] identifier[actual_objectId] , identifier[method] , identifier[parameters] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Message] identifier[msg] operator[=] Keyword[new] identifier[Message] operator[SEP] identifier[Message] operator[SEP] identifier[MSG_INVOKE] , identifier[pickle] , identifier[ser] operator[SEP] identifier[getSerializerId] operator[SEP] operator[SEP] , identifier[flags] , identifier[sequenceNr] , identifier[annotations] operator[SEP] operator[SEP] , identifier[pyroHmacKey] operator[SEP] operator[SEP] identifier[Message] identifier[resultmsg] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[sock] operator[SEP] { identifier[IOUtil] operator[SEP] identifier[send] operator[SEP] identifier[sock_out] , identifier[msg] operator[SEP] identifier[to_bytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Config] operator[SEP] identifier[MSG_TRACE_DIR] operator[!=] Other[null] operator[SEP] { identifier[Message] operator[SEP] identifier[TraceMessageSend] operator[SEP] identifier[sequenceNr] , identifier[msg] operator[SEP] identifier[get_header_bytes] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] identifier[get_annotations_bytes] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] identifier[data] operator[SEP] operator[SEP] } identifier[pickle] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[Message] operator[SEP] identifier[FLAGS_ONEWAY] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[resultmsg] operator[=] identifier[Message] operator[SEP] identifier[recv] operator[SEP] identifier[sock_in] , Keyword[new] Keyword[int] operator[SEP] operator[SEP] { identifier[Message] operator[SEP] identifier[MSG_RESULT] } , identifier[pyroHmacKey] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resultmsg] operator[SEP] identifier[seq] operator[!=] identifier[sequenceNr] operator[SEP] { Keyword[throw] Keyword[new] identifier[PyroException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[responseAnnotations] operator[SEP] identifier[resultmsg] operator[SEP] identifier[annotations] , identifier[resultmsg] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[resultmsg] operator[SEP] identifier[flags] operator[&] identifier[Message] operator[SEP] identifier[FLAGS_COMPRESSED] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[_decompressMessageData] operator[SEP] identifier[resultmsg] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[resultmsg] operator[SEP] identifier[flags] operator[&] identifier[Message] operator[SEP] identifier[FLAGS_ITEMSTREAMRESULT] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[streamId] operator[=] identifier[resultmsg] operator[SEP] identifier[annotations] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[streamId] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[PyroException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[PyroProxy] operator[SEP] identifier[StreamResultIterable] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[streamId] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[resultmsg] operator[SEP] identifier[flags] operator[&] identifier[Message] operator[SEP] identifier[FLAGS_EXCEPTION] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[Throwable] identifier[rx] operator[=] operator[SEP] identifier[Throwable] operator[SEP] identifier[ser] operator[SEP] identifier[deserializeData] operator[SEP] identifier[resultmsg] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rx] Keyword[instanceof] identifier[PyroException] operator[SEP] { Keyword[throw] operator[SEP] identifier[PyroException] operator[SEP] identifier[rx] operator[SEP] } Keyword[else] { identifier[PyroException] identifier[px] operator[SEP] Keyword[if] operator[SEP] identifier[rx] Keyword[instanceof] identifier[PythonException] operator[SEP] { identifier[PythonException] identifier[rxp] operator[=] operator[SEP] identifier[PythonException] operator[SEP] identifier[rx] operator[SEP] identifier[px] operator[=] Keyword[new] identifier[PyroException] operator[SEP] identifier[rxp] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[rxp] operator[SEP] operator[SEP] identifier[px] operator[SEP] identifier[pythonExceptionType] operator[=] identifier[rxp] operator[SEP] identifier[pythonExceptionType] operator[SEP] } Keyword[else] { identifier[px] operator[=] Keyword[new] identifier[PyroException] operator[SEP] Other[null] , identifier[rx] operator[SEP] operator[SEP] } Keyword[try] { identifier[Field] identifier[remotetbField] operator[=] identifier[rx] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredField] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[remotetb] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[remotetbField] operator[SEP] identifier[get] operator[SEP] identifier[rx] operator[SEP] operator[SEP] identifier[px] operator[SEP] identifier[_pyroTraceback] operator[=] identifier[remotetb] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } Keyword[throw] identifier[px] operator[SEP] } } Keyword[return] identifier[ser] operator[SEP] identifier[deserializeData] operator[SEP] identifier[resultmsg] operator[SEP] identifier[data] operator[SEP] operator[SEP] }
public static com.liferay.commerce.model.CommerceAvailabilityEstimate deleteCommerceAvailabilityEstimate( com.liferay.commerce.model.CommerceAvailabilityEstimate commerceAvailabilityEstimate) throws com.liferay.portal.kernel.exception.PortalException { return getService() .deleteCommerceAvailabilityEstimate(commerceAvailabilityEstimate); }
class class_name[name] begin[{] method[deleteCommerceAvailabilityEstimate, return_type[type[com]], modifier[public static], parameter[commerceAvailabilityEstimate]] begin[{] return[call[.getService, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[model] operator[SEP] identifier[CommerceAvailabilityEstimate] identifier[deleteCommerceAvailabilityEstimate] operator[SEP] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[model] operator[SEP] identifier[CommerceAvailabilityEstimate] identifier[commerceAvailabilityEstimate] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[portal] operator[SEP] identifier[kernel] operator[SEP] identifier[exception] operator[SEP] identifier[PortalException] { Keyword[return] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[deleteCommerceAvailabilityEstimate] operator[SEP] identifier[commerceAvailabilityEstimate] operator[SEP] operator[SEP] }
public void setValidator(MethodBinding validatorBinding) { Validator[] curValidators = getValidators(); // see if we need to null-out, or replace an existing validator if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // if we want to remove the validatorBinding if (null == validatorBinding) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators // list. if (MethodBindingValidator.class == curValidators[i].getClass()) { removeValidator(curValidators[i]); return; } } // if we want to replace the validatorBinding else //noinspection ObjectEquality if (validatorBinding == curValidators[i]) { removeValidator(curValidators[i]); break; } } } addValidator(new MethodBindingValidator(validatorBinding)); }
class class_name[name] begin[{] method[setValidator, return_type[void], modifier[public], parameter[validatorBinding]] begin[{] local_variable[type[Validator], curValidators] if[binary_operation[literal[null], !=, member[.curValidators]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=validatorBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=validatorBinding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=curValidators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=curValidators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=removeValidator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodBindingValidator, sub_type=None)), operandr=MemberReference(member=curValidators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=curValidators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=removeValidator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=curValidators, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] call[.addValidator, parameter[ClassCreator(arguments=[MemberReference(member=validatorBinding, 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=MethodBindingValidator, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setValidator] operator[SEP] identifier[MethodBinding] identifier[validatorBinding] operator[SEP] { identifier[Validator] operator[SEP] operator[SEP] identifier[curValidators] operator[=] identifier[getValidators] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[curValidators] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[curValidators] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[validatorBinding] operator[SEP] { Keyword[if] operator[SEP] identifier[MethodBindingValidator] operator[SEP] Keyword[class] operator[==] identifier[curValidators] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] { identifier[removeValidator] operator[SEP] identifier[curValidators] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[validatorBinding] operator[==] identifier[curValidators] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[removeValidator] operator[SEP] identifier[curValidators] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } } identifier[addValidator] operator[SEP] Keyword[new] identifier[MethodBindingValidator] operator[SEP] identifier[validatorBinding] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(GetTelemetryMetadataRequest getTelemetryMetadataRequest, ProtocolMarshaller protocolMarshaller) { if (getTelemetryMetadataRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getTelemetryMetadataRequest.getAssessmentRunArn(), ASSESSMENTRUNARN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[getTelemetryMetadataRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.getTelemetryMetadataRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAssessmentRunArn, postfix_operators=[], prefix_operators=[], qualifier=getTelemetryMetadataRequest, selectors=[], type_arguments=None), MemberReference(member=ASSESSMENTRUNARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[GetTelemetryMetadataRequest] identifier[getTelemetryMetadataRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[getTelemetryMetadataRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getTelemetryMetadataRequest] operator[SEP] identifier[getAssessmentRunArn] operator[SEP] operator[SEP] , identifier[ASSESSMENTRUNARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void play(int position) { checkState(); ArrayList<SoundCloudTrack> tracks = mPlayerPlaylist.getPlaylist().getTracks(); if (position >= 0 && position < tracks.size()) { SoundCloudTrack trackToPlay = tracks.get(position); mPlayerPlaylist.setPlayingTrack(position); PlaybackService.play(getContext(), mClientKey, trackToPlay); } }
class class_name[name] begin[{] method[play, return_type[void], modifier[public], parameter[position]] begin[{] call[.checkState, parameter[]] local_variable[type[ArrayList], tracks] if[binary_operation[binary_operation[member[.position], >=, literal[0]], &&, binary_operation[member[.position], <, call[tracks.size, parameter[]]]]] begin[{] local_variable[type[SoundCloudTrack], trackToPlay] call[mPlayerPlaylist.setPlayingTrack, parameter[member[.position]]] call[PlaybackService.play, parameter[call[.getContext, parameter[]], member[.mClientKey], member[.trackToPlay]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[play] operator[SEP] Keyword[int] identifier[position] operator[SEP] { identifier[checkState] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[SoundCloudTrack] operator[>] identifier[tracks] operator[=] identifier[mPlayerPlaylist] operator[SEP] identifier[getPlaylist] operator[SEP] operator[SEP] operator[SEP] identifier[getTracks] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[position] operator[>=] Other[0] operator[&&] identifier[position] operator[<] identifier[tracks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[SoundCloudTrack] identifier[trackToPlay] operator[=] identifier[tracks] operator[SEP] identifier[get] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[mPlayerPlaylist] operator[SEP] identifier[setPlayingTrack] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[PlaybackService] operator[SEP] identifier[play] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[mClientKey] , identifier[trackToPlay] operator[SEP] operator[SEP] } }
@Nullable public static Imp impWithId(BidRequest request, String id) { checkNotNull(id); for (Imp imp : request.getImpList()) { if (imp.getId().equals(id)) { return imp; } } return null; }
class class_name[name] begin[{] method[impWithId, return_type[type[Imp]], modifier[public static], parameter[request, id]] begin[{] call[.checkNotNull, parameter[member[.id]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=imp, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=imp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getImpList, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=imp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Imp, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[Imp] identifier[impWithId] operator[SEP] identifier[BidRequest] identifier[request] , identifier[String] identifier[id] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Imp] identifier[imp] operator[:] identifier[request] operator[SEP] identifier[getImpList] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[imp] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[id] operator[SEP] operator[SEP] { Keyword[return] identifier[imp] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public void writeProperty(String resourceName, String propertyName, String value) throws CmsException { m_cms.lockResource(resourceName); m_cms.writePropertyObject(resourceName, new CmsProperty(propertyName, value, null)); }
class class_name[name] begin[{] method[writeProperty, return_type[void], modifier[public], parameter[resourceName, propertyName, value]] begin[{] call[m_cms.lockResource, parameter[member[.resourceName]]] call[m_cms.writePropertyObject, parameter[member[.resourceName], ClassCreator(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsProperty, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[writeProperty] operator[SEP] identifier[String] identifier[resourceName] , identifier[String] identifier[propertyName] , identifier[String] identifier[value] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[m_cms] operator[SEP] identifier[lockResource] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] identifier[m_cms] operator[SEP] identifier[writePropertyObject] operator[SEP] identifier[resourceName] , Keyword[new] identifier[CmsProperty] operator[SEP] identifier[propertyName] , identifier[value] , Other[null] operator[SEP] operator[SEP] operator[SEP] }
public TopLevelClause newBoolFunctionClause(String functionName, List children) throws DAP2ServerSideException, NoSuchFunctionException { BoolFunction function = functionLibrary.getBoolFunction(functionName); if (function == null) { if (functionLibrary.getBTFunction(functionName) != null) { throw new NoSuchFunctionException ("The function " + functionName + "() does not return a " + "boolean value, and must be used in a comparison or " + "as an argument to another function."); } else { throw new NoSuchFunctionException ("This server does not support a " + functionName + "() function"); } } return new BoolFunctionClause(function, children); }
class class_name[name] begin[{] method[newBoolFunctionClause, return_type[type[TopLevelClause]], modifier[public], parameter[functionName, children]] begin[{] local_variable[type[BoolFunction], function] if[binary_operation[member[.function], ==, literal[null]]] begin[{] if[binary_operation[call[functionLibrary.getBTFunction, parameter[member[.functionName]]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The function "), operandr=MemberReference(member=functionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="() does not return a "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="boolean value, and must be used in a comparison or "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="as an argument to another function."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchFunctionException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This server does not support a "), operandr=MemberReference(member=functionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="() function"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchFunctionException, sub_type=None)), label=None) end[}] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=children, 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=BoolFunctionClause, sub_type=None))] end[}] END[}]
Keyword[public] identifier[TopLevelClause] identifier[newBoolFunctionClause] operator[SEP] identifier[String] identifier[functionName] , identifier[List] identifier[children] operator[SEP] Keyword[throws] identifier[DAP2ServerSideException] , identifier[NoSuchFunctionException] { identifier[BoolFunction] identifier[function] operator[=] identifier[functionLibrary] operator[SEP] identifier[getBoolFunction] operator[SEP] identifier[functionName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[function] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[functionLibrary] operator[SEP] identifier[getBTFunction] operator[SEP] identifier[functionName] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NoSuchFunctionException] operator[SEP] literal[String] operator[+] identifier[functionName] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[NoSuchFunctionException] operator[SEP] literal[String] operator[+] identifier[functionName] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[BoolFunctionClause] operator[SEP] identifier[function] , identifier[children] operator[SEP] operator[SEP] }
@Override public Pattern constructPattern() { Pattern p = new Pattern(SmallMoleculeReference.class, "SMR"); p.add(new Size( new PathConstraint("SmallMoleculeReference/entityReferenceOf/participantOf:Conversion"), 50, Size.Type.GREATER_OR_EQUAL), "SMR"); return p; }
class class_name[name] begin[{] method[constructPattern, return_type[type[Pattern]], modifier[public], parameter[]] begin[{] local_variable[type[Pattern], p] call[p.add, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SmallMoleculeReference/entityReferenceOf/participantOf:Conversion")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PathConstraint, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=50), MemberReference(member=GREATER_OR_EQUAL, postfix_operators=[], prefix_operators=[], qualifier=Size.Type, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Size, sub_type=None)), literal["SMR"]]] return[member[.p]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Pattern] identifier[constructPattern] operator[SEP] operator[SEP] { identifier[Pattern] identifier[p] operator[=] Keyword[new] identifier[Pattern] operator[SEP] identifier[SmallMoleculeReference] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Size] operator[SEP] Keyword[new] identifier[PathConstraint] operator[SEP] literal[String] operator[SEP] , Other[50] , identifier[Size] operator[SEP] identifier[Type] operator[SEP] identifier[GREATER_OR_EQUAL] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[p] operator[SEP] }
private InternalRequest createRequest(AbstractBceRequest bceRequest, HttpMethodName httpMethod, String... pathVariables) { List<String> path = new ArrayList<String>(); path.add(VERSION); if (pathVariables != null) { for (String pathVariable : pathVariables) { path.add(pathVariable); } } URI uri = HttpUtils.appendUri(this.getEndpoint(), path.toArray(new String[path.size()])); InternalRequest request = new InternalRequest(httpMethod, uri); request.setCredentials(bceRequest.getRequestCredentials()); return request; }
class class_name[name] begin[{] method[createRequest, return_type[type[InternalRequest]], modifier[private], parameter[bceRequest, httpMethod, pathVariables]] begin[{] local_variable[type[List], path] call[path.add, parameter[member[.VERSION]]] if[binary_operation[member[.pathVariables], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pathVariable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pathVariables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pathVariable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[URI], uri] local_variable[type[InternalRequest], request] call[request.setCredentials, parameter[call[bceRequest.getRequestCredentials, parameter[]]]] return[member[.request]] end[}] END[}]
Keyword[private] identifier[InternalRequest] identifier[createRequest] operator[SEP] identifier[AbstractBceRequest] identifier[bceRequest] , identifier[HttpMethodName] identifier[httpMethod] , identifier[String] operator[...] identifier[pathVariables] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[path] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[add] operator[SEP] identifier[VERSION] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pathVariables] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[pathVariable] operator[:] identifier[pathVariables] operator[SEP] { identifier[path] operator[SEP] identifier[add] operator[SEP] identifier[pathVariable] operator[SEP] operator[SEP] } } identifier[URI] identifier[uri] operator[=] identifier[HttpUtils] operator[SEP] identifier[appendUri] operator[SEP] Keyword[this] operator[SEP] identifier[getEndpoint] operator[SEP] operator[SEP] , identifier[path] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[InternalRequest] identifier[request] operator[=] Keyword[new] identifier[InternalRequest] operator[SEP] identifier[httpMethod] , identifier[uri] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setCredentials] operator[SEP] identifier[bceRequest] operator[SEP] identifier[getRequestCredentials] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[request] operator[SEP] }
public void setIconPitchAlignment(@Property.ICON_PITCH_ALIGNMENT String value) { PropertyValue propertyValue = iconPitchAlignment(value); constantPropertyUsageMap.put(PROPERTY_ICON_PITCH_ALIGNMENT, propertyValue); layer.setProperties(propertyValue); }
class class_name[name] begin[{] method[setIconPitchAlignment, return_type[void], modifier[public], parameter[value]] begin[{] local_variable[type[PropertyValue], propertyValue] call[constantPropertyUsageMap.put, parameter[member[.PROPERTY_ICON_PITCH_ALIGNMENT], member[.propertyValue]]] call[layer.setProperties, parameter[member[.propertyValue]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIconPitchAlignment] operator[SEP] annotation[@] identifier[Property] operator[SEP] identifier[ICON_PITCH_ALIGNMENT] identifier[String] identifier[value] operator[SEP] { identifier[PropertyValue] identifier[propertyValue] operator[=] identifier[iconPitchAlignment] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[constantPropertyUsageMap] operator[SEP] identifier[put] operator[SEP] identifier[PROPERTY_ICON_PITCH_ALIGNMENT] , identifier[propertyValue] operator[SEP] operator[SEP] identifier[layer] operator[SEP] identifier[setProperties] operator[SEP] identifier[propertyValue] operator[SEP] operator[SEP] }
public static void hasSize(Collection<?> input, int length, String message) { notNull(input, message); if (input.size() != length) { throw new IllegalArgumentException(message); } }
class class_name[name] begin[{] method[hasSize, return_type[void], modifier[public static], parameter[input, length, message]] begin[{] call[.notNull, parameter[member[.input], member[.message]]] if[binary_operation[call[input.size, parameter[]], !=, member[.length]]] 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=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[hasSize] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] identifier[input] , Keyword[int] identifier[length] , identifier[String] identifier[message] operator[SEP] { identifier[notNull] operator[SEP] identifier[input] , identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[length] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[message] operator[SEP] operator[SEP] } }
public static <T> com.google.common.base.Optional<T> toGuavaOptional(final Optional<T> optional) { return com.google.common.base.Optional.fromNullable(optional.orElse(null)); }
class class_name[name] begin[{] method[toGuavaOptional, return_type[type[com]], modifier[public static], parameter[optional]] begin[{] return[call[com.google.common.base.Optional.fromNullable, parameter[call[optional.orElse, parameter[literal[null]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[common] operator[SEP] identifier[base] operator[SEP] identifier[Optional] operator[<] identifier[T] operator[>] identifier[toGuavaOptional] operator[SEP] Keyword[final] identifier[Optional] operator[<] identifier[T] operator[>] identifier[optional] operator[SEP] { Keyword[return] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[common] operator[SEP] identifier[base] operator[SEP] identifier[Optional] operator[SEP] identifier[fromNullable] operator[SEP] identifier[optional] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "", name = "dewpointTemperature", scope = LocationType.class) public JAXBElement<Temperature> createLocationTypeDewpointTemperature(Temperature value) { return new JAXBElement<Temperature>(_LocationTypeDewpointTemperature_QNAME, Temperature.class, LocationType.class, value); }
class class_name[name] begin[{] method[createLocationTypeDewpointTemperature, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_LocationTypeDewpointTemperature_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Temperature, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocationType, sub_type=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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Temperature, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[LocationType] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[Temperature] operator[>] identifier[createLocationTypeDewpointTemperature] operator[SEP] identifier[Temperature] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[Temperature] operator[>] operator[SEP] identifier[_LocationTypeDewpointTemperature_QNAME] , identifier[Temperature] operator[SEP] Keyword[class] , identifier[LocationType] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP] }