code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public TimeSlot insertSlotAtEnd(long newSlotTimeout) { // this routine assumes that list could be empty TimeSlot retSlot = new TimeSlot(newSlotTimeout); if (this.lastSlot == null) { // list was empty this.lastSlot = retSlot; this.firstSlot = retSlot; } else { retSlot.prevEntry = this.lastSlot; this.lastSlot.nextEntry = retSlot; this.lastSlot = retSlot; } return retSlot; }
class class_name[name] begin[{] method[insertSlotAtEnd, return_type[type[TimeSlot]], modifier[public], parameter[newSlotTimeout]] begin[{] local_variable[type[TimeSlot], retSlot] if[binary_operation[THIS[member[None.lastSlot]], ==, literal[null]]] begin[{] assign[THIS[member[None.lastSlot]], member[.retSlot]] assign[THIS[member[None.firstSlot]], member[.retSlot]] else begin[{] assign[member[retSlot.prevEntry], THIS[member[None.lastSlot]]] assign[THIS[member[None.lastSlot]member[None.nextEntry]], member[.retSlot]] assign[THIS[member[None.lastSlot]], member[.retSlot]] end[}] return[member[.retSlot]] end[}] END[}]
Keyword[public] identifier[TimeSlot] identifier[insertSlotAtEnd] operator[SEP] Keyword[long] identifier[newSlotTimeout] operator[SEP] { identifier[TimeSlot] identifier[retSlot] operator[=] Keyword[new] identifier[TimeSlot] operator[SEP] identifier[newSlotTimeout] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[lastSlot] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[lastSlot] operator[=] identifier[retSlot] operator[SEP] Keyword[this] operator[SEP] identifier[firstSlot] operator[=] identifier[retSlot] operator[SEP] } Keyword[else] { identifier[retSlot] operator[SEP] identifier[prevEntry] operator[=] Keyword[this] operator[SEP] identifier[lastSlot] operator[SEP] Keyword[this] operator[SEP] identifier[lastSlot] operator[SEP] identifier[nextEntry] operator[=] identifier[retSlot] operator[SEP] Keyword[this] operator[SEP] identifier[lastSlot] operator[=] identifier[retSlot] operator[SEP] } Keyword[return] identifier[retSlot] operator[SEP] }
protected Map<CmsUUID, CmsElementView> loadElementViews() { List<CmsElementView> views = new ArrayList<CmsElementView>(); if (m_cms.existsResource("/")) { views.add(CmsElementView.DEFAULT_ELEMENT_VIEW); try { @SuppressWarnings("deprecation") CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType( m_elementViewType.getTypeId()); List<CmsResource> groups = m_cms.readResources("/", filter); for (CmsResource res : groups) { try { views.add(new CmsElementView(m_cms, res)); } catch (Exception e) { LOG.error(e.getMessage(), e); } } } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } Collections.sort(views, new CmsElementView.ElementViewComparator()); Map<CmsUUID, CmsElementView> elementViews = new LinkedHashMap<CmsUUID, CmsElementView>(); for (CmsElementView view : views) { elementViews.put(view.getId(), view); } return elementViews; } return null; }
class class_name[name] begin[{] method[loadElementViews, return_type[type[Map]], modifier[protected], parameter[]] begin[{] local_variable[type[List], views] if[call[m_cms.existsResource, parameter[literal["/"]]]] begin[{] call[views.add, parameter[member[CmsElementView.DEFAULT_ELEMENT_VIEW]]] TryStatement(block=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="deprecation"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeId, postfix_operators=[], prefix_operators=[], qualifier=m_elementViewType, selectors=[], type_arguments=None)], member=addRequireType, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter.ONLY_VISIBLE_NO_DELETED, selectors=[], type_arguments=None), name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResourceFilter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readResources, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), name=groups)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=res, 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=CmsElementView, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=views, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=res)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=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)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) call[Collections.sort, parameter[member[.views], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsElementView, sub_type=ReferenceType(arguments=None, dimensions=None, name=ElementViewComparator, sub_type=None)))]] local_variable[type[Map], elementViews] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=view, selectors=[], type_arguments=None), MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=elementViews, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=views, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=view)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsElementView, sub_type=None))), label=None) return[member[.elementViews]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[protected] identifier[Map] operator[<] identifier[CmsUUID] , identifier[CmsElementView] operator[>] identifier[loadElementViews] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[CmsElementView] operator[>] identifier[views] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsElementView] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_cms] operator[SEP] identifier[existsResource] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[views] operator[SEP] identifier[add] operator[SEP] identifier[CmsElementView] operator[SEP] identifier[DEFAULT_ELEMENT_VIEW] operator[SEP] operator[SEP] Keyword[try] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[CmsResourceFilter] identifier[filter] operator[=] identifier[CmsResourceFilter] operator[SEP] identifier[ONLY_VISIBLE_NO_DELETED] operator[SEP] identifier[addRequireType] operator[SEP] identifier[m_elementViewType] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[groups] operator[=] identifier[m_cms] operator[SEP] identifier[readResources] operator[SEP] literal[String] , identifier[filter] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsResource] identifier[res] operator[:] identifier[groups] operator[SEP] { Keyword[try] { identifier[views] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsElementView] operator[SEP] identifier[m_cms] , identifier[res] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[CmsException] 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] } identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[views] , Keyword[new] identifier[CmsElementView] operator[SEP] identifier[ElementViewComparator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[CmsUUID] , identifier[CmsElementView] operator[>] identifier[elementViews] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[CmsUUID] , identifier[CmsElementView] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsElementView] identifier[view] operator[:] identifier[views] operator[SEP] { identifier[elementViews] operator[SEP] identifier[put] operator[SEP] identifier[view] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[view] operator[SEP] operator[SEP] } Keyword[return] identifier[elementViews] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public List<org.openprovenance.prov.model.Type> getType() { if (type == null) { type = new ArrayList<org.openprovenance.prov.model.Type>(); } return this.type; }
class class_name[name] begin[{] method[getType, return_type[type[List]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.type], ==, literal[null]]] begin[{] assign[member[.type], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=openprovenance, sub_type=ReferenceType(arguments=None, dimensions=None, name=prov, sub_type=ReferenceType(arguments=None, dimensions=None, name=model, sub_type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None))))))], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] return[THIS[member[None.type]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[org] operator[SEP] identifier[openprovenance] operator[SEP] identifier[prov] operator[SEP] identifier[model] operator[SEP] identifier[Type] operator[>] identifier[getType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { identifier[type] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[org] operator[SEP] identifier[openprovenance] operator[SEP] identifier[prov] operator[SEP] identifier[model] operator[SEP] identifier[Type] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[type] operator[SEP] }
private <T> T orIfIgnoringFieldAbsence( @NullableDecl T input, @NullableDecl T defaultValue, boolean ignoreFieldAbsence) { return (input == null && ignoreFieldAbsence) ? defaultValue : input; }
class class_name[name] begin[{] method[orIfIgnoringFieldAbsence, return_type[type[T]], modifier[private], parameter[input, defaultValue, ignoreFieldAbsence]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MemberReference(member=ignoreFieldAbsence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), if_false=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[private] operator[<] identifier[T] operator[>] identifier[T] identifier[orIfIgnoringFieldAbsence] operator[SEP] annotation[@] identifier[NullableDecl] identifier[T] identifier[input] , annotation[@] identifier[NullableDecl] identifier[T] identifier[defaultValue] , Keyword[boolean] identifier[ignoreFieldAbsence] operator[SEP] { Keyword[return] operator[SEP] identifier[input] operator[==] Other[null] operator[&&] identifier[ignoreFieldAbsence] operator[SEP] operator[?] identifier[defaultValue] operator[:] identifier[input] operator[SEP] }
@SuppressWarnings("unchecked") @Deprecated public <T extends Item> void send(T item) throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException { publish(item); }
class class_name[name] begin[{] method[send, return_type[void], modifier[public], parameter[item]] begin[{] call[.publish, parameter[member[.item]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Deprecated] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Item] operator[>] Keyword[void] identifier[send] operator[SEP] identifier[T] identifier[item] operator[SEP] Keyword[throws] identifier[NotConnectedException] , identifier[InterruptedException] , identifier[NoResponseException] , identifier[XMPPErrorException] { identifier[publish] operator[SEP] identifier[item] operator[SEP] operator[SEP] }
public static List<String> getClasses() { ArrayList<String> names = new ArrayList<String>(); if(_init._h2oJar != null) { for( Enumeration<ZipEntry> e = (Enumeration) _init._h2oJar.entries(); e.hasMoreElements(); ) { String name = e.nextElement().getName(); if( name.endsWith(".class") ) names.add(name); } } else findClasses(new File(CLASSES), names); for( int i = 0; i < names.size(); i++ ) { String n = names.get(i); names.set(i, Utils.className(n)); } return names; }
class class_name[name] begin[{] method[getClasses, return_type[type[List]], modifier[public static], parameter[]] begin[{] local_variable[type[ArrayList], names] if[binary_operation[member[_init._h2oJar], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".class")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Cast(expression=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=_init._h2oJar, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), name=e)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ZipEntry, sub_type=None))], dimensions=[], name=Enumeration, sub_type=None)), update=None), label=None) else begin[{] call[.findClasses, parameter[ClassCreator(arguments=[MemberReference(member=CLASSES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), member[.names]]] 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=get, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=className, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=names, 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=names, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.names]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[getClasses] operator[SEP] operator[SEP] { identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[names] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_init] operator[SEP] identifier[_h2oJar] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Enumeration] operator[<] identifier[ZipEntry] operator[>] identifier[e] operator[=] operator[SEP] identifier[Enumeration] operator[SEP] identifier[_init] operator[SEP] identifier[_h2oJar] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[names] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP] } } Keyword[else] identifier[findClasses] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[CLASSES] operator[SEP] , identifier[names] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[names] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[n] operator[=] identifier[names] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[names] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[Utils] operator[SEP] identifier[className] operator[SEP] identifier[n] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[names] operator[SEP] }
@SuppressWarnings("unchecked") public static void onSaveState(Bundle bundle) { final ArrayList<Style> styleList = new ArrayList(); // Create a list of every Style used by a SuperToast in the queue for (SuperToast superToast : Toaster.getInstance().getQueue()) { if (superToast instanceof SuperActivityToast) { superToast.getStyle().isSuperActivityToast = true; } styleList.add(superToast.getStyle()); } bundle.putParcelableArrayList(BUNDLE_KEY, styleList); // Let's avoid any erratic behavior and cancel any showing/pending SuperActivityToasts manually Toaster.getInstance().cancelAllSuperToasts(); }
class class_name[name] begin[{] method[onSaveState, return_type[void], modifier[public static], parameter[bundle]] begin[{] local_variable[type[ArrayList], styleList] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=superToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SuperActivityToast, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MethodInvocation(arguments=[], member=getStyle, postfix_operators=[], prefix_operators=[], qualifier=superToast, selectors=[MemberReference(member=isSuperActivityToast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStyle, postfix_operators=[], prefix_operators=[], qualifier=superToast, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=styleList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Toaster, selectors=[MethodInvocation(arguments=[], member=getQueue, 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=superToast)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SuperToast, sub_type=None))), label=None) call[bundle.putParcelableArrayList, parameter[member[.BUNDLE_KEY], member[.styleList]]] call[Toaster.getInstance, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[void] identifier[onSaveState] operator[SEP] identifier[Bundle] identifier[bundle] operator[SEP] { Keyword[final] identifier[ArrayList] operator[<] identifier[Style] operator[>] identifier[styleList] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SuperToast] identifier[superToast] operator[:] identifier[Toaster] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getQueue] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[superToast] Keyword[instanceof] identifier[SuperActivityToast] operator[SEP] { identifier[superToast] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[isSuperActivityToast] operator[=] literal[boolean] operator[SEP] } identifier[styleList] operator[SEP] identifier[add] operator[SEP] identifier[superToast] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[bundle] operator[SEP] identifier[putParcelableArrayList] operator[SEP] identifier[BUNDLE_KEY] , identifier[styleList] operator[SEP] operator[SEP] identifier[Toaster] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[cancelAllSuperToasts] operator[SEP] operator[SEP] operator[SEP] }
@Override public void putAll(Map<? extends K, ? extends V> map) { if (isReadyOnly()) throw new UnsupportedOperationException("Can't add properties to read-only dictionary"); this.localMap.putAll(map); }
class class_name[name] begin[{] method[putAll, return_type[void], modifier[public], parameter[map]] begin[{] if[call[.isReadyOnly, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't add properties to read-only dictionary")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] THIS[member[None.localMap]call[None.putAll, parameter[member[.map]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[putAll] operator[SEP] identifier[Map] operator[<] operator[?] Keyword[extends] identifier[K] , operator[?] Keyword[extends] identifier[V] operator[>] identifier[map] operator[SEP] { Keyword[if] operator[SEP] identifier[isReadyOnly] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[localMap] operator[SEP] identifier[putAll] operator[SEP] identifier[map] operator[SEP] operator[SEP] }
private void commit() { try { // Execute any remaining batch inserts and commit the transaction. insertError.executeBatch(); insertInfo.executeBatch(); connection.commit(); } catch (SQLException ex) { throw new StorageException(ex); } }
class class_name[name] begin[{] method[commit, return_type[void], modifier[private], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=executeBatch, postfix_operators=[], prefix_operators=[], qualifier=insertError, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=executeBatch, postfix_operators=[], prefix_operators=[], qualifier=insertInfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[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=StorageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SQLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[commit] operator[SEP] operator[SEP] { Keyword[try] { identifier[insertError] operator[SEP] identifier[executeBatch] operator[SEP] operator[SEP] operator[SEP] identifier[insertInfo] operator[SEP] identifier[executeBatch] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[StorageException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public Dictionary invoke(Dictionary args) throws Exception { String value = time.getCurrentTime(); Hashtable result = new Hashtable(); result.put(RESULT_STATUS,value); return result; }
class class_name[name] begin[{] method[invoke, return_type[type[Dictionary]], modifier[public], parameter[args]] begin[{] local_variable[type[String], value] local_variable[type[Hashtable], result] call[result.put, parameter[member[.RESULT_STATUS], member[.value]]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Dictionary] identifier[invoke] operator[SEP] identifier[Dictionary] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[value] operator[=] identifier[time] operator[SEP] identifier[getCurrentTime] operator[SEP] operator[SEP] operator[SEP] identifier[Hashtable] identifier[result] operator[=] Keyword[new] identifier[Hashtable] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[RESULT_STATUS] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public String hrefTemplate() { UriTemplateBuilder uriTemplateBuilder = UriTemplate.buildFromTemplate(hrefTemplate); if (!queryParams.isEmpty()) { uriTemplateBuilder = uriTemplateBuilder.query( queryParams.keySet().toArray(new String[queryParams.keySet().size()])); } return uriTemplateBuilder.build().getTemplate(); }
class class_name[name] begin[{] method[hrefTemplate, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[UriTemplateBuilder], uriTemplateBuilder] if[call[queryParams.isEmpty, parameter[]]] begin[{] assign[member[.uriTemplateBuilder], call[uriTemplateBuilder.query, parameter[call[queryParams.keySet, parameter[]]]]] else begin[{] None end[}] return[call[uriTemplateBuilder.build, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[hrefTemplate] operator[SEP] operator[SEP] { identifier[UriTemplateBuilder] identifier[uriTemplateBuilder] operator[=] identifier[UriTemplate] operator[SEP] identifier[buildFromTemplate] operator[SEP] identifier[hrefTemplate] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[queryParams] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[uriTemplateBuilder] operator[=] identifier[uriTemplateBuilder] operator[SEP] identifier[query] operator[SEP] identifier[queryParams] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[queryParams] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[uriTemplateBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[getTemplate] operator[SEP] operator[SEP] operator[SEP] }
public static Path copy(Path sourcePath, Path destinationPath, CopyOption... options) { return operate(sourcePath, destinationPath, "copy", finalPath -> { try { return Files.copy(sourcePath, finalPath, options); } catch (Exception e) { return JMExceptionManager.handleExceptionAndReturnNull(log, e, "copy", sourcePath, destinationPath, options); } }); }
class class_name[name] begin[{] method[copy, return_type[type[Path]], modifier[public static], parameter[sourcePath, destinationPath, options]] begin[{] return[call[.operate, parameter[member[.sourcePath], member[.destinationPath], literal["copy"], LambdaExpression(body=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=sourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finalPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="copy"), MemberReference(member=sourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleExceptionAndReturnNull, postfix_operators=[], prefix_operators=[], qualifier=JMExceptionManager, 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)], parameters=[MemberReference(member=finalPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Path] identifier[copy] operator[SEP] identifier[Path] identifier[sourcePath] , identifier[Path] identifier[destinationPath] , identifier[CopyOption] operator[...] identifier[options] operator[SEP] { Keyword[return] identifier[operate] operator[SEP] identifier[sourcePath] , identifier[destinationPath] , literal[String] , identifier[finalPath] operator[->] { Keyword[try] { Keyword[return] identifier[Files] operator[SEP] identifier[copy] operator[SEP] identifier[sourcePath] , identifier[finalPath] , identifier[options] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] identifier[JMExceptionManager] operator[SEP] identifier[handleExceptionAndReturnNull] operator[SEP] identifier[log] , identifier[e] , literal[String] , identifier[sourcePath] , identifier[destinationPath] , identifier[options] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public String getName() { switch (type) { case Element.SUBJECT: return ElementTags.SUBJECT; case Element.KEYWORDS: return ElementTags.KEYWORDS; case Element.AUTHOR: return ElementTags.AUTHOR; case Element.TITLE: return ElementTags.TITLE; case Element.PRODUCER: return ElementTags.PRODUCER; case Element.CREATIONDATE: return ElementTags.CREATIONDATE; default: return ElementTags.UNKNOWN; } }
class class_name[name] begin[{] method[getName, return_type[type[String]], modifier[public], parameter[]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SUBJECT, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=SUBJECT, postfix_operators=[], prefix_operators=[], qualifier=ElementTags, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=KEYWORDS, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=KEYWORDS, postfix_operators=[], prefix_operators=[], qualifier=ElementTags, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=AUTHOR, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=AUTHOR, postfix_operators=[], prefix_operators=[], qualifier=ElementTags, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=TITLE, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TITLE, postfix_operators=[], prefix_operators=[], qualifier=ElementTags, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=PRODUCER, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=PRODUCER, postfix_operators=[], prefix_operators=[], qualifier=ElementTags, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=CREATIONDATE, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=CREATIONDATE, postfix_operators=[], prefix_operators=[], qualifier=ElementTags, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MemberReference(member=UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=ElementTags, selectors=[]), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] identifier[String] identifier[getName] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[Element] operator[SEP] identifier[SUBJECT] operator[:] Keyword[return] identifier[ElementTags] operator[SEP] identifier[SUBJECT] operator[SEP] Keyword[case] identifier[Element] operator[SEP] identifier[KEYWORDS] operator[:] Keyword[return] identifier[ElementTags] operator[SEP] identifier[KEYWORDS] operator[SEP] Keyword[case] identifier[Element] operator[SEP] identifier[AUTHOR] operator[:] Keyword[return] identifier[ElementTags] operator[SEP] identifier[AUTHOR] operator[SEP] Keyword[case] identifier[Element] operator[SEP] identifier[TITLE] operator[:] Keyword[return] identifier[ElementTags] operator[SEP] identifier[TITLE] operator[SEP] Keyword[case] identifier[Element] operator[SEP] identifier[PRODUCER] operator[:] Keyword[return] identifier[ElementTags] operator[SEP] identifier[PRODUCER] operator[SEP] Keyword[case] identifier[Element] operator[SEP] identifier[CREATIONDATE] operator[:] Keyword[return] identifier[ElementTags] operator[SEP] identifier[CREATIONDATE] operator[SEP] Keyword[default] operator[:] Keyword[return] identifier[ElementTags] operator[SEP] identifier[UNKNOWN] operator[SEP] } }
public static CPDefinitionSpecificationOptionValue fetchByC_CSOVI( long CPDefinitionId, long CPDefinitionSpecificationOptionValueId, boolean retrieveFromCache) { return getPersistence() .fetchByC_CSOVI(CPDefinitionId, CPDefinitionSpecificationOptionValueId, retrieveFromCache); }
class class_name[name] begin[{] method[fetchByC_CSOVI, return_type[type[CPDefinitionSpecificationOptionValue]], modifier[public static], parameter[CPDefinitionId, CPDefinitionSpecificationOptionValueId, retrieveFromCache]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPDefinitionSpecificationOptionValue] identifier[fetchByC_CSOVI] operator[SEP] Keyword[long] identifier[CPDefinitionId] , Keyword[long] identifier[CPDefinitionSpecificationOptionValueId] , Keyword[boolean] identifier[retrieveFromCache] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByC_CSOVI] operator[SEP] identifier[CPDefinitionId] , identifier[CPDefinitionSpecificationOptionValueId] , identifier[retrieveFromCache] operator[SEP] operator[SEP] }
@POST @Path("getDatabaseProductName") public String getDatabaseProductName(String id) throws SQLException { return DatabaseMetaDataHolder.get().get(id).getDatabaseProductName(); }
class class_name[name] begin[{] method[getDatabaseProductName, return_type[type[String]], modifier[public], parameter[id]] begin[{] return[call[DatabaseMetaDataHolder.get, parameter[]]] end[}] END[}]
annotation[@] identifier[POST] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[String] identifier[getDatabaseProductName] operator[SEP] identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[return] identifier[DatabaseMetaDataHolder] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[getDatabaseProductName] operator[SEP] operator[SEP] operator[SEP] }
private void addRelevantBaseTypes(ClassDescriptorDef curType, ArrayList baseTypes) { ClassDescriptorDef baseDef; for (Iterator it = curType.getDirectBaseTypes(); it.hasNext();) { baseDef = (ClassDescriptorDef)it.next(); if (!baseDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_INCLUDE_INHERITED, true)) { // the base type has include-inherited set to false which means that // it does not include base features // since we do want these base features, we have to traverse its base types addRelevantBaseTypes(baseDef, baseTypes); } baseTypes.add(baseDef); } }
class class_name[name] begin[{] method[addRelevantBaseTypes, return_type[void], modifier[private], parameter[curType, baseTypes]] begin[{] local_variable[type[ClassDescriptorDef], baseDef] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=baseDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ClassDescriptorDef, sub_type=None))), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=OJB_PROPERTY_INCLUDE_INHERITED, postfix_operators=[], prefix_operators=[], qualifier=PropertyHelper, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getBooleanProperty, postfix_operators=[], prefix_operators=['!'], qualifier=baseDef, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=baseDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=baseTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRelevantBaseTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=baseDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=baseTypes, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getDirectBaseTypes, postfix_operators=[], prefix_operators=[], qualifier=curType, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[addRelevantBaseTypes] operator[SEP] identifier[ClassDescriptorDef] identifier[curType] , identifier[ArrayList] identifier[baseTypes] operator[SEP] { identifier[ClassDescriptorDef] identifier[baseDef] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[curType] operator[SEP] identifier[getDirectBaseTypes] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[baseDef] operator[=] operator[SEP] identifier[ClassDescriptorDef] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[baseDef] operator[SEP] identifier[getBooleanProperty] operator[SEP] identifier[PropertyHelper] operator[SEP] identifier[OJB_PROPERTY_INCLUDE_INHERITED] , literal[boolean] operator[SEP] operator[SEP] { identifier[addRelevantBaseTypes] operator[SEP] identifier[baseDef] , identifier[baseTypes] operator[SEP] operator[SEP] } identifier[baseTypes] operator[SEP] identifier[add] operator[SEP] identifier[baseDef] operator[SEP] operator[SEP] } }
public void preInvokeMdbAfterActivate(EJSWrapperBase wrapper, EJSDeployedSupport s, Object eb, // d414873 Object[] args) throws RemoteException { // Now perform preinvoke processing that must occur after // the bean is activated. preInvokeAfterActivate(wrapper, eb, s, args); // If there is a registered message endpoint collaborator, call it for preInvoke processing. MessageEndpointCollaborator meCollaborator = getEJBRuntime().getMessageEndpointCollaborator(wrapper.bmd); if (meCollaborator != null) { HashMap<String, Object> contextData = new HashMap<String, Object>(); contextData.put(MessageEndpointCollaborator.KEY_ACTIVATION_SPEC_ID, wrapper.bmd.ivActivationSpecJndiName); contextData.put(MessageEndpointCollaborator.KEY_J2EE_NAME, wrapper.bmd.j2eeName); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Invoking MECollaborator " + meCollaborator + " for preInvoke processing with the following context data: " + contextData); } s.messageEndpointContext = meCollaborator.preInvoke(contextData); } // Normal path exit. if (TraceComponent.isAnyTracingEnabled()) { if (tc.isEntryEnabled()) { int methodId = s.methodId; EJBMethodInfoImpl methodInfo = s.methodInfo; ContainerTx containerTx = s.currentTx; Tr.exit(tc, "EJBpreInvoke(" + methodId + ":" + methodInfo.getMethodName() + ") " + " Invoking method '" + methodInfo.getMethodName() + "' on bean '" + wrapper.getClass().getName() + "(" + wrapper.beanId + ")" + "', '" + containerTx + "', isGlobalTx=" + (containerTx != null ? (containerTx.isTransactionGlobal() ? "true" : "false") : "Unknown")); } if (TEEJBInvocationInfo.isTraceEnabled()) TEEJBInvocationInfo.tracePreInvokeEnds(s, wrapper); } }
class class_name[name] begin[{] method[preInvokeMdbAfterActivate, return_type[void], modifier[public], parameter[wrapper, s, eb, args]] begin[{] call[.preInvokeAfterActivate, parameter[member[.wrapper], member[.eb], member[.s], member[.args]]] local_variable[type[MessageEndpointCollaborator], meCollaborator] if[binary_operation[member[.meCollaborator], !=, literal[null]]] begin[{] local_variable[type[HashMap], contextData] call[contextData.put, parameter[member[MessageEndpointCollaborator.KEY_ACTIVATION_SPEC_ID], member[wrapper.bmd.ivActivationSpecJndiName]]] call[contextData.put, parameter[member[MessageEndpointCollaborator.KEY_J2EE_NAME], member[wrapper.bmd.j2eeName]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["Invoking MECollaborator "], +, member[.meCollaborator]], +, literal[" for preInvoke processing with the following context data: "]], +, member[.contextData]]]] else begin[{] None end[}] assign[member[s.messageEndpointContext], call[meCollaborator.preInvoke, parameter[member[.contextData]]]] else begin[{] None end[}] if[call[TraceComponent.isAnyTracingEnabled, parameter[]]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] local_variable[type[int], methodId] local_variable[type[EJBMethodInfoImpl], methodInfo] local_variable[type[ContainerTx], containerTx] call[Tr.exit, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["EJBpreInvoke("], +, member[.methodId]], +, literal[":"]], +, call[methodInfo.getMethodName, parameter[]]], +, literal[") "]], +, literal[" Invoking method '"]], +, call[methodInfo.getMethodName, parameter[]]], +, literal["' on bean '"]], +, call[wrapper.getClass, parameter[]]], +, literal["("]], +, member[wrapper.beanId]], +, literal[")"]], +, literal["', '"]], +, member[.containerTx]], +, literal["', isGlobalTx="]], +, TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=containerTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown"), if_true=TernaryExpression(condition=MethodInvocation(arguments=[], member=isTransactionGlobal, postfix_operators=[], prefix_operators=[], qualifier=containerTx, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="false"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="true")))]]] else begin[{] None end[}] if[call[TEEJBInvocationInfo.isTraceEnabled, parameter[]]] begin[{] call[TEEJBInvocationInfo.tracePreInvokeEnds, parameter[member[.s], member[.wrapper]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[preInvokeMdbAfterActivate] operator[SEP] identifier[EJSWrapperBase] identifier[wrapper] , identifier[EJSDeployedSupport] identifier[s] , identifier[Object] identifier[eb] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[RemoteException] { identifier[preInvokeAfterActivate] operator[SEP] identifier[wrapper] , identifier[eb] , identifier[s] , identifier[args] operator[SEP] operator[SEP] identifier[MessageEndpointCollaborator] identifier[meCollaborator] operator[=] identifier[getEJBRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[getMessageEndpointCollaborator] operator[SEP] identifier[wrapper] operator[SEP] identifier[bmd] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[meCollaborator] operator[!=] Other[null] operator[SEP] { identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[contextData] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[contextData] operator[SEP] identifier[put] operator[SEP] identifier[MessageEndpointCollaborator] operator[SEP] identifier[KEY_ACTIVATION_SPEC_ID] , identifier[wrapper] operator[SEP] identifier[bmd] operator[SEP] identifier[ivActivationSpecJndiName] operator[SEP] operator[SEP] identifier[contextData] operator[SEP] identifier[put] operator[SEP] identifier[MessageEndpointCollaborator] operator[SEP] identifier[KEY_J2EE_NAME] , identifier[wrapper] operator[SEP] identifier[bmd] operator[SEP] identifier[j2eeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[meCollaborator] operator[+] literal[String] operator[+] identifier[contextData] operator[SEP] operator[SEP] } identifier[s] operator[SEP] identifier[messageEndpointContext] operator[=] identifier[meCollaborator] operator[SEP] identifier[preInvoke] operator[SEP] identifier[contextData] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[methodId] operator[=] identifier[s] operator[SEP] identifier[methodId] operator[SEP] identifier[EJBMethodInfoImpl] identifier[methodInfo] operator[=] identifier[s] operator[SEP] identifier[methodInfo] operator[SEP] identifier[ContainerTx] identifier[containerTx] operator[=] identifier[s] operator[SEP] identifier[currentTx] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[methodId] operator[+] literal[String] operator[+] identifier[methodInfo] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[methodInfo] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[wrapper] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[wrapper] operator[SEP] identifier[beanId] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[containerTx] operator[+] literal[String] operator[+] operator[SEP] identifier[containerTx] operator[!=] Other[null] operator[?] operator[SEP] identifier[containerTx] operator[SEP] identifier[isTransactionGlobal] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[:] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TEEJBInvocationInfo] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[TEEJBInvocationInfo] operator[SEP] identifier[tracePreInvokeEnds] operator[SEP] identifier[s] , identifier[wrapper] operator[SEP] operator[SEP] } }
public static FileInputStream getFileInputStreamPrivileged(final File file) throws FileNotFoundException { final AtomicReference<FileNotFoundException> exceptionRef = new AtomicReference<FileNotFoundException>(); FileInputStream fis = AccessController.doPrivileged(new PrivilegedAction<FileInputStream>() { @Override public FileInputStream run() { try { return new FileInputStream(file); } catch (FileNotFoundException e) { exceptionRef.set(e); return null; } } }); if (exceptionRef.get() != null) throw exceptionRef.get(); return fis; }
class class_name[name] begin[{] method[getFileInputStreamPrivileged, return_type[type[FileInputStream]], modifier[public static], parameter[file]] begin[{] local_variable[type[AtomicReference], exceptionRef] local_variable[type[FileInputStream], fis] if[binary_operation[call[exceptionRef.get, parameter[]], !=, literal[null]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=exceptionRef, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] return[member[.fis]] end[}] END[}]
Keyword[public] Keyword[static] identifier[FileInputStream] identifier[getFileInputStreamPrivileged] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[FileNotFoundException] { Keyword[final] identifier[AtomicReference] operator[<] identifier[FileNotFoundException] operator[>] identifier[exceptionRef] operator[=] Keyword[new] identifier[AtomicReference] operator[<] identifier[FileNotFoundException] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[FileInputStream] identifier[fis] operator[=] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[FileInputStream] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[FileInputStream] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[exceptionRef] operator[SEP] identifier[set] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exceptionRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[throw] identifier[exceptionRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fis] operator[SEP] }
public void setCacheNames(Collection<String> names) { if (names != null) { for (String name : names) { getCache(name); } dynamic = false; } else { dynamic = true; } }
class class_name[name] begin[{] method[setCacheNames, return_type[void], modifier[public], parameter[names]] begin[{] if[binary_operation[member[.names], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) assign[member[.dynamic], literal[false]] else begin[{] assign[member[.dynamic], literal[true]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCacheNames] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[names] operator[SEP] { Keyword[if] operator[SEP] identifier[names] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[names] operator[SEP] { identifier[getCache] operator[SEP] identifier[name] operator[SEP] operator[SEP] } identifier[dynamic] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[dynamic] operator[=] literal[boolean] operator[SEP] } }
int writeAsciiBytes(byte[] buffer, long bytesToWrite) throws IOException { if (commPort != null && commPort.isOpen()) { int cnt = 0; for (int i = 0; i < bytesToWrite; i++) { if (writeAsciiByte(buffer[i]) != 2) { return cnt; } cnt++; } return cnt; } else { throw new IOException("Comm port is not valid or not open"); } }
class class_name[name] begin[{] method[writeAsciiBytes, return_type[type[int]], modifier[default], parameter[buffer, bytesToWrite]] begin[{] if[binary_operation[binary_operation[member[.commPort], !=, literal[null]], &&, call[commPort.isOpen, parameter[]]]] begin[{] local_variable[type[int], cnt] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=writeAsciiByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=cnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), StatementExpression(expression=MemberReference(member=cnt, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bytesToWrite, 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[.cnt]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Comm port is not valid or not open")], 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[int] identifier[writeAsciiBytes] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] , Keyword[long] identifier[bytesToWrite] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[commPort] operator[!=] Other[null] operator[&&] identifier[commPort] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[cnt] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[bytesToWrite] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[writeAsciiByte] operator[SEP] identifier[buffer] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[!=] Other[2] operator[SEP] { Keyword[return] identifier[cnt] operator[SEP] } identifier[cnt] operator[++] operator[SEP] } Keyword[return] identifier[cnt] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public final String getColumnName(int index) { assert(verifyTableInvariants()); if ((index < 0) || (index >= m_colCount)) { throw new IllegalArgumentException("Not a valid column index."); } // move to the start of the list of column names int pos = POS_COL_TYPES + m_colCount; String name = null; for (int i = 0; i < index; i++) { pos += m_buffer.getInt(pos) + 4; } name = readString(pos, METADATA_ENCODING); assert(name != null); assert(verifyTableInvariants()); return name; }
class class_name[name] begin[{] method[getColumnName, return_type[type[String]], modifier[final public], parameter[index]] begin[{] AssertStatement(condition=MethodInvocation(arguments=[], member=verifyTableInvariants, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None, value=None) if[binary_operation[binary_operation[member[.index], <, literal[0]], ||, binary_operation[member[.index], >=, member[.m_colCount]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not a valid column index.")], 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], pos] local_variable[type[String], name] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=m_buffer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=index, 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[.name], call[.readString, parameter[member[.pos], member[.METADATA_ENCODING]]]] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) AssertStatement(condition=MethodInvocation(arguments=[], member=verifyTableInvariants, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None, value=None) return[member[.name]] end[}] END[}]
Keyword[public] Keyword[final] identifier[String] identifier[getColumnName] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[assert] operator[SEP] identifier[verifyTableInvariants] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[index] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[index] operator[>=] identifier[m_colCount] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[pos] operator[=] identifier[POS_COL_TYPES] operator[+] identifier[m_colCount] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[index] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[pos] operator[+=] identifier[m_buffer] operator[SEP] identifier[getInt] operator[SEP] identifier[pos] operator[SEP] operator[+] Other[4] operator[SEP] } identifier[name] operator[=] identifier[readString] operator[SEP] identifier[pos] , identifier[METADATA_ENCODING] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[verifyTableInvariants] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[name] operator[SEP] }
public VpnConnectionInner createOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().last().body(); }
class class_name[name] begin[{] method[createOrUpdate, return_type[type[VpnConnectionInner]], modifier[public], parameter[resourceGroupName, gatewayName, connectionName, vpnConnectionParameters]] begin[{] return[call[.createOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.gatewayName], member[.connectionName], member[.vpnConnectionParameters]]]] end[}] END[}]
Keyword[public] identifier[VpnConnectionInner] identifier[createOrUpdate] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[gatewayName] , identifier[String] identifier[connectionName] , identifier[VpnConnectionInner] identifier[vpnConnectionParameters] operator[SEP] { Keyword[return] identifier[createOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[gatewayName] , identifier[connectionName] , identifier[vpnConnectionParameters] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
static String fromPackageName(String packageName) { List<String> tokens = tokenOf(packageName); return fromTokens(tokens); }
class class_name[name] begin[{] method[fromPackageName, return_type[type[String]], modifier[static], parameter[packageName]] begin[{] local_variable[type[List], tokens] return[call[.fromTokens, parameter[member[.tokens]]]] end[}] END[}]
Keyword[static] identifier[String] identifier[fromPackageName] operator[SEP] identifier[String] identifier[packageName] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[tokens] operator[=] identifier[tokenOf] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] Keyword[return] identifier[fromTokens] operator[SEP] identifier[tokens] operator[SEP] operator[SEP] }
Resource[] updatePlugin(InputStream is, String realpath, boolean closeStream) throws PageException, IOException, SAXException { List<Resource> filesDeployed = new ArrayList<Resource>(); deployFilesFromStream(config, config.getPluginDirectory(), is, realpath, closeStream, filesDeployed); return filesDeployed.toArray(new Resource[filesDeployed.size()]); }
class class_name[name] begin[{] method[updatePlugin, return_type[type[Resource]], modifier[default], parameter[is, realpath, closeStream]] begin[{] local_variable[type[List], filesDeployed] call[.deployFilesFromStream, parameter[member[.config], call[config.getPluginDirectory, parameter[]], member[.is], member[.realpath], member[.closeStream], member[.filesDeployed]]] return[call[filesDeployed.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=filesDeployed, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Resource, sub_type=None))]]] end[}] END[}]
identifier[Resource] operator[SEP] operator[SEP] identifier[updatePlugin] operator[SEP] identifier[InputStream] identifier[is] , identifier[String] identifier[realpath] , Keyword[boolean] identifier[closeStream] operator[SEP] Keyword[throws] identifier[PageException] , identifier[IOException] , identifier[SAXException] { identifier[List] operator[<] identifier[Resource] operator[>] identifier[filesDeployed] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Resource] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[deployFilesFromStream] operator[SEP] identifier[config] , identifier[config] operator[SEP] identifier[getPluginDirectory] operator[SEP] operator[SEP] , identifier[is] , identifier[realpath] , identifier[closeStream] , identifier[filesDeployed] operator[SEP] operator[SEP] Keyword[return] identifier[filesDeployed] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Resource] operator[SEP] identifier[filesDeployed] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected Iterator getKeyIterator(final String base, final String modifier, final String key) { return new Iterator() { // The key ordering count always begins at the start of the ORDER array. private int i; public boolean hasNext() { return (useDefaults ? ((i < ORDER.length) && (ORDER[i] > ENVIRONMENT_DEFAULTS_CUTOFF)) : (i < ORDER.length)); } public Object next() { // Check that there is a next element and return null if not. if (!hasNext()) { return null; } // Get the next ordering count. int o = ORDER[i]; // Do bit matching on the count to choose which elements to include in the key. String result = (((o & E) != 0) ? (environment + ".") : "") + (((o & B) != 0) ? (base + ".") : "") + (((o & M) != 0) ? (modifier + ".") : "") + key; // Increment the iterator to get the next key on the next call. i++; return result; } public void remove() { // This method is not supported. throw new UnsupportedOperationException("remove() is not supported on this key order iterator as " + "the ordering cannot be changed"); } }; }
class class_name[name] begin[{] method[getKeyIterator, return_type[type[Iterator]], modifier[protected], parameter[base, modifier, key]] begin[{] return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=i)], documentation=None, modifiers={'private'}, type=BasicType(dimensions=[], name=int)), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=TernaryExpression(condition=MemberReference(member=useDefaults, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ORDER, selectors=[]), operator=<), if_true=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ORDER, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=ORDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=ENVIRONMENT_DEFAULTS_CUTOFF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&)), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=['!'], qualifier=, 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=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ORDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=o)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=E, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=BinaryOperation(operandl=MemberReference(member=environment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)), operandr=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=B, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=BinaryOperation(operandl=MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)), operator=+), operandr=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=M, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=BinaryOperation(operandl=MemberReference(member=modifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)), operator=+), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="remove() is not supported on this key order iterator as "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the ordering cannot be changed"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=remove, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Iterator, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[Iterator] identifier[getKeyIterator] operator[SEP] Keyword[final] identifier[String] identifier[base] , Keyword[final] identifier[String] identifier[modifier] , Keyword[final] identifier[String] identifier[key] operator[SEP] { Keyword[return] Keyword[new] identifier[Iterator] operator[SEP] operator[SEP] { Keyword[private] Keyword[int] identifier[i] operator[SEP] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[useDefaults] operator[?] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[ORDER] operator[SEP] identifier[length] operator[SEP] operator[&&] operator[SEP] identifier[ORDER] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[ENVIRONMENT_DEFAULTS_CUTOFF] operator[SEP] operator[SEP] operator[:] operator[SEP] identifier[i] operator[<] identifier[ORDER] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[public] identifier[Object] identifier[next] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[o] operator[=] identifier[ORDER] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[result] operator[=] operator[SEP] operator[SEP] operator[SEP] identifier[o] operator[&] identifier[E] operator[SEP] operator[!=] Other[0] operator[SEP] operator[?] operator[SEP] identifier[environment] operator[+] literal[String] operator[SEP] operator[:] literal[String] operator[SEP] operator[+] operator[SEP] operator[SEP] operator[SEP] identifier[o] operator[&] identifier[B] operator[SEP] operator[!=] Other[0] operator[SEP] operator[?] operator[SEP] identifier[base] operator[+] literal[String] operator[SEP] operator[:] literal[String] operator[SEP] operator[+] operator[SEP] operator[SEP] operator[SEP] identifier[o] operator[&] identifier[M] operator[SEP] operator[!=] Other[0] operator[SEP] operator[?] operator[SEP] identifier[modifier] operator[+] literal[String] operator[SEP] operator[:] literal[String] operator[SEP] operator[+] identifier[key] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[return] identifier[result] operator[SEP] } Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } } operator[SEP] }
public static String preprocessWikiText(String text) { if (text==null) return ""; text=text.trim(); int length=text.length(); char[] chars=new char[length]; text.getChars(0, length, chars, 0); StringBuilder sb=new StringBuilder(); boolean blankLine=true; StringBuilder spaces=new StringBuilder(); for (int p=0; p<length; p++) { char c=chars[p]; if (c=='\r') { // "\r\n" -> "\n"; then "\r" -> "\n" if (p+1<length && chars[p+1]=='\n') p++; sb.append('\n'); // discard spaces if there is nothing else on the line spaces.delete(0, spaces.length()); blankLine=true; } else if (c=='\n') { sb.append(c); // discard spaces if there is nothing else on the line spaces.delete(0, spaces.length()); blankLine=true; } else if (blankLine) { if (c<=' '/* && c!='\n'*/) { spaces.append(c); } else { // working around GWT issue // http://code.google.com/p/google-web-toolkit/issues/detail?id=4097 CharSequence cs = spaces; sb.append(cs); blankLine=false; sb.append(c); } } else { sb.append(c); } } return sb.toString(); }
class class_name[name] begin[{] method[preprocessWikiText, return_type[type[String]], modifier[public static], parameter[text]] begin[{] if[binary_operation[member[.text], ==, literal[null]]] begin[{] return[literal[""]] else begin[{] None end[}] assign[member[.text], call[text.trim, parameter[]]] local_variable[type[int], length] local_variable[type[char], chars] call[text.getChars, parameter[literal[0], member[.length], member[.chars], literal[0]]] local_variable[type[StringBuilder], sb] local_variable[type[boolean], blankLine] local_variable[type[StringBuilder], spaces] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator===), else_statement=IfStatement(condition=MemberReference(member=blankLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator=<=), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=spaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=cs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=blankLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=spaces, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=spaces, selectors=[], type_arguments=None)], member=delete, postfix_operators=[], prefix_operators=[], qualifier=spaces, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=blankLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator===), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MemberReference(member=p, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=spaces, selectors=[], type_arguments=None)], member=delete, postfix_operators=[], prefix_operators=[], qualifier=spaces, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=blankLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=p)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=p, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[preprocessWikiText] operator[SEP] identifier[String] identifier[text] operator[SEP] { Keyword[if] operator[SEP] identifier[text] operator[==] Other[null] operator[SEP] Keyword[return] literal[String] operator[SEP] identifier[text] operator[=] identifier[text] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[chars] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[getChars] operator[SEP] Other[0] , identifier[length] , identifier[chars] , Other[0] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[blankLine] operator[=] literal[boolean] operator[SEP] identifier[StringBuilder] identifier[spaces] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[p] operator[=] Other[0] operator[SEP] identifier[p] operator[<] identifier[length] operator[SEP] identifier[p] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[chars] operator[SEP] identifier[p] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[p] operator[+] Other[1] operator[<] identifier[length] operator[&&] identifier[chars] operator[SEP] identifier[p] operator[+] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] identifier[p] operator[++] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[spaces] operator[SEP] identifier[delete] operator[SEP] Other[0] , identifier[spaces] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[blankLine] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[spaces] operator[SEP] identifier[delete] operator[SEP] Other[0] , identifier[spaces] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[blankLine] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[blankLine] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[<=] literal[String] operator[SEP] { identifier[spaces] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[else] { identifier[CharSequence] identifier[cs] operator[=] identifier[spaces] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[cs] operator[SEP] operator[SEP] identifier[blankLine] operator[=] literal[boolean] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private TreeNodeVisitor train(OnLineStatistics setScore, RegressionDataSet subSet, List<Integer> features, CategoricalData[] catInfo, Random rand) { //Should we stop? Stop split(S) if(subSet.size() < stopSize || setScore.getVarance() <= 0.0 || Double.isNaN(setScore.getVarance())) return new NodeR(setScore.getMean()); double bestGain = Double.NEGATIVE_INFINITY; double bestThreshold = Double.NaN; int bestAttribute = -1; OnLineStatistics[] bestScores = null; List<RegressionDataSet> bestSplit = null; Set<Integer> bestLeftSide = null; /* * TODO use smarter random feature selection based on how many features * we need relative to how many are available */ Collections.shuffle(features); //It is possible, if we test all attribute - that one was categorical and no longer an option final int goTo = Math.min(selectionCount, features.size()); for(int i = 0; i < goTo; i++) { double gain; double threshold = Double.NaN; Set<Integer> leftSide = null; OnLineStatistics[] stats; int a = features.get(i); List<RegressionDataSet> aSplit; if(a < catInfo.length) { final int vals = catInfo[a].getNumOfCategories(); if(binaryCategoricalSplitting || vals == 2) { stats = createStats(2); Set<Integer> catsValsInUse = new IntSet(vals*2); for(int j = 0; j < subSet.size(); j++) catsValsInUse.add(subSet.getDataPoint(j).getCategoricalValue(a)); if(catsValsInUse.size() == 1) return new NodeR(setScore.getMean()); leftSide = new IntSet(vals); int toUse = rand.nextInt(catsValsInUse.size()-1)+1; ListUtils.randomSample(catsValsInUse, leftSide, toUse, rand); //Now we have anything in leftSide is path 0, we can do the bining aSplit = new ArrayList<>(2); aSplit.add(subSet.emptyClone()); aSplit.add(subSet.emptyClone()); for(int j = 0; j < subSet.size(); j++) { DataPoint dp = subSet.getDataPoint(j); double w_j = subSet.getWeight(j); double y_j = subSet.getTargetValue(j); int dest = leftSide.contains(dp.getCategoricalValue(a)) ? 0 : 1; stats[dest].add(y_j, w_j); aSplit.get(dest).addDataPoint(dp, y_j, w_j); } } else//split on each value { stats = createStats(vals); //Bin all the points to get their scores aSplit = new ArrayList<>(vals); for(int z = 0; z < vals; z++) aSplit.add(subSet.emptyClone()); for (int j = 0; j < subSet.size(); j++) { DataPoint dp = subSet.getDataPoint(j); double w_j = subSet.getWeight(j); double y_j = subSet.getTargetValue(j); stats[dp.getCategoricalValue(a)].add(y_j, w_j); aSplit.get(dp.getCategoricalValue(a)).addDataPoint(dp, y_j, w_j); } } } else { int numerA = a - catInfo.length; double min = Double.POSITIVE_INFINITY, max = Double.NEGATIVE_INFINITY; for(int j = 0; j < subSet.size(); j++) { DataPoint dp = subSet.getDataPoint(j); double val = dp.getNumericalValues().get(numerA); min = Math.min(min, val); max = Math.max(max, val); } //Uniform random threshold threshold = rand.nextDouble()*(max-min)+min; stats = createStats(2); aSplit = new ArrayList<>(2); aSplit.add(subSet.emptyClone()); aSplit.add(subSet.emptyClone()); for (int j = 0; j < subSet.size(); j++) { DataPoint dp = subSet.getDataPoint(j); double w_j = subSet.getWeight(j); double y_j = subSet.getTargetValue(j); double val = dp.getNumericalValues().get(numerA); int toAddTo = val <= threshold ? 0 : 1; aSplit.get(toAddTo).addDataPoint(dp, y_j, w_j); stats[toAddTo].add(y_j, w_j); } } gain = 1; double varNorm = setScore.getVarance(); double varSum = setScore.getSumOfWeights(); for(OnLineStatistics stat : stats) gain -= stat.getSumOfWeights()/varSum*(stat.getVarance()/varNorm); if(gain > bestGain) { bestGain = gain; bestAttribute = a; bestThreshold = threshold; bestScores = stats; bestSplit = aSplit; bestLeftSide = leftSide; } } //Best attribute has been selected NodeBase toReturn; if (bestAttribute >= 0) { if (bestAttribute < catInfo.length) if (bestSplit.size() == 2)//2 paths only toReturn = new NodeRCat(bestAttribute, bestLeftSide, setScore.getMean()); else { toReturn = new NodeRCat(goTo, bestSplit.size(), setScore.getMean()); features.remove(new Integer(bestAttribute));//Feature nolonger viable in this case } else toReturn = new NodeRNum(bestAttribute - catInfo.length, bestThreshold, setScore.getMean()); for (int i = 0; i < toReturn.children.length; i++) { toReturn.children[i] = train(bestScores[i], bestSplit.get(i), features, catInfo, rand); } return toReturn; } return new NodeR(setScore.getMean()); }
class class_name[name] begin[{] method[train, return_type[type[TreeNodeVisitor]], modifier[private], parameter[setScore, subSet, features, catInfo, rand]] begin[{] if[binary_operation[binary_operation[binary_operation[call[subSet.size, parameter[]], <, member[.stopSize]], ||, binary_operation[call[setScore.getVarance, parameter[]], <=, literal[0.0]]], ||, call[Double.isNaN, parameter[call[setScore.getVarance, parameter[]]]]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMean, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeR, sub_type=None))] else begin[{] None end[}] local_variable[type[double], bestGain] local_variable[type[double], bestThreshold] local_variable[type[int], bestAttribute] local_variable[type[OnLineStatistics], bestScores] local_variable[type[List], bestSplit] local_variable[type[Set], bestLeftSide] call[Collections.shuffle, parameter[member[.features]]] local_variable[type[int], goTo] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=gain)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=NaN, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), name=threshold)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=leftSide)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=Set, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=stats)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=OnLineStatistics, 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=features, selectors=[], type_arguments=None), name=a)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=aSplit)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RegressionDataSet, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=catInfo, selectors=[]), operator=<), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=catInfo, selectors=[]), operator=-), name=numerA)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=POSITIVE_INFINITY, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), name=min), VariableDeclarator(dimensions=[], initializer=MemberReference(member=NEGATIVE_INFINITY, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), name=max)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPoint, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=dp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataPoint, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNumericalValues, postfix_operators=[], prefix_operators=[], qualifier=dp, selectors=[MethodInvocation(arguments=[MemberReference(member=numerA, 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=val)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=threshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=nextDouble, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=*), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=createStats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=emptyClone, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=emptyClone, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPoint, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=dp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataPoint, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWeight, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=w_j)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTargetValue, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=y_j)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNumericalValues, postfix_operators=[], prefix_operators=[], qualifier=dp, selectors=[MethodInvocation(arguments=[MemberReference(member=numerA, 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=val)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=threshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), name=toAddTo)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=toAddTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[MethodInvocation(arguments=[MemberReference(member=dp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=w_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDataPoint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=toAddTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=y_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=w_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=catInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getNumOfCategories, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=vals)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=binaryCategoricalSplitting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=vals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=vals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createStats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=vals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=emptyClone, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=vals, 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=z)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=z, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPoint, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=dp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataPoint, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWeight, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=w_j)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTargetValue, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=y_j)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCategoricalValue, postfix_operators=[], prefix_operators=[], qualifier=dp, selectors=[], type_arguments=None)), MethodInvocation(arguments=[MemberReference(member=y_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=w_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCategoricalValue, postfix_operators=[], prefix_operators=[], qualifier=dp, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[MethodInvocation(arguments=[MemberReference(member=dp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=w_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDataPoint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=createStats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=vals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntSet, sub_type=None)), name=catsValsInUse)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPoint, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCategoricalValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=catsValsInUse, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=catsValsInUse, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMean, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeR, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=leftSide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=vals, 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=IntSet, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=catsValsInUse, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=toUse)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=catsValsInUse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=leftSide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=toUse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=randomSample, postfix_operators=[], prefix_operators=[], qualifier=ListUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=emptyClone, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=emptyClone, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPoint, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=dp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataPoint, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWeight, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=w_j)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTargetValue, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), name=y_j)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCategoricalValue, postfix_operators=[], prefix_operators=[], qualifier=dp, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=leftSide, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), name=dest)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=y_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=w_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=aSplit, selectors=[MethodInvocation(arguments=[MemberReference(member=dp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=w_j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDataPoint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=subSet, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=gain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getVarance, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None), name=varNorm)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSumOfWeights, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None), name=varSum)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=gain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSumOfWeights, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[], type_arguments=None), operandr=MemberReference(member=varSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getVarance, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[], type_arguments=None), operandr=MemberReference(member=varNorm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operator=*)), label=None), control=EnhancedForControl(iterable=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OnLineStatistics, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=gain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bestGain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestGain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=threshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestScores, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=aSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestLeftSide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=leftSide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=goTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[NodeBase], toReturn] if[binary_operation[member[.bestAttribute], >=, literal[0]]] begin[{] if[binary_operation[member[.bestAttribute], <, member[catInfo.length]]] begin[{] if[binary_operation[call[bestSplit.size, parameter[]], ==, literal[2]]] begin[{] assign[member[.toReturn], ClassCreator(arguments=[MemberReference(member=bestAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bestLeftSide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMean, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeRCat, sub_type=None))] else begin[{] assign[member[.toReturn], ClassCreator(arguments=[MemberReference(member=goTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=bestSplit, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMean, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeRCat, sub_type=None))] call[features.remove, parameter[ClassCreator(arguments=[MemberReference(member=bestAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] end[}] else begin[{] assign[member[.toReturn], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=bestAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=catInfo, selectors=[]), operator=-), MemberReference(member=bestThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMean, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeRNum, sub_type=None))] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=children, postfix_operators=[], prefix_operators=[], qualifier=toReturn, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=bestScores, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=bestSplit, selectors=[], type_arguments=None), MemberReference(member=features, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=catInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=train, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=toReturn.children, 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[.toReturn]] else begin[{] None end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMean, postfix_operators=[], prefix_operators=[], qualifier=setScore, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeR, sub_type=None))] end[}] END[}]
Keyword[private] identifier[TreeNodeVisitor] identifier[train] operator[SEP] identifier[OnLineStatistics] identifier[setScore] , identifier[RegressionDataSet] identifier[subSet] , identifier[List] operator[<] identifier[Integer] operator[>] identifier[features] , identifier[CategoricalData] operator[SEP] operator[SEP] identifier[catInfo] , identifier[Random] identifier[rand] operator[SEP] { Keyword[if] operator[SEP] identifier[subSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[stopSize] operator[||] identifier[setScore] operator[SEP] identifier[getVarance] operator[SEP] operator[SEP] operator[<=] literal[Float] operator[||] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[setScore] operator[SEP] identifier[getVarance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[NodeR] operator[SEP] identifier[setScore] operator[SEP] identifier[getMean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[bestGain] operator[=] identifier[Double] operator[SEP] identifier[NEGATIVE_INFINITY] operator[SEP] Keyword[double] identifier[bestThreshold] operator[=] identifier[Double] operator[SEP] identifier[NaN] operator[SEP] Keyword[int] identifier[bestAttribute] operator[=] operator[-] Other[1] operator[SEP] identifier[OnLineStatistics] operator[SEP] operator[SEP] identifier[bestScores] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[RegressionDataSet] operator[>] identifier[bestSplit] operator[=] Other[null] operator[SEP] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[bestLeftSide] operator[=] Other[null] operator[SEP] identifier[Collections] operator[SEP] identifier[shuffle] operator[SEP] identifier[features] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[goTo] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[selectionCount] , identifier[features] operator[SEP] identifier[size] 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[goTo] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[gain] operator[SEP] Keyword[double] identifier[threshold] operator[=] identifier[Double] operator[SEP] identifier[NaN] operator[SEP] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[leftSide] operator[=] Other[null] operator[SEP] identifier[OnLineStatistics] operator[SEP] operator[SEP] identifier[stats] operator[SEP] Keyword[int] identifier[a] operator[=] identifier[features] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[RegressionDataSet] operator[>] identifier[aSplit] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[<] identifier[catInfo] operator[SEP] identifier[length] operator[SEP] { Keyword[final] Keyword[int] identifier[vals] operator[=] identifier[catInfo] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[getNumOfCategories] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[binaryCategoricalSplitting] operator[||] identifier[vals] operator[==] Other[2] operator[SEP] { identifier[stats] operator[=] identifier[createStats] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[catsValsInUse] operator[=] Keyword[new] identifier[IntSet] operator[SEP] identifier[vals] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[subSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[catsValsInUse] operator[SEP] identifier[add] operator[SEP] identifier[subSet] operator[SEP] identifier[getDataPoint] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getCategoricalValue] operator[SEP] identifier[a] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[catsValsInUse] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] Keyword[return] Keyword[new] identifier[NodeR] operator[SEP] identifier[setScore] operator[SEP] identifier[getMean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[leftSide] operator[=] Keyword[new] identifier[IntSet] operator[SEP] identifier[vals] operator[SEP] operator[SEP] Keyword[int] identifier[toUse] operator[=] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] identifier[catsValsInUse] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[+] Other[1] operator[SEP] identifier[ListUtils] operator[SEP] identifier[randomSample] operator[SEP] identifier[catsValsInUse] , identifier[leftSide] , identifier[toUse] , identifier[rand] operator[SEP] operator[SEP] identifier[aSplit] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[aSplit] operator[SEP] identifier[add] operator[SEP] identifier[subSet] operator[SEP] identifier[emptyClone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[aSplit] operator[SEP] identifier[add] operator[SEP] identifier[subSet] operator[SEP] identifier[emptyClone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[subSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[DataPoint] identifier[dp] operator[=] identifier[subSet] operator[SEP] identifier[getDataPoint] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[w_j] operator[=] identifier[subSet] operator[SEP] identifier[getWeight] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[y_j] operator[=] identifier[subSet] operator[SEP] identifier[getTargetValue] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[int] identifier[dest] operator[=] identifier[leftSide] operator[SEP] identifier[contains] operator[SEP] identifier[dp] operator[SEP] identifier[getCategoricalValue] operator[SEP] identifier[a] operator[SEP] operator[SEP] operator[?] Other[0] operator[:] Other[1] operator[SEP] identifier[stats] operator[SEP] identifier[dest] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[y_j] , identifier[w_j] operator[SEP] operator[SEP] identifier[aSplit] operator[SEP] identifier[get] operator[SEP] identifier[dest] operator[SEP] operator[SEP] identifier[addDataPoint] operator[SEP] identifier[dp] , identifier[y_j] , identifier[w_j] operator[SEP] operator[SEP] } } Keyword[else] { identifier[stats] operator[=] identifier[createStats] operator[SEP] identifier[vals] operator[SEP] operator[SEP] identifier[aSplit] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[vals] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[z] operator[=] Other[0] operator[SEP] identifier[z] operator[<] identifier[vals] operator[SEP] identifier[z] operator[++] operator[SEP] identifier[aSplit] operator[SEP] identifier[add] operator[SEP] identifier[subSet] operator[SEP] identifier[emptyClone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[subSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[DataPoint] identifier[dp] operator[=] identifier[subSet] operator[SEP] identifier[getDataPoint] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[w_j] operator[=] identifier[subSet] operator[SEP] identifier[getWeight] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[y_j] operator[=] identifier[subSet] operator[SEP] identifier[getTargetValue] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[stats] operator[SEP] identifier[dp] operator[SEP] identifier[getCategoricalValue] operator[SEP] identifier[a] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[y_j] , identifier[w_j] operator[SEP] operator[SEP] identifier[aSplit] operator[SEP] identifier[get] operator[SEP] identifier[dp] operator[SEP] identifier[getCategoricalValue] operator[SEP] identifier[a] operator[SEP] operator[SEP] operator[SEP] identifier[addDataPoint] operator[SEP] identifier[dp] , identifier[y_j] , identifier[w_j] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[int] identifier[numerA] operator[=] identifier[a] operator[-] identifier[catInfo] operator[SEP] identifier[length] operator[SEP] Keyword[double] identifier[min] operator[=] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] , identifier[max] operator[=] identifier[Double] operator[SEP] identifier[NEGATIVE_INFINITY] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[subSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[DataPoint] identifier[dp] operator[=] identifier[subSet] operator[SEP] identifier[getDataPoint] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[val] operator[=] identifier[dp] operator[SEP] identifier[getNumericalValues] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[numerA] operator[SEP] operator[SEP] identifier[min] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[min] , identifier[val] operator[SEP] operator[SEP] identifier[max] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[max] , identifier[val] operator[SEP] operator[SEP] } identifier[threshold] operator[=] identifier[rand] operator[SEP] identifier[nextDouble] operator[SEP] operator[SEP] operator[*] operator[SEP] identifier[max] operator[-] identifier[min] operator[SEP] operator[+] identifier[min] operator[SEP] identifier[stats] operator[=] identifier[createStats] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[aSplit] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[aSplit] operator[SEP] identifier[add] operator[SEP] identifier[subSet] operator[SEP] identifier[emptyClone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[aSplit] operator[SEP] identifier[add] operator[SEP] identifier[subSet] operator[SEP] identifier[emptyClone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[subSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[DataPoint] identifier[dp] operator[=] identifier[subSet] operator[SEP] identifier[getDataPoint] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[w_j] operator[=] identifier[subSet] operator[SEP] identifier[getWeight] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[y_j] operator[=] identifier[subSet] operator[SEP] identifier[getTargetValue] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[val] operator[=] identifier[dp] operator[SEP] identifier[getNumericalValues] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[numerA] operator[SEP] operator[SEP] Keyword[int] identifier[toAddTo] operator[=] identifier[val] operator[<=] identifier[threshold] operator[?] Other[0] operator[:] Other[1] operator[SEP] identifier[aSplit] operator[SEP] identifier[get] operator[SEP] identifier[toAddTo] operator[SEP] operator[SEP] identifier[addDataPoint] operator[SEP] identifier[dp] , identifier[y_j] , identifier[w_j] operator[SEP] operator[SEP] identifier[stats] operator[SEP] identifier[toAddTo] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[y_j] , identifier[w_j] operator[SEP] operator[SEP] } } identifier[gain] operator[=] Other[1] operator[SEP] Keyword[double] identifier[varNorm] operator[=] identifier[setScore] operator[SEP] identifier[getVarance] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[varSum] operator[=] identifier[setScore] operator[SEP] identifier[getSumOfWeights] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OnLineStatistics] identifier[stat] operator[:] identifier[stats] operator[SEP] identifier[gain] operator[-=] identifier[stat] operator[SEP] identifier[getSumOfWeights] operator[SEP] operator[SEP] operator[/] identifier[varSum] operator[*] operator[SEP] identifier[stat] operator[SEP] identifier[getVarance] operator[SEP] operator[SEP] operator[/] identifier[varNorm] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gain] operator[>] identifier[bestGain] operator[SEP] { identifier[bestGain] operator[=] identifier[gain] operator[SEP] identifier[bestAttribute] operator[=] identifier[a] operator[SEP] identifier[bestThreshold] operator[=] identifier[threshold] operator[SEP] identifier[bestScores] operator[=] identifier[stats] operator[SEP] identifier[bestSplit] operator[=] identifier[aSplit] operator[SEP] identifier[bestLeftSide] operator[=] identifier[leftSide] operator[SEP] } } identifier[NodeBase] identifier[toReturn] operator[SEP] Keyword[if] operator[SEP] identifier[bestAttribute] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[bestAttribute] operator[<] identifier[catInfo] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[bestSplit] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[2] operator[SEP] identifier[toReturn] operator[=] Keyword[new] identifier[NodeRCat] operator[SEP] identifier[bestAttribute] , identifier[bestLeftSide] , identifier[setScore] operator[SEP] identifier[getMean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] { identifier[toReturn] operator[=] Keyword[new] identifier[NodeRCat] operator[SEP] identifier[goTo] , identifier[bestSplit] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[setScore] operator[SEP] identifier[getMean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[features] operator[SEP] identifier[remove] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[bestAttribute] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] identifier[toReturn] operator[=] Keyword[new] identifier[NodeRNum] operator[SEP] identifier[bestAttribute] operator[-] identifier[catInfo] operator[SEP] identifier[length] , identifier[bestThreshold] , identifier[setScore] operator[SEP] identifier[getMean] 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[toReturn] operator[SEP] identifier[children] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[toReturn] operator[SEP] identifier[children] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[train] operator[SEP] identifier[bestScores] operator[SEP] identifier[i] operator[SEP] , identifier[bestSplit] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[features] , identifier[catInfo] , identifier[rand] operator[SEP] operator[SEP] } Keyword[return] identifier[toReturn] operator[SEP] } Keyword[return] Keyword[new] identifier[NodeR] operator[SEP] identifier[setScore] operator[SEP] identifier[getMean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void beforeSessionEvent() throws NewSessionException { RemoteProxy p = session.getSlot().getProxy(); if (p instanceof TestSessionListener) { try { ((TestSessionListener) p).beforeSession(session); } catch (Exception e) { log.severe("Error running the beforeSessionListener : " + e.getMessage()); e.printStackTrace(); throw new NewSessionException("The listener threw an exception ( listener bug )", e); } } }
class class_name[name] begin[{] method[beforeSessionEvent, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[RemoteProxy], p] if[binary_operation[member[.p], instanceof, type[TestSessionListener]]] begin[{] TryStatement(block=[StatementExpression(expression=Cast(expression=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TestSessionListener, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error running the beforeSessionListener : "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=severe, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The listener threw an exception ( listener bug )"), 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=NewSessionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[beforeSessionEvent] operator[SEP] operator[SEP] Keyword[throws] identifier[NewSessionException] { identifier[RemoteProxy] identifier[p] operator[=] identifier[session] operator[SEP] identifier[getSlot] operator[SEP] operator[SEP] operator[SEP] identifier[getProxy] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[p] Keyword[instanceof] identifier[TestSessionListener] operator[SEP] { Keyword[try] { operator[SEP] operator[SEP] identifier[TestSessionListener] operator[SEP] identifier[p] operator[SEP] operator[SEP] identifier[beforeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NewSessionException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
public static void unzip(final File zip, final File patchDir) throws IOException { try (final ZipFile zipFile = new ZipFile(zip)){ unzip(zipFile, patchDir); } }
class class_name[name] begin[{] method[unzip, return_type[void], modifier[public static], parameter[zip, patchDir]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zipFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=patchDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unzip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=zipFile, type=ReferenceType(arguments=None, dimensions=[], name=ZipFile, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=zip, 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=ZipFile, sub_type=None)))]) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[unzip] operator[SEP] Keyword[final] identifier[File] identifier[zip] , Keyword[final] identifier[File] identifier[patchDir] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] operator[SEP] Keyword[final] identifier[ZipFile] identifier[zipFile] operator[=] Keyword[new] identifier[ZipFile] operator[SEP] identifier[zip] operator[SEP] operator[SEP] { identifier[unzip] operator[SEP] identifier[zipFile] , identifier[patchDir] operator[SEP] operator[SEP] } }
static List<Map<String, String>> convertConfigToAttributes(String configPath, List<ChildData> currentData) { List<Map<String, String>> attributes = new ArrayList<Map<String, String>>(); if (CommonUtils.isEmpty(currentData)) { return attributes; } for (ChildData childData : currentData) { attributes.add(convertConfigToAttribute(configPath, childData, false)); } return attributes; }
class class_name[name] begin[{] method[convertConfigToAttributes, return_type[type[List]], modifier[static], parameter[configPath, currentData]] begin[{] local_variable[type[List], attributes] if[call[CommonUtils.isEmpty, parameter[member[.currentData]]]] begin[{] return[member[.attributes]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=configPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=childData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=convertConfigToAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=currentData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ChildData, sub_type=None))), label=None) return[member[.attributes]] end[}] END[}]
Keyword[static] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[convertConfigToAttributes] operator[SEP] identifier[String] identifier[configPath] , identifier[List] operator[<] identifier[ChildData] operator[>] identifier[currentData] operator[SEP] { identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[attributes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CommonUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[currentData] operator[SEP] operator[SEP] { Keyword[return] identifier[attributes] operator[SEP] } Keyword[for] operator[SEP] identifier[ChildData] identifier[childData] operator[:] identifier[currentData] operator[SEP] { identifier[attributes] operator[SEP] identifier[add] operator[SEP] identifier[convertConfigToAttribute] operator[SEP] identifier[configPath] , identifier[childData] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[attributes] operator[SEP] }
private void initPath(IAtomContainer molecule) { for (int i = 0; i < molecule.getAtomCount(); i++) { IAtom atom = molecule.getAtom(i); atom.setProperty(PATH, new ArrayList<IAtom>()); } }
class class_name[name] begin[{] method[initPath, return_type[void], modifier[private], parameter[molecule]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=molecule, selectors=[], type_arguments=None), name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PATH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=molecule, 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) end[}] END[}]
Keyword[private] Keyword[void] identifier[initPath] operator[SEP] identifier[IAtomContainer] identifier[molecule] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[molecule] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[IAtom] identifier[atom] operator[=] identifier[molecule] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[atom] operator[SEP] identifier[setProperty] operator[SEP] identifier[PATH] , Keyword[new] identifier[ArrayList] operator[<] identifier[IAtom] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
static <T> Key<T> get(Class<T> type, AnnotationStrategy annotationStrategy) { return new Key<T>(type, annotationStrategy); }
class class_name[name] begin[{] method[get, return_type[type[Key]], modifier[static], parameter[type, annotationStrategy]] begin[{] return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotationStrategy, 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=Key, sub_type=None))] end[}] END[}]
Keyword[static] operator[<] identifier[T] operator[>] identifier[Key] operator[<] identifier[T] operator[>] identifier[get] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] , identifier[AnnotationStrategy] identifier[annotationStrategy] operator[SEP] { Keyword[return] Keyword[new] identifier[Key] operator[<] identifier[T] operator[>] operator[SEP] identifier[type] , identifier[annotationStrategy] operator[SEP] operator[SEP] }
@Override protected String doBuildColumnString(String dm) { StringBuilder sb = new StringBuilder(); sb.append(dm).append(urlId); sb.append(dm).append(docId); sb.append(dm).append(order); sb.append(dm).append(queryId); sb.append(dm).append(queryRequestedAt); sb.append(dm).append(requestedAt); sb.append(dm).append(url); sb.append(dm).append(userSessionId); 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]]] call[sb.append, parameter[member[.dm]]] call[sb.append, parameter[member[.dm]]] call[sb.append, parameter[member[.dm]]] call[sb.append, parameter[member[.dm]]] 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[urlId] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[docId] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[order] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[queryId] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[queryRequestedAt] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[requestedAt] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[dm] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[userSessionId] 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 static void initialize(KeenClient client) { if (client == null) { throw new IllegalArgumentException("Client must not be null"); } if (ClientSingleton.INSTANCE.client != null) { // Do nothing. return; } ClientSingleton.INSTANCE.client = client; }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[public static], parameter[client]] begin[{] if[binary_operation[member[.client], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Client must not be null")], 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[ClientSingleton.INSTANCE.client], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] assign[member[ClientSingleton.INSTANCE.client], member[.client]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[initialize] operator[SEP] identifier[KeenClient] identifier[client] operator[SEP] { Keyword[if] operator[SEP] identifier[client] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ClientSingleton] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[client] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[ClientSingleton] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[client] operator[=] identifier[client] operator[SEP] }
public static <T> boolean contains(T[] objectArray, T value) { return ArrayIterate.anySatisfyWith(objectArray, Predicates2.equal(), value); }
class class_name[name] begin[{] method[contains, return_type[type[boolean]], modifier[public static], parameter[objectArray, value]] begin[{] return[call[ArrayIterate.anySatisfyWith, parameter[member[.objectArray], call[Predicates2.equal, parameter[]], member[.value]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[boolean] identifier[contains] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[objectArray] , identifier[T] identifier[value] operator[SEP] { Keyword[return] identifier[ArrayIterate] operator[SEP] identifier[anySatisfyWith] operator[SEP] identifier[objectArray] , identifier[Predicates2] operator[SEP] identifier[equal] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] }
public void displayResourceInfo(List<CmsResource> resources, String messageKey) { m_infoResources = Lists.newArrayList(resources); if (m_infoComponent != null) { m_mainPanel.removeComponent(m_infoComponent); m_infoComponent = null; } if ((resources != null) && !resources.isEmpty()) { if (resources.size() == 1) { m_infoComponent = new CmsResourceInfo(resources.get(0)); m_mainPanel.addComponent(m_infoComponent, 0); } else { m_infoComponent = createResourceListPanel( messageKey == null ? null : Messages.get().getBundle(A_CmsUI.get().getLocale()).key(messageKey), resources); m_mainPanel.addComponent(m_infoComponent, 0); m_mainPanel.setExpandRatio(m_infoComponent, 1); // reset expand ratio of the content panel m_contentPanel.setSizeUndefined(); m_contentPanel.setWidth("100%"); m_mainPanel.setExpandRatio(m_contentPanel, 0); } } }
class class_name[name] begin[{] method[displayResourceInfo, return_type[void], modifier[public], parameter[resources, messageKey]] begin[{] assign[member[.m_infoResources], call[Lists.newArrayList, parameter[member[.resources]]]] if[binary_operation[member[.m_infoComponent], !=, literal[null]]] begin[{] call[m_mainPanel.removeComponent, parameter[member[.m_infoComponent]]] assign[member[.m_infoComponent], literal[null]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.resources], !=, literal[null]], &&, call[resources.isEmpty, parameter[]]]] begin[{] if[binary_operation[call[resources.size, parameter[]], ==, literal[1]]] begin[{] assign[member[.m_infoComponent], ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=resources, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsResourceInfo, sub_type=None))] call[m_mainPanel.addComponent, parameter[member[.m_infoComponent], literal[0]]] else begin[{] assign[member[.m_infoComponent], call[.createResourceListPanel, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=messageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUI, selectors=[MethodInvocation(arguments=[], member=getLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=messageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), member[.resources]]]] call[m_mainPanel.addComponent, parameter[member[.m_infoComponent], literal[0]]] call[m_mainPanel.setExpandRatio, parameter[member[.m_infoComponent], literal[1]]] call[m_contentPanel.setSizeUndefined, parameter[]] call[m_contentPanel.setWidth, parameter[literal["100%"]]] call[m_mainPanel.setExpandRatio, parameter[member[.m_contentPanel], literal[0]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[displayResourceInfo] operator[SEP] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[resources] , identifier[String] identifier[messageKey] operator[SEP] { identifier[m_infoResources] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] identifier[resources] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_infoComponent] operator[!=] Other[null] operator[SEP] { identifier[m_mainPanel] operator[SEP] identifier[removeComponent] operator[SEP] identifier[m_infoComponent] operator[SEP] operator[SEP] identifier[m_infoComponent] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[resources] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[resources] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { identifier[m_infoComponent] operator[=] Keyword[new] identifier[CmsResourceInfo] operator[SEP] identifier[resources] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[m_mainPanel] operator[SEP] identifier[addComponent] operator[SEP] identifier[m_infoComponent] , Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_infoComponent] operator[=] identifier[createResourceListPanel] operator[SEP] identifier[messageKey] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[messageKey] operator[SEP] , identifier[resources] operator[SEP] operator[SEP] identifier[m_mainPanel] operator[SEP] identifier[addComponent] operator[SEP] identifier[m_infoComponent] , Other[0] operator[SEP] operator[SEP] identifier[m_mainPanel] operator[SEP] identifier[setExpandRatio] operator[SEP] identifier[m_infoComponent] , Other[1] operator[SEP] operator[SEP] identifier[m_contentPanel] operator[SEP] identifier[setSizeUndefined] operator[SEP] operator[SEP] operator[SEP] identifier[m_contentPanel] operator[SEP] identifier[setWidth] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_mainPanel] operator[SEP] identifier[setExpandRatio] operator[SEP] identifier[m_contentPanel] , Other[0] operator[SEP] operator[SEP] } } }
public TileBasedLayer createLayer(String id, TileConfiguration conf, String url) { List<String> urls = new ArrayList<String>(); urls.add(url); return createLayer(id, conf, urls); }
class class_name[name] begin[{] method[createLayer, return_type[type[TileBasedLayer]], modifier[public], parameter[id, conf, url]] begin[{] local_variable[type[List], urls] call[urls.add, parameter[member[.url]]] return[call[.createLayer, parameter[member[.id], member[.conf], member[.urls]]]] end[}] END[}]
Keyword[public] identifier[TileBasedLayer] identifier[createLayer] operator[SEP] identifier[String] identifier[id] , identifier[TileConfiguration] identifier[conf] , identifier[String] identifier[url] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[urls] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[urls] operator[SEP] identifier[add] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[return] identifier[createLayer] operator[SEP] identifier[id] , identifier[conf] , identifier[urls] operator[SEP] operator[SEP] }
public final void release() { synchronized (this.LOCK) { if ((this.owner != null) && (this.owner.get() == Thread.currentThread())) { this.acquire--; if (this.acquire == 0) { this.owner = null; this.LOCK.notify(); } return; } if ((this.owner != null) && (this.owner.get() == null)) { this.owner = null; this.acquire = 0; this.LOCK.notify(); } throw new IllegalMonitorStateException(Thread.currentThread() .getName() + " is not the owner of the lock. " + ((this.owner != null) ? ((Thread) this.owner.get()) .getName() : "nobody") + " is the owner."); } }
class class_name[name] begin[{] method[release, return_type[void], modifier[final public], parameter[]] begin[{] SYNCHRONIZED[THIS[member[None.LOCK]]] BEGIN[{] if[binary_operation[binary_operation[THIS[member[None.owner]], !=, literal[null]], &&, binary_operation[THIS[member[None.owner]call[None.get, parameter[]]], ==, call[Thread.currentThread, parameter[]]]]] begin[{] THIS[member[None.acquire]] if[binary_operation[THIS[member[None.acquire]], ==, literal[0]]] begin[{] assign[THIS[member[None.owner]], literal[null]] THIS[member[None.LOCK]call[None.notify, parameter[]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[member[None.owner]], !=, literal[null]], &&, binary_operation[THIS[member[None.owner]call[None.get, parameter[]]], ==, literal[null]]]] begin[{] assign[THIS[member[None.owner]], literal[null]] assign[THIS[member[None.acquire]], literal[0]] THIS[member[None.LOCK]call[None.notify, parameter[]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=getName, 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=" is not the owner of the lock. "), operator=+), operandr=TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=owner, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="nobody"), if_true=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=owner, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None))), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is the owner."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalMonitorStateException, sub_type=None)), label=None) END[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[release] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[LOCK] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[acquire] operator[--] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[acquire] operator[==] Other[0] operator[SEP] { Keyword[this] operator[SEP] identifier[owner] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[LOCK] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[owner] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[acquire] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[LOCK] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalMonitorStateException] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[!=] Other[null] operator[SEP] operator[?] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static char getChar(MemorySegment[] segments, int offset) { if (inFirstSegment(segments, offset, 2)) { return segments[0].getChar(offset); } else { return getCharMultiSegments(segments, offset); } }
class class_name[name] begin[{] method[getChar, return_type[type[char]], modifier[public static], parameter[segments, offset]] begin[{] if[call[.inFirstSegment, parameter[member[.segments], member[.offset], literal[2]]]] begin[{] return[member[.segments]] else begin[{] return[call[.getCharMultiSegments, parameter[member[.segments], member[.offset]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[char] identifier[getChar] operator[SEP] identifier[MemorySegment] operator[SEP] operator[SEP] identifier[segments] , Keyword[int] identifier[offset] operator[SEP] { Keyword[if] operator[SEP] identifier[inFirstSegment] operator[SEP] identifier[segments] , identifier[offset] , Other[2] operator[SEP] operator[SEP] { Keyword[return] identifier[segments] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getChar] operator[SEP] identifier[offset] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[getCharMultiSegments] operator[SEP] identifier[segments] , identifier[offset] operator[SEP] operator[SEP] } }
@Nonnull @Nonempty public static String getCheckBoxHiddenFieldName (@Nonnull @Nonempty final String sFieldName) { ValueEnforcer.notEmpty (sFieldName, "FieldName"); return DEFAULT_CHECKBOX_HIDDEN_FIELD_PREFIX + sFieldName; }
class class_name[name] begin[{] method[getCheckBoxHiddenFieldName, return_type[type[String]], modifier[public static], parameter[sFieldName]] begin[{] call[ValueEnforcer.notEmpty, parameter[member[.sFieldName], literal["FieldName"]]] return[binary_operation[member[.DEFAULT_CHECKBOX_HIDDEN_FIELD_PREFIX], +, member[.sFieldName]]] end[}] END[}]
annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[public] Keyword[static] identifier[String] identifier[getCheckBoxHiddenFieldName] operator[SEP] annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sFieldName] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notEmpty] operator[SEP] identifier[sFieldName] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[DEFAULT_CHECKBOX_HIDDEN_FIELD_PREFIX] operator[+] identifier[sFieldName] operator[SEP] }
@Override public Response sendFAX(String CorpNum, int ItemCode, String MgtKey, String Sender, String Receiver) throws PopbillException { return sendFAX(CorpNum, ItemCode, MgtKey, Sender, Receiver, null); }
class class_name[name] begin[{] method[sendFAX, return_type[type[Response]], modifier[public], parameter[CorpNum, ItemCode, MgtKey, Sender, Receiver]] begin[{] return[call[.sendFAX, parameter[member[.CorpNum], member[.ItemCode], member[.MgtKey], member[.Sender], member[.Receiver], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Response] identifier[sendFAX] operator[SEP] identifier[String] identifier[CorpNum] , Keyword[int] identifier[ItemCode] , identifier[String] identifier[MgtKey] , identifier[String] identifier[Sender] , identifier[String] identifier[Receiver] operator[SEP] Keyword[throws] identifier[PopbillException] { Keyword[return] identifier[sendFAX] operator[SEP] identifier[CorpNum] , identifier[ItemCode] , identifier[MgtKey] , identifier[Sender] , identifier[Receiver] , Other[null] operator[SEP] operator[SEP] }
public synchronized Object setProperty( final String key, final String value) { String oldValue = super.getProperty(key); Object object = super.setProperty(key, value); if ((oldValue == null) && (object != null)) { oldValue = object.toString(); } // If there is a property object, notify it to give it chane to fire // its triggers. If one of those triggers fires a veto exception, roll // back the change. Property property = (Property) properties.get(key); if ((property != null) && triggersAreEnabled()) { try { property.onChange(oldValue, value); } catch (Trigger.VetoRT vex) { // Reset to the old value, do not call setProperty // unless you want to run out of stack space! superSetProperty(key, oldValue); try { property.onChange(value, oldValue); } catch (Trigger.VetoRT ex) { // ignore during reset } // Re-throw. throw vex; } } return oldValue; }
class class_name[name] begin[{] method[setProperty, return_type[type[Object]], modifier[synchronized public], parameter[key, value]] begin[{] local_variable[type[String], oldValue] local_variable[type[Object], object] if[binary_operation[binary_operation[member[.oldValue], ==, literal[null]], &&, binary_operation[member[.object], !=, literal[null]]]] begin[{] assign[member[.oldValue], call[object.toString, parameter[]]] else begin[{] None end[}] local_variable[type[Property], property] if[binary_operation[binary_operation[member[.property], !=, literal[null]], &&, call[.triggersAreEnabled, parameter[]]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onChange, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=superSetProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onChange, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Trigger.VetoRT']))], finally_block=None, label=None, resources=None), ThrowStatement(expression=MemberReference(member=vex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=vex, types=['Trigger.VetoRT']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.oldValue]] end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[Object] identifier[setProperty] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[String] identifier[value] operator[SEP] { identifier[String] identifier[oldValue] operator[=] Keyword[super] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[Object] identifier[object] operator[=] Keyword[super] operator[SEP] identifier[setProperty] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[oldValue] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[object] operator[!=] Other[null] operator[SEP] operator[SEP] { identifier[oldValue] operator[=] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[Property] identifier[property] operator[=] operator[SEP] identifier[Property] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[property] operator[!=] Other[null] operator[SEP] operator[&&] identifier[triggersAreEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[property] operator[SEP] identifier[onChange] operator[SEP] identifier[oldValue] , identifier[value] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Trigger] operator[SEP] identifier[VetoRT] identifier[vex] operator[SEP] { identifier[superSetProperty] operator[SEP] identifier[key] , identifier[oldValue] operator[SEP] operator[SEP] Keyword[try] { identifier[property] operator[SEP] identifier[onChange] operator[SEP] identifier[value] , identifier[oldValue] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Trigger] operator[SEP] identifier[VetoRT] identifier[ex] operator[SEP] { } Keyword[throw] identifier[vex] operator[SEP] } } Keyword[return] identifier[oldValue] operator[SEP] }
private boolean isWhitespace(char c) { if (c > 0x20) { return false; } if ((c == 0x20) || (c == 0x0a) || (c == 0x09) || (c == 0x0d)) { return true; } return false; // illegal ... }
class class_name[name] begin[{] method[isWhitespace, return_type[type[boolean]], modifier[private], parameter[c]] begin[{] if[binary_operation[member[.c], >, literal[0x20]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.c], ==, literal[0x20]], ||, binary_operation[member[.c], ==, literal[0x0a]]], ||, binary_operation[member[.c], ==, literal[0x09]]], ||, binary_operation[member[.c], ==, literal[0x0d]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isWhitespace] operator[SEP] Keyword[char] identifier[c] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[>] literal[Integer] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[Integer] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void serializeValues( JsonWriter writer, M values, JsonSerializationContext ctx, JsonSerializerParameters params ) { if ( !values.isEmpty() ) { Map<K, V> map = values; if ( ctx.isOrderMapEntriesByKeys() && !(values instanceof SortedMap<?, ?>) ) { map = new TreeMap<K, V>( map ); } if ( ctx.isWriteNullMapValues() ) { for ( Entry<K, V> entry : map.entrySet() ) { String name = keySerializer.serialize( entry.getKey(), ctx ); if ( keySerializer.mustBeEscaped( ctx ) ) { writer.name( name ); } else { writer.unescapeName( name ); } valueSerializer.serialize( writer, entry.getValue(), ctx, params, true ); } } else { for ( Entry<K, V> entry : map.entrySet() ) { if ( null != entry.getValue() ) { String name = keySerializer.serialize( entry.getKey(), ctx ); if ( keySerializer.mustBeEscaped( ctx ) ) { writer.name( name ); } else { writer.unescapeName( name ); } valueSerializer.serialize( writer, entry.getValue(), ctx, params, true ); } } } } }
class class_name[name] begin[{] method[serializeValues, return_type[void], modifier[public], parameter[writer, values, ctx, params]] begin[{] if[call[values.isEmpty, parameter[]]] begin[{] local_variable[type[Map], map] if[binary_operation[call[ctx.isOrderMapEntriesByKeys, parameter[]], &&, binary_operation[member[.values], instanceof, type[SortedMap]]]] begin[{] assign[member[.map], ClassCreator(arguments=[MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=TreeMap, sub_type=None))] else begin[{] None end[}] if[call[ctx.isWriteNullMapValues, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=keySerializer, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mustBeEscaped, postfix_operators=[], prefix_operators=[], qualifier=keySerializer, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unescapeName, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=valueSerializer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=keySerializer, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mustBeEscaped, postfix_operators=[], prefix_operators=[], qualifier=keySerializer, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unescapeName, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=valueSerializer, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[serializeValues] operator[SEP] identifier[JsonWriter] identifier[writer] , identifier[M] identifier[values] , identifier[JsonSerializationContext] identifier[ctx] , identifier[JsonSerializerParameters] identifier[params] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[values] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] operator[=] identifier[values] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[SEP] identifier[isOrderMapEntriesByKeys] operator[SEP] operator[SEP] operator[&&] operator[!] operator[SEP] identifier[values] Keyword[instanceof] identifier[SortedMap] operator[<] operator[?] , operator[?] operator[>] operator[SEP] operator[SEP] { identifier[map] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[map] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ctx] operator[SEP] identifier[isWriteNullMapValues] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[keySerializer] operator[SEP] identifier[serialize] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[ctx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keySerializer] operator[SEP] identifier[mustBeEscaped] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] { identifier[writer] operator[SEP] identifier[name] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[else] { identifier[writer] operator[SEP] identifier[unescapeName] operator[SEP] identifier[name] operator[SEP] operator[SEP] } identifier[valueSerializer] operator[SEP] identifier[serialize] operator[SEP] identifier[writer] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[ctx] , identifier[params] , literal[boolean] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[keySerializer] operator[SEP] identifier[serialize] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[ctx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keySerializer] operator[SEP] identifier[mustBeEscaped] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] { identifier[writer] operator[SEP] identifier[name] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[else] { identifier[writer] operator[SEP] identifier[unescapeName] operator[SEP] identifier[name] operator[SEP] operator[SEP] } identifier[valueSerializer] operator[SEP] identifier[serialize] operator[SEP] identifier[writer] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[ctx] , identifier[params] , literal[boolean] operator[SEP] operator[SEP] } } } } }
@Nonnull public static IntConsumer intConsumerFrom(Consumer<IntConsumerBuilder> buildingFunction) { IntConsumerBuilder builder = new IntConsumerBuilder(); buildingFunction.accept(builder); return builder.build(); }
class class_name[name] begin[{] method[intConsumerFrom, return_type[type[IntConsumer]], modifier[public static], parameter[buildingFunction]] begin[{] local_variable[type[IntConsumerBuilder], builder] call[buildingFunction.accept, parameter[member[.builder]]] return[call[builder.build, parameter[]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[IntConsumer] identifier[intConsumerFrom] operator[SEP] identifier[Consumer] operator[<] identifier[IntConsumerBuilder] operator[>] identifier[buildingFunction] operator[SEP] { identifier[IntConsumerBuilder] identifier[builder] operator[=] Keyword[new] identifier[IntConsumerBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildingFunction] operator[SEP] identifier[accept] operator[SEP] identifier[builder] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public static <T> Stream<T> iterate(final T init, final BooleanSupplier hasNext, final UnaryOperator<T> f) { N.checkArgNotNull(hasNext); N.checkArgNotNull(f); return of(new ObjIteratorEx<T>() { private T t = (T) NONE; private boolean hasNextVal = false; @Override public boolean hasNext() { if (hasNextVal == false) { hasNextVal = hasNext.getAsBoolean(); } return hasNextVal; } @Override public T next() { if (hasNextVal == false && hasNext() == false) { throw new NoSuchElementException(); } hasNextVal = false; return t = (t == NONE) ? init : f.apply(t); } }); }
class class_name[name] begin[{] method[iterate, return_type[type[Stream]], modifier[public static], parameter[init, hasNext, f]] begin[{] call[N.checkArgNotNull, parameter[member[.hasNext]]] call[N.checkArgNotNull, parameter[member[.f]]] return[call[.of, parameter[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=NONE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), name=t)], documentation=None, modifiers={'private'}, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=hasNextVal)], documentation=None, modifiers={'private'}, type=BasicType(dimensions=[], name=boolean)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=hasNextVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasNextVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAsBoolean, postfix_operators=[], prefix_operators=[], qualifier=hasNext, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=MemberReference(member=hasNextVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=hasNextVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, 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=NoSuchElementException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasNextVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), ReturnStatement(expression=Assignment(expressionl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NONE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), if_true=MemberReference(member=init, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None)], documentation=None, modifiers={'public'}, name=next, 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=ObjIteratorEx, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Stream] operator[<] identifier[T] operator[>] identifier[iterate] operator[SEP] Keyword[final] identifier[T] identifier[init] , Keyword[final] identifier[BooleanSupplier] identifier[hasNext] , Keyword[final] identifier[UnaryOperator] operator[<] identifier[T] operator[>] identifier[f] operator[SEP] { identifier[N] operator[SEP] identifier[checkArgNotNull] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] identifier[N] operator[SEP] identifier[checkArgNotNull] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[return] identifier[of] operator[SEP] Keyword[new] identifier[ObjIteratorEx] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] { Keyword[private] identifier[T] identifier[t] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[NONE] operator[SEP] Keyword[private] Keyword[boolean] identifier[hasNextVal] operator[=] literal[boolean] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[hasNextVal] operator[==] literal[boolean] operator[SEP] { identifier[hasNextVal] operator[=] identifier[hasNext] operator[SEP] identifier[getAsBoolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[hasNextVal] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[next] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[hasNextVal] operator[==] literal[boolean] operator[&&] identifier[hasNext] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[throw] Keyword[new] identifier[NoSuchElementException] operator[SEP] operator[SEP] operator[SEP] } identifier[hasNextVal] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[t] operator[=] operator[SEP] identifier[t] operator[==] identifier[NONE] operator[SEP] operator[?] identifier[init] operator[:] identifier[f] operator[SEP] identifier[apply] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public IfcSimplePropertyTemplateTypeEnum createIfcSimplePropertyTemplateTypeEnumFromString(EDataType eDataType, String initialValue) { IfcSimplePropertyTemplateTypeEnum result = IfcSimplePropertyTemplateTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
class class_name[name] begin[{] method[createIfcSimplePropertyTemplateTypeEnumFromString, return_type[type[IfcSimplePropertyTemplateTypeEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{] local_variable[type[IfcSimplePropertyTemplateTypeEnum], result] if[binary_operation[member[.result], ==, 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 value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[IfcSimplePropertyTemplateTypeEnum] identifier[createIfcSimplePropertyTemplateTypeEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] { identifier[IfcSimplePropertyTemplateTypeEnum] identifier[result] operator[=] identifier[IfcSimplePropertyTemplateTypeEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public <T> T head(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.HEAD).apply(configureRequest(type, HttpVerb.HEAD, closure), this::doHead)); }
class class_name[name] begin[{] method[head, return_type[type[T]], modifier[public], parameter[type, closure]] begin[{] return[call[type.cast, parameter[call[interceptors.get, parameter[member[HttpVerb.HEAD]]]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[head] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] , annotation[@] identifier[DelegatesTo] operator[SEP] identifier[HttpConfig] operator[SEP] Keyword[class] operator[SEP] Keyword[final] identifier[Closure] identifier[closure] operator[SEP] { Keyword[return] identifier[type] operator[SEP] identifier[cast] operator[SEP] identifier[interceptors] operator[SEP] identifier[get] operator[SEP] identifier[HttpVerb] operator[SEP] identifier[HEAD] operator[SEP] operator[SEP] identifier[apply] operator[SEP] identifier[configureRequest] operator[SEP] identifier[type] , identifier[HttpVerb] operator[SEP] identifier[HEAD] , identifier[closure] operator[SEP] , Keyword[this] operator[::] identifier[doHead] operator[SEP] operator[SEP] operator[SEP] }
public static void packDirectory(File dir, ZipOutputStream zos) throws IOException { byte[] buffer = new byte[64 * 1024]; // a reusable buffer try { traverseAndWrite(dir, zos, new StringBuilder(), true, buffer); } finally { close(zos); } }
class class_name[name] begin[{] method[packDirectory, return_type[void], modifier[public static], parameter[dir, zos]] begin[{] local_variable[type[byte], buffer] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=zos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverseAndWrite, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[packDirectory] operator[SEP] identifier[File] identifier[dir] , identifier[ZipOutputStream] identifier[zos] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[64] operator[*] Other[1024] operator[SEP] operator[SEP] Keyword[try] { identifier[traverseAndWrite] operator[SEP] identifier[dir] , identifier[zos] , Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] , literal[boolean] , identifier[buffer] operator[SEP] operator[SEP] } Keyword[finally] { identifier[close] operator[SEP] identifier[zos] operator[SEP] operator[SEP] } }
public static snmpuser[] get(nitro_service service, options option) throws Exception{ snmpuser obj = new snmpuser(); snmpuser[] response = (snmpuser[])obj.get_resources(service,option); return response; }
class class_name[name] begin[{] method[get, return_type[type[snmpuser]], modifier[public static], parameter[service, option]] begin[{] local_variable[type[snmpuser], obj] local_variable[type[snmpuser], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[snmpuser] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[options] identifier[option] operator[SEP] Keyword[throws] identifier[Exception] { identifier[snmpuser] identifier[obj] operator[=] Keyword[new] identifier[snmpuser] operator[SEP] operator[SEP] operator[SEP] identifier[snmpuser] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[snmpuser] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public static UnitResponse createException(Throwable e, String errMsg) { return UnitResponse.createException(e).setMessage(errMsg); }
class class_name[name] begin[{] method[createException, return_type[type[UnitResponse]], modifier[public static], parameter[e, errMsg]] begin[{] return[call[UnitResponse.createException, parameter[member[.e]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[UnitResponse] identifier[createException] operator[SEP] identifier[Throwable] identifier[e] , identifier[String] identifier[errMsg] operator[SEP] { Keyword[return] identifier[UnitResponse] operator[SEP] identifier[createException] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[setMessage] operator[SEP] identifier[errMsg] operator[SEP] operator[SEP] }
@SuppressWarnings("unused") // called through reflection by RequestServer public ModelMetricsListSchemaV3 score(int version, ModelMetricsListSchemaV3 s) { // parameters checking: if (null == s.model) throw new H2OIllegalArgumentException("model", "predict", s.model); if (null == DKV.get(s.model.name)) throw new H2OKeyNotFoundArgumentException("model", "predict", s.model.name); if (null == s.frame) throw new H2OIllegalArgumentException("frame", "predict", s.frame); if (null == DKV.get(s.frame.name)) throw new H2OKeyNotFoundArgumentException("frame", "predict", s.frame.name); ModelMetricsList parms = s.createAndFillImpl(); String customMetricFunc = s.custom_metric_func; if (customMetricFunc == null) { customMetricFunc = parms._model._parms._custom_metric_func; } parms._model.score(parms._frame, parms._predictions_name, null, true, CFuncRef.from(customMetricFunc)).remove(); // throw away predictions, keep metrics as a side-effect ModelMetricsListSchemaV3 mm = this.fetch(version, s); // TODO: for now only binary predictors write an MM object. // For the others cons one up here to return the predictions frame. if (null == mm) mm = new ModelMetricsListSchemaV3(); if (null == mm.model_metrics || 0 == mm.model_metrics.length) { Log.warn("Score() did not return a ModelMetrics for model: " + s.model + " on frame: " + s.frame); } return mm; }
class class_name[name] begin[{] method[score, return_type[type[ModelMetricsListSchemaV3]], modifier[public], parameter[version, s]] begin[{] if[binary_operation[literal[null], ==, member[s.model]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="model"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="predict"), MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=H2OIllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[literal[null], ==, call[DKV.get, parameter[member[s.model.name]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="model"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="predict"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=s.model, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=H2OKeyNotFoundArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[literal[null], ==, member[s.frame]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="frame"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="predict"), MemberReference(member=frame, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=H2OIllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[literal[null], ==, call[DKV.get, parameter[member[s.frame.name]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="frame"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="predict"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=s.frame, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=H2OKeyNotFoundArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ModelMetricsList], parms] local_variable[type[String], customMetricFunc] if[binary_operation[member[.customMetricFunc], ==, literal[null]]] begin[{] assign[member[.customMetricFunc], member[parms._model._parms._custom_metric_func]] else begin[{] None end[}] call[parms._model.score, parameter[member[parms._frame], member[parms._predictions_name], literal[null], literal[true], call[CFuncRef.from, parameter[member[.customMetricFunc]]]]] local_variable[type[ModelMetricsListSchemaV3], mm] if[binary_operation[literal[null], ==, member[.mm]]] begin[{] assign[member[.mm], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelMetricsListSchemaV3, sub_type=None))] else begin[{] None end[}] if[binary_operation[binary_operation[literal[null], ==, member[mm.model_metrics]], ||, binary_operation[literal[0], ==, member[mm.model_metrics.length]]]] begin[{] call[Log.warn, parameter[binary_operation[binary_operation[binary_operation[literal["Score() did not return a ModelMetrics for model: "], +, member[s.model]], +, literal[" on frame: "]], +, member[s.frame]]]] else begin[{] None end[}] return[member[.mm]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[ModelMetricsListSchemaV3] identifier[score] operator[SEP] Keyword[int] identifier[version] , identifier[ModelMetricsListSchemaV3] identifier[s] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[s] operator[SEP] identifier[model] operator[SEP] Keyword[throw] Keyword[new] identifier[H2OIllegalArgumentException] operator[SEP] literal[String] , literal[String] , identifier[s] operator[SEP] identifier[model] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[DKV] operator[SEP] identifier[get] operator[SEP] identifier[s] operator[SEP] identifier[model] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[H2OKeyNotFoundArgumentException] operator[SEP] literal[String] , literal[String] , identifier[s] operator[SEP] identifier[model] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[s] operator[SEP] identifier[frame] operator[SEP] Keyword[throw] Keyword[new] identifier[H2OIllegalArgumentException] operator[SEP] literal[String] , literal[String] , identifier[s] operator[SEP] identifier[frame] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[DKV] operator[SEP] identifier[get] operator[SEP] identifier[s] operator[SEP] identifier[frame] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[H2OKeyNotFoundArgumentException] operator[SEP] literal[String] , literal[String] , identifier[s] operator[SEP] identifier[frame] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[ModelMetricsList] identifier[parms] operator[=] identifier[s] operator[SEP] identifier[createAndFillImpl] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[customMetricFunc] operator[=] identifier[s] operator[SEP] identifier[custom_metric_func] operator[SEP] Keyword[if] operator[SEP] identifier[customMetricFunc] operator[==] Other[null] operator[SEP] { identifier[customMetricFunc] operator[=] identifier[parms] operator[SEP] identifier[_model] operator[SEP] identifier[_parms] operator[SEP] identifier[_custom_metric_func] operator[SEP] } identifier[parms] operator[SEP] identifier[_model] operator[SEP] identifier[score] operator[SEP] identifier[parms] operator[SEP] identifier[_frame] , identifier[parms] operator[SEP] identifier[_predictions_name] , Other[null] , literal[boolean] , identifier[CFuncRef] operator[SEP] identifier[from] operator[SEP] identifier[customMetricFunc] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[ModelMetricsListSchemaV3] identifier[mm] operator[=] Keyword[this] operator[SEP] identifier[fetch] operator[SEP] identifier[version] , identifier[s] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[mm] operator[SEP] identifier[mm] operator[=] Keyword[new] identifier[ModelMetricsListSchemaV3] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[mm] operator[SEP] identifier[model_metrics] operator[||] Other[0] operator[==] identifier[mm] operator[SEP] identifier[model_metrics] operator[SEP] identifier[length] operator[SEP] { identifier[Log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[s] operator[SEP] identifier[model] operator[+] literal[String] operator[+] identifier[s] operator[SEP] identifier[frame] operator[SEP] operator[SEP] } Keyword[return] identifier[mm] operator[SEP] }
public List<NaaccrValidationError> getAllValidationErrors() { List<NaaccrValidationError> results = new ArrayList<>(getValidationErrors()); results.addAll(getItems().stream().filter(item -> item.getValidationError() != null).map(Item::getValidationError).collect(Collectors.toList())); for (Tumor tumor : getTumors()) results.addAll(tumor.getAllValidationErrors()); return results; }
class class_name[name] begin[{] method[getAllValidationErrors, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], results] call[results.addAll, parameter[call[.getItems, parameter[]]]] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAllValidationErrors, postfix_operators=[], prefix_operators=[], qualifier=tumor, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTumors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tumor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Tumor, sub_type=None))), label=None) return[member[.results]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[NaaccrValidationError] operator[>] identifier[getAllValidationErrors] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[NaaccrValidationError] operator[>] identifier[results] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[getValidationErrors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[addAll] operator[SEP] identifier[getItems] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[item] operator[->] identifier[item] operator[SEP] identifier[getValidationError] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Item] operator[::] identifier[getValidationError] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Tumor] identifier[tumor] operator[:] identifier[getTumors] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[addAll] operator[SEP] identifier[tumor] operator[SEP] identifier[getAllValidationErrors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[results] operator[SEP] }
public long createLO(int mode) throws SQLException { if (conn.getAutoCommit()) { throw new PSQLException(GT.tr("Large Objects may not be used in auto-commit mode."), PSQLState.NO_ACTIVE_SQL_TRANSACTION); } FastpathArg[] args = new FastpathArg[1]; args[0] = new FastpathArg(mode); return fp.getOID("lo_creat", args); }
class class_name[name] begin[{] method[createLO, return_type[type[long]], modifier[public], parameter[mode]] begin[{] if[call[conn.getAutoCommit, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Large Objects may not be used in auto-commit mode.")], member=tr, postfix_operators=[], prefix_operators=[], qualifier=GT, selectors=[], type_arguments=None), MemberReference(member=NO_ACTIVE_SQL_TRANSACTION, postfix_operators=[], prefix_operators=[], qualifier=PSQLState, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PSQLException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[FastpathArg], args] assign[member[.args], ClassCreator(arguments=[MemberReference(member=mode, 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=FastpathArg, sub_type=None))] return[call[fp.getOID, parameter[literal["lo_creat"], member[.args]]]] end[}] END[}]
Keyword[public] Keyword[long] identifier[createLO] operator[SEP] Keyword[int] identifier[mode] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[if] operator[SEP] identifier[conn] operator[SEP] identifier[getAutoCommit] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[PSQLException] operator[SEP] identifier[GT] operator[SEP] identifier[tr] operator[SEP] literal[String] operator[SEP] , identifier[PSQLState] operator[SEP] identifier[NO_ACTIVE_SQL_TRANSACTION] operator[SEP] operator[SEP] } identifier[FastpathArg] operator[SEP] operator[SEP] identifier[args] operator[=] Keyword[new] identifier[FastpathArg] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[FastpathArg] operator[SEP] identifier[mode] operator[SEP] operator[SEP] Keyword[return] identifier[fp] operator[SEP] identifier[getOID] operator[SEP] literal[String] , identifier[args] operator[SEP] operator[SEP] }
public String build(Protocol protocol, String oauthToken, String oauthTokenSecret) throws IOException, OAuthException, URISyntaxException { OAuthAccessor accessor = new OAuthAccessor(consumer); accessor.tokenSecret = oauthTokenSecret; Map<String, String> parameters = new HashMap<String, String>(); parameters.put(OAuth.OAUTH_SIGNATURE_METHOD, "HMAC-SHA1"); parameters.put(OAuth.OAUTH_TOKEN, oauthToken); String url = String.format("https://mail.google.com/mail/b/%s/%s/", email, (Protocol.IMAP == protocol) ? "imap" : "smtp"); OAuthMessage message = new OAuthMessage( "GET", url, parameters.entrySet()); message.addRequiredParameters(accessor); StringBuilder authString = new StringBuilder(); authString.append("GET "); authString.append(url); authString.append(" "); int i = 0; for (Map.Entry<String, String> entry : message.getParameters()) { if (i++ > 0) { authString.append(","); } authString.append(OAuth.percentEncode(entry.getKey())); authString.append("=\""); authString.append(OAuth.percentEncode(entry.getValue())); authString.append("\""); } return Base64.encode(authString.toString().getBytes()); }
class class_name[name] begin[{] method[build, return_type[type[String]], modifier[public], parameter[protocol, oauthToken, oauthTokenSecret]] begin[{] local_variable[type[OAuthAccessor], accessor] assign[member[accessor.tokenSecret], member[.oauthTokenSecret]] local_variable[type[Map], parameters] call[parameters.put, parameter[member[OAuth.OAUTH_SIGNATURE_METHOD], literal["HMAC-SHA1"]]] call[parameters.put, parameter[member[OAuth.OAUTH_TOKEN], member[.oauthToken]]] local_variable[type[String], url] local_variable[type[OAuthMessage], message] call[message.addRequiredParameters, parameter[member[.accessor]]] local_variable[type[StringBuilder], authString] call[authString.append, parameter[literal["GET "]]] call[authString.append, parameter[member[.url]]] call[authString.append, parameter[literal[" "]]] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=authString, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=percentEncode, postfix_operators=[], prefix_operators=[], qualifier=OAuth, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=authString, 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=authString, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=percentEncode, postfix_operators=[], prefix_operators=[], qualifier=OAuth, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=authString, 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=authString, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[call[Base64.encode, parameter[call[authString.toString, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[build] operator[SEP] identifier[Protocol] identifier[protocol] , identifier[String] identifier[oauthToken] , identifier[String] identifier[oauthTokenSecret] operator[SEP] Keyword[throws] identifier[IOException] , identifier[OAuthException] , identifier[URISyntaxException] { identifier[OAuthAccessor] identifier[accessor] operator[=] Keyword[new] identifier[OAuthAccessor] operator[SEP] identifier[consumer] operator[SEP] operator[SEP] identifier[accessor] operator[SEP] identifier[tokenSecret] operator[=] identifier[oauthTokenSecret] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] identifier[OAuth] operator[SEP] identifier[OAUTH_SIGNATURE_METHOD] , literal[String] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] identifier[OAuth] operator[SEP] identifier[OAUTH_TOKEN] , identifier[oauthToken] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[email] , operator[SEP] identifier[Protocol] operator[SEP] identifier[IMAP] operator[==] identifier[protocol] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[OAuthMessage] identifier[message] operator[=] Keyword[new] identifier[OAuthMessage] operator[SEP] literal[String] , identifier[url] , identifier[parameters] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[addRequiredParameters] operator[SEP] identifier[accessor] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[authString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[authString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authString] operator[SEP] identifier[append] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[authString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[message] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[++] operator[>] Other[0] operator[SEP] { identifier[authString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[authString] operator[SEP] identifier[append] operator[SEP] identifier[OAuth] operator[SEP] identifier[percentEncode] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[authString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[authString] operator[SEP] identifier[append] operator[SEP] identifier[OAuth] operator[SEP] identifier[percentEncode] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[authString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[Base64] operator[SEP] identifier[encode] operator[SEP] identifier[authString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected Timeout parseTimeout(XMLStreamReader reader, Boolean isXa) throws XMLStreamException, ParserException, ValidateException { Long blockingTimeoutMillis = null; Long allocationRetryWaitMillis = null; Integer idleTimeoutMinutes = null; Integer allocationRetry = null; Integer xaResourceTimeout = null; Map<String, String> expressions = new HashMap<String, String>(); while (reader.hasNext()) { switch (reader.nextTag()) { case END_ELEMENT : { switch (reader.getLocalName()) { case CommonXML.ELEMENT_TIMEOUT : return new TimeoutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry, allocationRetryWaitMillis, xaResourceTimeout, !expressions.isEmpty() ? expressions : null); case CommonXML.ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS : case CommonXML.ELEMENT_ALLOCATION_RETRY : case CommonXML.ELEMENT_BLOCKING_TIMEOUT_MILLIS : case CommonXML.ELEMENT_IDLE_TIMEOUT_MINUTES : case CommonXML.ELEMENT_XA_RESOURCE_TIMEOUT : break; default : throw new ParserException(bundle.unexpectedEndTag(reader.getLocalName())); } } case START_ELEMENT : { switch (reader.getLocalName()) { case CommonXML.ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS : { allocationRetryWaitMillis = elementAsLong(reader, CommonXML.ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS, expressions); break; } case CommonXML.ELEMENT_ALLOCATION_RETRY : { allocationRetry = elementAsInteger(reader, CommonXML.ELEMENT_ALLOCATION_RETRY, expressions); break; } case CommonXML.ELEMENT_BLOCKING_TIMEOUT_MILLIS : { blockingTimeoutMillis = elementAsLong(reader, CommonXML.ELEMENT_BLOCKING_TIMEOUT_MILLIS, expressions); break; } case CommonXML.ELEMENT_IDLE_TIMEOUT_MINUTES : { idleTimeoutMinutes = elementAsInteger(reader, CommonXML.ELEMENT_IDLE_TIMEOUT_MINUTES, expressions); break; } case CommonXML.ELEMENT_XA_RESOURCE_TIMEOUT : { if (isXa != null && Boolean.FALSE.equals(isXa)) throw new ParserException(bundle.unsupportedElement(reader.getLocalName())); xaResourceTimeout = elementAsInteger(reader, CommonXML.ELEMENT_XA_RESOURCE_TIMEOUT, expressions); break; } default : throw new ParserException(bundle.unexpectedElement(reader.getLocalName())); } break; } } } throw new ParserException(bundle.unexpectedEndOfDocument()); }
class class_name[name] begin[{] method[parseTimeout, return_type[type[Timeout]], modifier[protected], parameter[reader, isXa]] begin[{] local_variable[type[Long], blockingTimeoutMillis] local_variable[type[Long], allocationRetryWaitMillis] local_variable[type[Integer], idleTimeoutMinutes] local_variable[type[Integer], allocationRetry] local_variable[type[Integer], xaResourceTimeout] local_variable[type[Map], expressions] while[call[reader.hasNext, parameter[]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['END_ELEMENT'], statements=[BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ELEMENT_TIMEOUT, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[])], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=blockingTimeoutMillis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=idleTimeoutMinutes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=allocationRetry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=allocationRetryWaitMillis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xaResourceTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=expressions, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=expressions, 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=TimeoutImpl, sub_type=None)), label=None)]), SwitchStatementCase(case=[MemberReference(member=ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=ELEMENT_ALLOCATION_RETRY, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=ELEMENT_BLOCKING_TIMEOUT_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=ELEMENT_IDLE_TIMEOUT_MINUTES, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=ELEMENT_XA_RESOURCE_TIMEOUT, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], member=unexpectedEndTag, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParserException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)])]), SwitchStatementCase(case=['START_ELEMENT'], statements=[BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=allocationRetryWaitMillis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=expressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAsLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=ELEMENT_ALLOCATION_RETRY, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=allocationRetry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ELEMENT_ALLOCATION_RETRY, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=expressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAsInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=ELEMENT_BLOCKING_TIMEOUT_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=blockingTimeoutMillis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ELEMENT_BLOCKING_TIMEOUT_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=expressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAsLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=ELEMENT_IDLE_TIMEOUT_MINUTES, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=idleTimeoutMinutes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ELEMENT_IDLE_TIMEOUT_MINUTES, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=expressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAsInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=ELEMENT_XA_RESOURCE_TIMEOUT, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[])], statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=isXa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=isXa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=Boolean.FALSE, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], member=unsupportedElement, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParserException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=xaResourceTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ELEMENT_XA_RESOURCE_TIMEOUT, postfix_operators=[], prefix_operators=[], qualifier=CommonXML, selectors=[]), MemberReference(member=expressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAsInteger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], member=unexpectedElement, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParserException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])])], expression=MethodInvocation(arguments=[], member=nextTag, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None) end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=unexpectedEndOfDocument, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParserException, sub_type=None)), label=None) end[}] END[}]
Keyword[protected] identifier[Timeout] identifier[parseTimeout] operator[SEP] identifier[XMLStreamReader] identifier[reader] , identifier[Boolean] identifier[isXa] operator[SEP] Keyword[throws] identifier[XMLStreamException] , identifier[ParserException] , identifier[ValidateException] { identifier[Long] identifier[blockingTimeoutMillis] operator[=] Other[null] operator[SEP] identifier[Long] identifier[allocationRetryWaitMillis] operator[=] Other[null] operator[SEP] identifier[Integer] identifier[idleTimeoutMinutes] operator[=] Other[null] operator[SEP] identifier[Integer] identifier[allocationRetry] operator[=] Other[null] operator[SEP] identifier[Integer] identifier[xaResourceTimeout] operator[=] Other[null] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[expressions] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[reader] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[reader] operator[SEP] identifier[nextTag] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[END_ELEMENT] operator[:] { Keyword[switch] operator[SEP] identifier[reader] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_TIMEOUT] operator[:] Keyword[return] Keyword[new] identifier[TimeoutImpl] operator[SEP] identifier[blockingTimeoutMillis] , identifier[idleTimeoutMinutes] , identifier[allocationRetry] , identifier[allocationRetryWaitMillis] , identifier[xaResourceTimeout] , operator[!] identifier[expressions] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] identifier[expressions] operator[:] Other[null] operator[SEP] operator[SEP] Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS] operator[:] Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_ALLOCATION_RETRY] operator[:] Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_BLOCKING_TIMEOUT_MILLIS] operator[:] Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_IDLE_TIMEOUT_MINUTES] operator[:] Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_XA_RESOURCE_TIMEOUT] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] identifier[bundle] operator[SEP] identifier[unexpectedEndTag] operator[SEP] identifier[reader] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[case] identifier[START_ELEMENT] operator[:] { Keyword[switch] operator[SEP] identifier[reader] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS] operator[:] { identifier[allocationRetryWaitMillis] operator[=] identifier[elementAsLong] operator[SEP] identifier[reader] , identifier[CommonXML] operator[SEP] identifier[ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS] , identifier[expressions] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_ALLOCATION_RETRY] operator[:] { identifier[allocationRetry] operator[=] identifier[elementAsInteger] operator[SEP] identifier[reader] , identifier[CommonXML] operator[SEP] identifier[ELEMENT_ALLOCATION_RETRY] , identifier[expressions] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_BLOCKING_TIMEOUT_MILLIS] operator[:] { identifier[blockingTimeoutMillis] operator[=] identifier[elementAsLong] operator[SEP] identifier[reader] , identifier[CommonXML] operator[SEP] identifier[ELEMENT_BLOCKING_TIMEOUT_MILLIS] , identifier[expressions] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_IDLE_TIMEOUT_MINUTES] operator[:] { identifier[idleTimeoutMinutes] operator[=] identifier[elementAsInteger] operator[SEP] identifier[reader] , identifier[CommonXML] operator[SEP] identifier[ELEMENT_IDLE_TIMEOUT_MINUTES] , identifier[expressions] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[CommonXML] operator[SEP] identifier[ELEMENT_XA_RESOURCE_TIMEOUT] operator[:] { Keyword[if] operator[SEP] identifier[isXa] operator[!=] Other[null] operator[&&] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] identifier[equals] operator[SEP] identifier[isXa] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] identifier[bundle] operator[SEP] identifier[unsupportedElement] operator[SEP] identifier[reader] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[xaResourceTimeout] operator[=] identifier[elementAsInteger] operator[SEP] identifier[reader] , identifier[CommonXML] operator[SEP] identifier[ELEMENT_XA_RESOURCE_TIMEOUT] , identifier[expressions] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] identifier[bundle] operator[SEP] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } } Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] identifier[bundle] operator[SEP] identifier[unexpectedEndOfDocument] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private GeneralMatrix fillVMatrix( int dim, Coordinate[] controlPoints ) { int controlPointsNum = controlPoints.length; GeneralMatrix V = new GeneralMatrix(controlPointsNum + 3, 1); for( int i = 0; i < controlPointsNum; i++ ) { V.setElement(i, 0, controlPoints[i].z); } V.setElement(V.getNumRow() - 3, 0, 0); V.setElement(V.getNumRow() - 2, 0, 0); V.setElement(V.getNumRow() - 1, 0, 0); return V; }
class class_name[name] begin[{] method[fillVMatrix, return_type[type[GeneralMatrix]], modifier[private], parameter[dim, controlPoints]] begin[{] local_variable[type[int], controlPointsNum] local_variable[type[GeneralMatrix], V] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=controlPoints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=z, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=setElement, postfix_operators=[], prefix_operators=[], qualifier=V, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=controlPointsNum, 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) call[V.setElement, parameter[binary_operation[call[V.getNumRow, parameter[]], -, literal[3]], literal[0], literal[0]]] call[V.setElement, parameter[binary_operation[call[V.getNumRow, parameter[]], -, literal[2]], literal[0], literal[0]]] call[V.setElement, parameter[binary_operation[call[V.getNumRow, parameter[]], -, literal[1]], literal[0], literal[0]]] return[member[.V]] end[}] END[}]
Keyword[private] identifier[GeneralMatrix] identifier[fillVMatrix] operator[SEP] Keyword[int] identifier[dim] , identifier[Coordinate] operator[SEP] operator[SEP] identifier[controlPoints] operator[SEP] { Keyword[int] identifier[controlPointsNum] operator[=] identifier[controlPoints] operator[SEP] identifier[length] operator[SEP] identifier[GeneralMatrix] identifier[V] operator[=] Keyword[new] identifier[GeneralMatrix] operator[SEP] identifier[controlPointsNum] operator[+] Other[3] , Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[controlPointsNum] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[V] operator[SEP] identifier[setElement] operator[SEP] identifier[i] , Other[0] , identifier[controlPoints] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[z] operator[SEP] operator[SEP] } identifier[V] operator[SEP] identifier[setElement] operator[SEP] identifier[V] operator[SEP] identifier[getNumRow] operator[SEP] operator[SEP] operator[-] Other[3] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[V] operator[SEP] identifier[setElement] operator[SEP] identifier[V] operator[SEP] identifier[getNumRow] operator[SEP] operator[SEP] operator[-] Other[2] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[V] operator[SEP] identifier[setElement] operator[SEP] identifier[V] operator[SEP] identifier[getNumRow] operator[SEP] operator[SEP] operator[-] Other[1] , Other[0] , Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[V] operator[SEP] }
public static void setContextStrategy(ContextStrategy contextStrategy) { if (ContextTrampoline.contextStrategy != null) { throw new IllegalStateException("contextStrategy was already set"); } if (contextStrategy == null) { throw new NullPointerException("contextStrategy"); } ContextTrampoline.contextStrategy = contextStrategy; }
class class_name[name] begin[{] method[setContextStrategy, return_type[void], modifier[public static], parameter[contextStrategy]] begin[{] if[binary_operation[member[ContextTrampoline.contextStrategy], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="contextStrategy was already set")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.contextStrategy], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="contextStrategy")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[ContextTrampoline.contextStrategy], member[.contextStrategy]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setContextStrategy] operator[SEP] identifier[ContextStrategy] identifier[contextStrategy] operator[SEP] { Keyword[if] operator[SEP] identifier[ContextTrampoline] operator[SEP] identifier[contextStrategy] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contextStrategy] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ContextTrampoline] operator[SEP] identifier[contextStrategy] operator[=] identifier[contextStrategy] operator[SEP] }
private static Moment moveEventuallyToLS(Moment adjusted) { PlainDate date = adjusted.getDateUTC(); PlainTime time = adjusted.getTimeUTC(); if ( (LeapSeconds.getInstance().getShift(date) == 1) && (time.getHour() == 23) && (time.getMinute() == 59) && (time.getSecond() == 59) ) { return adjusted.plus(1, SI.SECONDS); } else { return adjusted; } }
class class_name[name] begin[{] method[moveEventuallyToLS, return_type[type[Moment]], modifier[private static], parameter[adjusted]] begin[{] local_variable[type[PlainDate], date] local_variable[type[PlainTime], time] if[binary_operation[binary_operation[binary_operation[binary_operation[call[LeapSeconds.getInstance, parameter[]], ==, literal[1]], &&, binary_operation[call[time.getHour, parameter[]], ==, literal[23]]], &&, binary_operation[call[time.getMinute, parameter[]], ==, literal[59]]], &&, binary_operation[call[time.getSecond, parameter[]], ==, literal[59]]]] begin[{] return[call[adjusted.plus, parameter[literal[1], member[SI.SECONDS]]]] else begin[{] return[member[.adjusted]] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[Moment] identifier[moveEventuallyToLS] operator[SEP] identifier[Moment] identifier[adjusted] operator[SEP] { identifier[PlainDate] identifier[date] operator[=] identifier[adjusted] operator[SEP] identifier[getDateUTC] operator[SEP] operator[SEP] operator[SEP] identifier[PlainTime] identifier[time] operator[=] identifier[adjusted] operator[SEP] identifier[getTimeUTC] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LeapSeconds] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getShift] operator[SEP] identifier[date] operator[SEP] operator[==] Other[1] operator[SEP] operator[&&] operator[SEP] identifier[time] operator[SEP] identifier[getHour] operator[SEP] operator[SEP] operator[==] Other[23] operator[SEP] operator[&&] operator[SEP] identifier[time] operator[SEP] identifier[getMinute] operator[SEP] operator[SEP] operator[==] Other[59] operator[SEP] operator[&&] operator[SEP] identifier[time] operator[SEP] identifier[getSecond] operator[SEP] operator[SEP] operator[==] Other[59] operator[SEP] operator[SEP] { Keyword[return] identifier[adjusted] operator[SEP] identifier[plus] operator[SEP] Other[1] , identifier[SI] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[adjusted] operator[SEP] } }
public static EventType map(Event event) { EventType eventType = new EventType(); eventType.setTimestamp(Converter.convertDate(event.getTimestamp())); eventType.setEventType(convertEventType(event.getEventType())); OriginatorType origType = mapOriginator(event.getOriginator()); eventType.setOriginator(origType); MessageInfoType miType = mapMessageInfo(event.getMessageInfo()); eventType.setMessageInfo(miType); eventType.setCustomInfo(convertCustomInfo(event.getCustomInfo())); eventType.setContentCut(event.isContentCut()); if (event.getContent() != null) { DataHandler datHandler = getDataHandlerForString(event); eventType.setContent(datHandler); } return eventType; }
class class_name[name] begin[{] method[map, return_type[type[EventType]], modifier[public static], parameter[event]] begin[{] local_variable[type[EventType], eventType] call[eventType.setTimestamp, parameter[call[Converter.convertDate, parameter[call[event.getTimestamp, parameter[]]]]]] call[eventType.setEventType, parameter[call[.convertEventType, parameter[call[event.getEventType, parameter[]]]]]] local_variable[type[OriginatorType], origType] call[eventType.setOriginator, parameter[member[.origType]]] local_variable[type[MessageInfoType], miType] call[eventType.setMessageInfo, parameter[member[.miType]]] call[eventType.setCustomInfo, parameter[call[.convertCustomInfo, parameter[call[event.getCustomInfo, parameter[]]]]]] call[eventType.setContentCut, parameter[call[event.isContentCut, parameter[]]]] if[binary_operation[call[event.getContent, parameter[]], !=, literal[null]]] begin[{] local_variable[type[DataHandler], datHandler] call[eventType.setContent, parameter[member[.datHandler]]] else begin[{] None end[}] return[member[.eventType]] end[}] END[}]
Keyword[public] Keyword[static] identifier[EventType] identifier[map] operator[SEP] identifier[Event] identifier[event] operator[SEP] { identifier[EventType] identifier[eventType] operator[=] Keyword[new] identifier[EventType] operator[SEP] operator[SEP] operator[SEP] identifier[eventType] operator[SEP] identifier[setTimestamp] operator[SEP] identifier[Converter] operator[SEP] identifier[convertDate] operator[SEP] identifier[event] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[eventType] operator[SEP] identifier[setEventType] operator[SEP] identifier[convertEventType] operator[SEP] identifier[event] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[OriginatorType] identifier[origType] operator[=] identifier[mapOriginator] operator[SEP] identifier[event] operator[SEP] identifier[getOriginator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[eventType] operator[SEP] identifier[setOriginator] operator[SEP] identifier[origType] operator[SEP] operator[SEP] identifier[MessageInfoType] identifier[miType] operator[=] identifier[mapMessageInfo] operator[SEP] identifier[event] operator[SEP] identifier[getMessageInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[eventType] operator[SEP] identifier[setMessageInfo] operator[SEP] identifier[miType] operator[SEP] operator[SEP] identifier[eventType] operator[SEP] identifier[setCustomInfo] operator[SEP] identifier[convertCustomInfo] operator[SEP] identifier[event] operator[SEP] identifier[getCustomInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[eventType] operator[SEP] identifier[setContentCut] operator[SEP] identifier[event] operator[SEP] identifier[isContentCut] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[DataHandler] identifier[datHandler] operator[=] identifier[getDataHandlerForString] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[eventType] operator[SEP] identifier[setContent] operator[SEP] identifier[datHandler] operator[SEP] operator[SEP] } Keyword[return] identifier[eventType] operator[SEP] }
@Override public CommerceCurrency findByG_P_A_First(long groupId, boolean primary, boolean active, OrderByComparator<CommerceCurrency> orderByComparator) throws NoSuchCurrencyException { CommerceCurrency commerceCurrency = fetchByG_P_A_First(groupId, primary, active, orderByComparator); if (commerceCurrency != null) { return commerceCurrency; } StringBundler msg = new StringBundler(8); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("groupId="); msg.append(groupId); msg.append(", primary="); msg.append(primary); msg.append(", active="); msg.append(active); msg.append("}"); throw new NoSuchCurrencyException(msg.toString()); }
class class_name[name] begin[{] method[findByG_P_A_First, return_type[type[CommerceCurrency]], modifier[public], parameter[groupId, primary, active, orderByComparator]] begin[{] local_variable[type[CommerceCurrency], commerceCurrency] if[binary_operation[member[.commerceCurrency], !=, literal[null]]] begin[{] return[member[.commerceCurrency]] else begin[{] None end[}] local_variable[type[StringBundler], msg] call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]] call[msg.append, parameter[literal["groupId="]]] call[msg.append, parameter[member[.groupId]]] call[msg.append, parameter[literal[", primary="]]] call[msg.append, parameter[member[.primary]]] call[msg.append, parameter[literal[", active="]]] call[msg.append, parameter[member[.active]]] call[msg.append, parameter[literal["}"]]] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchCurrencyException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceCurrency] identifier[findByG_P_A_First] operator[SEP] Keyword[long] identifier[groupId] , Keyword[boolean] identifier[primary] , Keyword[boolean] identifier[active] , identifier[OrderByComparator] operator[<] identifier[CommerceCurrency] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchCurrencyException] { identifier[CommerceCurrency] identifier[commerceCurrency] operator[=] identifier[fetchByG_P_A_First] operator[SEP] identifier[groupId] , identifier[primary] , identifier[active] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceCurrency] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[commerceCurrency] operator[SEP] } identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[8] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[primary] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[active] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchCurrencyException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public ItemDocument build() { prepareBuild(); return factory.getItemDocument((ItemIdValue) this.entityIdValue, this.labels, this.descriptions, this.aliases, getStatementGroups(), this.siteLinks, this.revisionId); }
class class_name[name] begin[{] method[build, return_type[type[ItemDocument]], modifier[public], parameter[]] begin[{] call[.prepareBuild, parameter[]] return[call[factory.getItemDocument, parameter[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=entityIdValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=ReferenceType(arguments=None, dimensions=[], name=ItemIdValue, sub_type=None)), THIS[member[None.labels]], THIS[member[None.descriptions]], THIS[member[None.aliases]], call[.getStatementGroups, parameter[]], THIS[member[None.siteLinks]], THIS[member[None.revisionId]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ItemDocument] identifier[build] operator[SEP] operator[SEP] { identifier[prepareBuild] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[factory] operator[SEP] identifier[getItemDocument] operator[SEP] operator[SEP] identifier[ItemIdValue] operator[SEP] Keyword[this] operator[SEP] identifier[entityIdValue] , Keyword[this] operator[SEP] identifier[labels] , Keyword[this] operator[SEP] identifier[descriptions] , Keyword[this] operator[SEP] identifier[aliases] , identifier[getStatementGroups] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[siteLinks] , Keyword[this] operator[SEP] identifier[revisionId] operator[SEP] operator[SEP] }
public static int getColumns(final Sheet sheet) { ArgUtils.notNull(sheet, "sheet"); int minRowIndex = sheet.getFirstRowNum(); int maxRowIndex = sheet.getLastRowNum(); int maxColumnsIndex = 0; for(int i = minRowIndex; i <= maxRowIndex; i++) { final Row row = sheet.getRow(i); if(row == null) { continue; } final int column = row.getLastCellNum(); if(column > maxColumnsIndex) { maxColumnsIndex = column; } } return maxColumnsIndex; }
class class_name[name] begin[{] method[getColumns, return_type[type[int]], modifier[public static], parameter[sheet]] begin[{] call[ArgUtils.notNull, parameter[member[.sheet], literal["sheet"]]] local_variable[type[int], minRowIndex] local_variable[type[int], maxRowIndex] local_variable[type[int], maxColumnsIndex] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRow, postfix_operators=[], prefix_operators=[], qualifier=sheet, selectors=[], type_arguments=None), name=row)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLastCellNum, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), name=column)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxColumnsIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxColumnsIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxRowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=minRowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.maxColumnsIndex]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getColumns] operator[SEP] Keyword[final] identifier[Sheet] identifier[sheet] operator[SEP] { identifier[ArgUtils] operator[SEP] identifier[notNull] operator[SEP] identifier[sheet] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[minRowIndex] operator[=] identifier[sheet] operator[SEP] identifier[getFirstRowNum] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[maxRowIndex] operator[=] identifier[sheet] operator[SEP] identifier[getLastRowNum] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[maxColumnsIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[minRowIndex] operator[SEP] identifier[i] operator[<=] identifier[maxRowIndex] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[Row] identifier[row] operator[=] identifier[sheet] operator[SEP] identifier[getRow] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[row] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[final] Keyword[int] identifier[column] operator[=] identifier[row] operator[SEP] identifier[getLastCellNum] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[column] operator[>] identifier[maxColumnsIndex] operator[SEP] { identifier[maxColumnsIndex] operator[=] identifier[column] operator[SEP] } } Keyword[return] identifier[maxColumnsIndex] operator[SEP] }
@Override public Subject delegate(String roleName, String appName) { Subject runAsSubject = getRunAsSubjectFromProvider(roleName, appName); return runAsSubject; }
class class_name[name] begin[{] method[delegate, return_type[type[Subject]], modifier[public], parameter[roleName, appName]] begin[{] local_variable[type[Subject], runAsSubject] return[member[.runAsSubject]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Subject] identifier[delegate] operator[SEP] identifier[String] identifier[roleName] , identifier[String] identifier[appName] operator[SEP] { identifier[Subject] identifier[runAsSubject] operator[=] identifier[getRunAsSubjectFromProvider] operator[SEP] identifier[roleName] , identifier[appName] operator[SEP] operator[SEP] Keyword[return] identifier[runAsSubject] operator[SEP] }
public final void mT__14() throws RecognitionException { try { int _type = T__14; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalXbaseWithAnnotations.g:12:7: ( '||' ) // InternalXbaseWithAnnotations.g:12:9: '||' { match("||"); } state.type = _type; state.channel = _channel; } finally { } }
class class_name[name] begin[{] method[mT__14, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=T__14, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="||")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[mT__14] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { Keyword[int] identifier[_type] operator[=] identifier[T__14] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP] } Keyword[finally] { } }
public static String getKeysWhereSQL(Class<?> clazz) throws NoKeyColumnAnnotationException { List<Field> keyFields = DOInfoReader.getKeyColumns(clazz); String where = joinWhere(keyFields, "AND"); return autoSetSoftDeleted("WHERE " + where, clazz); }
class class_name[name] begin[{] method[getKeysWhereSQL, return_type[type[String]], modifier[public static], parameter[clazz]] begin[{] local_variable[type[List], keyFields] local_variable[type[String], where] return[call[.autoSetSoftDeleted, parameter[binary_operation[literal["WHERE "], +, member[.where]], member[.clazz]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getKeysWhereSQL] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] Keyword[throws] identifier[NoKeyColumnAnnotationException] { identifier[List] operator[<] identifier[Field] operator[>] identifier[keyFields] operator[=] identifier[DOInfoReader] operator[SEP] identifier[getKeyColumns] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[String] identifier[where] operator[=] identifier[joinWhere] operator[SEP] identifier[keyFields] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[autoSetSoftDeleted] operator[SEP] literal[String] operator[+] identifier[where] , identifier[clazz] operator[SEP] operator[SEP] }
@Override public final boolean write (final ITask task, final Session session, final ByteBuffer src, final int logicalBlockAddress, final long length) throws Exception { if (src.remaining() < length) { throw new IllegalArgumentException("Source buffer is too small. Buffer size: " + src.remaining() + " Expected: " + length); } int startAddress = logicalBlockAddress; final long blockSize = session.getBlockSize(); int totalBlocks = (int) Math.ceil(length / (double) blockSize); long bytes2Process = length; int bufferPosition = 0; final Connection connection = session.getNextFreeConnection(); connection.getSession().addOutstandingTask(connection, task); // first stage short blocks = (short) Math.min(WRITE_FIRST_STAGE_BLOCKS, totalBlocks); if (LOGGER.isInfoEnabled()) { LOGGER.info("Now sending sequences of length " + blocks + " blocks."); } int expectedDataTransferLength = (int) Math.min(bytes2Process, blocks * blockSize); connection.nextState(new WriteRequestState(connection, src, bufferPosition, TaskAttributes.SIMPLE, expectedDataTransferLength, startAddress, blocks)); startAddress += blocks; totalBlocks -= blocks; bytes2Process -= blocks * blockSize; bufferPosition += expectedDataTransferLength; // second stage blocks = (short) Math.min(WRITE_SECOND_STAGE_BLOCKS, totalBlocks); if (blocks > 0) { if (LOGGER.isInfoEnabled()) { LOGGER.info("Now sending sequences of length " + blocks + " blocks."); LOGGER.info("Remaining, DataSegmentLength: " + bytes2Process + ", " + expectedDataTransferLength); } expectedDataTransferLength = (int) Math.min(bytes2Process, blocks * blockSize); connection.nextState(new WriteRequestState(connection, src, bufferPosition, TaskAttributes.SIMPLE, expectedDataTransferLength, startAddress, blocks)); startAddress += blocks; totalBlocks -= blocks; bytes2Process -= blocks * blockSize; bufferPosition += expectedDataTransferLength; } // third stage blocks = (short) Math.min(WRITE_THIRD_STAGE_BLOCKS, totalBlocks); while (blocks > 0) { if (LOGGER.isInfoEnabled()) { LOGGER.info("Now sending sequences of length " + blocks + " blocks."); } expectedDataTransferLength = (int) Math.min(bytes2Process, blocks * blockSize); connection.nextState(new WriteRequestState(connection, src, bufferPosition, TaskAttributes.SIMPLE, expectedDataTransferLength, startAddress, blocks)); startAddress += blocks; totalBlocks -= blocks; blocks = (short) Math.min(READ_THIRD_STAGE_BLOCKS, totalBlocks); bufferPosition += expectedDataTransferLength; } return true; }
class class_name[name] begin[{] method[write, return_type[type[boolean]], modifier[final public], parameter[task, session, src, logicalBlockAddress, length]] begin[{] if[binary_operation[call[src.remaining, parameter[]], <, member[.length]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source buffer is too small. Buffer size: "), operandr=MethodInvocation(arguments=[], member=remaining, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Expected: "), operator=+), operandr=MemberReference(member=length, 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[}] local_variable[type[int], startAddress] local_variable[type[long], blockSize] local_variable[type[int], totalBlocks] local_variable[type[long], bytes2Process] local_variable[type[int], bufferPosition] local_variable[type[Connection], connection] call[connection.getSession, parameter[]] local_variable[type[short], blocks] if[call[LOGGER.isInfoEnabled, parameter[]]] begin[{] call[LOGGER.info, parameter[binary_operation[binary_operation[literal["Now sending sequences of length "], +, member[.blocks]], +, literal[" blocks."]]]] else begin[{] None end[}] local_variable[type[int], expectedDataTransferLength] call[connection.nextState, parameter[ClassCreator(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bufferPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SIMPLE, postfix_operators=[], prefix_operators=[], qualifier=TaskAttributes, selectors=[]), MemberReference(member=expectedDataTransferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=blocks, 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=WriteRequestState, sub_type=None))]] assign[member[.startAddress], member[.blocks]] assign[member[.totalBlocks], member[.blocks]] assign[member[.bytes2Process], binary_operation[member[.blocks], *, member[.blockSize]]] assign[member[.bufferPosition], member[.expectedDataTransferLength]] assign[member[.blocks], Cast(expression=MethodInvocation(arguments=[MemberReference(member=WRITE_SECOND_STAGE_BLOCKS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=totalBlocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=short))] if[binary_operation[member[.blocks], >, literal[0]]] begin[{] if[call[LOGGER.isInfoEnabled, parameter[]]] begin[{] call[LOGGER.info, parameter[binary_operation[binary_operation[literal["Now sending sequences of length "], +, member[.blocks]], +, literal[" blocks."]]]] call[LOGGER.info, parameter[binary_operation[binary_operation[binary_operation[literal["Remaining, DataSegmentLength: "], +, member[.bytes2Process]], +, literal[", "]], +, member[.expectedDataTransferLength]]]] else begin[{] None end[}] assign[member[.expectedDataTransferLength], Cast(expression=MethodInvocation(arguments=[MemberReference(member=bytes2Process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=blocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] call[connection.nextState, parameter[ClassCreator(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bufferPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SIMPLE, postfix_operators=[], prefix_operators=[], qualifier=TaskAttributes, selectors=[]), MemberReference(member=expectedDataTransferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=blocks, 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=WriteRequestState, sub_type=None))]] assign[member[.startAddress], member[.blocks]] assign[member[.totalBlocks], member[.blocks]] assign[member[.bytes2Process], binary_operation[member[.blocks], *, member[.blockSize]]] assign[member[.bufferPosition], member[.expectedDataTransferLength]] else begin[{] None end[}] assign[member[.blocks], Cast(expression=MethodInvocation(arguments=[MemberReference(member=WRITE_THIRD_STAGE_BLOCKS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=totalBlocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=short))] while[binary_operation[member[.blocks], >, literal[0]]] begin[{] if[call[LOGGER.isInfoEnabled, parameter[]]] begin[{] call[LOGGER.info, parameter[binary_operation[binary_operation[literal["Now sending sequences of length "], +, member[.blocks]], +, literal[" blocks."]]]] else begin[{] None end[}] assign[member[.expectedDataTransferLength], Cast(expression=MethodInvocation(arguments=[MemberReference(member=bytes2Process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=blocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] call[connection.nextState, parameter[ClassCreator(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bufferPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SIMPLE, postfix_operators=[], prefix_operators=[], qualifier=TaskAttributes, selectors=[]), MemberReference(member=expectedDataTransferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=blocks, 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=WriteRequestState, sub_type=None))]] assign[member[.startAddress], member[.blocks]] assign[member[.totalBlocks], member[.blocks]] assign[member[.blocks], Cast(expression=MethodInvocation(arguments=[MemberReference(member=READ_THIRD_STAGE_BLOCKS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=totalBlocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=short))] assign[member[.bufferPosition], member[.expectedDataTransferLength]] end[}] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[boolean] identifier[write] operator[SEP] Keyword[final] identifier[ITask] identifier[task] , Keyword[final] identifier[Session] identifier[session] , Keyword[final] identifier[ByteBuffer] identifier[src] , Keyword[final] Keyword[int] identifier[logicalBlockAddress] , Keyword[final] Keyword[long] identifier[length] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[src] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[<] identifier[length] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[src] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[length] operator[SEP] operator[SEP] } Keyword[int] identifier[startAddress] operator[=] identifier[logicalBlockAddress] operator[SEP] Keyword[final] Keyword[long] identifier[blockSize] operator[=] identifier[session] operator[SEP] identifier[getBlockSize] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[totalBlocks] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[ceil] operator[SEP] identifier[length] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[blockSize] operator[SEP] operator[SEP] Keyword[long] identifier[bytes2Process] operator[=] identifier[length] operator[SEP] Keyword[int] identifier[bufferPosition] operator[=] Other[0] operator[SEP] Keyword[final] identifier[Connection] identifier[connection] operator[=] identifier[session] operator[SEP] identifier[getNextFreeConnection] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[addOutstandingTask] operator[SEP] identifier[connection] , identifier[task] operator[SEP] operator[SEP] Keyword[short] identifier[blocks] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[WRITE_FIRST_STAGE_BLOCKS] , identifier[totalBlocks] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[blocks] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[expectedDataTransferLength] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[bytes2Process] , identifier[blocks] operator[*] identifier[blockSize] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[nextState] operator[SEP] Keyword[new] identifier[WriteRequestState] operator[SEP] identifier[connection] , identifier[src] , identifier[bufferPosition] , identifier[TaskAttributes] operator[SEP] identifier[SIMPLE] , identifier[expectedDataTransferLength] , identifier[startAddress] , identifier[blocks] operator[SEP] operator[SEP] operator[SEP] identifier[startAddress] operator[+=] identifier[blocks] operator[SEP] identifier[totalBlocks] operator[-=] identifier[blocks] operator[SEP] identifier[bytes2Process] operator[-=] identifier[blocks] operator[*] identifier[blockSize] operator[SEP] identifier[bufferPosition] operator[+=] identifier[expectedDataTransferLength] operator[SEP] identifier[blocks] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[WRITE_SECOND_STAGE_BLOCKS] , identifier[totalBlocks] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[blocks] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[blocks] operator[+] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[bytes2Process] operator[+] literal[String] operator[+] identifier[expectedDataTransferLength] operator[SEP] operator[SEP] } identifier[expectedDataTransferLength] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[bytes2Process] , identifier[blocks] operator[*] identifier[blockSize] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[nextState] operator[SEP] Keyword[new] identifier[WriteRequestState] operator[SEP] identifier[connection] , identifier[src] , identifier[bufferPosition] , identifier[TaskAttributes] operator[SEP] identifier[SIMPLE] , identifier[expectedDataTransferLength] , identifier[startAddress] , identifier[blocks] operator[SEP] operator[SEP] operator[SEP] identifier[startAddress] operator[+=] identifier[blocks] operator[SEP] identifier[totalBlocks] operator[-=] identifier[blocks] operator[SEP] identifier[bytes2Process] operator[-=] identifier[blocks] operator[*] identifier[blockSize] operator[SEP] identifier[bufferPosition] operator[+=] identifier[expectedDataTransferLength] operator[SEP] } identifier[blocks] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[WRITE_THIRD_STAGE_BLOCKS] , identifier[totalBlocks] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[blocks] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[blocks] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[expectedDataTransferLength] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[bytes2Process] , identifier[blocks] operator[*] identifier[blockSize] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[nextState] operator[SEP] Keyword[new] identifier[WriteRequestState] operator[SEP] identifier[connection] , identifier[src] , identifier[bufferPosition] , identifier[TaskAttributes] operator[SEP] identifier[SIMPLE] , identifier[expectedDataTransferLength] , identifier[startAddress] , identifier[blocks] operator[SEP] operator[SEP] operator[SEP] identifier[startAddress] operator[+=] identifier[blocks] operator[SEP] identifier[totalBlocks] operator[-=] identifier[blocks] operator[SEP] identifier[blocks] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[READ_THIRD_STAGE_BLOCKS] , identifier[totalBlocks] operator[SEP] operator[SEP] identifier[bufferPosition] operator[+=] identifier[expectedDataTransferLength] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public CmsContainerElementData getCachedElement(String clientId) { if (m_elements.containsKey(clientId)) { return m_elements.get(clientId); } return null; }
class class_name[name] begin[{] method[getCachedElement, return_type[type[CmsContainerElementData]], modifier[public], parameter[clientId]] begin[{] if[call[m_elements.containsKey, parameter[member[.clientId]]]] begin[{] return[call[m_elements.get, parameter[member[.clientId]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[CmsContainerElementData] identifier[getCachedElement] operator[SEP] identifier[String] identifier[clientId] operator[SEP] { Keyword[if] operator[SEP] identifier[m_elements] operator[SEP] identifier[containsKey] operator[SEP] identifier[clientId] operator[SEP] operator[SEP] { Keyword[return] identifier[m_elements] operator[SEP] identifier[get] operator[SEP] identifier[clientId] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "valueComponent") public JAXBElement<ValuePropertyType> createValueComponent(ValuePropertyType value) { return new JAXBElement<ValuePropertyType>(_ValueComponent_QNAME, ValuePropertyType.class, null, value); }
class class_name[name] begin[{] method[createValueComponent, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_ValueComponent_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValuePropertyType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ValuePropertyType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[ValuePropertyType] operator[>] identifier[createValueComponent] operator[SEP] identifier[ValuePropertyType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[ValuePropertyType] operator[>] operator[SEP] identifier[_ValueComponent_QNAME] , identifier[ValuePropertyType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
private void findResolvConf(String file) { InputStream in = null; try { in = new FileInputStream(file); } catch (FileNotFoundException e) { return; } InputStreamReader isr = new InputStreamReader(in); BufferedReader br = new BufferedReader(isr); List lserver = new ArrayList(0); List lsearch = new ArrayList(0); try { String line; while ((line = br.readLine()) != null) { if (line.startsWith("nameserver")) { StringTokenizer st = new StringTokenizer(line); st.nextToken(); /* skip nameserver */ addServer(st.nextToken(), lserver); } else if (line.startsWith("domain")) { StringTokenizer st = new StringTokenizer(line); st.nextToken(); /* skip domain */ if (!st.hasMoreTokens()) continue; if (lsearch.isEmpty()) addSearch(st.nextToken(), lsearch); } else if (line.startsWith("search")) { if (!lsearch.isEmpty()) lsearch.clear(); StringTokenizer st = new StringTokenizer(line); st.nextToken(); /* skip search */ while (st.hasMoreTokens()) addSearch(st.nextToken(), lsearch); } } br.close(); } catch (IOException e) { } configureFromLists(lserver, lsearch); }
class class_name[name] begin[{] method[findResolvConf, return_type[void], modifier[private], parameter[file]] begin[{] local_variable[type[InputStream], in] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=file, 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=FileInputStream, sub_type=None))), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None) local_variable[type[InputStreamReader], isr] local_variable[type[BufferedReader], br] local_variable[type[List], lserver] local_variable[type[List], lsearch] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="nameserver")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="domain")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="search")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=lsearch, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=lsearch, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=line, 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=StringTokenizer, sub_type=None)), name=st)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringTokenizer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), label=None), WhileStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), MemberReference(member=lsearch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSearch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), condition=MethodInvocation(arguments=[], member=hasMoreTokens, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=line, 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=StringTokenizer, sub_type=None)), name=st)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringTokenizer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=hasMoreTokens, postfix_operators=[], prefix_operators=['!'], qualifier=st, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=lsearch, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), MemberReference(member=lsearch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSearch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=line, 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=StringTokenizer, sub_type=None)), name=st)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringTokenizer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), MemberReference(member=lserver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) call[.configureFromLists, parameter[member[.lserver], member[.lsearch]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[findResolvConf] operator[SEP] identifier[String] identifier[file] operator[SEP] { identifier[InputStream] identifier[in] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[in] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { Keyword[return] operator[SEP] } identifier[InputStreamReader] identifier[isr] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[in] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[br] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] identifier[isr] operator[SEP] operator[SEP] identifier[List] identifier[lserver] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[List] identifier[lsearch] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[try] { identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[StringTokenizer] identifier[st] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[addServer] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] , identifier[lserver] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[StringTokenizer] identifier[st] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[st] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[lsearch] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[addSearch] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] , identifier[lsearch] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[lsearch] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[lsearch] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[st] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[st] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] identifier[addSearch] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] , identifier[lsearch] operator[SEP] operator[SEP] } } identifier[br] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { } identifier[configureFromLists] operator[SEP] identifier[lserver] , identifier[lsearch] operator[SEP] operator[SEP] }
ExecutionResult executeSync(Supplier<ExecutionResult> supplier) { for (PolicyExecutor<Policy<Object>> policyExecutor : policyExecutors) supplier = policyExecutor.supply(supplier); ExecutionResult result = supplier.get(); completed = result.isComplete(); executor.handleComplete(result, this); return result; }
class class_name[name] begin[{] method[executeSync, return_type[type[ExecutionResult]], modifier[default], parameter[supplier]] begin[{] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=supplier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=supplier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=supply, postfix_operators=[], prefix_operators=[], qualifier=policyExecutor, selectors=[], type_arguments=None)), label=None), control=EnhancedForControl(iterable=MemberReference(member=policyExecutors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=policyExecutor)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Policy, sub_type=None))], dimensions=[], name=PolicyExecutor, sub_type=None))), label=None) local_variable[type[ExecutionResult], result] assign[member[.completed], call[result.isComplete, parameter[]]] call[executor.handleComplete, parameter[member[.result], THIS[]]] return[member[.result]] end[}] END[}]
identifier[ExecutionResult] identifier[executeSync] operator[SEP] identifier[Supplier] operator[<] identifier[ExecutionResult] operator[>] identifier[supplier] operator[SEP] { Keyword[for] operator[SEP] identifier[PolicyExecutor] operator[<] identifier[Policy] operator[<] identifier[Object] operator[>] operator[>] identifier[policyExecutor] operator[:] identifier[policyExecutors] operator[SEP] identifier[supplier] operator[=] identifier[policyExecutor] operator[SEP] identifier[supply] operator[SEP] identifier[supplier] operator[SEP] operator[SEP] identifier[ExecutionResult] identifier[result] operator[=] identifier[supplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[completed] operator[=] identifier[result] operator[SEP] identifier[isComplete] operator[SEP] operator[SEP] operator[SEP] identifier[executor] operator[SEP] identifier[handleComplete] operator[SEP] identifier[result] , Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
@Override protected void dumpData(PrintWriter pw) { DateFormat df = new SimpleDateFormat("HH:mm:ss"); pw.println(" [Data"); for (Object item : m_data) { pw.println(" " + df.format((Date) item)); } pw.println(" ]"); }
class class_name[name] begin[{] method[dumpData, return_type[void], modifier[protected], parameter[pw]] begin[{] local_variable[type[DateFormat], df] call[pw.println, parameter[literal[" [Data"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operandr=MethodInvocation(arguments=[Cast(expression=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None))], member=format, postfix_operators=[], prefix_operators=[], qualifier=df, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=pw, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=m_data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) call[pw.println, parameter[literal[" ]"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[dumpData] operator[SEP] identifier[PrintWriter] identifier[pw] operator[SEP] { identifier[DateFormat] identifier[df] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pw] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[item] operator[:] identifier[m_data] operator[SEP] { identifier[pw] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[df] operator[SEP] identifier[format] operator[SEP] operator[SEP] identifier[Date] operator[SEP] identifier[item] operator[SEP] operator[SEP] operator[SEP] } identifier[pw] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, long proposalId) throws RemoteException { // Get the WorkflowRequestService. WorkflowRequestServiceInterface workflowRequestService = adManagerServices.get(session, WorkflowRequestServiceInterface.class); // Create a statement to select workflow external condition requests for a proposal. StatementBuilder statementBuilder = new StatementBuilder() .where("WHERE entityId = :entityId and entityType = :entityType " + "and type = :type and conditionStatus = :conditionStatus") .orderBy("id ASC") .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) .withBindVariableValue("entityId", proposalId) .withBindVariableValue("entityType", WorkflowEntityType.PROPOSAL.toString()) .withBindVariableValue("conditionStatus", WorkflowEvaluationStatus.PENDING.toString()) .withBindVariableValue("type", WorkflowRequestType.WORKFLOW_EXTERNAL_CONDITION_REQUEST.toString()); // Default for total result set size. int totalResultSetSize = 0; do { // Get workflow requests by statement. WorkflowRequestPage page = workflowRequestService.getWorkflowRequestsByStatement( statementBuilder.toStatement()); if (page.getResults() != null) { totalResultSetSize = page.getTotalResultSetSize(); int i = page.getStartIndex(); for (WorkflowRequest workflowRequest : page.getResults()) { System.out.printf("%d) Workflow external condition request with ID %d " + "for '%s' with ID %d will be triggered.%n", i++, workflowRequest.getId(), workflowRequest.getEntityType(), workflowRequest.getEntityId()); } } statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.getOffset() < totalResultSetSize); System.out.printf("Number of workflow external condition requests to be triggered: %d%n", totalResultSetSize); if (totalResultSetSize > 0) { // Remove limit and offset from statement. statementBuilder.removeLimitAndOffset(); // Create action. com.google.api.ads.admanager.axis.v201808.TriggerWorkflowExternalConditionRequests action = new com.google.api.ads.admanager.axis.v201808.TriggerWorkflowExternalConditionRequests(); // Perform action. UpdateResult result = workflowRequestService.performWorkflowRequestAction( action, statementBuilder.toStatement()); if (result != null && result.getNumChanges() > 0) { System.out.printf("Number of workflow external condition requests triggered: %d%n", result.getNumChanges()); } else { System.out.println("No workflow external condition requests were triggered."); } } }
class class_name[name] begin[{] method[runExample, return_type[void], modifier[public static], parameter[adManagerServices, session, proposalId]] begin[{] local_variable[type[WorkflowRequestServiceInterface], workflowRequestService] local_variable[type[StatementBuilder], statementBuilder] local_variable[type[int], totalResultSetSize] do[binary_operation[call[statementBuilder.getOffset, parameter[]], <, member[.totalResultSetSize]]] begin[{] local_variable[type[WorkflowRequestPage], page] if[binary_operation[call[page.getResults, parameter[]], !=, literal[null]]] begin[{] assign[member[.totalResultSetSize], call[page.getTotalResultSetSize, parameter[]]] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%d) Workflow external condition request with ID %d "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="for '%s' with ID %d will be triggered.%n"), operator=+), MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=workflowRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getEntityType, postfix_operators=[], prefix_operators=[], qualifier=workflowRequest, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getEntityId, postfix_operators=[], prefix_operators=[], qualifier=workflowRequest, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getResults, postfix_operators=[], prefix_operators=[], qualifier=page, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=workflowRequest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WorkflowRequest, sub_type=None))), label=None) else begin[{] None end[}] call[statementBuilder.increaseOffsetBy, parameter[member[StatementBuilder.SUGGESTED_PAGE_LIMIT]]] end[}] call[System.out.printf, parameter[literal["Number of workflow external condition requests to be triggered: %d%n"], member[.totalResultSetSize]]] if[binary_operation[member[.totalResultSetSize], >, literal[0]]] begin[{] call[statementBuilder.removeLimitAndOffset, parameter[]] local_variable[type[com], action] local_variable[type[UpdateResult], result] if[binary_operation[binary_operation[member[.result], !=, literal[null]], &&, binary_operation[call[result.getNumChanges, parameter[]], >, literal[0]]]] begin[{] call[System.out.printf, parameter[literal["Number of workflow external condition requests triggered: %d%n"], call[result.getNumChanges, parameter[]]]] else begin[{] call[System.out.println, parameter[literal["No workflow external condition requests were triggered."]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[runExample] operator[SEP] identifier[AdManagerServices] identifier[adManagerServices] , identifier[AdManagerSession] identifier[session] , Keyword[long] identifier[proposalId] operator[SEP] Keyword[throws] identifier[RemoteException] { identifier[WorkflowRequestServiceInterface] identifier[workflowRequestService] operator[=] identifier[adManagerServices] operator[SEP] identifier[get] operator[SEP] identifier[session] , identifier[WorkflowRequestServiceInterface] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[StatementBuilder] identifier[statementBuilder] operator[=] Keyword[new] identifier[StatementBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[where] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[orderBy] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[limit] operator[SEP] identifier[StatementBuilder] operator[SEP] identifier[SUGGESTED_PAGE_LIMIT] operator[SEP] operator[SEP] identifier[withBindVariableValue] operator[SEP] literal[String] , identifier[proposalId] operator[SEP] operator[SEP] identifier[withBindVariableValue] operator[SEP] literal[String] , identifier[WorkflowEntityType] operator[SEP] identifier[PROPOSAL] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[withBindVariableValue] operator[SEP] literal[String] , identifier[WorkflowEvaluationStatus] operator[SEP] identifier[PENDING] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[withBindVariableValue] operator[SEP] literal[String] , identifier[WorkflowRequestType] operator[SEP] identifier[WORKFLOW_EXTERNAL_CONDITION_REQUEST] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[totalResultSetSize] operator[=] Other[0] operator[SEP] Keyword[do] { identifier[WorkflowRequestPage] identifier[page] operator[=] identifier[workflowRequestService] operator[SEP] identifier[getWorkflowRequestsByStatement] operator[SEP] identifier[statementBuilder] operator[SEP] identifier[toStatement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[page] operator[SEP] identifier[getResults] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[totalResultSetSize] operator[=] identifier[page] operator[SEP] identifier[getTotalResultSetSize] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[page] operator[SEP] identifier[getStartIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[WorkflowRequest] identifier[workflowRequest] operator[:] identifier[page] operator[SEP] identifier[getResults] operator[SEP] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] operator[+] literal[String] , identifier[i] operator[++] , identifier[workflowRequest] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[workflowRequest] operator[SEP] identifier[getEntityType] operator[SEP] operator[SEP] , identifier[workflowRequest] operator[SEP] identifier[getEntityId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[statementBuilder] operator[SEP] identifier[increaseOffsetBy] operator[SEP] identifier[StatementBuilder] operator[SEP] identifier[SUGGESTED_PAGE_LIMIT] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[statementBuilder] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[<] identifier[totalResultSetSize] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[totalResultSetSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[totalResultSetSize] operator[>] Other[0] operator[SEP] { identifier[statementBuilder] operator[SEP] identifier[removeLimitAndOffset] operator[SEP] operator[SEP] 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[TriggerWorkflowExternalConditionRequests] identifier[action] operator[=] Keyword[new] 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[TriggerWorkflowExternalConditionRequests] operator[SEP] operator[SEP] operator[SEP] identifier[UpdateResult] identifier[result] operator[=] identifier[workflowRequestService] operator[SEP] identifier[performWorkflowRequestAction] operator[SEP] identifier[action] , identifier[statementBuilder] operator[SEP] identifier[toStatement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[&&] identifier[result] operator[SEP] identifier[getNumChanges] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[result] operator[SEP] identifier[getNumChanges] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } } }
public static BufferedImage renderDOTImage(Reader dotReader) throws IOException { InputStream pngIs = runDOT(dotReader, "png"); BufferedImage img = ImageIO.read(pngIs); pngIs.close(); return img; }
class class_name[name] begin[{] method[renderDOTImage, return_type[type[BufferedImage]], modifier[public static], parameter[dotReader]] begin[{] local_variable[type[InputStream], pngIs] local_variable[type[BufferedImage], img] call[pngIs.close, parameter[]] return[member[.img]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BufferedImage] identifier[renderDOTImage] operator[SEP] identifier[Reader] identifier[dotReader] operator[SEP] Keyword[throws] identifier[IOException] { identifier[InputStream] identifier[pngIs] operator[=] identifier[runDOT] operator[SEP] identifier[dotReader] , literal[String] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[img] operator[=] identifier[ImageIO] operator[SEP] identifier[read] operator[SEP] identifier[pngIs] operator[SEP] operator[SEP] identifier[pngIs] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[img] operator[SEP] }
@Nonnull public static LDblToCharFunction dblToCharFunctionFrom(Consumer<LDblToCharFunctionBuilder> buildingFunction) { LDblToCharFunctionBuilder builder = new LDblToCharFunctionBuilder(); buildingFunction.accept(builder); return builder.build(); }
class class_name[name] begin[{] method[dblToCharFunctionFrom, return_type[type[LDblToCharFunction]], modifier[public static], parameter[buildingFunction]] begin[{] local_variable[type[LDblToCharFunctionBuilder], builder] call[buildingFunction.accept, parameter[member[.builder]]] return[call[builder.build, parameter[]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[LDblToCharFunction] identifier[dblToCharFunctionFrom] operator[SEP] identifier[Consumer] operator[<] identifier[LDblToCharFunctionBuilder] operator[>] identifier[buildingFunction] operator[SEP] { identifier[LDblToCharFunctionBuilder] identifier[builder] operator[=] Keyword[new] identifier[LDblToCharFunctionBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildingFunction] operator[SEP] identifier[accept] operator[SEP] identifier[builder] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public SetPlatformApplicationAttributesRequest withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; }
class class_name[name] begin[{] method[withAttributes, return_type[type[SetPlatformApplicationAttributesRequest]], modifier[public], parameter[attributes]] begin[{] call[.setAttributes, parameter[member[.attributes]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[SetPlatformApplicationAttributesRequest] identifier[withAttributes] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[attributes] operator[SEP] { identifier[setAttributes] operator[SEP] identifier[attributes] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@SuppressWarnings("unchecked") static <T> T stringToType(String str, Class<T> clazz) { try { final Function<String, ?> func = supportedElementTypes.get(clazz); if (func != null) { return (T) func.apply(str); } } catch (NumberFormatException e) { throw e; } catch (Throwable cause) { throw new IllegalArgumentException( "Can't convert '" + str + "' to type '" + clazz.getSimpleName() + "'.", cause); } throw new IllegalArgumentException( "Can't convert '" + str + "' to type '" + clazz.getSimpleName() + "'."); }
class class_name[name] begin[{] method[stringToType, return_type[type[T]], modifier[static], parameter[str, clazz]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=supportedElementTypes, selectors=[], type_arguments=None), name=func)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Function, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=func, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=func, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't convert '"), operandr=MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' to type '"), operator=+), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'."), operator=+), MemberReference(member=cause, 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)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cause, types=['Throwable']))], finally_block=None, label=None, resources=None) ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't convert '"), operandr=MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' to type '"), operator=+), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[stringToType] operator[SEP] identifier[String] identifier[str] , identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] { Keyword[try] { Keyword[final] identifier[Function] operator[<] identifier[String] , operator[?] operator[>] identifier[func] operator[=] identifier[supportedElementTypes] operator[SEP] identifier[get] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[func] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[func] operator[SEP] identifier[apply] operator[SEP] identifier[str] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[cause] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[str] operator[+] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[cause] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[str] operator[+] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] }
public final WeeklyOpeningHours compress() { final Map<HourRanges, List<DayOfTheWeek>> map = new HashMap<>(); for (final DayOpeningHours doh : weeklyOpeningHours) { final HourRanges ranges = doh.getHourRanges().compress(); List<DayOfTheWeek> dayList = map.get(ranges); if (dayList == null) { dayList = new ArrayList<>(); map.put(ranges, dayList); } dayList.add(doh.getDayOfTheWeek()); } final StringBuilder sb = new StringBuilder(); final Iterator<HourRanges> it = map.keySet().iterator(); while (it.hasNext()) { final HourRanges ranges = it.next(); final List<DayOfTheWeek> days = map.get(ranges); Collections.sort(days); if (sb.length() > 0) { sb.append(","); } sb.append(new MultiDayOfTheWeek(days.toArray(new DayOfTheWeek[days.size()])).compress().asBaseType() + " " + ranges); } return new WeeklyOpeningHours(sb.toString()); }
class class_name[name] begin[{] method[compress, return_type[type[WeeklyOpeningHours]], modifier[final public], parameter[]] begin[{] local_variable[type[Map], map] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHourRanges, postfix_operators=[], prefix_operators=[], qualifier=doh, selectors=[MethodInvocation(arguments=[], member=compress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=ranges)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=HourRanges, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ranges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), name=dayList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DayOfTheWeek, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dayList, 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=dayList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ranges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dayList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDayOfTheWeek, postfix_operators=[], prefix_operators=[], qualifier=doh, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dayList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=weeklyOpeningHours, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=doh)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=DayOpeningHours, sub_type=None))), label=None) local_variable[type[StringBuilder], sb] local_variable[type[Iterator], it] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[HourRanges], ranges] local_variable[type[List], days] call[Collections.sort, parameter[member[.days]]] if[binary_operation[call[sb.length, parameter[]], >, literal[0]]] begin[{] call[sb.append, parameter[literal[","]]] else begin[{] None end[}] call[sb.append, parameter[binary_operation[binary_operation[ClassCreator(arguments=[MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=days, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DayOfTheWeek, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=days, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=compress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=asBaseType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MultiDayOfTheWeek, sub_type=None)), +, literal[" "]], +, member[.ranges]]]] end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WeeklyOpeningHours, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] identifier[WeeklyOpeningHours] identifier[compress] operator[SEP] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[HourRanges] , identifier[List] operator[<] identifier[DayOfTheWeek] operator[>] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[DayOpeningHours] identifier[doh] operator[:] identifier[weeklyOpeningHours] operator[SEP] { Keyword[final] identifier[HourRanges] identifier[ranges] operator[=] identifier[doh] operator[SEP] identifier[getHourRanges] operator[SEP] operator[SEP] operator[SEP] identifier[compress] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[DayOfTheWeek] operator[>] identifier[dayList] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[ranges] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dayList] operator[==] Other[null] operator[SEP] { identifier[dayList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[ranges] , identifier[dayList] operator[SEP] operator[SEP] } identifier[dayList] operator[SEP] identifier[add] operator[SEP] identifier[doh] operator[SEP] identifier[getDayOfTheWeek] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[HourRanges] operator[>] identifier[it] operator[=] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[HourRanges] identifier[ranges] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[DayOfTheWeek] operator[>] identifier[days] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[ranges] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[days] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] Keyword[new] identifier[MultiDayOfTheWeek] operator[SEP] identifier[days] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[DayOfTheWeek] operator[SEP] identifier[days] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[compress] operator[SEP] operator[SEP] operator[SEP] identifier[asBaseType] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[ranges] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[WeeklyOpeningHours] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void add(CharSequence name, CharSequence value, long headerSize) { // Clear the table if the header field size is larger than the maxHeaderTableSize. if (headerSize > maxHeaderTableSize) { clear(); return; } // Evict oldest entries until we have enough maxHeaderTableSize. while (maxHeaderTableSize - size < headerSize) { remove(); } int h = AsciiString.hashCode(name); int i = index(h); HeaderEntry old = headerFields[i]; HeaderEntry e = new HeaderEntry(h, name, value, head.before.index - 1, old); headerFields[i] = e; e.addBefore(head); size += headerSize; }
class class_name[name] begin[{] method[add, return_type[void], modifier[private], parameter[name, value, headerSize]] begin[{] if[binary_operation[member[.headerSize], >, member[.maxHeaderTableSize]]] begin[{] call[.clear, parameter[]] return[None] else begin[{] None end[}] while[binary_operation[binary_operation[member[.maxHeaderTableSize], -, member[.size]], <, member[.headerSize]]] begin[{] call[.remove, parameter[]] end[}] local_variable[type[int], h] local_variable[type[int], i] local_variable[type[HeaderEntry], old] local_variable[type[HeaderEntry], e] assign[member[.headerFields], member[.e]] call[e.addBefore, parameter[member[.head]]] assign[member[.size], member[.headerSize]] end[}] END[}]
Keyword[private] Keyword[void] identifier[add] operator[SEP] identifier[CharSequence] identifier[name] , identifier[CharSequence] identifier[value] , Keyword[long] identifier[headerSize] operator[SEP] { Keyword[if] operator[SEP] identifier[headerSize] operator[>] identifier[maxHeaderTableSize] operator[SEP] { identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[while] operator[SEP] identifier[maxHeaderTableSize] operator[-] identifier[size] operator[<] identifier[headerSize] operator[SEP] { identifier[remove] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[h] operator[=] identifier[AsciiString] operator[SEP] identifier[hashCode] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[index] operator[SEP] identifier[h] operator[SEP] operator[SEP] identifier[HeaderEntry] identifier[old] operator[=] identifier[headerFields] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[HeaderEntry] identifier[e] operator[=] Keyword[new] identifier[HeaderEntry] operator[SEP] identifier[h] , identifier[name] , identifier[value] , identifier[head] operator[SEP] identifier[before] operator[SEP] identifier[index] operator[-] Other[1] , identifier[old] operator[SEP] operator[SEP] identifier[headerFields] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[e] operator[SEP] identifier[e] operator[SEP] identifier[addBefore] operator[SEP] identifier[head] operator[SEP] operator[SEP] identifier[size] operator[+=] identifier[headerSize] operator[SEP] }
public void addPhoto(Photo photo) { Photo.PhotoType type = photo.getType(); if (postType != null && !postType.equals(type)) { throw new IllegalArgumentException("Photos must all be the same type (source or data)"); } if (pendingPhotos == null) { pendingPhotos = new ArrayList<Photo>(); } pendingPhotos.add(photo); this.postType = type; }
class class_name[name] begin[{] method[addPhoto, return_type[void], modifier[public], parameter[photo]] begin[{] local_variable[type[Photo], type] if[binary_operation[binary_operation[member[.postType], !=, literal[null]], &&, call[postType.equals, parameter[member[.type]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Photos must all be the same type (source or data)")], 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[.pendingPhotos], ==, literal[null]]] begin[{] assign[member[.pendingPhotos], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Photo, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] call[pendingPhotos.add, parameter[member[.photo]]] assign[THIS[member[None.postType]], member[.type]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addPhoto] operator[SEP] identifier[Photo] identifier[photo] operator[SEP] { identifier[Photo] operator[SEP] identifier[PhotoType] identifier[type] operator[=] identifier[photo] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[postType] operator[!=] Other[null] operator[&&] operator[!] identifier[postType] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[pendingPhotos] operator[==] Other[null] operator[SEP] { identifier[pendingPhotos] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Photo] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[pendingPhotos] operator[SEP] identifier[add] operator[SEP] identifier[photo] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[postType] operator[=] identifier[type] operator[SEP] }
@SuppressWarnings("unchecked") public <T extends IEntity> T updateAccountOnTxns(T entity) throws FMSException { IntuitMessage intuitMessage = prepareupdateAccountOnTxns(entity); //execute interceptors executeInterceptors(intuitMessage); return (T) retrieveEntity(intuitMessage); }
class class_name[name] begin[{] method[updateAccountOnTxns, return_type[type[T]], modifier[public], parameter[entity]] begin[{] local_variable[type[IntuitMessage], intuitMessage] call[.executeInterceptors, parameter[member[.intuitMessage]]] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=intuitMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=retrieveEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[IEntity] operator[>] identifier[T] identifier[updateAccountOnTxns] operator[SEP] identifier[T] identifier[entity] operator[SEP] Keyword[throws] identifier[FMSException] { identifier[IntuitMessage] identifier[intuitMessage] operator[=] identifier[prepareupdateAccountOnTxns] operator[SEP] identifier[entity] operator[SEP] operator[SEP] identifier[executeInterceptors] operator[SEP] identifier[intuitMessage] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[retrieveEntity] operator[SEP] identifier[intuitMessage] operator[SEP] operator[SEP] }
public static BegunTx<?> getBegunTxOnThread() { final Stack<BegunTx<?>> stack = threadLocal.get(); return stack != null ? stack.peek() : null; }
class class_name[name] begin[{] method[getBegunTxOnThread, return_type[type[BegunTx]], modifier[public static], parameter[]] begin[{] local_variable[type[Stack], stack] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[BegunTx] operator[<] operator[?] operator[>] identifier[getBegunTxOnThread] operator[SEP] operator[SEP] { Keyword[final] identifier[Stack] operator[<] identifier[BegunTx] operator[<] operator[?] operator[>] operator[>] identifier[stack] operator[=] identifier[threadLocal] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[stack] operator[!=] Other[null] operator[?] identifier[stack] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
public void addSingularAttribute(String attributeName, SingularAttribute<X, ?> attribute) { if (declaredSingluarAttribs == null) { declaredSingluarAttribs = new HashMap<String, SingularAttribute<X, ?>>(); } declaredSingluarAttribs.put(attributeName, attribute); onValidateAttributeConstraints((Field) attribute.getJavaMember()); onEmbeddableAttribute((Field) attribute.getJavaMember()); }
class class_name[name] begin[{] method[addSingularAttribute, return_type[void], modifier[public], parameter[attributeName, attribute]] begin[{] if[binary_operation[member[.declaredSingluarAttribs], ==, literal[null]]] begin[{] assign[member[.declaredSingluarAttribs], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=X, sub_type=None)), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=SingularAttribute, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] else begin[{] None end[}] call[declaredSingluarAttribs.put, parameter[member[.attributeName], member[.attribute]]] call[.onValidateAttributeConstraints, parameter[Cast(expression=MethodInvocation(arguments=[], member=getJavaMember, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))]] call[.onEmbeddableAttribute, parameter[Cast(expression=MethodInvocation(arguments=[], member=getJavaMember, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addSingularAttribute] operator[SEP] identifier[String] identifier[attributeName] , identifier[SingularAttribute] operator[<] identifier[X] , operator[?] operator[>] identifier[attribute] operator[SEP] { Keyword[if] operator[SEP] identifier[declaredSingluarAttribs] operator[==] Other[null] operator[SEP] { identifier[declaredSingluarAttribs] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[SingularAttribute] operator[<] identifier[X] , operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[declaredSingluarAttribs] operator[SEP] identifier[put] operator[SEP] identifier[attributeName] , identifier[attribute] operator[SEP] operator[SEP] identifier[onValidateAttributeConstraints] operator[SEP] operator[SEP] identifier[Field] operator[SEP] identifier[attribute] operator[SEP] identifier[getJavaMember] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[onEmbeddableAttribute] operator[SEP] operator[SEP] identifier[Field] operator[SEP] identifier[attribute] operator[SEP] identifier[getJavaMember] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "anzahl_zimmer") @XmlJavaTypeAdapter(Adapter7 .class) public JAXBElement<BigDecimal> createAnzahlZimmer(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlZimmer_QNAME, BigDecimal.class, null, value); }
class class_name[name] begin[{] method[createAnzahlZimmer, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_AnzahlZimmer_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] annotation[@] identifier[XmlJavaTypeAdapter] operator[SEP] identifier[Adapter7] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[BigDecimal] operator[>] identifier[createAnzahlZimmer] operator[SEP] identifier[BigDecimal] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[BigDecimal] operator[>] operator[SEP] identifier[_AnzahlZimmer_QNAME] , identifier[BigDecimal] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
@Override public IMonomer getMonomer(String monName, String strandName) { logger.debug("Getting monomer from strand: ", monName, strandName); return super.getMonomer(monName, strandName); }
class class_name[name] begin[{] method[getMonomer, return_type[type[IMonomer]], modifier[public], parameter[monName, strandName]] begin[{] call[logger.debug, parameter[literal["Getting monomer from strand: "], member[.monName], member[.strandName]]] return[SuperMethodInvocation(arguments=[MemberReference(member=monName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=strandName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMonomer, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[IMonomer] identifier[getMonomer] operator[SEP] identifier[String] identifier[monName] , identifier[String] identifier[strandName] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[monName] , identifier[strandName] operator[SEP] operator[SEP] Keyword[return] Keyword[super] operator[SEP] identifier[getMonomer] operator[SEP] identifier[monName] , identifier[strandName] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") private static List<String> getWebSphereGroups(final String securityName) { Context ic = null; try { // TODO: Cache UserRegistry object ic = new InitialContext(); Object objRef = ic.lookup(USER_REGISTRY); Object userReg = invokeMethod(getNarrowMethod(), null , objRef, Class.forName("com.ibm.websphere.security.UserRegistry")); if (logger.isDebugEnabled()) { logger.debug("Determining WebSphere groups for user " + securityName + " using WebSphere UserRegistry " + userReg); } final Collection groups = (Collection) invokeMethod(getGroupsForUserMethod(), userReg, new Object[] { securityName }); if (logger.isDebugEnabled()) { logger.debug("Groups for user " + securityName + ": " + groups.toString()); } return new ArrayList(groups); } catch (Exception e) { logger.error("Exception occured while looking up groups for user", e); throw new RuntimeException( "Exception occured while looking up groups for user", e); } finally { try { if (ic != null) { ic.close(); } } catch (NamingException e) { logger.debug("Exception occured while closing context", e); } } }
class class_name[name] begin[{] method[getWebSphereGroups, return_type[type[List]], modifier[private static], parameter[securityName]] begin[{] local_variable[type[Context], ic] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitialContext, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=USER_REGISTRY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=ic, selectors=[], type_arguments=None), name=objRef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNarrowMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=objRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.websphere.security.UserRegistry")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None)], member=invokeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=userReg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Determining WebSphere groups for user "), operandr=MemberReference(member=securityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" using WebSphere UserRegistry "), operator=+), operandr=MemberReference(member=userReg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGroupsForUserMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=userReg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=securityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=invokeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None)), name=groups)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Groups for user "), operandr=MemberReference(member=securityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=groups, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=groups, 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=ArrayList, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception occured while looking up groups for user"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception occured while looking up groups for user"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=ic, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception occured while closing context"), 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=['NamingException']))], finally_block=None, label=None, resources=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[getWebSphereGroups] operator[SEP] Keyword[final] identifier[String] identifier[securityName] operator[SEP] { identifier[Context] identifier[ic] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[ic] operator[=] Keyword[new] identifier[InitialContext] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[objRef] operator[=] identifier[ic] operator[SEP] identifier[lookup] operator[SEP] identifier[USER_REGISTRY] operator[SEP] operator[SEP] identifier[Object] identifier[userReg] operator[=] identifier[invokeMethod] operator[SEP] identifier[getNarrowMethod] operator[SEP] operator[SEP] , Other[null] , identifier[objRef] , identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[securityName] operator[+] literal[String] operator[+] identifier[userReg] operator[SEP] operator[SEP] } Keyword[final] identifier[Collection] identifier[groups] operator[=] operator[SEP] identifier[Collection] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[getGroupsForUserMethod] operator[SEP] operator[SEP] , identifier[userReg] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[securityName] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[securityName] operator[+] literal[String] operator[+] identifier[groups] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ArrayList] operator[SEP] identifier[groups] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { Keyword[if] operator[SEP] identifier[ic] operator[!=] Other[null] operator[SEP] { identifier[ic] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NamingException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
public static <K> void removeAll(Region<K, ?> region, Set<K> keys) { if (keys == null) { throw new NullPointerException(); } if (keys.isEmpty()) { // Nothing to do return; } Function function = new RemoveAllFunction(); FunctionService.registerFunction(function); ResultCollector<?, ?> rc = FunctionService.onRegion(region) .withFilter(keys).withArgs(region.getName()).execute(function); // Obtain result from the collector to return // only after everything is done. rc.getResult(); }
class class_name[name] begin[{] method[removeAll, return_type[void], modifier[public static], parameter[region, keys]] begin[{] if[binary_operation[member[.keys], ==, 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[{] None end[}] if[call[keys.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Function], function] call[FunctionService.registerFunction, parameter[member[.function]]] local_variable[type[ResultCollector], rc] call[rc.getResult, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] operator[>] Keyword[void] identifier[removeAll] operator[SEP] identifier[Region] operator[<] identifier[K] , operator[?] operator[>] identifier[region] , identifier[Set] operator[<] identifier[K] operator[>] identifier[keys] operator[SEP] { Keyword[if] operator[SEP] identifier[keys] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[Function] identifier[function] operator[=] Keyword[new] identifier[RemoveAllFunction] operator[SEP] operator[SEP] operator[SEP] identifier[FunctionService] operator[SEP] identifier[registerFunction] operator[SEP] identifier[function] operator[SEP] operator[SEP] identifier[ResultCollector] operator[<] operator[?] , operator[?] operator[>] identifier[rc] operator[=] identifier[FunctionService] operator[SEP] identifier[onRegion] operator[SEP] identifier[region] operator[SEP] operator[SEP] identifier[withFilter] operator[SEP] identifier[keys] operator[SEP] operator[SEP] identifier[withArgs] operator[SEP] identifier[region] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[function] operator[SEP] operator[SEP] identifier[rc] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] }
public static void changeSign( DMatrixD1 a ) { final int size = a.getNumElements(); for( int i = 0; i < size; i++ ) { a.data[i] = -a.data[i]; } }
class class_name[name] begin[{] method[changeSign, return_type[void], modifier[public static], parameter[a]] begin[{] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=data, postfix_operators=[], prefix_operators=['-'], qualifier=a, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[changeSign] operator[SEP] identifier[DMatrixD1] identifier[a] operator[SEP] { Keyword[final] Keyword[int] identifier[size] operator[=] identifier[a] operator[SEP] identifier[getNumElements] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[a] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[=] operator[-] identifier[a] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] } }
public static Class[] resolveTypeParameters(Class invocationClass, Type targetType) { if (targetType instanceof ParameterizedType) { Type[] actualTypes = ((ParameterizedType) targetType).getActualTypeArguments(); Class[] actualClasses = new Class[actualTypes.length]; for (int i = 0; i < actualTypes.length; i++) { actualClasses[i] = resolveTypeVariable(invocationClass, actualTypes[i]); } return actualClasses; } return EMPTY_CLASSES; }
class class_name[name] begin[{] method[resolveTypeParameters, return_type[type[Class]], modifier[public static], parameter[invocationClass, targetType]] begin[{] if[binary_operation[member[.targetType], instanceof, type[ParameterizedType]]] begin[{] local_variable[type[Type], actualTypes] local_variable[type[Class], actualClasses] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=actualClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=invocationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=actualTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=resolveTypeVariable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=actualTypes, 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[.actualClasses]] else begin[{] None end[}] return[member[.EMPTY_CLASSES]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] operator[SEP] operator[SEP] identifier[resolveTypeParameters] operator[SEP] identifier[Class] identifier[invocationClass] , identifier[Type] identifier[targetType] operator[SEP] { Keyword[if] operator[SEP] identifier[targetType] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] { identifier[Type] operator[SEP] operator[SEP] identifier[actualTypes] operator[=] operator[SEP] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[targetType] operator[SEP] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[SEP] operator[SEP] identifier[actualClasses] operator[=] Keyword[new] identifier[Class] operator[SEP] identifier[actualTypes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[actualTypes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[actualClasses] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[resolveTypeVariable] operator[SEP] identifier[invocationClass] , identifier[actualTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[actualClasses] operator[SEP] } Keyword[return] identifier[EMPTY_CLASSES] operator[SEP] }
public void init(Context context) { if (!mNotFoundClassesMap.isEmpty()) { buildInstalledPackagesCache(context); } mPackageMonitor.register(context); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[context]] begin[{] if[call[mNotFoundClassesMap.isEmpty, parameter[]]] begin[{] call[.buildInstalledPackagesCache, parameter[member[.context]]] else begin[{] None end[}] call[mPackageMonitor.register, parameter[member[.context]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[Context] identifier[context] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[mNotFoundClassesMap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[buildInstalledPackagesCache] operator[SEP] identifier[context] operator[SEP] operator[SEP] } identifier[mPackageMonitor] operator[SEP] identifier[register] operator[SEP] identifier[context] operator[SEP] operator[SEP] }
private void addQueryParams(final Request request) { if (language != null) { request.addQueryParam("Language", language); } if (modelBuild != null) { request.addQueryParam("ModelBuild", modelBuild.toString()); } if (status != null) { request.addQueryParam("Status", status); } 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[.language], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["Language"], member[.language]]] else begin[{] None end[}] if[binary_operation[member[.modelBuild], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["ModelBuild"], call[modelBuild.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.status], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["Status"], member[.status]]] 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[language] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[language] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[modelBuild] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[modelBuild] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[status] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[status] 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 File findSourceFile (final String filename) { final Collection <File> sourceRoots = this.nonGeneratedSourceRoots; for (final File sourceRoot : sourceRoots) { final File sourceFile = new File (sourceRoot, filename); if (sourceFile.exists ()) { return sourceFile; } } return null; }
class class_name[name] begin[{] method[findSourceFile, return_type[type[File]], modifier[private], parameter[filename]] begin[{] local_variable[type[Collection], sourceRoots] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=sourceRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=sourceFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=sourceFile, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=sourceFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sourceRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sourceRoot)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] identifier[File] identifier[findSourceFile] operator[SEP] Keyword[final] identifier[String] identifier[filename] operator[SEP] { Keyword[final] identifier[Collection] operator[<] identifier[File] operator[>] identifier[sourceRoots] operator[=] Keyword[this] operator[SEP] identifier[nonGeneratedSourceRoots] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[File] identifier[sourceRoot] operator[:] identifier[sourceRoots] operator[SEP] { Keyword[final] identifier[File] identifier[sourceFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[sourceRoot] , identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sourceFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[sourceFile] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
@NonNull public List<T> getObject() { List<T> beans = new ArrayList<T>(); beans.addAll(getBeans()); Collections.sort(beans, COMPARATOR); return beans; }
class class_name[name] begin[{] method[getObject, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], beans] call[beans.addAll, parameter[call[.getBeans, parameter[]]]] call[Collections.sort, parameter[member[.beans], member[.COMPARATOR]]] return[member[.beans]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] identifier[List] operator[<] identifier[T] operator[>] identifier[getObject] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[T] operator[>] identifier[beans] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[beans] operator[SEP] identifier[addAll] operator[SEP] identifier[getBeans] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[beans] , identifier[COMPARATOR] operator[SEP] operator[SEP] Keyword[return] identifier[beans] operator[SEP] }
public synchronized E pop() { E obj; int len = size(); obj = peek(); removeElementAt(len - 1); return obj; }
class class_name[name] begin[{] method[pop, return_type[type[E]], modifier[synchronized public], parameter[]] begin[{] local_variable[type[E], obj] local_variable[type[int], len] assign[member[.obj], call[.peek, parameter[]]] call[.removeElementAt, parameter[binary_operation[member[.len], -, literal[1]]]] return[member[.obj]] end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[E] identifier[pop] operator[SEP] operator[SEP] { identifier[E] identifier[obj] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[=] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[removeElementAt] operator[SEP] identifier[len] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[obj] operator[SEP] }
public void index(Record record) { // FIXME: check if record is already indexed // allocate an ID for this record long id = store.makeNewRecordId(); store.registerRecord(id, record); // go through ID properties and register them for (Property p : config.getIdentityProperties()) for (String extid : record.getValues(p.getName())) store.registerId(id, extid); // go through lookup properties and register those for (Property p : config.getLookupProperties()) { String propname = p.getName(); for (String value : record.getValues(propname)) { String[] tokens = StringUtils.split(value); for (int ix = 0; ix < tokens.length; ix++) store.registerToken(id, propname, tokens[ix]); } } }
class class_name[name] begin[{] method[index, return_type[void], modifier[public], parameter[record]] begin[{] local_variable[type[long], id] call[store.registerRecord, parameter[member[.id], member[.record]]] ForStatement(body=ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=extid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerId, postfix_operators=[], prefix_operators=[], qualifier=store, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=getValues, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=extid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getIdentityProperties, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Property, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), name=propname)], 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=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=tokens)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=registerToken, postfix_operators=[], prefix_operators=[], qualifier=store, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ix)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ix, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=propname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValues, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getLookupProperties, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Property, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[index] operator[SEP] identifier[Record] identifier[record] operator[SEP] { Keyword[long] identifier[id] operator[=] identifier[store] operator[SEP] identifier[makeNewRecordId] operator[SEP] operator[SEP] operator[SEP] identifier[store] operator[SEP] identifier[registerRecord] operator[SEP] identifier[id] , identifier[record] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Property] identifier[p] operator[:] identifier[config] operator[SEP] identifier[getIdentityProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[extid] operator[:] identifier[record] operator[SEP] identifier[getValues] operator[SEP] identifier[p] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[store] operator[SEP] identifier[registerId] operator[SEP] identifier[id] , identifier[extid] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Property] identifier[p] operator[:] identifier[config] operator[SEP] identifier[getLookupProperties] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[propname] operator[=] identifier[p] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[value] operator[:] identifier[record] operator[SEP] identifier[getValues] operator[SEP] identifier[propname] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[tokens] operator[=] identifier[StringUtils] operator[SEP] identifier[split] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ix] operator[=] Other[0] operator[SEP] identifier[ix] operator[<] identifier[tokens] operator[SEP] identifier[length] operator[SEP] identifier[ix] operator[++] operator[SEP] identifier[store] operator[SEP] identifier[registerToken] operator[SEP] identifier[id] , identifier[propname] , identifier[tokens] operator[SEP] identifier[ix] operator[SEP] operator[SEP] operator[SEP] } } }
@Override public List<byte[]> hMGet(byte[] key, byte[]... fields) { try { if (isPipelined()) { pipeline(new JedisResult(pipeline.hmget(key, fields))); return null; } return client.hmget(key, fields); } catch (Exception ex) { throw convertException(ex); } }
class class_name[name] begin[{] method[hMGet, return_type[type[List]], modifier[public], parameter[key, fields]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isPipelined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hmget, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JedisResult, sub_type=None))], member=pipeline, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hmget, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[hMGet] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[key] , Keyword[byte] operator[SEP] operator[SEP] operator[...] identifier[fields] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[isPipelined] operator[SEP] operator[SEP] operator[SEP] { identifier[pipeline] operator[SEP] Keyword[new] identifier[JedisResult] operator[SEP] identifier[pipeline] operator[SEP] identifier[hmget] operator[SEP] identifier[key] , identifier[fields] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[client] operator[SEP] identifier[hmget] operator[SEP] identifier[key] , identifier[fields] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[throw] identifier[convertException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
static SocketChannelUDT newConnectorChannelUDT(final TypeUDT type) { try { return SelectorProviderUDT.from(type).openSocketChannel(); } catch (final IOException e) { throw new ChannelException("failed to open a socket channel", e); } }
class class_name[name] begin[{] method[newConnectorChannelUDT, return_type[type[SocketChannelUDT]], modifier[static], parameter[type]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=from, postfix_operators=[], prefix_operators=[], qualifier=SelectorProviderUDT, selectors=[MethodInvocation(arguments=[], member=openSocketChannel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to open a socket channel"), 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=ChannelException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[static] identifier[SocketChannelUDT] identifier[newConnectorChannelUDT] operator[SEP] Keyword[final] identifier[TypeUDT] identifier[type] operator[SEP] { Keyword[try] { Keyword[return] identifier[SelectorProviderUDT] operator[SEP] identifier[from] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[openSocketChannel] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ChannelException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static void assertXMLNotEqual(Reader control, Reader test) throws SAXException, IOException { assertXMLNotEqual(null, control, test); }
class class_name[name] begin[{] method[assertXMLNotEqual, return_type[void], modifier[public static], parameter[control, test]] begin[{] call[.assertXMLNotEqual, parameter[literal[null], member[.control], member[.test]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[assertXMLNotEqual] operator[SEP] identifier[Reader] identifier[control] , identifier[Reader] identifier[test] operator[SEP] Keyword[throws] identifier[SAXException] , identifier[IOException] { identifier[assertXMLNotEqual] operator[SEP] Other[null] , identifier[control] , identifier[test] operator[SEP] operator[SEP] }
@Override protected DoubleMatrix1D rPri(DoubleMatrix1D X) { if(getMeq()==0){ return F1.make(0); } return ColtUtils.zMult(getA(), X, getB(), -1); }
class class_name[name] begin[{] method[rPri, return_type[type[DoubleMatrix1D]], modifier[protected], parameter[X]] begin[{] if[binary_operation[call[.getMeq, parameter[]], ==, literal[0]]] begin[{] return[call[F1.make, parameter[literal[0]]]] else begin[{] None end[}] return[call[ColtUtils.zMult, parameter[call[.getA, parameter[]], member[.X], call[.getB, parameter[]], literal[1]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[DoubleMatrix1D] identifier[rPri] operator[SEP] identifier[DoubleMatrix1D] identifier[X] operator[SEP] { Keyword[if] operator[SEP] identifier[getMeq] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[F1] operator[SEP] identifier[make] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] identifier[ColtUtils] operator[SEP] identifier[zMult] operator[SEP] identifier[getA] operator[SEP] operator[SEP] , identifier[X] , identifier[getB] operator[SEP] operator[SEP] , operator[-] Other[1] operator[SEP] operator[SEP] }
public boolean isValid(String value) { if (value == null) { return false; } // Check the whole url address structure Matcher urlMatcher = URL_PATTERN.matcher(value); if (!urlMatcher.matches()) { return false; } String scheme = urlMatcher.group(PARSE_URL_SCHEME); if (!isValidScheme(scheme)) { return false; } String authority = urlMatcher.group(PARSE_URL_AUTHORITY); if ("file".equals(scheme)) {// Special case - file: allows an empty authority if (authority != null) { if (authority.contains(":")) { // but cannot allow trailing : return false; } } // drop through to continue validation } else { // not file: // Validate the authority if (!isValidAuthority(authority)) { return false; } } if (!isValidPath(urlMatcher.group(PARSE_URL_PATH))) { return false; } if (!isValidQuery(urlMatcher.group(PARSE_URL_QUERY))) { return false; } if (!isValidFragment(urlMatcher.group(PARSE_URL_FRAGMENT))) { return false; } return true; }
class class_name[name] begin[{] method[isValid, return_type[type[boolean]], modifier[public], parameter[value]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Matcher], urlMatcher] if[call[urlMatcher.matches, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[String], scheme] if[call[.isValidScheme, parameter[member[.scheme]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[String], authority] if[literal["file"]] begin[{] if[binary_operation[member[.authority], !=, literal[null]]] begin[{] if[call[authority.contains, parameter[literal[":"]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] if[call[.isValidAuthority, parameter[member[.authority]]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] if[call[.isValidPath, parameter[call[urlMatcher.group, parameter[member[.PARSE_URL_PATH]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.isValidQuery, parameter[call[urlMatcher.group, parameter[member[.PARSE_URL_QUERY]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.isValidFragment, parameter[call[urlMatcher.group, parameter[member[.PARSE_URL_FRAGMENT]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isValid] operator[SEP] identifier[String] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[Matcher] identifier[urlMatcher] operator[=] identifier[URL_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[urlMatcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[String] identifier[scheme] operator[=] identifier[urlMatcher] operator[SEP] identifier[group] operator[SEP] identifier[PARSE_URL_SCHEME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isValidScheme] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[String] identifier[authority] operator[=] identifier[urlMatcher] operator[SEP] identifier[group] operator[SEP] identifier[PARSE_URL_AUTHORITY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[authority] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[authority] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[isValidAuthority] operator[SEP] identifier[authority] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isValidPath] operator[SEP] identifier[urlMatcher] operator[SEP] identifier[group] operator[SEP] identifier[PARSE_URL_PATH] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isValidQuery] operator[SEP] identifier[urlMatcher] operator[SEP] identifier[group] operator[SEP] identifier[PARSE_URL_QUERY] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isValidFragment] operator[SEP] identifier[urlMatcher] operator[SEP] identifier[group] operator[SEP] identifier[PARSE_URL_FRAGMENT] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }